/* ============================================================
   Cosmadex — design tokens
   Warm-but-trustworthy: subtle cream backgrounds, deep teal accent,
   strong type hierarchy, no shadows, no gradients.
   ============================================================ */
:root {
  /* Neutrals — slightly warm white instead of pure clinical */
  --bg:         #fdfcfa;        /* page background, warm white */
  --bg-soft:    #f7f4ee;        /* section background, sand */
  --bg-card:    #ffffff;        /* card background, true white */
  --bg-tint:    #f1ede5;        /* deeper sand for chips */

  --text:       #1a1814;        /* near-black, warm */
  --text-soft:  #524d44;        /* secondary text */
  --text-muted: #8c8479;        /* tertiary text */

  --border:     #e8e2d6;        /* hairline, warm */
  --border-soft:#f0ebdf;
  --border-strong: #c8c0ad;

  /* Accent — deep teal, scientific feel, not beauty-pastel */
  --accent:        #0e7490;
  --accent-hover:  #0c5b6e;
  --accent-soft:   #ecfeff;
  --accent-tint:   #cffafe;

  /* Semantic */
  --danger:        #b91c1c;
  --danger-soft:   #fef2f2;
  --danger-border: #fecaca;
  --warning:       #b45309;
  --warning-soft:  #fef3c7;
  --warning-border:#fcd34d;
  --success:       #047857;
  --success-soft:  #ecfdf5;
  --success-border:#bbf7d0;
  --info:          #1d4ed8;
  --info-soft:     #eff6ff;
  --info-border:   #bfdbfe;

  --serif: ui-serif, Georgia, "Times New Roman", serif;
  --sans:  -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono:  ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, monospace;

  --container: 1200px;
  --gutter:    24px;
  --radius:    8px;
  --radius-lg: 12px;
}

/* ============================================================
   Reset + base
   ============================================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}
.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;
}
.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.container.narrow { max-width: 760px; }

.muted { color: var(--text-muted); }
.small { font-size: 0.88rem; }
.mono { font-family: var(--mono); font-size: 0.92em; }

/* ============================================================
   Header
   ============================================================ */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.header-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 32px;
  padding: 18px 0 14px;
}
.brand {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.brand strong { color: var(--accent); font-weight: 800; }
.brand span { color: var(--text-soft); font-weight: 500; }
.brand:hover { text-decoration: none; }

.nav-primary {
  display: flex; gap: 26px; flex-wrap: wrap;
  font-size: 0.95rem;
}
.nav-primary a {
  color: var(--text-soft);
  font-weight: 500;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
}
.nav-primary a:hover { color: var(--accent); text-decoration: none; border-bottom-color: var(--accent); }

/* Language dropdown */
.lang-switch { position: relative; }
.lang-button {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 99px;
  background: var(--bg-card);
  color: var(--text-soft);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease;
}
.lang-button:hover { border-color: var(--border-strong); color: var(--text); }
.lang-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.lang-button-flag { font-size: 0.95rem; line-height: 1; }
.lang-button-code { letter-spacing: 0.06em; }
.lang-button-chev { transition: transform .15s ease; opacity: 0.7; }
.lang-button[aria-expanded="true"] .lang-button-chev { transform: rotate(180deg); }

.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  list-style: none;
  margin: 0;
  padding: 6px;
  min-width: 240px;
  max-height: 360px;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  z-index: 100;
  display: none;
  font-family: var(--sans);
}
.lang-menu.open { display: block; }
.lang-menu li { margin: 0; }
.lang-menu a {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 4px;
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
  letter-spacing: 0;
  text-transform: none;
}
.lang-menu a:hover { background: var(--accent-soft); color: var(--accent); text-decoration: none; }
.lang-menu a[aria-current="true"] { background: var(--bg-soft); color: var(--accent); font-weight: 600; }
.lang-menu-flag { font-size: 1rem; line-height: 1; }
.lang-menu-native { color: inherit; }
.lang-menu-en {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 500;
  font-family: var(--mono);
  letter-spacing: 0.02em;
}
.lang-menu a:hover .lang-menu-en { color: var(--accent); opacity: 0.7; }
@media (max-width: 800px) {
  .lang-menu { right: -8px; min-width: 220px; }
}

/* Header search bar — compact */
.search-bar {
  display: flex;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 0 0 16px;
  background: var(--bg-card);
}
.search-bar input {
  flex: 1;
  padding: 10px 14px;
  border: 0;
  font: inherit;
  background: transparent;
  color: var(--text);
  outline: none;
}
.search-bar button {
  padding: 10px 18px;
  border: 0;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.search-bar button:hover { background: var(--accent-hover); }
.search-bar-large { max-width: 680px; margin: 28px auto 14px; }
.search-bar-large input { padding: 16px 22px; font-size: 1rem; }
.search-bar-large button { padding: 16px 28px; font-size: 1rem; }

/* ============================================================
   Hero (homepage)
   ============================================================ */
.hero {
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
  padding: 64px 0 56px;
  text-align: center;
}
.hero h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(30px, 4.4vw, 46px);
  line-height: 1.12;
  letter-spacing: -0.022em;
  margin-bottom: 16px;
  color: var(--text);
}
.hero .lede {
  max-width: 660px;
  margin: 0 auto 32px;
  color: var(--text-soft);
  font-size: 1.08rem;
}
.search-examples { font-size: 0.92rem; color: var(--text-muted); }
.search-examples a { font-weight: 500; }

/* Stats strip */
.stats { background: var(--bg); padding: 36px 0; border-bottom: 1px solid var(--border); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat {
  text-align: center;
  padding: 22px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  transition: border-color .15s ease;
}
.stat:hover { border-color: var(--border-strong); }
.stat-number {
  font-family: var(--serif);
  font-size: 2.1rem; font-weight: 600; letter-spacing: -0.02em;
  line-height: 1;
}
.stat-label { font-size: 0.85rem; color: var(--text-muted); margin-top: 6px; }
.stat-label a { color: var(--text-muted); }
.stat-label a:hover { color: var(--accent); }
.stat-danger .stat-number  { color: var(--danger); }
.stat-warning .stat-number { color: var(--warning); }

/* Two-col on homepage */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  padding: 52px 0;
}
.two-col h2 {
  font-family: var(--serif);
  font-size: 1.5rem; margin-bottom: 8px; letter-spacing: -0.01em;
  font-weight: 600;
}

.tag-list { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.tag-list a {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 13px;
  border: 1px solid var(--border);
  border-radius: 99px;
  font-size: 0.92rem;
  background: var(--bg-card);
  color: var(--text);
}
.tag-list a:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  text-decoration: none;
}
.tag-list .count {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}
.tag-list a:hover .count { color: var(--accent); }

.reg-list { list-style: none; }
.reg-list li { border-bottom: 1px solid var(--border); }
.reg-list li:last-child { border-bottom: 0; }
.reg-list a { display: flex; flex-direction: column; padding: 14px 0; color: var(--text); }
.reg-list a:hover { text-decoration: none; }
.reg-list a:hover strong { color: var(--accent); }
.reg-list strong { font-size: 1.02rem; font-weight: 600; }
.reg-list .muted { font-size: 0.88rem; }

.more-link { font-weight: 500; }

/* How it works (homepage) */
.how-it-works { padding: 56px 0; }
.how-it-works h2 { font-family: var(--serif); font-size: 1.5rem; font-weight: 600; }
.steps {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px;
  margin-top: 28px;
}
.step h3 { margin: 14px 0 6px; font-size: 1.08rem; letter-spacing: -0.01em; font-weight: 600; }
.step p { color: var(--text-soft); font-size: 0.95rem; }
.step-num {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-family: var(--mono);
}

/* FAQ */
.faq { padding: 32px 0; }
.faq h2 { font-family: var(--serif); margin-bottom: 18px; font-weight: 600; }
.faq details {
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}
.faq summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex; justify-content: space-between; align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.3rem; color: var(--text-muted); margin-left: 12px; }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin-top: 10px; color: var(--text-soft); }

/* ============================================================
   Breadcrumb
   ============================================================ */
.breadcrumb { font-size: 0.88rem; color: var(--text-muted); padding: 18px 0 0; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span { margin: 0 8px; }

/* ============================================================
   INGREDIENT PAGE — at-a-glance hero
   ============================================================ */
.ingredient-page { padding: 0 0 80px; }

.ing-hero {
  margin-top: 12px;
  padding: 32px 36px;
  border-radius: var(--radius-lg);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-left: 6px solid var(--text-muted);
  margin-bottom: 36px;
}
.ing-hero--banned     { border-left-color: var(--danger);  background: var(--danger-soft); }
.ing-hero--restricted { border-left-color: var(--warning); background: var(--warning-soft); }
.ing-hero--colorant,
.ing-hero--preservative,
.ing-hero--uv_filter  { border-left-color: var(--info);    background: var(--info-soft); }
.ing-hero--allowed    { border-left-color: var(--success); background: var(--success-soft); }
.ing-hero--noted      { border-left-color: var(--text-muted); background: var(--bg-soft); }

.status-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--bg-card);
  margin-bottom: 18px;
}
.status-pill .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: currentColor; flex: none;
}
.status-pill--banned     { color: var(--danger); }
.status-pill--restricted { color: var(--warning); }
.status-pill--colorant,
.status-pill--preservative,
.status-pill--uv_filter  { color: var(--info); }
.status-pill--allowed    { color: var(--success); }
.status-pill--noted      { color: var(--text-soft); }

.ing-hero h1 {
  font-family: var(--serif);
  font-size: clamp(32px, 4.4vw, 48px);
  line-height: 1.1;
  letter-spacing: -0.022em;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

.pronunciation {
  margin: 4px 0 18px;
  color: var(--text-soft);
  font-size: 0.95rem;
}
.pronunciation .pron-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-right: 8px;
  font-weight: 600;
}
.pronunciation .pron-text { font-style: italic; }

.tldr { margin-top: 12px; }
.tldr p {
  font-size: 1.05rem;
  margin-bottom: 8px;
  color: var(--text);
}
.tldr p:last-child { margin-bottom: 0; }
.tldr strong {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-right: 4px;
}

.ing-hero .lede {
  font-size: 1.05rem;
  color: var(--text-soft);
  margin-top: 6px;
  max-width: 60ch;
}

/* ============================================================
   INGREDIENT PAGE — two-column grid + sticky aside
   ============================================================ */
.ing-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 56px;
  align-items: start;
}

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

.ing-section { margin-bottom: 40px; }
.ing-section h2 {
  font-family: var(--serif);
  font-size: 1.45rem;
  letter-spacing: -0.01em;
  font-weight: 600;
  margin-bottom: 14px;
  color: var(--text);
}
.prose-p {
  font-size: 1rem;
  color: var(--text);
  line-height: 1.7;
  max-width: 65ch;
}

/* Function cards — visual chips with descriptions */
.function-cards {
  list-style: none;
  display: grid;
  gap: 12px;
  margin-top: 12px;
}
.function-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  transition: border-color .15s ease, transform .15s ease;
}
.function-card:hover { border-color: var(--accent); }
.function-card-name {
  display: inline-block;
  font-weight: 600;
  color: var(--text);
  font-size: 1rem;
  text-transform: capitalize;
}
.function-card-name:hover { color: var(--accent); text-decoration: none; }
.function-card-desc {
  margin-top: 4px;
  color: var(--text-soft);
  font-size: 0.95rem;
  line-height: 1.55;
}

/* "Often found in" chips */
.chip-list {
  list-style: none;
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 8px;
}
.chip {
  padding: 7px 14px;
  background: var(--bg-tint);
  border: 1px solid var(--border);
  border-radius: 99px;
  font-size: 0.92rem;
  color: var(--text);
  text-transform: capitalize;
}

/* Tip card */
.tip-card {
  background: var(--accent-soft);
  border: 1px solid var(--accent-tint);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 16px 20px;
  font-size: 0.98rem;
  color: var(--text);
  line-height: 1.6;
}

/* Alerts (regulatory) */
.alert {
  padding: 16px 20px;
  border-radius: var(--radius);
  border: 1px solid;
}
.alert-danger  { background: var(--danger-soft);  border-color: var(--danger-border); }
.alert-warning { background: var(--warning-soft); border-color: var(--warning-border); }
.alert-info    { background: var(--info-soft);    border-color: var(--info-border); }
.alert p + p { margin-top: 8px; }

/* Related grid */
.related-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.related-grid a {
  display: flex; flex-direction: column; gap: 2px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
}
.related-grid a:hover {
  border-color: var(--accent);
  text-decoration: none;
}
.related-grid a:hover .related-name { color: var(--accent); }
.related-name { font-weight: 600; font-size: 0.95rem; }
.related-meta { color: var(--text-muted); font-size: 0.82rem; }

/* Source note */
.source-note {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* ============================================================
   INGREDIENT PAGE — sticky aside (right column)
   ============================================================ */
.ing-aside-sticky { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 16px; }

.aside-h3 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 12px;
}

.structure-card,
.info-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}

.structure-img {
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  padding: 16px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 10px;
}
.structure-img img { width: 100%; height: auto; max-width: 280px; }
.structure-credit { font-size: 0.78rem; color: var(--text-muted); }

.info-dl {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  font-size: 0.92rem;
}
.info-dl dt {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 12px;
}
.info-dl dt:first-child { margin-top: 0; }
.info-dl dd {
  color: var(--text);
  margin-top: 2px;
  line-height: 1.45;
}
.status-text--banned { color: var(--danger); font-weight: 500; }
.status-text--restricted { color: var(--warning); font-weight: 500; }
.status-text--allowed { color: var(--success); font-weight: 500; }

/* ============================================================
   Page header (function pages, regulatory lists, etc.)
   ============================================================ */
.page-header { padding: 28px 0 36px; border-bottom: 1px solid var(--border); margin-bottom: 36px; }
.page-header h1 {
  font-family: var(--serif);
  font-size: clamp(28px, 3.6vw, 38px);
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  line-height: 1.18;
  font-weight: 600;
}
.page-header .lede { color: var(--text-soft); font-size: 1.05rem; max-width: 65ch; }

/* ============================================================
   Tables
   ============================================================ */
.reg-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
}
.reg-table th, .reg-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.reg-table th {
  background: var(--bg-soft);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-soft);
}
.reg-table tr:hover { background: var(--bg-soft); }
.reg-table a { color: var(--text); font-weight: 500; }
.reg-table a:hover { color: var(--accent); }

/* ============================================================
   Functions index
   ============================================================ */
.function-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 18px;
}
.function-grid a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text);
}
.function-grid a:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  text-decoration: none;
}
.function-grid .count {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}
.function-grid a:hover .count { color: var(--accent); }

.ingredient-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 4px 24px;
}
.ingredient-list li { padding: 8px 0; border-bottom: 1px dashed var(--border); }
.ingredient-list .ing-name { font-weight: 500; }

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  padding: 56px 0 36px;
  margin-top: 72px;
  font-size: 0.93rem;
}
.footer-cols {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 32px;
}
.footer-cols h4 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 12px; }
.footer-cols ul { list-style: none; }
.footer-cols li { padding: 4px 0; }
.footer-cols strong { font-size: 1.05rem; display: block; margin-bottom: 6px; }
.footer-cols p { color: var(--text-soft); }
.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.82rem;
}
.footer-bottom p + p { margin-top: 8px; }

/* Prose (about page) */
.prose p { margin-bottom: 14px; color: var(--text); }
.prose h2 { font-family: var(--serif); margin: 28px 0 12px; font-size: 1.4rem; font-weight: 600; }
.prose h3 { margin: 22px 0 8px; font-size: 1.1rem; }
.prose ul, .prose ol { margin: 0 0 14px 24px; }
.prose li { margin-bottom: 4px; }
.prose .legal-meta { margin-top: 32px; padding-top: 14px; border-top: 1px solid var(--border); color: var(--text-soft); font-size: 0.9rem; }

/* ============================================================
   Eyebrow labels — small uppercase mono labels above section headings
   ============================================================ */
.eyebrow, .hero-eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}
.hero-eyebrow { margin-bottom: 14px; }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.section-head h2 {
  font-family: var(--serif);
  font-size: 1.6rem;
  letter-spacing: -0.02em;
  font-weight: 600;
  margin: 0;
}
.section-head-center { justify-content: center; text-align: center; }
.section-head .more-link { font-size: 0.92rem; padding-bottom: 4px; }

/* ============================================================
   Featured ingredient cards (homepage + function pages)
   ============================================================ */
.featured-strip {
  background: var(--bg);
  padding: 56px 0;
  border-bottom: 1px solid var(--border);
}
.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}
.featured-grid--small { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

.featured-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  color: var(--text);
  transition: border-color .15s ease, transform .15s ease;
}
.featured-card:hover {
  border-color: var(--accent);
  text-decoration: none;
  transform: translateY(-1px);
}
.featured-card-img {
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
}
.featured-card-img img { width: auto; height: 130px; max-height: 130px; }
.featured-card-letter {
  font-family: var(--serif);
  font-size: 4rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: -0.02em;
}
.featured-card-body { padding: 14px 16px 16px; flex: 1; display: flex; flex-direction: column; }
.featured-card-name {
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 6px;
  text-transform: capitalize;
}
.featured-card:hover .featured-card-name { color: var(--accent); }
.featured-card-tldr {
  color: var(--text-soft);
  font-size: 0.88rem;
  line-height: 1.5;
  flex: 1;
}
.featured-card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.featured-tag {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 99px;
  background: var(--bg-tint);
  color: var(--text-soft);
}

.browse-section { padding: 24px 0 24px; }
.home-faq-section { padding: 32px 0 56px; }

/* ============================================================
   Function page header
   ============================================================ */
.function-header { padding-bottom: 32px; }
.function-header .lede { font-size: 1.1rem; max-width: 60ch; margin-bottom: 8px; }

/* ============================================================
   Regulatory list page
   ============================================================ */
.reg-header {
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  border: 1px solid var(--border);
  border-left: 6px solid var(--text-muted);
  background: var(--bg-soft);
  margin: 16px 0 32px;
}
.reg-header--banned       { border-left-color: var(--danger);  background: var(--danger-soft); }
.reg-header--restricted   { border-left-color: var(--warning); background: var(--warning-soft); }
.reg-header--colorant,
.reg-header--preservative,
.reg-header--uv_filter    { border-left-color: var(--info);    background: var(--info-soft); }
.reg-header h1 { margin-top: 4px; }

.info-card-wide {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 26px;
}
.info-card-wide .aside-h3 { margin-bottom: 14px; }
.info-card-wide .prose p { font-size: 0.98rem; }
.info-card-wide .prose p:last-child { margin-bottom: 0; }

.filter-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font: inherit;
  background: var(--bg-card);
  color: var(--text);
  margin: 12px 0 18px;
  outline: none;
}
.filter-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1000px) {
  .ing-grid { grid-template-columns: 1fr; gap: 32px; }
  .ing-aside-sticky { position: static; flex-direction: row; flex-wrap: wrap; }
  .ing-aside-sticky .structure-card,
  .ing-aside-sticky .info-card { flex: 1 1 280px; }
}
@media (max-width: 800px) {
  .header-row { grid-template-columns: auto auto; gap: 12px; }
  .nav-primary { grid-column: 1 / -1; gap: 18px; font-size: 0.9rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; gap: 36px; padding: 36px 0; }
  .steps { grid-template-columns: 1fr; gap: 22px; }
  .footer-cols { grid-template-columns: 1fr; gap: 28px; }
  .related-grid { grid-template-columns: 1fr; }
  .ing-hero { padding: 24px 22px; }
  .ing-aside-sticky { flex-direction: column; }
}
