/* ==========================================================================
   YummyMetrics — site styles
   Brand tokens are locked (see project brief). Edit values here only.
   ========================================================================== */

:root {
  /* Brand */
  --tomato: #E5482D;        /* brand, calories, large type */
  --tomato-deep: #C23A21;   /* links, buttons, small text */
  --tomato-wash: #FBE6E1;
  --ink: #15201B;           /* text */
  --ink-2: #44514A;         /* secondary text */
  --ink-3: #66726B;         /* tertiary / meta */
  --paper: #EEF1EC;         /* page background (Sage Paper) */
  --surface: #FFFFFF;       /* cards */
  --line: #E3E7E1;
  --line-strong: #CDD4CB;

  /* Macros — use everywhere a macro is shown */
  --protein: #9D2B5B;
  --carbs: #F2A900;
  --fat: #0F8A82;

  /* Type */
  --font-display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --font-body: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  /* Layout */
  --wrap: 1180px;
  --wrap-narrow: 760px;
  --gutter: clamp(16px, 4vw, 32px);
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(21, 32, 27, .05), 0 4px 16px rgba(21, 32, 27, .05);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
img, svg { display: block; max-width: 100%; }
main { flex: 1; }
:focus-visible { outline: 3px solid var(--tomato); outline-offset: 2px; border-radius: 4px; }

.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 100;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--radius-sm);
  font-weight: 600; text-decoration: none; transition: top .15s;
}
.skip-link:focus { top: 12px; }

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 .5em;
  color: var(--ink);
}
h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); letter-spacing: -0.03em; }
h2 { font-size: clamp(1.45rem, 3vw, 1.9rem); margin-top: 2em; }
h3 { font-size: 1.2rem; font-weight: 700; margin-top: 1.6em; }
p { margin: 0 0 1.1em; }
a { color: var(--tomato-deep); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
strong { font-weight: 600; }
small, .small { font-size: .875rem; }
.mono, .eyebrow {
  font-family: var(--font-mono);
  font-size: .78rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.eyebrow { color: var(--tomato-deep); font-weight: 500; display: inline-block; margin-bottom: .9rem; }
.lead { font-size: clamp(1.08rem, 2vw, 1.25rem); color: var(--ink-2); line-height: 1.55; max-width: 62ch; }
.num { font-variant-numeric: tabular-nums; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.wrap--narrow { max-width: calc(var(--wrap-narrow) + 2 * var(--gutter)); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(238, 241, 236, .9);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand svg { width: 36px; height: 36px; flex: none; }
.brand-word {
  font-family: var(--font-display); font-weight: 800; font-size: 1.45rem;
  letter-spacing: -0.035em; line-height: 1;
}
.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.header-tools { display: flex; align-items: center; gap: 8px; }

/* Language switcher (<details>, plain links — no automatic redirects) */
.lang-switch { position: relative; }
.lang-switch summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  height: 42px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  font-family: var(--font-mono); font-size: .8rem; font-weight: 500; letter-spacing: .04em; color: var(--ink);
}
.lang-switch summary::-webkit-details-marker { display: none; }
.lang-switch summary:hover { background: rgba(21, 32, 27, .06); }
.lang-switch summary svg { width: 16px; height: 16px; }
.lang-switch ul {
  position: absolute; inset-inline-end: 0; top: calc(100% + 6px); z-index: 60; min-width: 170px;
  margin: 0; padding: 6px; list-style: none; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow);
}
.lang-switch a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px;
  color: var(--ink); text-decoration: none; font-weight: 500; font-size: .95rem;
}
.lang-switch a:hover { background: var(--paper); }
.lang-switch a[aria-current] { color: var(--tomato-deep); }
.lang-switch .lang-code { font-family: var(--font-mono); font-size: .72rem; color: var(--ink-3); min-width: 1.6em; }
.nav a {
  color: var(--ink); text-decoration: none; font-weight: 500; font-size: .95rem;
  padding: 8px 12px; border-radius: var(--radius-sm); white-space: nowrap;
}
.nav a:hover { background: rgba(21, 32, 27, .06); }
.nav a[aria-current] { color: var(--tomato-deep); }
.nav .btn { margin-left: 8px; }
.nav-toggle {
  display: none; background: none; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  width: 42px; height: 42px; align-items: center; justify-content: center; cursor: pointer; color: var(--ink);
}
.nav-toggle svg { width: 20px; height: 20px; }

@media (max-width: 1040px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    display: none; position: absolute; left: 0; right: 0; top: 68px;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--line);
    padding: 8px var(--gutter) 16px; box-shadow: var(--shadow);
  }
  .nav.is-open { display: flex; }
  .nav a { padding: 12px 8px; border-bottom: 1px solid var(--line); border-radius: 0; font-size: 1rem; }
  .nav .btn { margin: 12px 0 0; text-align: center; border-bottom: 0; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-body); font-weight: 600; font-size: .95rem; line-height: 1;
  padding: 12px 18px; border-radius: 999px; border: 1px solid transparent;
  background: var(--tomato-deep); color: #fff !important; text-decoration: none; cursor: pointer;
  transition: background .15s, transform .15s;
}
.btn:hover { background: #A9311B; }
.btn:active { transform: translateY(1px); }
.btn--ghost { background: transparent; color: var(--ink) !important; border-color: var(--line-strong); }
.btn--ghost:hover { background: rgba(21, 32, 27, .05); }
.btn--sm { padding: 9px 14px; font-size: .88rem; }

/* ---------- Page hero (inner pages) ---------- */
.page-hero { padding: clamp(40px, 7vw, 76px) 0 clamp(24px, 4vw, 40px); }
.page-hero h1 { max-width: 18ch; }
.page-meta { color: var(--ink-3); font-size: .9rem; margin-top: 1rem; }

/* ---------- Prose (legal & long-form) ---------- */
.prose { padding-bottom: clamp(48px, 8vw, 96px); }
.prose > *:first-child { margin-top: 0; }
.prose h2 { padding-top: 1.6rem; border-top: 1px solid var(--line); }
.prose h2:first-of-type { border-top: 0; padding-top: 0; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.prose li { margin-bottom: .45em; }
.prose li::marker { color: var(--tomato); }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 1.5em; font-size: .93rem; background: var(--surface); border-radius: var(--radius-sm); overflow: hidden; box-shadow: 0 0 0 1px var(--line); }
.prose th, .prose td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); font-weight: 500; background: #F7F8F6; }
.prose tr:last-child td { border-bottom: 0; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.prose blockquote, .callout {
  margin: 0 0 1.5em; padding: 16px 20px; border-left: 4px solid var(--tomato);
  background: var(--surface); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--ink-2);
}
.callout p:last-child { margin-bottom: 0; }
.callout strong { color: var(--ink); }

.toc {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 22px; margin-bottom: 2.5rem;
}
.toc .mono { color: var(--ink-3); display: block; margin-bottom: 8px; }
.toc ol { margin: 0; padding-left: 1.2em; columns: 2; column-gap: 32px; font-size: .95rem; }
.toc li { break-inside: avoid; margin-bottom: 4px; }
.toc a { color: var(--ink); text-decoration: none; }
.toc a:hover { color: var(--tomato-deep); text-decoration: underline; }
@media (max-width: 600px) { .toc ol { columns: 1; } }

/* ---------- Cards & grids ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow);
}
.grid { display: grid; gap: 20px; }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); }
.card h3 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }
.card-icon {
  width: 40px; height: 40px; border-radius: 10px; background: var(--tomato-wash); color: var(--tomato-deep);
  display: flex; align-items: center; justify-content: center; margin-bottom: 14px;
}
.card-icon svg { width: 22px; height: 22px; }

/* ---------- Home ---------- */
.hero { padding: clamp(48px, 9vw, 112px) 0 clamp(40px, 6vw, 72px); }
.hero-grid { display: grid; grid-template-columns: minmax(0,1.1fr) minmax(0,.9fr); gap: clamp(32px, 6vw, 72px); align-items: center; }
.hero h1 { font-size: clamp(2.5rem, 6.4vw, 4.6rem); letter-spacing: -0.04em; line-height: 1.02; }
.hero h1 em { font-style: normal; color: var(--tomato); }
@media (max-width: 900px) { .hero-grid { grid-template-columns: minmax(0,1fr); } }
.hero-grid > *, .grid > * { min-width: 0; }

.search-mock {
  display: flex; align-items: center; gap: 10px; background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: 999px; padding: 6px 6px 6px 18px;
  max-width: 520px; margin: 28px 0 14px; box-shadow: var(--shadow);
}
.search-mock svg { width: 20px; height: 20px; color: var(--ink-3); flex: none; }
.search-mock input {
  flex: 1; width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 1rem; color: var(--ink); padding: 8px 0;
}
.search-mock input::placeholder { color: var(--ink-3); }
.hero-note { color: var(--ink-3); font-size: .9rem; }

/* Nutrition preview card */
.nutri {
  background: var(--surface); border-radius: 20px; padding: 26px; border: 1px solid var(--line);
  box-shadow: 0 2px 4px rgba(21,32,27,.04), 0 18px 48px rgba(21,32,27,.10);
}
.nutri-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.nutri-name { font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; letter-spacing: -0.02em; line-height: 1.1; margin: 4px 0 0; }
.nutri-basis { color: var(--ink-3); }
.nutri-kcal { text-align: right; }
.nutri-kcal b { display: block; font-family: var(--font-display); font-size: 2.6rem; color: var(--tomato); line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.macro-bar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; margin: 22px 0 18px; gap: 3px; }
.macro-bar span { display: block; }
.macro-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 0; padding: 0; list-style: none; }
.macro-list li { border-top: 3px solid; padding-top: 8px; }
.macro-list .k { display: block; font-family: var(--font-mono); font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.macro-list .v { font-weight: 600; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.nutri-rows { margin: 18px 0 0; padding: 0; list-style: none; font-size: .93rem; }
.nutri-rows li { display: flex; justify-content: space-between; padding: 8px 0; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.nutri-rows li span:first-child { color: var(--ink-2); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }

.section { padding: clamp(40px, 7vw, 88px) 0; }
.section--white { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { max-width: 640px; margin-bottom: 36px; }
.section-head h2 { margin-top: 0; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1.4fr .8fr; gap: 28px; align-items: start; padding-bottom: clamp(48px, 8vw, 96px); }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }
.form-card { min-height: 420px; }
.contact-list { list-style: none; margin: 0; padding: 0; }
.contact-list li { display: flex; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); }
.contact-list li:first-child { border-top: 0; padding-top: 0; }
.contact-list svg { width: 20px; height: 20px; color: var(--tomato-deep); flex: none; margin-top: 3px; }
.contact-list .k { display: block; font-family: var(--font-mono); font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }

/* ---------- 404 ---------- */
.notfound { padding: clamp(56px, 10vw, 120px) 0; text-align: center; }
.notfound .big {
  font-family: var(--font-display); font-weight: 800; font-size: clamp(5rem, 18vw, 10rem);
  line-height: .9; letter-spacing: -0.06em; color: var(--tomato); font-variant-numeric: tabular-nums; margin: 0 0 20px;
}
.notfound .face { width: 96px; height: 96px; margin: 0 auto 24px; }
.notfound .lead { margin: 0 auto 28px; }
.notfound-links { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #C9D1CB; margin-top: auto; font-size: .93rem; }
.site-footer a { color: #E9EEEA; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-top { display: grid; grid-template-columns: 1.3fr repeat(4, 1fr); gap: 32px; padding: 56px 0 40px; }
.footer-brand .brand { color: #F4F1EA; }
.footer-brand p { margin: 14px 0 0; max-width: 32ch; color: #A9B4AD; }
.footer-col h2 { font-family: var(--font-mono); font-size: .72rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: #8E9A93; margin: 0 0 14px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 9px; }
.footer-col button {
  background: none; border: 0; padding: 0; font: inherit; color: #E9EEEA; cursor: pointer; text-align: left;
}
.footer-col button:hover { color: #fff; text-decoration: underline; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1); padding: 20px 0 28px;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; color: #8E9A93; font-size: .85rem;
}
.footer-bottom p { margin: 0; }
@media (max-width: 1000px) { .footer-top { grid-template-columns: repeat(4, 1fr); } .footer-brand { grid-column: 1 / -1; } }
@media (max-width: 700px) { .footer-top { grid-template-columns: 1fr 1fr; } }
.net-list span { display: block; font-size: .8rem; color: #8E9A93; margin-top: 1px; }

/* ---------- Consent banner ---------- */
.consent {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 90;
  max-width: 560px; margin-left: auto;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  border-radius: 16px; padding: 20px 22px; box-shadow: 0 12px 48px rgba(21,32,27,.18);
  font-size: .93rem; line-height: 1.55;
}
.consent[hidden] { display: none; }
.consent h2 { font-size: 1.1rem; margin: 0 0 6px; }
.consent p { margin: 0 0 14px; color: var(--ink-2); }
.consent-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.consent-actions .btn { flex: 1 1 auto; }
.consent-prefs { border-top: 1px solid var(--line); margin: 4px 0 14px; padding-top: 6px; }
.consent-prefs[hidden] { display: none; }
.pref { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.pref:last-child { border-bottom: 0; }
.pref b { display: block; font-weight: 600; }
.pref span { color: var(--ink-3); font-size: .86rem; }
.switch { position: relative; width: 44px; height: 26px; flex: none; margin-top: 2px; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; background: var(--line-strong); border-radius: 999px; transition: background .15s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.switch input:checked + i { background: var(--tomato-deep); }
.switch input:checked + i::after { transform: translateX(18px); }
.switch input:disabled + i { opacity: .55; }
.switch input:focus-visible + i { outline: 3px solid var(--tomato); outline-offset: 2px; }

/* ---------- FAQ ---------- */
.faq-group { margin-bottom: 2.6rem; }
.faq-group > h2 { border-top: 0 !important; padding-top: 0 !important; margin-top: 0; font-size: 1.35rem; }
.faq-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 10px; }
.faq-item summary {
  cursor: pointer; list-style: none; padding: 16px 52px 16px 20px; font-weight: 600; position: relative; line-height: 1.4;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: ""; position: absolute; right: 20px; top: 50%; width: 10px; height: 10px; margin-top: -7px;
  border-right: 2px solid var(--tomato-deep); border-bottom: 2px solid var(--tomato-deep); transform: rotate(45deg); transition: transform .15s;
}
.faq-item[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.faq-item summary:hover { color: var(--tomato-deep); }
.faq-a { padding: 0 20px 4px; color: var(--ink-2); }
.faq-a ul { padding-left: 1.2em; }

/* ---------- Worked example ---------- */
.steps { counter-reset: step; list-style: none; padding: 0 !important; }
.step { position: relative; padding-left: 52px; margin-bottom: 2.4rem; }
.step::before {
  counter-increment: step; content: counter(step); position: absolute; left: 0; top: 0;
  width: 36px; height: 36px; border-radius: 50%; background: var(--tomato); color: #fff;
  font-family: var(--font-display); font-weight: 800; display: flex; align-items: center; justify-content: center;
}
.step h2 { margin-top: 0 !important; padding-top: 4px !important; border-top: 0 !important; font-size: 1.35rem; }
.prose td.n, .prose th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.prose tr.total td { font-weight: 600; background: #F7F8F6; }
.recipe-card ul { margin: 0; }
.result-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(120px,100%), 1fr)); gap: 12px; margin: 0 0 1.4em; }
.result { background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--ink); border-radius: var(--radius-sm); padding: 12px 14px; }
.result .k { display: block; font-family: var(--font-mono); font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.result .v { font-family: var(--font-display); font-weight: 800; font-size: 1.6rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.result .v small { font-family: var(--font-body); font-weight: 500; font-size: .85rem; color: var(--ink-3); }

/* ---------- Utilities ---------- */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--ink-3); }
.source-line { font-family: var(--font-mono); font-size: .75rem; letter-spacing: .04em; color: #8E9A93; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media print { .site-header, .site-footer, .consent, .toc { display: none !important; } body { background: #fff; } }

@media (max-width: 600px) {
  .step { padding-left: 0; }
  .step::before { position: static; margin-bottom: 10px; width: 32px; height: 32px; }
  .prose th, .prose td { padding: 8px 9px; }
  .prose table { font-size: .84rem; }
  .prose th { font-size: .64rem; letter-spacing: .03em; }
}

/* ---------- Keep exploring (related pages) ---------- */
.related { border-top: 1px solid var(--line); padding: clamp(36px, 6vw, 56px) 0 clamp(44px, 7vw, 72px); }
.related h2 { margin: 0 0 18px; font-size: 1.3rem; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 10px; }
.related-card {
  display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 14px 16px; text-decoration: none; color: var(--ink); transition: border-color .15s, transform .15s;
}
.related-card:hover { border-color: var(--tomato); transform: translateY(-1px); }
.related-card b { display: block; font-weight: 600; color: var(--tomato-deep); }
.related-card span { display: block; font-size: .86rem; color: var(--ink-3); line-height: 1.4; margin-top: 2px; }
.site-footer a[aria-current="page"] { color: #fff; text-decoration: underline; text-decoration-color: var(--tomato); text-decoration-thickness: 2px; }

/* ==========================================================================
   Step 3 — food browser, food-group pages, ingredient pages
   ========================================================================== */

/* ---------- Breadcrumbs ---------- */
.crumbs { font-size: .86rem; color: var(--ink-3); padding-top: 22px; }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 8px; }
.crumbs li + li::before { content: "/"; margin-right: 8px; color: var(--line-strong); }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { color: var(--tomato-deep); text-decoration: underline; }
.crumbs [aria-current] { color: var(--ink-3); }

/* ---------- Food browser ---------- */
.fb { padding-bottom: clamp(40px, 7vw, 72px); }
.fb-controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 14px; }
.fb-search { flex: 1 1 320px; display: flex; align-items: center; gap: 10px; background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: 999px; padding: 4px 16px; box-shadow: var(--shadow); }
.fb-search svg { width: 20px; height: 20px; color: var(--ink-3); flex: none; }
.fb-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 1rem; padding: 9px 0; color: var(--ink); }
.fb-search input::-webkit-search-cancel-button { cursor: pointer; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; font: inherit; font-size: .86rem; font-weight: 500; color: var(--ink-2);
  padding: 7px 13px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.seg button:hover:not([aria-pressed="true"]) { background: rgba(21,32,27,.06); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; padding: 0; list-style: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--ink); font: inherit; font-size: .85rem; padding: 6px 12px; border-radius: 999px; cursor: pointer; text-decoration: none; }
.chip:hover { border-color: var(--tomato); }
.chip[aria-pressed="true"], .chip.is-on { background: var(--tomato-deep); border-color: var(--tomato-deep); color: #fff; }
.chip small { font-size: .74rem; opacity: .7; font-variant-numeric: tabular-nums; }
.az { display: flex; flex-wrap: wrap; gap: 2px; margin: 4px 0 10px; }
.az[hidden] { display: none; }
.az button { width: 30px; height: 30px; border: 0; background: transparent; border-radius: 6px; font-family: var(--font-mono);
  font-size: .8rem; color: var(--tomato-deep); cursor: pointer; }
.az button:hover:not(:disabled) { background: var(--tomato-wash); }
.az button:disabled { color: var(--line-strong); cursor: default; }
.fb-count { color: var(--ink-3); font-size: .88rem; margin: 0 0 8px; min-height: 1.4em; }
.fb-wrap { overflow: auto; max-height: 78vh; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.fb-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .92rem; font-variant-numeric: tabular-nums; }
.fb-table th, .fb-table td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.fb-table th:first-child, .fb-table td:first-child { text-align: left; white-space: normal; min-width: 210px; position: sticky; left: 0; background: inherit; z-index: 1; }
.fb-table thead th { position: sticky; top: 0; z-index: 2; background: #F7F8F6; font-family: var(--font-mono); font-size: .7rem;
  letter-spacing: .05em; text-transform: uppercase; color: var(--ink-2); font-weight: 500; }
.fb-table thead th:first-child { z-index: 3; }
.fb-table tbody tr { background: var(--surface); }
.fb-table tbody tr:hover { background: #FAFBF9; }
.fb-table th small { text-transform: none; letter-spacing: 0; color: var(--ink-3); }
.fb-table th button { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.fb-table th button::after { content: "↕"; opacity: .35; font-size: .85em; }
.fb-table th[aria-sort="ascending"] button::after { content: "↑"; opacity: 1; color: var(--tomato-deep); }
.fb-table th[aria-sort="descending"] button::after { content: "↓"; opacity: 1; color: var(--tomato-deep); }
.fb-table th button:focus-visible { outline: 3px solid var(--tomato); outline-offset: 2px; border-radius: 3px; }
.fb-table td a { color: var(--ink); font-weight: 500; text-decoration: none; }
.fb-table td a:hover { color: var(--tomato-deep); text-decoration: underline; }
.fb-table td .sub { display: block; font-size: .76rem; color: var(--ink-3); font-weight: 400; }
.fb-table td.kcal { color: var(--tomato-deep); font-weight: 600; }
.fb-table th.c-protein { box-shadow: inset 0 -3px var(--protein); }
.fb-table th.c-carbs { box-shadow: inset 0 -3px var(--carbs); }
.fb-table th.c-fat { box-shadow: inset 0 -3px var(--fat); }
.fb-table .na { color: var(--line-strong); }
.fb-empty { padding: 28px; text-align: center; color: var(--ink-3); }
.fb-note { color: var(--ink-3); font-size: .82rem; margin-top: 10px; }
@media (max-width: 600px) {
  .fb-table th, .fb-table td { padding: 8px 9px; }
  .fb-table th:first-child, .fb-table td:first-child { min-width: 150px; }
  .seg { width: 100%; } .seg button { flex: 1; padding: 7px 6px; }
}

.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); gap: 10px; margin: 0 0 28px; padding: 0; list-style: none; }
.cat-card { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 12px 14px; text-decoration: none; color: var(--ink); font-weight: 500; }
.cat-card:hover { border-color: var(--tomato); color: var(--tomato-deep); }
.cat-card span { font-size: .8rem; color: var(--ink-3); font-variant-numeric: tabular-nums; font-weight: 400; }

.toplists { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 16px; margin: 8px 0 32px; }
.toplist h3 { margin: 0 0 8px; font-size: 1rem; }
.toplist ol { margin: 0; padding-left: 1.3em; font-size: .92rem; }
.toplist li { margin-bottom: 4px; }
.toplist li::marker { color: var(--tomato); font-variant-numeric: tabular-nums; }
.toplist .v { color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Ingredient page ---------- */
.food-hero { padding-top: 14px; padding-bottom: 22px; }
.eyebrow a { color: inherit; text-decoration: none; }
.eyebrow a:hover { text-decoration: underline; }
.food-hero h1 { font-size: clamp(2rem, 4.6vw, 3rem); max-width: 22ch; margin-bottom: .35em; }
.food-hero .lead { max-width: 70ch; }
.food-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: clamp(20px, 3vw, 32px); align-items: start; padding-bottom: clamp(40px, 7vw, 72px); }
@media (max-width: 900px) { .food-grid { grid-template-columns: minmax(0, 1fr); } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(18px, 3vw, 26px); }
.panel + .panel { margin-top: 16px; }
.panel h2 { font-size: 1.15rem; margin: 0 0 12px; }
.portion-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.portion-row label { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.portion-row select, .portion-row input { font: inherit; font-size: .95rem; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: #fff; color: var(--ink); }
.portion-row select { flex: 1 1 220px; min-width: 0; }
.portion-row input { width: 110px; }
.portion-row input[hidden] { display: none; }
.kcal-big { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.kcal-big b { font-family: var(--font-display); font-weight: 800; font-size: clamp(2.6rem, 6vw, 3.4rem); color: var(--tomato); line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.kcal-big span { color: var(--ink-3); }
.kcal-big .kj { font-size: .9rem; }
.energy-note { font-size: .8rem; color: var(--ink-3); margin: 6px 0 0; }
.nt { width: 100%; border-collapse: collapse; margin-top: 18px; font-size: .93rem; font-variant-numeric: tabular-nums; }
.nt caption { text-align: left; font-family: var(--font-mono); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); padding-bottom: 6px; }
.nt th, .nt td { padding: 8px 0; border-top: 1px solid var(--line); text-align: right; font-weight: 400; }
.nt th { text-align: left; color: var(--ink); }
.nt tr.sub th { padding-left: 18px; color: var(--ink-2); }
.nt tr.major th, .nt tr.major td { font-weight: 600; }
.nt td.dv { width: 64px; color: var(--ink-3); font-size: .85rem; }
.nt thead th { border-top: 0; font-family: var(--font-mono); font-size: .68rem; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); font-weight: 500; text-align: right; }
.nt thead th:first-child { text-align: left; }
.nt .na { color: var(--line-strong); }
.dv-note { font-size: .78rem; color: var(--ink-3); margin: 10px 0 0; }
.facts { margin: 0; padding: 0; list-style: none; }
.facts li { padding: 10px 0; border-top: 1px solid var(--line); font-size: .95rem; line-height: 1.5; }
.facts li:first-child { border-top: 0; padding-top: 0; }
.split { display: flex; height: 12px; border-radius: 999px; overflow: hidden; gap: 3px; margin: 4px 0 12px; }
.split span { display: block; min-width: 2px; }
.split-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .86rem; color: var(--ink-2); margin: 0; padding: 0; list-style: none; font-variant-numeric: tabular-nums; }
.linklist { margin: 0; padding: 0; list-style: none; }
.linklist li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: .93rem; }
.linklist li:first-child { border-top: 0; padding-top: 0; }
.linklist a { text-decoration: none; color: var(--ink); }
.linklist a:hover { color: var(--tomato-deep); text-decoration: underline; }
.linklist .v { color: var(--ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.source dl { margin: 0; font-size: .88rem; }
.source dt { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin-top: 10px; }
.source dt:first-child { margin-top: 0; }
.source dd { margin: 2px 0 0; color: var(--ink-2); overflow-wrap: anywhere; }
.nutri-link { display: inline-block; margin-top: 16px; font-weight: 500; font-size: .93rem; color: var(--tomato-deep); text-decoration: none; }
.nutri-link:hover { text-decoration: underline; }
@media (max-width: 600px) {
  .chips { flex-wrap: nowrap; overflow-x: auto; margin-left: calc(-1 * var(--gutter)); margin-right: calc(-1 * var(--gutter));
    padding: 2px var(--gutter) 6px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { white-space: nowrap; }
}

/* ---------- Network banner (hoyooken.com) ----------
   Static and in normal flow: never sticky/fixed, so it can't sit under AdSense anchor
   or vignette ads. Height is reserved (min-height) so it causes no layout shift. */
.net-promo { padding: 8px 0 clamp(32px, 5vw, 48px); }
.net-promo__card {
  display: flex; align-items: center; gap: 18px; min-height: 92px; box-sizing: border-box;
  padding: 16px 20px; border-radius: 16px; background: #23204A; color: #fff; text-decoration: none;
  box-shadow: 0 6px 22px rgba(35, 32, 74, .18);
}
.net-promo__card:hover .net-promo__cta, .net-promo__card:focus-visible .net-promo__cta { background: #FF8F4F; }
.net-promo__card:focus-visible { outline: 3px solid #FF7A2F; outline-offset: 3px; }
.net-promo__icon { flex: 0 0 56px; width: 56px; height: 56px; }
.net-promo__icon svg { display: block; width: 100%; height: 100%; }
.net-promo__body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.net-promo__eyebrow { font-family: var(--font-mono); font-size: .7rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: #FF7A2F; }
.net-promo__name { font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; line-height: 1.1; color: #fff; }
.net-promo__name span { color: #FF7A2F; }
.net-promo__text { font-size: .92rem; color: #D9D6EE; line-height: 1.35; }
.net-promo__cta {
  flex: 0 0 auto; padding: 10px 18px; border-radius: 999px; background: #FF7A2F; color: #23204A;
  font-weight: 600; font-size: .95rem; white-space: nowrap; transition: background .15s;
}
@media (max-width: 600px) {
  .net-promo__card { flex-wrap: wrap; gap: 12px 14px; padding: 16px; }
  .net-promo__icon { flex-basis: 48px; width: 48px; height: 48px; }
  .net-promo__body { flex-basis: calc(100% - 62px); }
  .net-promo__cta { width: 100%; text-align: center; }
}
@media print { .net-promo { display: none; } }
