/*
Theme Name: NutriFoodGuide
Theme URI: https://nutrifoodguide.com
Author: NutriFoodGuide Editorial
Author URI: https://nutrifoodguide.com
Description: A premium, lightweight, content-first editorial theme for evidence-based everyday nutrition education. Built for readability, trust, and performance rather than aggressive monetization.
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 8.0
Tested up to: 6.6
License: GNU General Public License v2 or later
License URI: LICENSE
Text Domain: nutrifoodguide
Tags: blog, news, custom-menu, custom-logo, featured-images, translation-ready, accessibility-ready, threaded-comments, block-styles, editor-style, wide-blocks

NutriFoodGuide is a custom-built theme. It intentionally avoids page builders,
icon-font libraries, and web-font dependencies in favor of a fast, accessible,
system-font editorial layout.
*/

/* ==========================================================================
   1. DESIGN TOKENS
   All color, type, spacing and layout decisions flow from these variables.
   Do not hardcode raw values in templates or component CSS — reference tokens.
   ========================================================================== */

:root {

  /* --- Color: Editorial, calm, "trustworthy nutrition magazine" ---
     Deliberately avoids the generic "health supplement" look (bright lime
     green, glossy gradients) and the generic "AI blog" look (warm cream +
     terracotta serif). Forest green reads clinical-adjacent-but-warm;
     cream/off-white keeps long-form reading comfortable. */

  --color-primary: #1F3D2E;          /* deep forest green — headers, nav, primary actions */
  --color-primary-dark: #142A1F;     /* hover/active states on primary */
  --color-secondary: #F4EFE4;        /* warm cream — section backgrounds, cards */
  --color-accent: #6B9E78;           /* soft natural green — links, tags, small accents */
  --color-accent-dark: #4F7D5C;      /* accent hover/focus */

  /* --- Highlight: minimal amber/gold, chosen as Design B ---
     Used ONLY for wayfinding — "editor's pick" tags, secondary/outline
     buttons, small badges. Never as a fill, background, or primary CTA.
     Keeps the site from reading as a green/cream default while avoiding
     the generic "orange wellness site" look. */
  --color-highlight: #C68A2E;        /* amber — outline buttons, icons */
  --color-highlight-bg: #FBF1DC;     /* pale gold — tag/badge backgrounds */
  --color-highlight-text: #8A5A12;   /* text on highlight-bg, AA on pale gold */

  --color-text: #2A2A28;             /* dark charcoal — body text */
  --color-text-muted: #5B5B57;       /* secondary text, meta, captions */
  --color-bg: #FBFAF7;               /* off-white — page background */
  --color-surface: #FFFFFF;          /* cards, content surfaces on top of bg */
  --color-border: #E4E0D6;           /* hairline borders, dividers */

  --color-link: var(--color-primary);
  --color-link-hover: var(--color-accent-dark);

  --color-success: #3E7A4C;
  --color-warning: #A85E1E;
  --color-error: #A3372F;

  --color-ad-label: #6B6B64;         /* "Advertisement" label text — muted but WCAG AA (4.5:1) on ad-bg */
  --color-ad-bg: #F1EFE9;            /* ad slot background, visually distinct from editorial */

  /* Focus ring — must remain visible at all times (WCAG 2.2 AA) */
  --color-focus-ring: #1F3D2E;

  /* --- Typography ---
     System font stack only: zero web-font requests by default, per the
     performance requirement. This is a deliberate choice, not a fallback. */

  --font-display: -apple-system, "Georgia", "Iowan Old Style", "Palatino Linotype", "Times New Roman", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;

  /* Type scale — 1.25 (major third) ratio, base 17px for long-form legibility */
  --text-xs: 0.75rem;    /* 12px — captions, labels, ad disclosure */
  --text-sm: 0.85rem;    /* ~14px — meta, byline, breadcrumbs */
  --text-base: 1.0625rem; /* 17px — body copy */
  --text-lg: 1.25rem;    /* 20px — lead paragraph, large body */
  --text-xl: 1.6rem;     /* ~26px — H3 */
  --text-2xl: 2rem;      /* 32px — H2 */
  --text-3xl: 2.5rem;    /* 40px — H1 article */
  --text-4xl: 3.25rem;   /* 52px — hero headline */

  --line-height-tight: 1.25;
  --line-height-heading: 1.3;
  --line-height-body: 1.7;   /* comfortable for long-form reading, per spec */

  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  /* --- Spacing scale (rem-based, 8px baseline) --- */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-5: 3rem;
  --space-6: 4rem;
  --space-7: 6rem;

  /* --- Layout --- */
  --content-max-width: 1280px;      /* outer page container */
  --article-width: 720px;           /* article column: within 680-760px spec */
  --sidebar-width: 320px;
  --gutter: 1.5rem;

  /* --- Radius & elevation — restrained, editorial (not "app-like") --- */
  --radius-sm: 4px;
  --radius-md: 8px;
  --shadow-sm: 0 1px 2px rgba(31, 61, 46, 0.06);
  --shadow-md: 0 4px 16px rgba(31, 61, 46, 0.08);

  /* --- Motion --- */
  --transition-fast: 120ms ease;
  --transition-base: 200ms ease;
}

/* Dark mode intentionally deferred: not part of the brief. Respect user
   reduced-motion preference regardless of color scheme. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   2. RESET / BASE
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--line-height-body);
  color: var(--color-text);
  background-color: var(--color-bg);
  font-weight: var(--font-weight-regular);
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  line-height: var(--line-height-heading);
  font-weight: var(--font-weight-semibold);
  color: var(--color-primary-dark);
  margin: 0 0 var(--space-2);
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); margin-top: var(--space-5); }
h3 { font-size: var(--text-xl); margin-top: var(--space-4); }
h4 { font-size: var(--text-lg); }

p { margin: 0 0 var(--space-3); }

a {
  color: var(--color-link);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
a:hover { color: var(--color-link-hover); }

/* Visible focus state — required, never suppressed */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--color-focus-ring);
  outline-offset: 2px;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--color-primary);
  color: #fff;
  padding: var(--space-1) var(--space-2);
  z-index: 1000;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus {
  left: 0;
}

/* Visually-hidden but screen-reader-accessible text (form labels, etc.) */
.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}

/* Container utility */
.container {
  max-width: var(--content-max-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Ad slot base styling — clearly separated from editorial content per spec */
.ad-slot {
  background: var(--color-ad-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: var(--space-2);
  margin-block: var(--space-4);
  text-align: center;
}
.ad-slot__label {
  display: block;
  font-size: var(--text-xs);
  color: var(--color-ad-label);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-1);
}
.ad-slot--empty {
  border-style: dashed;
  opacity: 0.6;
}

/* Responsive breakpoints (reference, applied per-component):
   320 / 375 / 414  -> mobile, single column
   768              -> tablet, sidebar collapses under content
   1024+            -> desktop, two-column article layout
   1440 / 1920      -> content stays capped at --content-max-width */

/* ==========================================================================
   3. BUTTONS & BADGES
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-medium);
  padding: 0.7em 1.3em;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.btn-primary {
  background: var(--color-primary);
  color: var(--color-secondary);
}
.btn-primary:hover {
  background: var(--color-primary-dark);
  color: var(--color-secondary);
}

.btn-outline {
  background: transparent;
  border-color: var(--color-primary);
  color: var(--color-primary);
}
.btn-outline:hover {
  background: var(--color-secondary);
}

/* Highlight variant reserved for secondary, non-primary actions —
   never used for the main CTA on a page (see token comment above). */
.btn-highlight-outline {
  background: transparent;
  border-color: var(--color-highlight);
  color: var(--color-highlight-text);
}
.btn-highlight-outline:hover {
  background: var(--color-highlight-bg);
}

.badge {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: var(--font-weight-medium);
  padding: 0.3em 0.7em;
  border-radius: var(--radius-sm);
  background: var(--color-highlight-bg);
  color: var(--color-highlight-text);
}
.badge-category {
  background: var(--color-secondary);
  color: var(--color-primary-dark);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.7rem;
}

/* ==========================================================================
   4. SITE HEADER
   ========================================================================== */

.site-header {
  background: var(--color-primary);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding-block: var(--space-2);
}

.site-logo {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--color-secondary);
  text-decoration: none;
  letter-spacing: 0.01em;
  flex-shrink: 0;
}
.site-logo:hover { color: var(--color-secondary); }
.site-logo img { display: block; height: 40px; width: auto; }

.primary-nav {
  display: flex;
}
.primary-nav ul {
  list-style: none;
  display: flex;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
}
.primary-nav a {
  color: var(--color-secondary);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-medium);
  text-decoration: none;
  padding: 0.5em 0;
  border-bottom: 2px solid transparent;
}
.primary-nav a:hover,
.primary-nav a:focus-visible {
  border-bottom-color: var(--color-highlight);
  color: var(--color-secondary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.header-search-toggle,
.nav-toggle {
  background: none;
  border: none;
  color: var(--color-secondary);
  cursor: pointer;
  padding: 0.4em;
  line-height: 0;
  display: flex;
}
.header-search-toggle svg,
.nav-toggle svg { width: 22px; height: 22px; }

.nav-toggle { display: none; }

.header-search-form {
  display: none;
  padding: var(--space-2) 0;
  border-top: 1px solid rgba(244, 239, 228, 0.15);
}
.header-search-form.is-open { display: block; }
.header-search-form input[type="search"] {
  width: 100%;
  padding: 0.6em 0.9em;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  font-size: var(--text-base);
  font-family: var(--font-body);
}

@media (max-width: 900px) {
  .primary-nav { display: none; }
  .primary-nav.is-open {
    display: block;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: var(--color-primary);
    padding: var(--space-2) var(--gutter) var(--space-3);
  }
  .primary-nav.is-open ul {
    flex-direction: column;
    gap: var(--space-1);
  }
  .nav-toggle { display: flex; }
  .site-header__inner { position: relative; }
}

/* ==========================================================================
   5. HOMEPAGE SECTIONS
   ========================================================================== */

.section {
  padding-block: var(--space-6);
}
.section--muted {
  background: var(--color-secondary);
}
.section__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}
.section__header h2 { margin: 0; }
.section__link {
  font-size: var(--text-sm);
  font-weight: var(--font-weight-medium);
  white-space: nowrap;
}

/* Hero */
.hero {
  padding-block: var(--space-7) var(--space-6);
  text-align: center;
}
.hero__headline {
  font-size: var(--text-4xl);
  max-width: 800px;
  margin-inline: auto;
}
.hero__subcopy {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  max-width: 600px;
  margin: var(--space-2) auto var(--space-4);
  line-height: var(--line-height-body);
}
.hero__ctas {
  display: flex;
  gap: var(--space-2);
  justify-content: center;
  flex-wrap: wrap;
}

/* Card grids */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-3);
}

.article-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: box-shadow var(--transition-base), border-color var(--transition-base);
}
.article-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-accent);
}
.article-card__image {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--color-secondary);
}
.article-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.article-card__body {
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  flex: 1;
}
.article-card__title {
  font-size: var(--text-lg);
  margin: 0;
  color: var(--color-primary-dark);
}
.article-card__excerpt {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin: 0;
  flex: 1;
}
.article-card__meta {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  display: flex;
  gap: var(--space-1);
}

/* Nutrient / food pill grid */
.pill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-2);
}
.pill-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-2);
  text-align: center;
  text-decoration: none;
  color: var(--color-primary-dark);
  font-weight: var(--font-weight-medium);
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
}
.pill-card:hover {
  border-color: var(--color-accent);
  background: var(--color-secondary);
  color: var(--color-primary-dark);
}

/* Trust section */
.trust-section {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: var(--space-5);
  align-items: center;
}
@media (max-width: 800px) {
  .trust-section { grid-template-columns: 1fr; }
}
.trust-section__list {
  list-style: none;
  margin: var(--space-3) 0 0;
  padding: 0;
  display: grid;
  gap: var(--space-2);
}
.trust-section__list li {
  padding-left: var(--space-3);
  position: relative;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.trust-section__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-accent);
}

/* Newsletter */
.newsletter {
  background: var(--color-primary);
  color: var(--color-secondary);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  text-align: center;
}
.newsletter h2 { color: var(--color-secondary); }
.newsletter p {
  color: rgba(244, 239, 228, 0.85);
  max-width: 480px;
  margin-inline: auto;
}
.newsletter-form {
  display: flex;
  gap: var(--space-1);
  max-width: 420px;
  margin: var(--space-3) auto 0;
}
.newsletter-form input[type="email"] {
  flex: 1;
  padding: 0.7em 1em;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-size: var(--text-base);
}
@media (max-width: 480px) {
  .newsletter-form { flex-direction: column; }
}

/* About (homepage strip) */
.about-strip {
  max-width: 680px;
  margin-inline: auto;
  text-align: center;
}

/* ==========================================================================
   6. SITE FOOTER
   ========================================================================== */

.site-footer {
  background: var(--color-primary-dark);
  color: rgba(244, 239, 228, 0.8);
  padding-block: var(--space-6) var(--space-4);
  margin-top: var(--space-6);
}
.site-footer a {
  color: rgba(244, 239, 228, 0.85);
  text-decoration: none;
}
.site-footer a:hover { color: var(--color-secondary); }

.footer-widgets {
  padding-block: var(--space-3);
  border-bottom: 1px solid rgba(244, 239, 228, 0.12);
}
.widget { margin-bottom: var(--space-3); }
.widget:last-child { margin-bottom: 0; }
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { margin-bottom: 0.4em; font-size: var(--text-sm); }

.footer-top {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: var(--space-4);
  padding-bottom: var(--space-5);
  border-bottom: 1px solid rgba(244, 239, 228, 0.12);
}
@media (max-width: 800px) {
  .footer-top { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .footer-top { grid-template-columns: 1fr; }
}

.footer-brand .site-logo { color: var(--color-secondary); }
.footer-brand p {
  font-size: var(--text-sm);
  margin-top: var(--space-1);
  max-width: 260px;
}

.footer-col h3 {
  color: var(--color-secondary);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: var(--space-2);
}
.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.6em;
}
.footer-col a { font-size: var(--text-sm); }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding-top: var(--space-3);
  font-size: var(--text-xs);
}
.footer-social {
  display: flex;
  gap: var(--space-2);
}
.footer-social a { display: flex; }
.footer-social svg { width: 18px; height: 18px; }

/* ==========================================================================
   7. BREADCRUMBS
   ========================================================================== */

.breadcrumbs {
  margin-block: var(--space-3) var(--space-2);
}
.breadcrumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4em;
  margin: 0;
  padding: 0;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.breadcrumbs li { display: flex; align-items: center; gap: 0.4em; }
.breadcrumbs li:not(:last-child)::after {
  content: "/";
  margin-left: 0.4em;
  color: var(--color-border);
}
.breadcrumbs a { color: var(--color-text-muted); }
.breadcrumbs a:hover { color: var(--color-primary); }
.breadcrumbs li[aria-current="page"] { color: var(--color-text); }

/* ==========================================================================
   8. ARTICLE / GUIDE LAYOUT
   ========================================================================== */

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, var(--article-width)) var(--sidebar-width);
  gap: var(--space-5);
  padding-block: var(--space-2) var(--space-6);
  align-items: start;
}
@media (max-width: 1024px) {
  .article-layout {
    grid-template-columns: 1fr;
  }
}

/* Guides run longer and are meant to read as flagship resources —
   slightly more breathing room above the header and between sections
   than a standard article, without diverging from the shared design
   system (same tokens, same components, just more of them). */
.article-layout--guide .article-header {
  padding-top: var(--space-2);
}
.article-content--guide h2 {
  margin-top: var(--space-4);
}

.article-main { min-width: 0; }

.article-header { margin-block: var(--space-3) var(--space-3); }
.article-header h1 { margin-top: var(--space-1); }

.article-intro {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  line-height: var(--line-height-body);
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-top: var(--space-2);
}

.article-featured-image {
  margin-block: var(--space-3);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.article-featured-image img { width: 100%; }

.badge-category--guide {
  background: var(--color-highlight-bg);
  color: var(--color-highlight-text);
}

/* Article body typography */
.article-content,
.article-content--guide {
  font-size: var(--text-base);
  line-height: var(--line-height-body);
}
.article-content h2 { padding-top: var(--space-2); }
.article-content h2::before {
  content: "";
  display: block;
  height: 1px;
}
.article-content ul,
.article-content ol {
  padding-left: 1.3em;
  margin: 0 0 var(--space-3);
}
.article-content li { margin-bottom: 0.4em; }
.article-content blockquote {
  margin: var(--space-3) 0;
  padding: var(--space-2) var(--space-3);
  border-left: 3px solid var(--color-accent);
  background: var(--color-secondary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--color-text);
}
.article-content figure { margin: var(--space-3) 0; }
.article-content figcaption {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

/* ==========================================================================
   9. TABLE OF CONTENTS
   ========================================================================== */

.toc {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
}
.toc__title {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  margin: 0 0 var(--space-1);
}
.toc__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4em;
}
.toc__item a {
  font-size: var(--text-sm);
  color: var(--color-text);
  text-decoration: none;
}
.toc__item a:hover { color: var(--color-primary); text-decoration: underline; }
.toc__item--h3 { padding-left: var(--space-2); }

/* ==========================================================================
   10. KEY TAKEAWAYS
   ========================================================================== */

.key-takeaways {
  background: var(--color-secondary);
  border-left: 3px solid var(--color-accent);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: var(--space-3);
  margin-block: var(--space-3) var(--space-4);
}
.key-takeaways__title {
  margin: 0 0 var(--space-1);
  font-size: var(--text-lg);
}
.key-takeaways ul {
  margin: 0;
  padding-left: 1.2em;
}
.key-takeaways li {
  font-size: var(--text-sm);
  margin-bottom: 0.4em;
}

/* ==========================================================================
   11. FAQ ACCORDION (native <details>, no JS required)
   ========================================================================== */

.faq { margin-block: var(--space-5); }
.faq__item {
  border-bottom: 1px solid var(--color-border);
  padding-block: var(--space-2);
}
.faq__question {
  font-family: var(--font-body);
  font-weight: var(--font-weight-medium);
  font-size: var(--text-base);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--color-primary-dark);
}
.faq__question::-webkit-details-marker { display: none; }
.faq__question::after {
  content: "+";
  font-size: 1.3em;
  color: var(--color-accent-dark);
  flex-shrink: 0;
  margin-left: var(--space-2);
  transition: transform var(--transition-fast);
}
.faq__item[open] .faq__question::after { transform: rotate(45deg); }
.faq__answer {
  padding-top: var(--space-1);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}
.faq__answer p { margin: 0; }

/* ==========================================================================
   12. REFERENCES
   ========================================================================== */

.references { margin-block: var(--space-5); }
.references__list {
  padding-left: 1.3em;
  display: grid;
  gap: 0.6em;
}
.references__list li { font-size: var(--text-sm); }
.references__org,
.references__date {
  display: inline-block;
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  margin-left: 0.5em;
}
.references__org::before { content: "— "; }
.references__date::before { content: "· "; }

/* ==========================================================================
   13. DISCLAIMER
   ========================================================================== */

.disclaimer {
  background: var(--color-ad-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  margin-block: var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.disclaimer strong { color: var(--color-text); }

/* ==========================================================================
   14. AUTHOR BOX
   ========================================================================== */

.author-box {
  display: flex;
  gap: var(--space-2);
  background: var(--color-secondary);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  margin-block: var(--space-4);
}
.author-box__photo {
  border-radius: 50%;
  flex-shrink: 0;
  width: 64px;
  height: 64px;
}
.author-box__content {
  flex: 1;
  min-width: 0;
}
.author-box__name {
  font-weight: var(--font-weight-semibold);
  margin: 0 0 0.2em;
}
.author-box__name a { color: var(--color-primary-dark); }
.author-box__credentials {
  display: inline-block;
  margin-left: 0.5em;
  font-size: var(--text-xs);
  font-weight: var(--font-weight-regular);
  color: var(--color-text-muted);
}
.author-box__bio {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin: 0 0 var(--space-1);
}
.author-box__meta {
  list-style: none;
  margin: 0 0 var(--space-1);
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8em;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.author-box__archive-link {
  font-size: var(--text-sm);
  font-weight: var(--font-weight-medium);
}
@media (max-width: 480px) {
  .author-box { flex-direction: column; }
}

/* ==========================================================================
   15. RELATED POSTS SECTION (used inside article-main)
   ========================================================================== */

.related-posts { margin-block: var(--space-5); }
.related-posts h2 { margin-bottom: var(--space-2); }

/* ==========================================================================
   16. SIDEBAR BLOCKS
   ========================================================================== */

.article-sidebar {
  display: grid;
  gap: var(--space-3);
  position: sticky;
  top: calc(var(--space-6) + 60px);
}
.widget-title {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  margin: 0 0 var(--space-1);
}
.footer-widgets .widget-title { color: var(--color-secondary); opacity: 0.8; }
@media (max-width: 1024px) {
  .article-sidebar { position: static; }
}

/* ==========================================================================
   17. CATEGORY / SUBCATEGORY ARCHIVE
   ========================================================================== */

.category-hero {
  padding-block: var(--space-4) var(--space-2);
  max-width: 760px;
}
.category-hero__description {
  color: var(--color-text-muted);
  font-size: var(--text-lg);
  line-height: var(--line-height-body);
}

.card-grid--featured .article-card {
  grid-column: 1 / -1;
}
@media (min-width: 640px) {
  .card-grid--featured { grid-template-columns: 1fr; }
  .card-grid--featured .article-card { display: grid; grid-template-columns: 320px 1fr; }
  .card-grid--featured .article-card__image { aspect-ratio: auto; height: 100%; }
}

.pagination { margin-top: var(--space-4); }
.pagination .nav-links {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
  list-style: none;
  padding: 0;
}
.pagination a,
.pagination span {
  font-size: var(--text-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-primary);
}

/* ==========================================================================
   18. NUTRITION TABLES & COMPARISON TABLES
   Spec sections 18/Phase 4.6/4.7 — semantic <table> markup, accessible
   headers, horizontal scroll on mobile, no overflow.
   ========================================================================== */

.nfg-table-wrap {
  overflow-x: auto;
  margin-block: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  -webkit-overflow-scrolling: touch;
}
table.nfg-table,
.article-content table {
  width: 100%;
  min-width: 480px;
  border-collapse: collapse;
  font-size: var(--text-sm);
}
table.nfg-table caption,
.article-content table caption {
  text-align: left;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  padding: var(--space-1) var(--space-2);
}
table.nfg-table th,
table.nfg-table td,
.article-content table th,
.article-content table td {
  padding: 0.7em 1em;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}
table.nfg-table thead th,
.article-content table thead th {
  background: var(--color-secondary);
  color: var(--color-primary-dark);
  font-weight: var(--font-weight-semibold);
  white-space: nowrap;
}
table.nfg-table tbody tr:hover,
.article-content table tbody tr:hover {
  background: rgba(107, 158, 120, 0.06);
}

/* Comparison table variant: first column emphasized as the attribute label */
table.nfg-comparison-table th:first-child,
table.nfg-comparison-table td:first-child {
  font-weight: var(--font-weight-medium);
  background: var(--color-secondary);
  white-space: nowrap;
}

/* ==========================================================================
   19. CALLOUT / HIGHLIGHT BOX
   Generic reusable callout for tips, warnings, or emphasis inside
   article content — distinct from key-takeaways (which is intro-only)
   and disclaimer (which is legal-toned).
   ========================================================================== */

.nfg-callout {
  background: var(--color-highlight-bg);
  border-left: 3px solid var(--color-highlight);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: var(--space-2) var(--space-3);
  margin-block: var(--space-3);
  font-size: var(--text-sm);
}
.nfg-callout strong:first-child { color: var(--color-highlight-text); }

/* Food-source card grid — used within Guide content for "which foods
   contain this nutrient" visual lists. Reuses article-card styling so
   it never introduces a new visual language. */
.food-source-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-2);
  margin-block: var(--space-3);
}
.food-source-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-2);
  text-align: center;
}
.food-source-card__name {
  font-weight: var(--font-weight-medium);
  margin: var(--space-1) 0 0.2em;
}
.food-source-card__amount {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* Related-guide callout: prominent internal link from a supporting
   article back to its cornerstone Guide (spec: internal linking). */
.related-guide-callout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  background: var(--color-primary);
  color: var(--color-secondary);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  margin-block: var(--space-4);
  text-decoration: none;
}
.related-guide-callout:hover { background: var(--color-primary-dark); color: var(--color-secondary); }
.related-guide-callout__label {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.75;
  display: block;
  margin-bottom: 0.2em;
}
.related-guide-callout__title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  margin: 0;
  color: var(--color-secondary);
}
.related-guide-callout__title a {
  color: var(--color-secondary);
  text-decoration: none;
}

/* ==========================================================================
   20. PLAIN PAGES / LEGAL PAGES / AUTHOR PAGES (Phase 5)
   ========================================================================== */

.page-content {
  max-width: var(--article-width);
  margin-inline: auto;
  padding-block: var(--space-2) var(--space-6);
}

.article-layout--legal {
  grid-template-columns: 1fr;
  max-width: var(--article-width);
  margin-inline: auto;
}

.toc--inline {
  margin-block: var(--space-3) var(--space-4);
}

.author-archive-header {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  padding-block: var(--space-4) var(--space-2);
}
.author-archive-header__photo { border-radius: 50%; flex-shrink: 0; }
.author-archive-header__bio {
  color: var(--color-text-muted);
  max-width: 640px;
  margin-top: var(--space-1);
}
@media (max-width: 480px) {
  .author-archive-header { flex-direction: column; text-align: center; }
}

.authors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-3);
}
.author-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  text-align: center;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3em;
}
.author-card:hover { border-color: var(--color-accent); }
.author-card__photo { border-radius: 50%; }
.author-card__name { font-weight: var(--font-weight-medium); color: var(--color-primary-dark); }
.author-card__credentials { font-size: var(--text-xs); color: var(--color-text-muted); }
