/* Iowa Water Made Simple — page styles.
   Extends the Broadsheet design system (styles.css). Tokens only: every
   color/space/radius comes from a var(). No boxes for layout — hierarchy is
   whitespace and the serif scale, per the system's direction. */

:root { --measure: 880px; }

/* Anchor jumps land with breathing room; smooth unless the reader opts out */
:where(section, header) { scroll-margin-top: var(--space-6); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

/* Reading size toggle (progressive enhancement; works without JS at default) */
html { font-size: 19px; line-height: 1.6; }
html[data-size="large"] { font-size: 21.5px; }
@media (max-width: 640px) { html { font-size: 17px; } }

body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

strong { font-weight: 600; }
a:hover { color: var(--color-accent-600); }

/* Skip link — first focusable element, for keyboard/screen-reader users */
.skip {
  position: absolute; left: var(--space-3); top: -100px;
  background: var(--color-accent); color: var(--color-bg);
  padding: var(--space-2) var(--space-3); border-radius: var(--radius-md);
  z-index: 10; transition: top 0.15s;
}
.skip:focus { top: var(--space-3); color: var(--color-bg); }

/* Layout column */
.wrap { max-width: var(--measure); margin: 0 auto; padding-inline: var(--space-4); }
.section { padding-top: calc(var(--space-8) * 2); }
.section--tight { padding-top: calc(var(--space-8) * 1.2); }

/* Front-page furniture: the one place rules print — thick over thin */
.dateline {
  border-top: 3px solid var(--color-text);
  border-bottom: 1px solid var(--color-text);
  display: flex; justify-content: space-between; gap: var(--space-4);
  padding: var(--space-1) 0;
  font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
}
.dateline span:nth-child(2) { text-align: center; }
.dateline span:last-child { text-align: right; }
@media (max-width: 560px) { .dateline { font-size: 10px; gap: var(--space-2); } }

/* Section kicker (Part N · label) */
.kicker {
  margin: 0 0 var(--space-2); font-size: 13px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-accent-700);
}

/* Hero headline — clean serif, the system's near-black ink, balanced ragging */
.hero-head { font-size: 52px; line-height: 1.05; text-wrap: balance; }
@media (max-width: 640px) { .hero-head { font-size: 38px; } }

/* Display figures use .cmyk-num from the system; this sizes them */
.fig { font-family: var(--font-heading); font-weight: 600; }
.fig-sm { font-size: 40px; }
.fig-md { font-size: 52px; }
.fig-lg { font-size: 64px; }

/* Grids */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: var(--space-6); }
.cols-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--space-8); }
.measure-narrow { max-width: 660px; }
.measure-mid { max-width: 720px; }

/* Jump navigation — a plain contents list, not chrome-heavy nav */
.toc { margin-top: calc(var(--space-8) * 1.2); }
.toc h2 { font-size: 16px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--color-neutral-700); margin-bottom: var(--space-3); }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--space-2) var(--space-6); counter-reset: toc; }
.toc li { counter-increment: toc; }
.toc a { display: block; padding: var(--space-1) 0; border-bottom: 1px solid var(--color-divider); text-decoration: none; }
.toc a::before { content: counter(toc) ". "; color: var(--color-accent); font-weight: 600; }
.toc a:hover { color: var(--color-accent-600); }

/* "What to do" — a left-ruled callout, not a box (system avoids boxes for layout) */
.do {
  border-left: 3px solid var(--color-accent);
  padding: var(--space-1) 0 var(--space-1) var(--space-4);
  margin-top: var(--space-4);
}
.do--magenta { border-left-color: var(--color-accent-2); }
.do .lead { font-weight: 600; color: var(--color-accent-700); }
.do--magenta .lead { color: var(--color-accent-2-700); }

/* River nitrate chart — horizontal bars against the legal-limit line */
.chart { display: grid; gap: var(--space-2); max-width: var(--measure-mid, 720px); }
.chart-row { display: grid; grid-template-columns: minmax(120px, 210px) 1fr 52px; gap: var(--space-3); align-items: center; }
.chart-label { font-size: 0.76em; font-weight: 600; text-align: right; line-height: 1.25; }
.chart-track { position: relative; height: 26px; }
.chart-track::before { /* the legal-limit line at 10 mg/L, chart scaled to 16 max */
  content: ""; position: absolute; top: -6px; bottom: -6px; left: 62.5%;
  border-left: 2px dashed var(--color-neutral-600); z-index: 1;
}
.chart-bar { height: 100%; border-radius: var(--radius-sm); background: var(--color-accent-2); }
.chart-bar--under { background: var(--color-accent); }
.chart-val { font-size: 0.82em; font-weight: 600; }
.chart-limit { position: absolute; left: 62.5%; transform: translateX(-50%); font-size: 0.7em; font-weight: 600; white-space: nowrap; }

/* Numbered "why" steps */
.steps { display: grid; gap: var(--space-6); max-width: var(--measure-mid, 720px); }
.step { display: grid; grid-template-columns: 64px 1fr; gap: var(--space-4); align-items: start; }
.step .fig { font-size: 44px; }
.pull { font-style: italic; color: var(--color-neutral-700); }

/* Masthead — brand wordmark left, reading toolbar right */
.masthead { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); padding-top: var(--space-3); }
.brand { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-heading); font-weight: 600; font-size: 19px; letter-spacing: -0.01em; color: var(--color-text); text-decoration: none; }
.brand:hover { color: var(--color-accent-700); }
.brand-mark { width: 20px; height: 20px; flex: none; color: var(--color-accent); }

/* Reading toolbar */
.toolbar { display: flex; align-items: center; gap: var(--space-2); font-size: 13px; }
.toolbar .btn { font-size: 13px; }
@media (max-width: 420px) { .brand { font-size: 16px; } .toolbar #sizelabel { display: none; } }

/* Lists with breathing room */
ul.spaced { margin: 0; padding-left: 20px; display: grid; gap: var(--space-2); }
ul.spaced.wide { gap: var(--space-3); }

/* Utility */
.eyebrow { font-size: 0.85em; }
.hair { color: var(--color-neutral-700); }
.nowrap { white-space: nowrap; }

/* Print: hide interactive chrome */
@media print {
  .toolbar, .skip, .toc { display: none; }
  .section { padding-top: var(--space-8); }
}
