/* ==========================================================================
   ARTICLE TEMPLATE STYLES
   Benessere Pieno - Professional Article Design
   ========================================================================== */

/* CSS Variables */
:root {
  --primary: #2c5f7c;
  --primary-dark: #1a4a5e;
  --primary-light: #e8f4f8;
  --accent: #0d7563;
  --accent-light: #48a999;
  --accent-bg: #e8f4f0;
  --text: #333;
  --text-light: #595959;
  --text-muted: #777;
  --bg: #f8f9fa;
  --white: #fff;
  --border: #e0e0e0;
  --border-light: #f0f0f0;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 15px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 25px rgba(0,0,0,0.12);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
}

/* Reset */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 17px;
}

a { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }
a:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
a:hover { color: var(--accent); }

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 15px 20px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo img { height: 45px; width: auto; }

.main-nav ul { display: flex; list-style: none; gap: 25px; }
.main-nav a {
  color: var(--text);
  font-weight: 500;
  padding: 8px 0;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}
.main-nav a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* ==========================================================================
   Article Header
   ========================================================================== */
.article-header {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: var(--white);
  padding: 40px 20px 50px;
}

.article-header-content {
  max-width: 800px;
  margin: 0 auto;
}

.breadcrumb {
  font-size: 14px;
  margin-bottom: 20px;
  opacity: 0.85;
}

.breadcrumb a { color: var(--white); text-decoration: underline; }
.breadcrumb a:hover { opacity: 0.8; }

.category-badge {
  display: inline-block;
  background: var(--accent);
  color: var(--white);
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 15px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.article-header h1 {
  font-size: 34px;
  margin-bottom: 20px;
  line-height: 1.25;
  font-weight: 700;
}

/* ==========================================================================
   Author & Review Meta
   ========================================================================== */
.article-meta-box {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 20px;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255,255,255,0.1);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
}

.meta-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
}

.meta-text { font-size: 14px; }
.meta-text strong { display: block; font-size: 15px; }
.meta-text span { opacity: 0.85; }

.review-badge {
  background: var(--accent);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 10px;
}

.review-badge svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* ==========================================================================
   Main Content Layout
   ========================================================================== */
.main-container {
  max-width: 1100px;
  margin: -30px auto 0;
  padding: 0 20px 40px;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 30px;
}

/* ==========================================================================
   Article Content
   ========================================================================== */
.article-content {
  background: var(--white);
  padding: 40px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

/* ==========================================================================
   Social Sharing
   ========================================================================== */
.share-buttons {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-light);
}

.share-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  color: var(--white);
  transition: transform 0.2s, opacity 0.2s;
  border: none;
  cursor: pointer;
}

.share-btn:hover { transform: translateY(-2px); opacity: 0.9; color: var(--white); }

.share-btn.facebook { background: #1877f2; }
.share-btn.whatsapp { background: #25d366; }
.share-btn.linkedin { background: #0077b5; }
.share-btn.copy { background: var(--text-light); }

.share-btn svg { width: 18px; height: 18px; fill: currentColor; }

/* ==========================================================================
   Table of Contents
   ========================================================================== */
.toc {
  background: var(--primary-light);
  border-radius: var(--radius-md);
  padding: 20px 25px;
  margin-bottom: 30px;
}

.toc-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.toc-list {
  list-style: none;
  counter-reset: toc;
}

.toc-list li {
  counter-increment: toc;
  margin-bottom: 10px;
}

.toc-list a {
  color: var(--primary);
  text-decoration: none;
  font-size: 15px;
  display: flex;
  align-items: baseline;
  gap: 10px;
  transition: color 0.2s;
}

.toc-list a::before {
  content: counter(toc) ".";
  color: var(--accent);
  font-weight: 600;
  min-width: 20px;
}

.toc-list a:hover { color: var(--accent); text-decoration: underline; }

/* ==========================================================================
   Article Typography
   ========================================================================== */
.article-body h2 {
  font-size: 24px;
  color: var(--primary-dark);
  margin: 40px 0 18px;
  padding-top: 25px;
  border-top: 2px solid var(--border-light);
  scroll-margin-top: 100px;
}

.article-body h2:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.article-body h3 {
  font-size: 20px;
  color: var(--primary);
  margin: 28px 0 14px;
}

.article-body p {
  margin-bottom: 18px;
  color: var(--text);
}

.article-body ul, .article-body ol {
  margin: 18px 0 22px 25px;
}

.article-body li {
  margin-bottom: 10px;
  padding-left: 5px;
}

.article-body strong { color: var(--primary-dark); }

/* ==========================================================================
   Hero Image
   ========================================================================== */
.article-hero {
  margin: 0 0 30px 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.article-hero img {
  width: 100%;
  height: auto;
  display: block;
}

.article-hero figcaption {
  background: var(--bg);
  padding: 10px 15px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

/* ==========================================================================
   Highlight Boxes
   ========================================================================== */
.highlight-box {
  background: var(--accent-bg);
  border-left: 4px solid var(--accent);
  padding: 20px 25px;
  margin: 28px 0;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.highlight-box.tip { background: #fff8e6; border-color: #f5a623; }
.highlight-box.info { background: var(--primary-light); border-color: var(--primary); }
.highlight-box.warning { background: #fff0f0; border-color: #e74c3c; }

.highlight-box h4 {
  color: var(--primary-dark);
  margin-bottom: 10px;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.highlight-box p { margin-bottom: 0; font-size: 15px; }

/* ==========================================================================
   Example Box
   ========================================================================== */
.example-box {
  background: var(--bg);
  border: 2px dashed var(--border);
  padding: 20px 25px;
  margin: 28px 0;
  border-radius: var(--radius-md);
}

.example-box h4 {
  color: var(--primary-dark);
  margin-bottom: 15px;
  font-size: 16px;
}

.example-box ol {
  margin: 0 0 0 20px;
}

.example-box li {
  margin-bottom: 8px;
}

/* ==========================================================================
   CTA Box
   ========================================================================== */
.cta-box {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--white);
  padding: 30px;
  border-radius: var(--radius-lg);
  margin: 35px 0;
  text-align: center;
}

.cta-box h4 {
  font-size: 20px;
  margin-bottom: 12px;
}

.cta-box p {
  opacity: 0.9;
  margin-bottom: 20px;
  color: var(--white);
}

.cta-btn {
  display: inline-block;
  background: var(--accent);
  color: var(--white);
  padding: 14px 30px;
  border-radius: 30px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
}

.cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
  color: var(--white);
}

/* ==========================================================================
   Author Box
   ========================================================================== */
.author-box {
  display: flex;
  gap: 20px;
  background: var(--bg);
  padding: 25px;
  border-radius: var(--radius-md);
  margin-top: 40px;
  border: 1px solid var(--border-light);
}

.author-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 28px;
  font-weight: 700;
  flex-shrink: 0;
}

.author-info h4 {
  font-size: 18px;
  color: var(--primary-dark);
  margin-bottom: 4px;
}

.author-title {
  color: var(--accent);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 10px;
}

.author-info p {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 0;
  line-height: 1.6;
}

/* ==========================================================================
   Feedback Section
   ========================================================================== */
.feedback-section {
  background: var(--bg);
  padding: 25px;
  border-radius: var(--radius-md);
  margin-top: 30px;
  text-align: center;
  border: 1px solid var(--border-light);
}

.feedback-section h4 {
  font-size: 16px;
  color: var(--primary-dark);
  margin-bottom: 15px;
}

.feedback-buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
}

.feedback-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border: 2px solid var(--border);
  border-radius: 30px;
  background: var(--white);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.feedback-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.feedback-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--white);
}

/* ==========================================================================
   References
   ========================================================================== */
.references-section {
  margin-top: 35px;
  padding-top: 25px;
  border-top: 2px solid var(--border-light);
}

.references-section h3 {
  font-size: 18px;
  color: var(--primary-dark);
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.references-list {
  list-style: decimal;
  margin-left: 25px;
  font-size: 14px;
  color: var(--text-light);
}

.references-list li {
  margin-bottom: 10px;
  line-height: 1.5;
}

.references-list a {
  word-break: break-word;
}

/* ==========================================================================
   Article Footer
   ========================================================================== */
.article-footer {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
  font-size: 13px;
  color: var(--text-muted);
}

.article-footer p { margin-bottom: 8px; }

/* ==========================================================================
   Sidebar
   ========================================================================== */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.sidebar-widget {
  background: var(--white);
  padding: 25px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.sidebar-widget h3 {
  font-size: 16px;
  color: var(--primary-dark);
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--accent);
}

/* Related Articles Sidebar */
.related-sidebar-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
}

.related-sidebar-item:last-child { border-bottom: none; }

.related-sidebar-thumb {
  width: 70px;
  height: 50px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  flex-shrink: 0;
  overflow: hidden;
}

.related-sidebar-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.related-sidebar-info h4 {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 4px;
}

.related-sidebar-info h4 a {
  color: var(--text);
  text-decoration: none;
}

.related-sidebar-info h4 a:hover {
  color: var(--accent);
}

.related-sidebar-info span {
  font-size: 12px;
  color: var(--text-muted);
}

/* Newsletter Widget */
.newsletter-widget {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--white);
}

.newsletter-widget h3 {
  color: var(--white);
  border-bottom-color: rgba(255,255,255,0.3);
}

.newsletter-widget p {
  font-size: 14px;
  opacity: 0.9;
  margin-bottom: 15px;
}

.newsletter-form input {
  width: 100%;
  padding: 12px 15px;
  border: none;
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  font-size: 14px;
}

.newsletter-form button {
  width: 100%;
  padding: 12px;
  background: var(--accent);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.newsletter-form button:hover { background: var(--accent-light); }

/* ==========================================================================
   Related Articles Section (Full Width)
   ========================================================================== */
.related-section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 50px 20px;
}

.related-section h2 {
  font-size: 26px;
  color: var(--primary-dark);
  margin-bottom: 30px;
  text-align: center;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 25px;
}

.related-card {
  background: var(--white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
}

.related-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.related-card-image {
  height: 160px;
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--accent-bg) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.related-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.related-card-image .placeholder-icon {
  font-size: 48px;
  opacity: 0.3;
}

.related-card-content {
  padding: 20px;
}

.related-card-category {
  display: inline-block;
  background: var(--accent-bg);
  color: var(--accent);
  padding: 4px 10px;
  border-radius: 15px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 10px;
}

.related-card h3 {
  font-size: 17px;
  margin-bottom: 10px;
  line-height: 1.4;
}

.related-card h3 a {
  color: var(--primary-dark);
  text-decoration: none;
}

.related-card h3 a:hover { color: var(--accent); }

.related-card p {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 15px;
  line-height: 1.5;
}

.related-card-meta {
  font-size: 13px;
  color: var(--text-muted);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: var(--primary-dark);
  color: var(--white);
  padding: 50px 20px 30px;
}

.footer-content {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 40px;
}

.footer-section h4 {
  font-size: 16px;
  margin-bottom: 18px;
  color: var(--accent-light);
}

.footer-section ul { list-style: none; }
.footer-section li { margin-bottom: 10px; }
.footer-section a {
  color: rgba(255,255,255,0.8);
  font-size: 14px;
  text-decoration: none;
  transition: color 0.2s;
}
.footer-section a:hover { color: var(--accent-light); }
.footer-section p { font-size: 14px; color: rgba(255,255,255,0.7); line-height: 1.6; }

.footer-bottom {
  max-width: 1100px;
  margin: 40px auto 0;
  padding-top: 25px;
  border-top: 1px solid rgba(255,255,255,0.1);
  text-align: center;
  font-size: 13px;
  color: rgba(255,255,255,0.5);
}

/* ==========================================================================
   Cookie Banner
   ========================================================================== */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--primary-dark);
  color: var(--white);
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1000;
  flex-wrap: wrap;
  gap: 15px;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
}

.cookie-banner p {
  margin: 0;
  font-size: 14px;
  flex: 1;
}

.cookie-banner a { color: var(--accent-light); }

.cookie-btn {
  background: var(--accent);
  color: var(--white);
  border: none;
  padding: 10px 25px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s;
}

.cookie-btn:hover { background: var(--accent-light); }

/* ==========================================================================
   Responsive Design
   ========================================================================== */
@media (max-width: 900px) {
  .main-container {
    grid-template-columns: 1fr;
    margin-top: -20px;
  }

  .sidebar { order: 2; }
}

@media (max-width: 768px) {
  .header-content { flex-direction: column; gap: 15px; }
  .main-nav ul { gap: 15px; flex-wrap: wrap; justify-content: center; }
  .article-header h1 { font-size: 26px; }
  .article-content { padding: 25px; }
  .article-meta-box { flex-direction: column; }
  .share-buttons { flex-wrap: wrap; }
  .share-btn span { display: none; }
  .author-box { flex-direction: column; text-align: center; align-items: center; }
  .feedback-buttons { flex-direction: column; }
  .related-grid { grid-template-columns: 1fr; }
}
