/* ==========================================================================
   Latino Obesity Foundation — Design System
   Palette: deep teal-green (health, calm) + marigold (warmth, cultural
   resonance without stereotype) on a warm-neutral ground.
   Type: Fraunces (display) / Public Sans (body, civic clarity).
   ========================================================================== */

:root {
  --ink:          #0F1E1B;
  --body-text:    #2B3A36;
  --muted:        #55655F;
  --surface:      #FAF9F6;
  --surface-2:    #FFFFFF;
  --surface-3:    #F1F0EA;
  --primary:      #0A7268;
  --primary-deep: #06554D;
  --primary-soft: #E2F0ED;
  --band:         #123F6D;
  --band-soft:    #E6EEF6;
  --accent:       #C25E08;
  --accent-bright:#F08419;
  --accent-soft:  #FBEAD2;
  --green:        #1E8F5E;
  --line:         #DEE3DF;
  --line-strong:  #C4CDC8;
  --focus:        #C56A0A;

  --ff-display: "Fraunces", Georgia, "Times New Roman", serif;
  --ff-body:    "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  --step--1: clamp(0.82rem, 0.80rem + 0.10vw, 0.88rem);
  --step-0:  clamp(1.00rem, 0.97rem + 0.16vw, 1.10rem);
  --step-1:  clamp(1.20rem, 1.14rem + 0.30vw, 1.40rem);
  --step-2:  clamp(1.45rem, 1.32rem + 0.60vw, 1.85rem);
  --step-3:  clamp(1.75rem, 1.50rem + 1.10vw, 2.50rem);
  --step-4:  clamp(2.10rem, 1.65rem + 2.00vw, 3.40rem);

  --gutter: 20px;
  --maxw: 1140px;
  --measure: 68ch;
  --radius: 10px;
  --radius-lg: 16px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink:          #EEF3F1;
    --body-text:    #D6E0DC;
    --muted:        #A2B3AD;
    --surface:      #0C1513;
    --surface-2:    #12211E;
    --surface-3:    #172A26;
    --primary:      #4FC0B0;
    --primary-deep: #8FD9CE;
    --primary-soft: #14302C;
    --band:         #0A2A47;
    --band-soft:    #132A3E;
    --accent:       #EFA054;
    --accent-bright:#F5AD54;
    --accent-soft:  #2E2114;
    --green:        #44B77F;
    --line:         #223833;
    --line-strong:  #32514A;
    --focus:        #EFA054;
  }
}
:root[data-theme="dark"] {
  --ink:          #EEF3F1;
  --body-text:    #D6E0DC;
  --muted:        #A2B3AD;
  --surface:      #0C1513;
  --surface-2:    #12211E;
  --surface-3:    #172A26;
  --primary:      #4FC0B0;
  --primary-deep: #8FD9CE;
  --primary-soft: #14302C;
  --band:         #0A2A47;
  --band-soft:    #132A3E;
  --accent:       #EFA054;
  --accent-bright:#F5AD54;
  --accent-soft:  #2E2114;
  --green:        #44B77F;
  --line:         #223833;
  --line-strong:  #32514A;
  --focus:        #EFA054;
}

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

body {
  margin: 0;
  background: var(--surface);
  color: var(--body-text);
  font-family: var(--ff-body);
  font-size: var(--step-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 {
  font-family: var(--ff-display);
  color: var(--ink);
  line-height: 1.15;
  text-wrap: balance;
  margin: 0;
  font-weight: 600;
  font-variation-settings: "SOFT" 0, "WONK" 0;
}
h1 { font-size: var(--step-4); letter-spacing: -0.015em; }
h2 { font-size: var(--step-3); letter-spacing: -0.01em; }
h3 { font-size: var(--step-1); }
h4 { font-size: var(--step-0); font-family: var(--ff-body); font-weight: 700; }
p  { margin: 0; }

a { color: var(--primary); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 3px;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--primary-deep); color: #fff; padding: 12px 18px;
  border-radius: 0 0 var(--radius) 0; font-weight: 600;
}
.skip-link:focus { left: 0; color: #fff; }

/* ---------- layout ---------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.prose { max-width: var(--measure); }
.prose > * + * { margin-top: 1.05em; }
.prose h2 { margin-top: 2.2em; }
.prose h3 { margin-top: 1.8em; }
.prose ul, .prose ol { padding-left: 1.25em; margin-top: 0.9em; }
.prose li + li { margin-top: 0.5em; }

.section { padding-block: clamp(48px, 7vw, 88px); }
.section--tight { padding-block: clamp(32px, 5vw, 56px); }
.section--alt { background: var(--surface-3); }
.section--deep { background: var(--band); }
.section--deep h2, .section--deep h3 { color: #FFFFFF; }
.section--deep p, .section--deep li { color: #D4E3F0; }
.section--deep a { color: #FFD9A8; }

.stack { display: flex; flex-direction: column; gap: 18px; align-items: flex-start; }
.grid { display: grid; gap: 22px; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 100;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 68px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img, .brand svg { height: 52px; width: auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1.08; }
.brand-name {
  font-family: var(--ff-display); font-weight: 600; font-size: 0.99rem;
  color: var(--ink); letter-spacing: -0.01em; white-space: nowrap;
}
.brand-sub {
  font-size: 0.63rem; letter-spacing: 0.11em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; white-space: nowrap;
}

.nav-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  background: none; border: 1px solid var(--line-strong); color: var(--ink);
  font: inherit; font-size: 0.9rem; font-weight: 600;
  padding: 9px 14px; border-radius: var(--radius); cursor: pointer;
}
.nav-toggle:hover { border-color: var(--primary); color: var(--primary); }

.site-nav ul {
  list-style: none; display: flex; flex-wrap: nowrap; gap: 2px;
  margin: 0; padding: 0; align-items: center;
}
.site-nav a {
  display: block; padding: 8px 10px; border-radius: 8px; white-space: nowrap;
  text-decoration: none; color: var(--body-text);
  font-size: 0.875rem; font-weight: 500;
}
.site-nav a:hover { background: var(--primary-soft); color: var(--primary-deep); }
.site-nav a[aria-current="page"] {
  color: var(--primary-deep); font-weight: 700;
  box-shadow: inset 0 -2px 0 var(--accent);
}
.lang-link {
  border: 1px solid var(--line-strong); border-radius: 8px;
  padding: 7px 11px !important; font-weight: 600 !important; font-size: 0.85rem !important;
}

@media (max-width: 1180px) {
  .site-nav {
    display: none; width: 100%;
    border-top: 1px solid var(--line); padding-block: 10px 18px;
  }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; align-items: stretch; gap: 2px; }
  .site-nav a { padding: 12px 10px; font-size: 1rem; }
  .header-bar { flex-wrap: wrap; }
}
@media (min-width: 1181px) {
  .nav-toggle { display: none; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 13px 22px; border-radius: var(--radius);
  font-weight: 650; font-size: 0.97rem; text-decoration: none;
  border: 1.5px solid transparent; cursor: pointer; font-family: inherit;
  transition: transform .12s ease, background-color .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--primary-deep); color: #fff; }
.btn--ghost { border-color: var(--line-strong); color: var(--ink); background: transparent; }
.btn--ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn--onDark { background: #FFFFFF; color: var(--band); }
.btn--onDark:hover { background: var(--accent-soft); color: var(--band); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .btn:hover { transform: none; }
}

/* ---------- hero ---------- */
.hero {
  background:
    radial-gradient(90% 80% at 96% 4%, var(--band-soft) 0%, transparent 60%),
    radial-gradient(120% 90% at 78% 14%, var(--primary-soft) 0%, transparent 55%),
    var(--surface);
  border-bottom: 1px solid var(--line);
  padding-block: clamp(44px, 7vw, 86px);
}
.hero-grid {
  display: grid; gap: clamp(28px, 4vw, 52px);
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  align-items: center;
}
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; } }

.eyebrow {
  display: inline-block;
  font-size: 0.72rem; letter-spacing: 0.15em; text-transform: uppercase;
  font-weight: 700; color: var(--accent);
  border-left: 3px solid var(--accent); padding-left: 10px;
}
.lede { font-size: var(--step-1); color: var(--muted); max-width: 58ch; line-height: 1.5; }

.hero-card {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: clamp(22px, 3vw, 32px);
  box-shadow: 0 1px 2px rgba(15,30,27,.05), 0 12px 32px -18px rgba(15,30,27,.30);
}
.hero-card h2 { font-size: var(--step-1); }

/* ---------- page banner ---------- */
.page-banner {
  background: var(--band);
  padding-block: clamp(38px, 5.5vw, 66px);
  border-bottom: 4px solid var(--accent-bright);
}
.page-banner h1 { color: #FFFFFF; }
.page-banner .lede { color: #C5D6E6; }
.page-banner .eyebrow { color: #FFC880; border-color: #FFC880; }

/* ---------- cards ---------- */
.card {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 24px;
  display: flex; flex-direction: column; gap: 10px;
}
.card h3 { font-size: var(--step-1); }
.card p { color: var(--muted); font-size: 0.96rem; }
.card-link {
  margin-top: auto; padding-top: 8px; font-weight: 650;
  font-size: 0.92rem; text-decoration: none;
}
.card-link::after { content: " →"; }

.card--flat { background: transparent; border: none; padding: 0; border-top: 3px solid var(--primary); padding-top: 16px; border-radius: 0; }

/* factor list on Understanding Obesity */
.factor {
  border-left: 3px solid var(--line-strong);
  padding: 4px 0 4px 18px;
}
.factor h3 { font-size: var(--step-0); font-family: var(--ff-body); font-weight: 700; margin-bottom: 4px; }
.factor p { color: var(--muted); font-size: 0.95rem; }

/* ---------- stats ---------- */
.stat {
  border-top: 3px solid var(--accent);
  padding-top: 14px;
}
.stat-num {
  font-family: var(--ff-display); font-size: clamp(2rem, 1.4rem + 2.4vw, 2.9rem);
  font-weight: 600; color: var(--ink); line-height: 1; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.stat-label { margin-top: 8px; font-size: 0.95rem; color: var(--body-text); }
.stat-src { margin-top: 8px; font-size: 0.74rem; color: var(--muted); line-height: 1.45; }
.section--deep .stat-num { color: #FFFFFF; }
.section--deep .stat-label { color: #D4E3F0; }
.section--deep .stat-src { color: #9FB6CC; }

/* ---------- callouts ---------- */
.note {
  background: var(--primary-soft); border-left: 4px solid var(--primary);
  padding: 18px 20px; border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.95rem;
}
.note strong { color: var(--ink); }
.note--warn { background: var(--accent-soft); border-left-color: var(--accent); }
.note--todo {
  background: var(--accent-soft); border: 1.5px dashed var(--accent);
  border-radius: var(--radius); font-size: 0.9rem;
}

.pill-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.pill-list li {
  background: var(--primary-soft); color: var(--primary-deep);
  padding: 6px 13px; border-radius: 999px; font-size: 0.87rem; font-weight: 600;
}

/* definition rows */
.deflist { display: grid; gap: 0; border-top: 1px solid var(--line); }
.deflist > div {
  display: grid; grid-template-columns: minmax(150px, 0.4fr) 1fr; gap: 18px;
  padding: 16px 0; border-bottom: 1px solid var(--line);
}
.deflist dt { font-weight: 700; color: var(--ink); }
.deflist dd { margin: 0; color: var(--muted); font-size: 0.96rem; }
@media (max-width: 620px) { .deflist > div { grid-template-columns: 1fr; gap: 4px; } }

/* FAQ */
details.faq {
  border-bottom: 1px solid var(--line); padding: 4px 0;
}
details.faq summary {
  cursor: pointer; padding: 16px 0; font-weight: 650; color: var(--ink);
  list-style: none; display: flex; justify-content: space-between; gap: 16px; align-items: center;
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; font-size: 1.4rem; color: var(--accent); line-height: 1; }
details.faq[open] summary::after { content: "–"; }
details.faq .faq-body { padding-bottom: 18px; color: var(--muted); max-width: var(--measure); }
details.faq .faq-body > * + * { margin-top: 0.8em; }

/* ---------- forms ---------- */
.form { display: grid; gap: 16px; max-width: 620px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 650; font-size: 0.92rem; color: var(--ink); }
.field input, .field select, .field textarea {
  font: inherit; font-size: 0.97rem; color: var(--body-text);
  padding: 12px 14px; border: 1.5px solid var(--line-strong);
  border-radius: var(--radius); background: var(--surface-2); width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); }
.field .hint { font-size: 0.82rem; color: var(--muted); }

/* ---------- footer ---------- */
.site-footer {
  background: var(--band); color: #C5D6E6;
  padding-block: clamp(40px, 5vw, 60px) 28px; margin-top: 0;
}
.site-footer a { color: #E8F2F0; text-decoration: none; }
.site-footer a:hover { color: #FFD9A8; text-decoration: underline; }
.footer-grid {
  display: grid; gap: 32px;
  grid-template-columns: minmax(0, 1.4fr) repeat(auto-fit, minmax(150px, 1fr));
}
.footer-head { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: #8FC6E8; font-weight: 700; margin-bottom: 12px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; font-size: 0.93rem; }
.footer-brand-name { font-family: var(--ff-display); color: #fff; font-size: 1.15rem; font-weight: 600; }
.footer-legal {
  margin-top: 36px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.16);
  font-size: 0.8rem; color: #9FB6CC; display: flex; flex-wrap: wrap; gap: 8px 22px; justify-content: space-between;
}
.footer-disclaimer {
  margin-top: 18px; font-size: 0.79rem; color: #9FB6CC; line-height: 1.6; max-width: 80ch;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.table-scroll { overflow-x: auto; }

/* article meta line */
.article-meta {
  font-size: 0.8rem; color: var(--muted); letter-spacing: 0.01em;
  padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 4px;
}

/* ---------- brand logo ---------- */
.lof-logo { display: block; }
.brand-tag {
  font-size: 0.68rem; color: var(--muted); font-weight: 500;
  letter-spacing: 0.01em; white-space: nowrap;
}
.footer-mark {
  background: #FFFFFF; border-radius: 12px; padding: 9px 12px;
  display: inline-block; margin-bottom: 14px;
}
.footer-mark img { height: 52px; width: auto; display: block; }
.logo-lockup { max-width: 420px; width: 100%; height: auto; }

/* language switch */
.lang-switch {
  border: 1.5px solid var(--line-strong); border-radius: 999px;
  padding: 5px 12px !important; font-weight: 700 !important;
  font-size: 0.78rem !important; letter-spacing: .06em; text-transform: uppercase;
  color: var(--primary) !important;
}
.lang-switch:hover { border-color: var(--primary); background: var(--primary-soft); }
@media (max-width: 1180px) {
  .site-nav .lang-switch { display: inline-block; width: fit-content; margin-top: 8px; }
}
