/**
 * MedAI Wellness Official Design System
 * Version: 2.0 (Medical Editorial Standard)
 * Responsive: 320px to 1920px
 */

@import url('https://fonts.googleapis.com/css2?family=Merriweather:ital,wght@0,300;0,400;0,700;1,300;1,400&family=Source+Sans+3:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

:root {
  /* Surface & Base */
  --bg-body: #ffffff;
  --bg-alt: #f8fafc;
  --bg-card: #ffffff;
  
  /* Text & Contrast */
  --text-main: #1f2937;    /* Slate 900 */
  --text-muted: #4b5563;   /* Slate 600 */
  --text-light: #9ca3af;   /* Slate 400 */
  --text-dark: #0f172a;    /* Charcoal/Black */
  
  /* Brand Accent: MedAI Clinical Gold & Teal */
  --accent: #b5802a;         /* Warm Clinical Gold */
  --accent-light: #d4a352;
  --accent-dark: #8c5d18;
  --accent-bg: #fdfbf7;      /* Warm ivory-gold tint for cards */
  --accent-border: #e8d5b0;
  --teal: #0d9488;          /* Neural Autonomic Science Teal */
  
  /* Functional Semantic Colors */
  --info-bg: #eff6ff;
  --info-border: #bfdbfe;
  --info-text: #1e40af;
  
  --warning-bg: #fefce8;
  --warning-border: #fef08a;
  --warning-text: #854d0e;
  
  --success-bg: #f0fdf4;
  --success-border: #bbf7d0;
  --success-text: #166534;
  
  /* Border & Dividers */
  --border-light: #e5e7eb;
  --border-subtle: #f1f5f9;
  
  /* Links */
  --link: #1a56db;
  --link-hover: #1e40af;
  
  /* Typography */
  --serif: 'Merriweather', Georgia, 'Times New Roman', serif;
  --sans: 'Source Sans 3', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  /* Layout Dimensions */
  --max-w-content: 740px;  /* Optimal measure: 65-75 chars/line */
  --max-w-site: 1080px;
  
  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  
  /* Elevation Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 14px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.09);
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--sans);
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Accessibility */
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip-link:focus {
  position: fixed;
  top: 0;
  left: 0;
  width: auto;
  height: auto;
  padding: 10px 18px;
  background: var(--text-dark);
  color: #fff;
  font-size: 0.9rem;
  z-index: 9999;
}

/* 1. HEADER & NAVIGATION */
.site-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.site-header-inner {
  max-width: var(--max-w-site);
  margin: 0 auto;
  padding: 0 20px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-brand {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.site-brand img {
  height: 38px;
  width: auto;
  display: block;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.site-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  transition: color 0.15s ease;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--accent);
}

/* Mobile Navigation Toggle */
.mobile-nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--text-dark);
}

.mobile-nav-menu {
  display: none;
  background: #ffffff;
  border-bottom: 1px solid var(--border-light);
  padding: 16px 20px;
}

.mobile-nav-menu.open {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mobile-nav-menu a {
  color: var(--text-main);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 600;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
}

/* 2. BREADCRUMBS */
.breadcrumb-nav {
  max-width: var(--max-w-content);
  margin: 24px auto 0;
  padding: 0 20px;
  font-size: 0.85rem;
  color: var(--text-light);
  line-height: 1.5;
}

.breadcrumb-nav a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

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

.breadcrumb-sep {
  margin: 0 8px;
  color: #cbd5e1;
}

/* 3. ARTICLE LAYOUT */
.article-wrap {
  max-width: var(--max-w-content);
  margin: 0 auto;
  padding: 24px 20px 64px;
}

/* 4. HERO SECTION */
.article-header {
  margin-bottom: 24px;
}

.category-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: var(--accent-bg);
  border: 1px solid var(--accent-border);
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 14px;
}

.article-title {
  font-family: var(--serif);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

/* Author Row & E-E-A-T */
.author-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border-light);
}

.author-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 700;
  border: 2px solid var(--accent-border);
  box-shadow: var(--shadow-sm);
}

.author-info {
  display: flex;
  flex-direction: column;
}

.author-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-dark);
}

.author-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.author-meta-dot {
  color: #cbd5e1;
}

/* Featured Hero Image */
.article-hero {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius-md);
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
  background-color: var(--bg-alt);
  display: block;
}

/* 5. KEY TAKEAWAYS BOX (AI Overview Optimized) */
.key-takeaways {
  background: var(--accent-bg);
  border: 1px solid var(--accent-border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 22px 24px;
  margin: 28px 0;
  box-shadow: var(--shadow-sm);
}

.key-takeaways h3 {
  font-family: var(--sans);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.key-takeaways ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.key-takeaways li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 8px;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-main);
}

.key-takeaways li::before {
  content: "•";
  position: absolute;
  left: 4px;
  color: var(--accent);
  font-weight: bold;
  font-size: 1.2rem;
  line-height: 1;
}

/* 6. TABLE OF CONTENTS */
.table-of-contents {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin: 28px 0 36px;
  box-shadow: var(--shadow-sm);
}

.toc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.toc-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 8px;
}

.toc-badge {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--bg-alt);
  color: var(--text-muted);
  padding: 3px 8px;
  border-radius: 12px;
  font-weight: 700;
}

.toc-list {
  margin-left: 20px;
  font-size: 0.92rem;
  line-height: 1.8;
  color: var(--text-muted);
}

.toc-list a {
  color: var(--link);
  text-decoration: none;
  font-weight: 500;
}

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

/* 7. ARTICLE BODY TYPOGRAPHY */
.article-body {
  font-family: var(--serif);
  font-size: 1.0625rem; /* 17px */
  line-height: 1.85;
  color: var(--text-main);
}

.article-lead {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-style: italic;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 24px;
}

.article-body h2 {
  font-family: var(--serif);
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.35;
  margin: 44px 0 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.article-body h3 {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.4;
  margin: 32px 0 12px;
}

.article-body h4 {
  font-family: var(--sans);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-dark);
  margin: 24px 0 8px;
}

.article-body p {
  margin-bottom: 22px;
}

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

.article-body a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 500;
  transition: color 0.15s ease;
}

.article-body a:hover {
  color: var(--accent);
}

.article-body ul, .article-body ol {
  margin: 0 0 24px 24px;
}

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

/* 8. CLINICAL CALLOUT BOXES */
.info-box {
  font-family: var(--sans);
  background: var(--info-bg);
  border: 1px solid var(--info-border);
  border-left: 4px solid var(--info-text);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  margin: 28px 0;
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--info-text);
}

.warning-box {
  font-family: var(--sans);
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  border-left: 4px solid var(--warning-text);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  margin: 28px 0;
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--warning-text);
}

/* 9. DATA & COMPARISON TABLES */
.clinical-table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 32px 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.clinical-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--sans);
  font-size: 0.9rem;
  text-align: left;
}

.clinical-table th {
  background: #f1f5f9;
  color: var(--text-dark);
  font-weight: 700;
  padding: 12px 16px;
  border-bottom: 2px solid var(--border-light);
  white-space: nowrap;
}

.clinical-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-main);
  vertical-align: top;
}

.clinical-table tr:nth-child(even) {
  background: #fbfcfe;
}

.clinical-table tr:hover {
  background: var(--accent-bg);
}

/* 10. FAQ SECTION */
.faq-section {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 2px solid var(--border-light);
}

.faq-section h2 {
  font-family: var(--serif);
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 24px;
}

.faq-item {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.faq-item h3 {
  font-family: var(--sans);
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 10px;
  line-height: 1.4;
}

.faq-item p {
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin: 0;
}

/* 11. SCIENTIFIC REFERENCES */
.references-box {
  margin-top: 48px;
  padding: 22px 24px;
  background: var(--bg-alt);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  font-family: var(--sans);
  font-size: 0.88rem;
  color: var(--text-muted);
}

.references-box h4 {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 14px;
}

.references-box ol {
  margin-left: 20px;
}

.references-box li {
  margin-bottom: 8px;
  line-height: 1.6;
}

.references-box a {
  color: var(--link);
  text-decoration: underline;
}

/* 12. CLINICAL CTA CARD */
.clinical-cta-box {
  margin: 40px 0;
  padding: 24px 28px;
  background: linear-gradient(135deg, #0a0f1d 0%, #151c33 100%);
  border: 1px solid rgba(181,128,42,0.6);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  color: #f8fafc;
  font-family: var(--sans);
}

.cta-tag {
  background: rgba(181,128,42,0.25);
  color: #e5b95a;
  border: 1px solid rgba(181,128,42,0.5);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.clinical-cta-box h3 {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  margin: 10px 0 8px;
  line-height: 1.35;
}

.clinical-cta-box p {
  color: #cbd5e1;
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 18px;
}

.cta-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #b5802a, #d49e47);
  color: #0a0f1d;
  font-size: 0.84rem;
  font-weight: 800;
  padding: 11px 20px;
  border-radius: 6px;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(181,128,42,0.3);
  transition: transform 0.15s ease;
}

.cta-button:hover {
  transform: translateY(-2px);
}

/* 13. FOOTER */
.site-footer {
  background: var(--text-dark);
  color: #94a3b8;
  padding: 56px 20px 40px;
  margin-top: 64px;
  font-family: var(--sans);
}

.site-footer-inner {
  max-width: var(--max-w-site);
  margin: 0 auto;
  text-align: center;
}

.footer-brand {
  margin-bottom: 24px;
}

.footer-brand img {
  height: 38px;
  width: auto;
  display: inline-block;
}

.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 24px;
}

.footer-links a {
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  transition: color 0.15s ease;
}

.footer-links a:hover {
  color: #ffffff;
}

.footer-legal {
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.7;
  max-width: 700px;
  margin: 0 auto;
}

/* 14. RESPONSIVE BREAKPOINTS (320px to 1024px) */
@media (max-width: 768px) {
  .site-nav {
    display: none;
  }
  .mobile-nav-toggle {
    display: block;
  }
  .article-title {
    font-size: 1.75rem;
  }
  .article-body {
    font-size: 1rem;
    line-height: 1.75;
  }
  .article-body h2 {
    font-size: 1.35rem;
  }
  .article-body h3 {
    font-size: 1.15rem;
  }
  .clinical-cta-box {
    padding: 20px;
  }
}

@media (max-width: 480px) {
  .site-header-inner {
    height: 56px;
  }
  .site-brand img {
    height: 30px;
  }
  .article-wrap {
    padding: 16px 16px 48px;
  }
  .article-title {
    font-size: 1.55rem;
  }
  .author-row {
    gap: 8px;
  }
  .key-takeaways {
    padding: 16px;
  }
  .table-of-contents {
    padding: 16px;
  }
  .clinical-table th,
  .clinical-table td {
    padding: 10px 12px;
    font-size: 0.82rem;
  }
}
