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

:root {
  --bg: #FAFAF7;
  --bg-surface: #F1F1EA;
  --bg-card: #FFFFFF;
  --ink: #1D2A22;
  --text: #33402F ;
  --text-muted: #6B7566;
  --accent: #2F6E4F;
  --accent-dim: #24543D;
  --accent-glow: rgba(47,110,79,0.10);
  --border: rgba(29,42,34,0.10);
  --warn-bg: #FBF3E3;
  --warn-border: #E8D3A0;
  --warn-text: #6B5218;
  --font-body: 'Source Sans 3', system-ui, sans-serif;
  --font-display: 'Source Serif 4', Georgia, serif;
  --radius: 6px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dim); text-decoration: underline; }

.container { max-width: 880px; margin: 0 auto; padding: 0 1.5rem; }

nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250,250,247,0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 880px; margin: 0 auto; padding: 0 1.5rem;
  display: flex; align-items: center; justify-content: space-between; height: 58px;
}
.nav-logo { font-family: var(--font-display); font-size: 1.3rem; color: var(--ink); font-weight: 600; }
.nav-logo span { color: var(--accent); }
.nav-links { display: flex; gap: 1.75rem; list-style: none; }
.nav-links a { color: var(--text-muted); font-size: 0.85rem; font-weight: 600; letter-spacing: 0.02em; }
.nav-links a:hover { color: var(--accent); text-decoration: none; }

main { padding-bottom: 3rem; }

.hero { padding: 2.5rem 0 1.85rem; border-bottom: 1px solid var(--border); }
.hero-eyebrow { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); font-weight: 600; margin-bottom: 0.75rem; }
.hero h1 { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.8rem, 4vw, 2.5rem); line-height: 1.25; color: var(--ink); margin-bottom: 1rem; }
.hero p { max-width: 62ch; color: var(--text); font-size: 1.02rem; }

.section { padding: 2.75rem 0; border-bottom: 1px solid var(--border); }
.section h2 { font-family: var(--font-display); font-size: 1.5rem; color: var(--ink); margin-bottom: 0.9rem; }
.section h3 { font-size: 1.05rem; color: var(--ink); margin: 1.4rem 0 0.5rem; }
.section p { margin-bottom: 0.9rem; max-width: 68ch; }
.section ul, .section ol { margin: 0 0 1rem 1.3rem; }
.section li { margin-bottom: 0.4rem; max-width: 64ch; }

.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.4rem 1.6rem; margin-bottom: 1rem; }

.disclosure-box {
  background: var(--warn-bg); border: 1px solid var(--warn-border); color: var(--warn-text);
  border-radius: var(--radius); padding: 1rem 1.25rem; font-size: 0.88rem; margin: 1.25rem 0;
}
.disclosure-box strong { display: block; margin-bottom: 0.25rem; }

.source-note { font-size: 0.82rem; color: var(--text-muted); border-top: 1px dashed var(--border); padding-top: 0.75rem; margin-top: 1.5rem; }
.source-note a { color: var(--text-muted); text-decoration: underline; }

.status-tag {
  display: inline-block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em;
  background: var(--accent-glow); color: var(--accent-dim); border-radius: 3px; padding: 0.2rem 0.55rem; font-weight: 600;
}

footer { border-top: 1px solid var(--border); padding: 2rem 0; }
.footer-inner { max-width: 880px; margin: 0 auto; padding: 0 1.5rem; }
.footer-brand { font-family: var(--font-display); font-size: 1.05rem; color: var(--ink); margin-bottom: 0.5rem; }
.footer-brand span { color: var(--accent); }
.footer-links { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; margin: 0.75rem 0; list-style: none; }
.footer-links a { font-size: 0.82rem; color: var(--text-muted); }
.footer-disclaimer { font-size: 0.75rem; color: var(--text-muted); line-height: 1.7; max-width: 70ch; }

@media (max-width: 640px) {
  .nav-links { gap: 1rem; }
  .nav-links a { font-size: 0.78rem; }
}

/* ── Homepage density layout (index.html only — additive, does not affect
   any other page; .section/.card base rules above are untouched so
   Basics/Lactase/About/Disclaimer/etc. render exactly as before) ── */
.card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.85rem; }
.card-grid .card { margin-bottom: 0; }
.card-compact { padding: 0.95rem 1.15rem; }
.card-compact h3 { font-size: 0.98rem; margin: 0 0 0.4rem; }
.card-compact p { font-size: 0.88rem; margin-bottom: 0.55rem; max-width: none; }
.card-compact a { font-size: 0.85rem; }
.subsection-heading {
  font-family: var(--font-body); font-size: 0.78rem; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--text-muted); font-weight: 600; margin-bottom: 0.85rem;
}

@media (max-width: 640px) {
  .card-grid { grid-template-columns: 1fr; }
}

/* Accessible keyboard focus indication (site-wide, additive — only visible
   on keyboard focus, no change to default/hover appearance) */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── Homepage decision-tool layout (index.html only — additive) ── */
.hero-compact { padding: 1.75rem 0 1.4rem; }
.hero-compact h1 { margin-bottom: 0.6rem; }
.hero-compact p { margin-bottom: 0; }

/* Whole-card clickable links: inherit text color, no underline, subtle
   hover/focus affordance. Applies on top of the existing .card look —
   visual identity (palette, radius, border) is unchanged. */
.decision-card { display: block; color: inherit; text-decoration: none; transition: border-color 0.15s ease; }
.decision-card:hover { color: inherit; text-decoration: none; border-color: var(--accent); }
.decision-card:hover p, .decision-card:hover .decision-enzyme { color: var(--text); }

.decision-card-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.3rem;
}
.decision-card-head h3 { margin: 0; }
.decision-enzyme { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); margin-bottom: 0.4rem; }

/* Evidence badges — calm, single visual language across all four;
   "Best supported" gets the existing accent tint, everything else a
   neutral muted tint (no traffic-light color coding). */
.status-tag-neutral { background: var(--bg-surface); color: var(--text-muted); }

/* Dampened section for symptoms/medical-condition content — same palette,
   muted surface color (already used elsewhere as --bg-surface) so it
   visually recedes rather than competing with the decision-tool sections. */
.section-muted {
  background: var(--bg-surface);
  padding: 1.4rem 1.5rem;
  border-radius: var(--radius);
  margin: 0.5rem 0 2rem;
}

/* Visible call-to-action line inside whole-card links — reuses the site's
   existing link color/weight so it reads as "this is clickable" without
   introducing a new nested <a> (invalid inside an already-anchored card). */
.decision-cta {
  display: block;
  margin-top: 0.6rem;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.85rem;
}
.decision-card:hover .decision-cta { color: var(--accent-dim); }

/* Compact variant of the primary 2x2 decision cards: tighter padding, no
   leftover bottom whitespace, title+badge share the top line whenever the
   card is wide enough (decision-card-head is already a wrapping flex row). */
.decision-card-lead {
  padding: 1rem 1.2rem;
}
.decision-card-lead .decision-card-head { margin-bottom: 0.25rem; }
.decision-card-lead h3 { font-size: 1rem; }
.decision-card-lead p { margin-bottom: 0.4rem; font-size: 0.92rem; }
.decision-card-lead .decision-enzyme { margin-bottom: 0.3rem; }
.decision-card-lead .decision-cta { margin-top: 0.3rem; }
