/* ============================================================
   OVULATION.GUIDE — Design System
   Clean, calm, clinically credible. Berry primary, teal data
   accent, blush surfaces. Layout width follows page function:
   tools and hubs go wide, guides hold a reading column.
   ============================================================ */

:root {
  /* Primary — berry/rose. Deep enough to pass contrast on white. */
  --berry: #a4265f;
  --berry-dark: #7d1a48;
  --berry-mid: #c2497d;
  --berry-light: #fdf1f6;
  --berry-border: #f3d2e1;

  /* Data / positive accent — teal reads as clinical, not decorative. */
  --teal: #0e7c72;
  --teal-dark: #0a5d56;
  --teal-light: #eaf7f5;
  --teal-border: #c2e6e1;

  /* Plum for the pregnancy pillar. */
  --plum: #6c3a86;
  --plum-light: #f6f0fa;
  --plum-border: #e3d3ee;

  /* Warm signal colour for cautions. */
  --amber: #a86412;
  --amber-light: #fdf4e6;
  --amber-border: #f0dcbc;

  --text: #2a1f2a;
  --text-muted: #6b5a68;
  --text-light: #9a8794;
  --surface: #ffffff;
  --surface-2: #fdf9fb;
  --surface-3: #f8f0f4;
  --ink: #2b1b28;
  --border: #ecdfe6;
  --border-strong: #ddc9d5;

  --shadow-sm: 0 1px 3px rgba(74, 28, 55, .07);
  --shadow: 0 4px 14px rgba(74, 28, 55, .09);
  --shadow-lg: 0 14px 40px rgba(74, 28, 55, .13);

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --nav-height: 64px;

  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;

  /* Layout widths — the "width follows function" rule lives here. */
  --w-wide: 1200px;
  --w-narrow: 760px;
  --w-read: 68ch;
}

/* Pillar accents. Applied on <body> so a whole page shifts hue. */
.accent-rose   { --accent: var(--berry); --accent-dark: var(--berry-dark); --accent-light: var(--berry-light); --accent-border: var(--berry-border); }
.accent-teal   { --accent: var(--teal);  --accent-dark: var(--teal-dark);  --accent-light: var(--teal-light);  --accent-border: var(--teal-border); }
.accent-plum   { --accent: var(--plum);  --accent-dark: #522a68;           --accent-light: var(--plum-light);  --accent-border: var(--plum-border); }
body { --accent: var(--berry); --accent-dark: var(--berry-dark); --accent-light: var(--berry-light); --accent-border: var(--berry-border); }

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

html { font-size: 16px; scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-height) + 16px); -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--surface-2);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--berry); text-decoration: none; }
a:hover { color: var(--berry-dark); text-decoration: underline; text-underline-offset: 2px; }
img, picture, video, svg { max-width: 100%; display: block; }
img { height: auto; }

h1, h2, h3, h4 { line-height: 1.2; color: var(--ink); font-weight: 700; text-wrap: balance; }
h1 { font-size: clamp(2rem, 4.4vw, 3rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.45rem, 2.6vw, 2rem); letter-spacing: -.015em; }
h3 { font-size: 1.2rem; }
p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--berry); color: #fff; padding: .7rem 1.1rem; border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }
:focus-visible { outline: 3px solid var(--berry-mid); outline-offset: 2px; border-radius: 4px; }

/* ---- LAYOUT WIDTHS ---- */
.container { max-width: var(--w-wide); margin: 0 auto; padding: 0 1.5rem; width: 100%; }
.container-narrow { max-width: var(--w-narrow); }
.section { padding: 4rem 0; }
.section-tinted { background: var(--surface-3); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .74rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent); margin-bottom: .85rem;
}
.eyebrow i { width: 18px; height: 2px; background: var(--accent); border-radius: 2px; display: block; }

.section-head { max-width: 62ch; margin-bottom: 2.25rem; }
.section-head p { color: var(--text-muted); font-size: 1.05rem; margin-top: .6rem; }
.dek { font-size: clamp(1.05rem, 1.7vw, 1.24rem); color: var(--text-muted); line-height: 1.55; margin-top: .9rem; }

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-family: inherit; font-size: .95rem; font-weight: 650; line-height: 1;
  padding: .78rem 1.3rem; border-radius: 999px; border: 1.5px solid transparent;
  cursor: pointer; transition: background .15s, color .15s, border-color .15s, transform .1s;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--berry); color: #fff; }
.btn-primary:hover { background: var(--berry-dark); color: #fff; }
.btn-outline { background: transparent; color: var(--berry); border-color: var(--berry-border); }
.btn-outline:hover { background: var(--berry-light); color: var(--berry-dark); }
.btn-sm { font-size: .85rem; padding: .55rem 1rem; }
.btn-lg { font-size: 1.02rem; padding: .95rem 1.7rem; }
.btn-full { width: 100%; }

/* ---- NAVIGATION ---- */
.site-nav {
  background: var(--surface); border-bottom: 1px solid var(--border);
  height: var(--nav-height); position: sticky; top: 0; z-index: 200; box-shadow: var(--shadow-sm);
}
.nav-inner { display: flex; align-items: center; height: 100%; gap: 1.25rem; }
.nav-logo {
  display: flex; align-items: center; gap: .5rem; flex-shrink: 0;
  font-size: 1.22rem; font-weight: 800; color: var(--berry); letter-spacing: -.03em;
}
.nav-logo:hover { color: var(--berry-dark); text-decoration: none; }
.nav-logo-mark { color: var(--berry); }
.nav-logo-text span { color: var(--text-light); font-weight: 600; }

.nav-links { display: flex; align-items: center; gap: .15rem; flex: 1; }
.nav-links > a, .nav-dropdown-trigger {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .45rem .7rem; border-radius: var(--radius-sm);
  font-size: .9rem; font-weight: 550; color: var(--text); white-space: nowrap;
  transition: background .15s, color .15s;
}
.nav-links > a:hover, .nav-dropdown-trigger:hover,
.nav-links > a.active, .nav-dropdown-trigger.active { background: var(--berry-light); color: var(--berry); text-decoration: none; }

.nav-has-dropdown { position: relative; }
.nav-has-dropdown:hover .nav-dropdown-trigger { background: var(--berry-light); color: var(--berry); }
.nav-has-dropdown:hover .nav-dropdown-trigger svg { transform: rotate(180deg); }
.nav-dropdown-trigger svg { transition: transform .15s; flex-shrink: 0; }

.nav-mega {
  position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); width: min(660px, 88vw); padding: 1.25rem;
  display: none; z-index: 300; grid-template-columns: 1fr 1.15fr; gap: 1.5rem;
}
.nav-has-dropdown:hover .nav-mega, .nav-has-dropdown:focus-within .nav-mega { display: grid; }
.nav-mega::before { content: ""; position: absolute; top: -10px; left: 0; right: 0; height: 10px; }
.nav-mega-intro strong { display: block; font-size: 1.02rem; line-height: 1.3; margin-bottom: .45rem; color: var(--ink); }
.nav-mega-intro p { font-size: .85rem; color: var(--text-muted); line-height: 1.5; margin-bottom: .9rem; }
.nav-mega-cta { font-size: .85rem; font-weight: 650; color: var(--berry); }
.nav-mega-list { display: grid; gap: .15rem; align-content: start; }
.nav-mega-list a { display: block; padding: .5rem .65rem; border-radius: var(--radius-sm); transition: background .12s; }
.nav-mega-list a:hover { background: var(--surface-3); text-decoration: none; }
.nav-mega-list strong { display: block; font-size: .82rem; color: var(--accent, var(--berry)); font-weight: 700; }
.nav-mega-list small { display: block; font-size: .84rem; color: var(--text); line-height: 1.35; }

/* margin-left:auto, not the nav-links flex:1, is what pins the actions to the
   right edge — below 1080px .nav-links is display:none and stops pushing. */
.nav-actions { display: flex; align-items: center; gap: .6rem; flex-shrink: 0; margin-left: auto; }
.nav-hamburger { display: none; background: none; border: 0; cursor: pointer; padding: .5rem; width: 44px; height: 44px; margin-right: -.5rem; }
.nav-hamburger span { display: block; height: 2px; width: 22px; background: var(--ink); border-radius: 2px; margin: 4px auto; transition: transform .2s, opacity .2s; }
.nav-hamburger.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.nav-mobile-panel {
  display: none; position: fixed; top: var(--nav-height); left: 0; right: 0; bottom: 0;
  background: var(--surface); z-index: 190; overflow-y: auto; padding: 1rem 1.25rem 3rem;
  border-top: 1px solid var(--border);
}
.nav-mobile-panel.open { display: block; }
.mob-link { display: block; padding: .8rem .5rem; font-weight: 600; color: var(--text); border-bottom: 1px solid var(--border); }
.mob-link.active { color: var(--berry); }
.nav-mobile-acc-btn {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: .8rem .5rem; background: none; border: 0; border-bottom: 1px solid var(--border);
  font: inherit; font-weight: 600; color: var(--text); cursor: pointer; text-align: left;
}
.nav-mobile-acc-btn svg { transition: transform .2s; }
.nav-mobile-acc-btn.open svg { transform: rotate(180deg); }
.nav-mobile-acc-body { display: none; padding: .35rem 0 .6rem .8rem; }
.nav-mobile-acc-body.open { display: block; }
.mob-sub-link { display: block; padding: .5rem .5rem; font-size: .92rem; color: var(--text-muted); border-bottom: 1px solid var(--surface-3); }
.mob-sub-hub { color: var(--berry); font-weight: 650; }
.nav-mobile-actions { margin-top: 1.5rem; display: grid; gap: .5rem; }

/* ---- BREADCRUMB ---- */
.breadcrumb-bar { background: var(--surface); border-bottom: 1px solid var(--border); }
/* Vertical padding only. These elements also carry .container, and the mobile
   .container rule later in this file would clobber a padding shorthand. */
.breadcrumb-trail { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding-top: .7rem; padding-bottom: .7rem; font-size: .82rem; color: var(--text-light); }
.breadcrumb-trail a { color: var(--text-muted); }
.breadcrumb-trail [aria-current] { color: var(--ink); font-weight: 600; }

/* ---- HERO (home) ---- */
.hero { background: linear-gradient(170deg, var(--berry-light) 0%, var(--surface-2) 65%); border-bottom: 1px solid var(--border); }
.hero-inner { display: grid; grid-template-columns: 1.05fr .95fr; gap: 3rem; align-items: center; padding-top: 3.5rem; padding-bottom: 3.5rem; }
.hero-copy h1 { margin-bottom: .3rem; }
.hero-dek { font-size: 1.12rem; color: var(--text-muted); margin: 1rem 0 1.5rem; line-height: 1.6; }
.hero-points { list-style: none; display: grid; gap: .6rem; margin-bottom: 1.6rem; }
.hero-points li { display: flex; gap: .65rem; align-items: flex-start; font-size: .98rem; }
.hero-points span { color: var(--teal); font-weight: 800; flex-shrink: 0; }
.hero-meta { display: flex; flex-wrap: wrap; gap: .5rem; }
.hero-meta span {
  font-size: .76rem; font-weight: 650; letter-spacing: .04em; text-transform: uppercase;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-muted);
  padding: .35rem .7rem; border-radius: 999px;
}
.hero-figure { border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg); border: 1px solid var(--border); }
.hero-figure img { width: 100%; aspect-ratio: 8 / 5; object-fit: cover; }

/* ---- CALCULATOR (wide, tool-shaped) ---- */
.calculator-section { padding: 3.5rem 0; }
.calc-shell {
  display: grid; grid-template-columns: 380px 1fr; gap: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow);
}
.calc-form { padding: 2rem; background: var(--surface-3); border-right: 1px solid var(--border); }
.calc-form-head { margin-bottom: 1.5rem; }
.calc-form-head h2 { font-size: 1.35rem; }
.calc-form-head p { font-size: .9rem; color: var(--text-muted); margin-top: .3rem; }

.field { display: block; margin-bottom: 1.35rem; }
.field-label { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; font-size: .85rem; font-weight: 650; color: var(--ink); margin-bottom: .45rem; }
.field-label em { font-style: normal; color: var(--berry); font-weight: 700; font-variant-numeric: tabular-nums; }
.field small { display: block; font-size: .78rem; color: var(--text-light); margin-top: .4rem; line-height: 1.45; }
.field input[type="date"], .field input[type="email"], .field input[type="text"], .field select, .field textarea {
  width: 100%; font: inherit; font-size: .95rem; padding: .68rem .8rem;
  border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text);
}
.field textarea { resize: vertical; min-height: 130px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--berry-mid); outline: none; box-shadow: 0 0 0 3px var(--berry-light); }
.field input[type="range"] { width: 100%; accent-color: var(--berry); height: 26px; }
.field-hidden { position: absolute; left: -9999px; }
.calc-note { font-size: .78rem; color: var(--text-light); margin-top: .9rem; line-height: 1.5; }

.calc-result { padding: 2rem; min-width: 0; }
.result-headline h2 { font-size: clamp(1.25rem, 2.2vw, 1.6rem); margin-bottom: .5rem; }
.result-headline p { color: var(--text-muted); font-size: .95rem; margin-bottom: 1.5rem; }
.result-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .8rem; margin-bottom: 1.75rem; }
.result-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: .95rem 1rem; }
.result-card span { display: block; font-size: .72rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text-light); margin-bottom: .35rem; }
.result-card strong { display: block; font-size: 1.02rem; color: var(--ink); line-height: 1.3; }
.result-card small { display: block; font-size: .78rem; color: var(--text-muted); margin-top: .3rem; }
.result-card.is-peak { background: var(--berry-light); border-color: var(--berry-border); }
.result-card.is-peak strong { color: var(--berry-dark); }

.cycle-bar { margin-bottom: 1.75rem; }
.cycle-bar-track { position: relative; height: 34px; background: var(--surface-3); border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.cycle-seg { position: absolute; top: 0; bottom: 0; }
.cycle-period { background: repeating-linear-gradient(45deg, #e9b7c9, #e9b7c9 5px, #f2ccda 5px, #f2ccda 10px); }
.cycle-fertile { background: linear-gradient(90deg, var(--teal-border), var(--teal)); opacity: .85; }
.cycle-ov { width: 4px; background: var(--berry-dark); border-radius: 2px; }
.cycle-legend { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: .7rem; font-size: .78rem; color: var(--text-muted); align-items: center; }
.cycle-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.dot-period { background: #e9b7c9; }
.dot-fertile { background: var(--teal); }
.dot-ov { background: var(--berry-dark); }
.cycle-days { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--text-light); }

.calc-empty { text-align: center; padding: 2rem 1rem; max-width: 46ch; margin: 0 auto; }
.calc-empty-mark { color: var(--berry-border); display: flex; justify-content: center; margin-bottom: 1rem; }
.calc-empty h2 { font-size: 1.3rem; margin-bottom: .6rem; }
.calc-empty > p { color: var(--text-muted); font-size: .95rem; margin-bottom: 1.5rem; }
.calc-empty-list { list-style: none; text-align: left; display: grid; gap: .8rem; }
.calc-empty-list li { font-size: .88rem; color: var(--text-muted); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .75rem .9rem; }
.calc-empty-list strong { color: var(--ink); }

.result-table-wrap h3 { font-size: 1.05rem; margin-bottom: .8rem; }
.result-next { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .8rem; margin-top: 1.5rem; }

/* ---- TABLES ---- */
.table-wrap, .result-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.info-table { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 520px; background: var(--surface); }
.info-table th, .info-table td { padding: .7rem .85rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.info-table thead th { background: var(--surface-3); font-size: .76rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted); border-bottom: 2px solid var(--border-strong); white-space: nowrap; }
.info-table tbody th { font-weight: 650; color: var(--ink); }
.info-table tbody tr:hover { background: var(--surface-2); }
.info-table tbody tr:last-child th, .info-table tbody tr:last-child td { border-bottom: 0; }
.table-note { font-size: .82rem; color: var(--text-light); margin-top: .7rem; line-height: 1.55; font-style: italic; }

/* ---- CALLOUTS ---- */
.callout { border-radius: var(--radius); padding: 1rem 1.15rem; margin: 1.25rem 0; border: 1px solid; }
.callout strong { display: block; margin-bottom: .3rem; font-size: .95rem; }
.callout p { font-size: .9rem; line-height: 1.6; margin: 0; }
.callout-good { background: var(--teal-light); border-color: var(--teal-border); }
.callout-good strong { color: var(--teal-dark); }
.callout-watch { background: var(--amber-light); border-color: var(--amber-border); }
.callout-watch strong { color: var(--amber); }

.link-card {
  display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: .9rem 1rem; transition: border-color .15s, box-shadow .15s, transform .15s;
}
.link-card:hover { border-color: var(--berry-border); box-shadow: var(--shadow); transform: translateY(-2px); text-decoration: none; }
.link-card strong { display: block; color: var(--ink); font-size: .95rem; }
.link-card small { display: block; color: var(--text-muted); font-size: .82rem; margin-top: .2rem; }

/* ---- EXPLAINER CARDS ---- */
.explainer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.explainer-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.4rem; position: relative; }
.explainer-num { font-family: var(--font-display); font-size: 1.5rem; color: var(--berry-border); font-weight: 700; display: block; margin-bottom: .5rem; }
.explainer-card h3 { font-size: 1.02rem; margin-bottom: .5rem; }
.explainer-card p { font-size: .89rem; color: var(--text-muted); line-height: 1.6; }

/* ---- PILLAR CARDS ---- */
.pillar-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.pillar-grid-two { grid-template-columns: repeat(2, 1fr); }
.pillar-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .18s, transform .18s; }
.pillar-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.pillar-card-media img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.pillar-card-body { padding: 1.4rem; display: flex; flex-direction: column; flex: 1; }
.pillar-tag {
  display: inline-block; align-self: flex-start; font-size: .7rem; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: var(--accent); background: var(--accent-light);
  border: 1px solid var(--accent-border); padding: .25rem .6rem; border-radius: 999px; margin-bottom: .75rem;
}
.pillar-card h3 { font-size: 1.15rem; margin-bottom: .5rem; line-height: 1.3; }
.pillar-card h3 a { color: var(--ink); }
.pillar-card h3 a:hover { color: var(--accent); }
.pillar-card-body > p { font-size: .9rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 1rem; }
.pillar-card-links { list-style: none; display: grid; gap: .35rem; margin-bottom: 1rem; }
.pillar-card-links a { font-size: .87rem; color: var(--text); display: block; padding-left: .9rem; position: relative; }
.pillar-card-links a::before { content: "›"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
.pillar-card-more { margin-top: auto; font-size: .87rem; font-weight: 650; color: var(--accent); }

/* ---- HUB PAGE ---- */
.hub-hero { background: linear-gradient(170deg, var(--accent-light) 0%, var(--surface-2) 70%); border-bottom: 1px solid var(--border); }
.hub-hero-inner { display: grid; grid-template-columns: 1.15fr .85fr; gap: 3rem; align-items: center; padding-top: 3rem; padding-bottom: 3rem; }
.hub-intro { font-size: .98rem; color: var(--text-muted); line-height: 1.7; margin-top: 1.2rem; max-width: 60ch; }
.hub-questions { margin-top: 1.5rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.25rem; max-width: 56ch; }
.hub-questions-label { font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-light); display: block; margin-bottom: .6rem; }
.hub-questions ul { list-style: none; display: grid; gap: .4rem; }
.hub-questions li { font-size: .9rem; color: var(--text); padding-left: 1.1rem; position: relative; }
.hub-questions li::before { content: "?"; position: absolute; left: 0; color: var(--accent); font-weight: 800; }
.hub-hero-figure { border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg); border: 1px solid var(--border); }
.hub-hero-figure img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }

.hub-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.5rem; }
.hub-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .18s, transform .18s; }
.hub-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.hub-card-media { position: relative; display: block; }
.hub-card-media img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.hub-card-flag {
  position: absolute; top: .75rem; left: .75rem; font-size: .68rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; background: rgba(255,255,255,.94);
  color: var(--berry-dark); padding: .3rem .6rem; border-radius: 999px; box-shadow: var(--shadow-sm);
}
.hub-card-body { padding: 1.35rem; display: flex; flex-direction: column; flex: 1; }
.hub-card-kicker { font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin-bottom: .5rem; }
.hub-card h3 { font-size: 1.12rem; line-height: 1.3; margin-bottom: .5rem; }
.hub-card h3 a { color: var(--ink); }
.hub-card h3 a:hover { color: var(--accent); }
.hub-card-body > p { font-size: .89rem; color: var(--text-muted); line-height: 1.6; margin-bottom: .9rem; }
.hub-card-takeaway { list-style: none; display: grid; gap: .4rem; margin-bottom: 1rem; }
.hub-card-takeaway li { font-size: .82rem; color: var(--text-muted); line-height: 1.5; padding-left: 1rem; position: relative; }
.hub-card-takeaway li::before { content: ""; position: absolute; left: 0; top: .55em; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.hub-card-foot { margin-top: auto; display: flex; gap: 1rem; font-size: .76rem; color: var(--text-light); border-top: 1px solid var(--border); padding-top: .8rem; }

.hub-cta { display: flex; align-items: center; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.hub-cta h2 { margin-bottom: .5rem; }
.hub-cta p { color: var(--text-muted); max-width: 54ch; font-size: .96rem; }
.hub-return { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--border); font-size: .92rem; font-weight: 600; }

/* ---- ARTICLE (magazine) ---- */
.article-hero { background: linear-gradient(170deg, var(--accent-light) 0%, var(--surface-2) 72%); border-bottom: 1px solid var(--border); padding: 2.75rem 0 0; }
.article-hero-inner { display: grid; grid-template-columns: 1.05fr .95fr; gap: 3rem; align-items: center; padding-bottom: 2.75rem; }
.article-hero h1 { margin-bottom: .25rem; }
.article-meta { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; margin-top: 1.4rem; font-size: .82rem; color: var(--text-muted); }
.article-meta span { display: inline-flex; align-items: center; }
.article-meta span + span::before { content: ""; }
.article-hero-figure { border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg); border: 1px solid var(--border); }
.article-hero-figure img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }

.glance-strip {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); margin-top: -1.75rem; position: relative; z-index: 2; overflow: hidden;
}
.glance-item { padding: 1.1rem 1.25rem; border-right: 1px solid var(--border); }
.glance-item:last-child { border-right: 0; }
.glance-label { display: block; font-size: .7rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--text-light); }
.glance-value { display: block; font-family: var(--font-display); font-size: 1.5rem; color: var(--accent-dark); line-height: 1.15; margin: .3rem 0 .15rem; }
.glance-note { display: block; font-size: .78rem; color: var(--text-muted); line-height: 1.4; }

/* The reading column. This is the "width follows function" rule: a guide is
   a column of prose with a rail, never a full-bleed dashboard. */
.article-layout { display: grid; grid-template-columns: 232px minmax(0, var(--w-read)); gap: 3.5rem; justify-content: center; padding-top: 3rem; padding-bottom: 3.5rem; }
.article-rail-inner { position: sticky; top: calc(var(--nav-height) + 1.5rem); }
.rail-title { display: block; font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-light); margin-bottom: .7rem; }
.rail-nav { display: grid; gap: .1rem; border-left: 2px solid var(--border); margin-bottom: 1.75rem; }
.rail-nav a { display: block; padding: .38rem .8rem; font-size: .82rem; color: var(--text-muted); line-height: 1.4; border-left: 2px solid transparent; margin-left: -2px; }
.rail-nav a:hover, .rail-nav a.is-active { color: var(--accent); border-left-color: var(--accent); text-decoration: none; }
.rail-cta { background: var(--accent-light); border: 1px solid var(--accent-border); border-radius: var(--radius); padding: 1rem; }
.rail-cta strong { display: block; font-size: .92rem; color: var(--ink); margin-bottom: .3rem; }
.rail-cta p { font-size: .8rem; color: var(--text-muted); line-height: 1.5; margin-bottom: .8rem; }

.article-body { min-width: 0; font-size: 1.055rem; overflow-wrap: break-word; }
.article-body .lede { font-size: 1.2rem; line-height: 1.65; color: var(--ink); font-family: var(--font-display); margin-bottom: 1.75rem; }
.article-section { margin-bottom: 2.5rem; }
.article-section h2 { font-family: var(--font-display); font-size: clamp(1.4rem, 2.4vw, 1.75rem); margin-bottom: .5rem; padding-top: .4rem; }
.section-standfirst { font-size: .95rem; color: var(--accent-dark); font-weight: 600; margin-bottom: 1rem; }
.article-body p { line-height: 1.72; color: var(--text); }
.article-body p + p { margin-top: 1rem; }

.takeaways { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: var(--radius); padding: 1.35rem 1.5rem; margin-bottom: 2.25rem; }
.takeaways-label { display: block; font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin-bottom: .8rem; }
.takeaways ul { list-style: none; display: grid; gap: .65rem; }
.takeaways li { font-size: .94rem; line-height: 1.6; color: var(--text); padding-left: 1.35rem; position: relative; }
.takeaways li::before { content: ""; position: absolute; left: 0; top: .58em; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

.rich-list, .rich-steps { margin: 1rem 0 0; padding-left: 0; list-style: none; display: grid; gap: .85rem; counter-reset: step; }
.rich-list li { position: relative; padding-left: 1.5rem; line-height: 1.68; }
.rich-list li::before { content: ""; position: absolute; left: .2rem; top: .62em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.rich-steps li { position: relative; padding-left: 2.6rem; line-height: 1.68; counter-increment: step; min-height: 1.8rem; }
.rich-steps li::before {
  content: counter(step); position: absolute; left: 0; top: .05em;
  width: 1.85rem; height: 1.85rem; border-radius: 50%;
  background: var(--accent-light); border: 1px solid var(--accent-border); color: var(--accent-dark);
  font-size: .8rem; font-weight: 700; display: flex; align-items: center; justify-content: center;
}

.fact-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1rem; margin-top: 1.25rem; }
.fact-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem; }
.fact-tag { display: inline-block; font-size: .66rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--accent-dark); background: var(--accent-light); border: 1px solid var(--accent-border); padding: .2rem .55rem; border-radius: 999px; margin-bottom: .65rem; }
.fact-card h3 { font-size: 1rem; margin-bottom: .45rem; line-height: 1.3; }
.fact-card p { font-size: .88rem; color: var(--text-muted); line-height: 1.62; }

.timeline { list-style: none; margin-top: 1.25rem; padding-left: 1.15rem; border-left: 2px solid var(--accent-border); display: grid; gap: 1.2rem; }
.timeline li { position: relative; }
.timeline li::before { content: ""; position: absolute; left: -1.53rem; top: .45em; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); border: 2px solid var(--surface-2); }
.timeline-label { display: block; font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-dark); margin-bottom: .25rem; }
.timeline p { font-size: .93rem; color: var(--text-muted); line-height: 1.65; }

.pull-quote { margin: 2.5rem 0; padding: 1.75rem 0; border-top: 2px solid var(--accent-border); border-bottom: 2px solid var(--accent-border); }
.pull-quote blockquote { font-family: var(--font-display); font-size: clamp(1.2rem, 2.4vw, 1.5rem); line-height: 1.42; color: var(--ink); }
.pull-quote figcaption { margin-top: .8rem; font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }

.risk-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .7rem; margin-top: 1.25rem; }
.risk-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .85rem .95rem; }
.risk-week { display: block; font-size: .72rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text-light); }
.risk-value { display: block; font-family: var(--font-display); font-size: 1.4rem; color: var(--accent-dark); margin: .2rem 0; }
.risk-item small { display: block; font-size: .78rem; color: var(--text-muted); line-height: 1.45; }

.doctor-box { background: var(--amber-light); border: 1px solid var(--amber-border); border-radius: var(--radius-lg); padding: 1.5rem 1.75rem; }
.doctor-box h2 { font-family: var(--font-display); color: var(--amber); margin-bottom: .6rem; padding-top: 0; }
.doctor-box > p { font-size: .95rem; color: var(--text); margin-bottom: .9rem; }
.doctor-box ul { list-style: none; display: grid; gap: .6rem; }
.doctor-box li { font-size: .93rem; line-height: 1.6; padding-left: 1.5rem; position: relative; }
.doctor-box li::before { content: "!"; position: absolute; left: .25rem; color: var(--amber); font-weight: 800; }
.doctor-note { font-size: .85rem !important; color: var(--text-muted) !important; margin-top: 1rem !important; margin-bottom: 0 !important; font-style: italic; }

.faq-list { display: grid; gap: .6rem; margin-top: 1rem; }
.faq-list details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.faq-list summary { padding: .95rem 1.15rem; font-weight: 650; font-size: .97rem; cursor: pointer; color: var(--ink); list-style: none; display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: "+"; color: var(--accent); font-size: 1.3rem; font-weight: 400; line-height: 1; flex-shrink: 0; }
.faq-list details[open] summary::after { content: "–"; }
.faq-list details[open] summary { border-bottom: 1px solid var(--border); }
.faq-list p { padding: 1rem 1.15rem; font-size: .93rem; color: var(--text-muted); line-height: 1.68; }

.source-list { margin-top: 1rem; padding-left: 1.3rem; display: grid; gap: .5rem; }
.source-list li { font-size: .88rem; line-height: 1.55; color: var(--text-muted); }
.source-list a { font-weight: 600; }
.disclaimer-line { margin-top: 1.75rem; padding-top: 1rem; border-top: 1px solid var(--border); font-size: .82rem; color: var(--text-light); line-height: 1.6; }

/* ---- INLINE TOOL (inside an article) ---- */
.inline-tool { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.75rem; margin: 0 0 2.5rem; box-shadow: var(--shadow); }
.inline-tool-head h2 { font-family: var(--font-display); font-size: 1.45rem; margin-bottom: .4rem; }
.inline-tool-head p { font-size: .92rem; color: var(--text-muted); margin-bottom: 1.5rem; }
.tool-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-bottom: 1.5rem; }
.tool-tab { position: relative; cursor: pointer; }
.tool-tab input { position: absolute; opacity: 0; width: 0; height: 0; }
.tool-tab span { display: block; padding: .75rem .8rem; border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface-2); transition: border-color .15s, background .15s; height: 100%; }
.tool-tab strong { display: block; font-size: .86rem; color: var(--ink); }
.tool-tab small { display: block; font-size: .74rem; color: var(--text-light); margin-top: .15rem; }
.tool-tab input:checked + span { border-color: var(--berry); background: var(--berry-light); }
.tool-tab input:focus-visible + span { outline: 3px solid var(--berry-mid); outline-offset: 2px; }
.tool-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem 1.5rem; margin-bottom: 1.25rem; }
.tool-result { margin-top: 1.75rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.tool-result-headline { background: var(--berry-light); border: 1px solid var(--berry-border); border-radius: var(--radius); padding: 1.15rem 1.35rem; margin-bottom: 1.25rem; }
.tool-result-headline span { display: block; font-size: .72rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--berry); }
.tool-result-headline strong { display: block; font-family: var(--font-display); font-size: clamp(1.3rem, 3vw, 1.75rem); color: var(--berry-dark); margin: .25rem 0 .2rem; }
.tool-result-headline small { display: block; font-size: .82rem; color: var(--text-muted); }
.trimester-list { display: grid; gap: .6rem; margin-top: 1.25rem; }
.trimester-item { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .8rem 1rem; }
.trimester-item strong { font-size: .9rem; color: var(--ink); }
.trimester-item span { display: block; font-size: .86rem; color: var(--accent-dark); font-weight: 600; margin: .15rem 0; }
.trimester-item small { font-size: .8rem; color: var(--text-muted); line-height: 1.5; }

/* ---- RELATED ---- */
.related-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.25rem; }
.related-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; padding-bottom: 1.15rem; transition: box-shadow .18s, transform .18s; }
.related-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); text-decoration: none; }
.related-card img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; margin-bottom: 1rem; }
.related-kicker { display: block; padding: 0 1.15rem; font-size: .7rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--accent); margin-bottom: .35rem; }
.related-card strong { display: block; padding: 0 1.15rem; font-size: 1rem; color: var(--ink); line-height: 1.3; margin-bottom: .35rem; }
.related-card small { display: block; padding: 0 1.15rem; font-size: .84rem; color: var(--text-muted); line-height: 1.55; }

/* ---- STATIC PAGES ---- */
.static-page { padding-top: 3rem; padding-bottom: 4rem; }
.static-hero { margin-bottom: 2.5rem; }
.static-page section { margin-bottom: 2.25rem; }
.static-page h2 { font-family: var(--font-display); font-size: 1.45rem; margin-bottom: .7rem; }
.static-page p, .static-page li { color: var(--text-muted); line-height: 1.72; }
.static-page .rich-steps li { color: var(--text); }
.static-updated { font-size: .84rem; color: var(--text-light); padding-top: 1.25rem; border-top: 1px solid var(--border); }
.static-cta { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; background: var(--berry-light); border: 1px solid var(--berry-border); border-radius: var(--radius-lg); padding: 1.5rem; }
.static-cta strong { display: block; font-size: 1.05rem; color: var(--ink); }
.static-cta p { font-size: .9rem; margin-top: .2rem; }
.contact-form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.75rem; margin-bottom: 2.5rem; }
.error-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: .8rem; margin-bottom: 2.5rem; }

/* ---- FOOTER ---- */
.site-footer { background: var(--ink); color: #e9dde5; padding: 3.5rem 0 1.75rem; margin-top: 0; }
.footer-top { display: grid; grid-template-columns: 1.1fr 3fr; gap: 3rem; padding-bottom: 2.5rem; border-bottom: 1px solid rgba(255,255,255,.12); }
.footer-logo { display: flex; align-items: center; gap: .5rem; font-size: 1.15rem; font-weight: 800; color: #fff; letter-spacing: -.03em; margin-bottom: .9rem; }
.footer-logo span { color: rgba(255,255,255,.55); font-weight: 600; }
.footer-desc { font-size: .88rem; line-height: 1.65; color: rgba(255,255,255,.72); margin-bottom: .9rem; }
.footer-disclaimer { font-size: .8rem; line-height: 1.6; color: rgba(255,255,255,.5); }
.footer-cols { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1.5rem; }
.footer-heading { font-size: .74rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #fff; margin-bottom: .8rem; }
.footer-links { list-style: none; display: grid; gap: .45rem; }
.footer-links a { font-size: .84rem; color: rgba(255,255,255,.72); line-height: 1.45; }
.footer-links a:hover { color: #fff; }
.footer-bottom { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-top: 1.5rem; font-size: .8rem; color: rgba(255,255,255,.5); }

/* ---- RESPONSIVE ---- */
@media (max-width: 1080px) {
  .nav-links { display: none; }
  .nav-hamburger { display: block; }
  .article-layout { grid-template-columns: minmax(0, var(--w-read)); }
  .article-rail { display: none; }
  .hero-inner, .hub-hero-inner, .article-hero-inner { grid-template-columns: 1fr; gap: 2rem; }
  .hero-figure, .hub-hero-figure, .article-hero-figure { order: -1; }
  .footer-top { grid-template-columns: 1fr; gap: 2rem; }
  .footer-cols { grid-template-columns: repeat(3, 1fr); }
  .pillar-grid { grid-template-columns: 1fr; }
  .glance-strip { grid-template-columns: repeat(2, 1fr); }
  .glance-item:nth-child(2) { border-right: 0; }
  .glance-item:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
}

@media (max-width: 880px) {
  .calc-shell { grid-template-columns: 1fr; }
  .calc-form { border-right: 0; border-bottom: 1px solid var(--border); }
  .nav-cta { display: none; }
  .tool-tabs { grid-template-columns: 1fr; }
  .hub-cta { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 640px) {
  :root { --nav-height: 58px; }
  .container { padding: 0 1.1rem; }
  .section { padding: 2.75rem 0; }
  .hero-inner { padding-top: 2.25rem; padding-bottom: 2.25rem; }
  .calc-form, .calc-result, .inline-tool, .contact-form { padding: 1.35rem; }
  .glance-strip { grid-template-columns: 1fr; margin-top: -1rem; }
  .glance-item { border-right: 0; border-bottom: 1px solid var(--border); }
  .glance-item:last-child { border-bottom: 0; }
  .footer-cols { grid-template-columns: repeat(2, 1fr); }
  .article-body { font-size: 1.02rem; }
  .article-layout { padding-top: 2rem; }
  .doctor-box { padding: 1.2rem; }
  .pull-quote { margin: 1.75rem 0; }
  .result-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 420px) {
  .result-grid, .risk-strip { grid-template-columns: 1fr; }
  .footer-cols { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

@media print {
  .site-nav, .nav-mobile-panel, .site-footer, .article-rail, .breadcrumb-bar, .btn { display: none !important; }
  body { background: #fff; }
  .article-layout { grid-template-columns: 1fr; padding: 0; }
}
