/* ==========================================================================
   Editorial theme (2026-09-24, author picked direction A of three).

   Loaded AFTER style.css and overrides it; delete the <link> in index.html to
   return to the previous look. Serif text (Source Serif 4) with a sans for
   labels, controls and charts (IBM Plex Sans), a warm white page, near-black
   ink and one deep river-teal accent. Figures sit on the page under a rule
   rather than in rounded cards; no tinted boxes, no pill buttons, no
   letter-spaced uppercase labels.

   Chart chrome (surface, grid, axis, ink) is mirrored in strings.js PAL and
   the chart font in app.js FONT. The categorical data palettes in style.css
   are untouched — they match the paper's figures.
   ========================================================================== */

:root {
  --surface:    #fbfaf6;
  --plane:      #fbfaf6;
  --ink:        #1b1a17;
  --ink-2:      #46443e;
  --ink-muted:  #77746b;
  --grid:       #e6e3da;
  --axis:       #bdb8ab;
  --rule:       #dcd8cd;
  --brand:      #0e4f5c;
  --brand-soft: #e5eded;

  --serif: "Source Serif 4", "Source Serif Pro", Georgia, "Times New Roman", serif;
  --sans:  "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --measure: 68ch;
}

/* ── base ─────────────────────────────────────────────────────────────── */
body {
  font-family: var(--serif);
  font-size: 18.5px; line-height: 1.6;
  background: var(--plane); color: var(--ink);
  font-optical-sizing: auto;
}
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; }
strong { font-weight: 650; }
a { color: var(--brand); border-bottom: 1px solid rgba(14, 79, 92, 0.35); }

/* everything that is interface rather than reading: sans */
.site-header, .storynav, .secnum, .fig .figlabel, .fig .figsub, .controls,
.reading, .fignote, details.method > summary, .tableview > summary, table.data,
.keynum .k, .keylead, .byline, .search-wrap, .dropdown, .basin-panel, .hint,
.hydro-legend, .overmap-side, .site-footer, details.moredetail > summary,
dl.defs dt, .chip, .copybtn, .playbtn, .segmented button, .term::after,
.info .info-pop, .leaflet-container, .design-steps p {
  font-family: var(--sans);
}

/* ── header ───────────────────────────────────────────────────────────── */
.site-header { background: rgba(251, 250, 246, 0.96); border-bottom: 1px solid var(--rule); }
.site-header .short-title { font-size: 14.5px; font-weight: 600; }
.header-links a { font-weight: 500; }
.header-links a.pdf {
  border: 1px solid var(--ink); color: var(--ink); border-radius: 0; padding: 3px 10px;
}
.header-links a.pdf:hover { background: var(--ink); color: var(--plane); }
.langswitch { border: 0; border-radius: 0; gap: 2px; }
.langswitch button {
  padding: 3px 6px; font-weight: 500; color: var(--ink-muted); letter-spacing: 0;
  border-bottom: 2px solid transparent; border-radius: 0;
}
.langswitch button[aria-pressed="true"] { background: none; color: var(--ink); font-weight: 650; border-bottom-color: var(--ink); }
.langswitch button:not([aria-pressed="true"]):hover { background: none; color: var(--ink); }

.storynav { background: rgba(251, 250, 246, 0.97); }
.storynav a { font-weight: 500; font-size: 13.5px; color: var(--ink-muted); }
.storynav a:hover { color: var(--ink); }
.storynav a.active { color: var(--ink); border-bottom-color: var(--ink); }

/* ── hero ─────────────────────────────────────────────────────────────── */
.hero { background: var(--plane); border-bottom: 0; }
.hero .inner { padding-top: 64px; padding-bottom: 34px; }
.hero h1 { font-size: clamp(32px, 5vw, 52px); font-weight: 600; letter-spacing: -0.015em; line-height: 1.12; }
.byline { font-size: 15px; color: var(--ink-2); }
.standfirst { font-size: clamp(19px, 2.2vw, 22.5px); line-height: 1.5; color: var(--ink-2); max-width: 62ch; }

.keylead { font-size: 14.5px; font-weight: 500; color: var(--ink-2); margin-bottom: 10px; }
.keynums {
  background: none; border: 0; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--rule);
  border-radius: 0; gap: 0;
}
.keynum { background: none; padding: 16px 22px 18px 0; }
.keynum + .keynum { padding-left: 22px; border-left: 1px solid var(--rule); }
.keynum .v { font-family: var(--serif); font-size: 42px; font-weight: 600; letter-spacing: -0.02em; }
.keynum .k { font-size: 14px; }

/* ── sections ─────────────────────────────────────────────────────────── */
section { border-top: 1px solid var(--rule); padding-top: 60px; }
.secnum {
  font-size: 13.5px; font-weight: 500; letter-spacing: 0; text-transform: none;
  color: var(--brand); margin-bottom: 8px;
}
section > h2 { font-size: clamp(27px, 3.4vw, 36px); letter-spacing: -0.012em; line-height: 1.18; }
section h3 { font-size: 22px; }

/* ── figures: on the page under a rule, not in a card ─────────────────── */
.fig {
  background: none; border: 0; border-radius: 0; overflow: visible;
  border-top: 2px solid var(--ink); margin: 40px 0 14px;
}
.fig > header, .controls, .fig footer { padding-left: 0; padding-right: 0; }
.fig > header { padding-top: 12px; }
.fig .figlabel {
  font-size: 13.5px; font-weight: 600; letter-spacing: 0; text-transform: none;
  color: var(--brand); margin-bottom: 4px;
}
.fig .figtitle { font-family: var(--serif); font-size: 22px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; }
.fig .figsub { font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.plotwrap { padding-left: 0; padding-right: 0; }
.fig footer { border-top: 1px solid var(--rule); margin-top: 10px; padding-top: 12px; }
.fignote { font-size: 13.5px; color: var(--ink-muted); line-height: 1.55; }

.reading {
  background: none; border-radius: 0; border-left: 2px solid var(--brand);
  margin: 6px 0 0; padding: 3px 0 3px 16px; font-size: 15.5px; color: var(--ink-2);
}
details.method > summary, .tableview > summary { font-weight: 500; }
details.method .body {
  background: none; border-radius: 0; border-left: 1px solid var(--rule); padding: 4px 0 4px 18px;
  font-size: 15.5px;
}
.eq, details.method .body code { background: none; border-radius: 0; }

/* controls */
.ctl > .ctl-label {
  font-size: 12.5px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--ink-muted);
}
.segmented { border-radius: 0; border-color: var(--ink); }
.segmented button { border-right-color: var(--ink); background: none; font-weight: 500; color: var(--ink); }
.segmented button[aria-pressed="true"] { background: var(--ink); color: var(--plane); }
.segmented button:not([aria-pressed="true"]):hover { background: var(--brand-soft); color: var(--ink); }
.playbtn, .selectctl select, .copybtn { border-radius: 0; border-color: var(--ink); background: none; color: var(--ink); }
.sliderctl input[type="range"] { accent-color: var(--ink); }

/* ── prose furniture ──────────────────────────────────────────────────── */
.callout {
  background: none; border-radius: 0; padding: 14px 0 10px;
  border-top: 1px solid var(--ink); border-bottom: 1px solid var(--rule);
}
.callout .label { font-family: var(--sans); font-size: 13px; letter-spacing: 0; text-transform: none; font-weight: 600; }
.slogan { background: none; border-radius: 0; border-left: 2px solid var(--prot); }
.slogan .es-quote { font-style: italic; font-weight: 600; }
.slogan-photo .gloss { background: none; padding-left: 0; font-family: var(--sans); font-size: 14px; }

.design-steps { background: none; border: 0; border-radius: 0; gap: 0 28px; }
.design-steps > div { background: none; padding: 14px 0 10px; border-top: 1px solid var(--ink); }
.design-steps span {
  width: auto; height: auto; border-radius: 0; background: none; color: var(--brand);
  font-family: var(--serif); font-size: 24px; font-weight: 600; margin-bottom: 4px; justify-content: flex-start;
}
.design-steps strong { font-size: 17px; }
.category-key .dotkey { width: 14px; height: 14px; border-radius: 50%; }

.reforms > li { padding-left: 40px; }
.reforms > li::before {
  background: none; border-radius: 0; width: auto; height: auto; place-items: start;
  font-family: var(--serif); font-size: 24px; font-weight: 600; color: var(--brand); top: -4px;
}
.reforms h4 { font-size: 19px; }

.quotes blockquote { background: none; border-radius: 0; }
details.moredetail {
  background: none; border-radius: 0; border-left: 0; border-right: 0; border-color: var(--rule);
}
details.moredetail > summary { font-weight: 500; padding-left: 0; }
details.moredetail > .prose, details.moredetail > .event-grid { margin-left: 0; margin-right: 0; }
dl.defs { padding-left: 0; padding-right: 0; }

.term::after, .info .info-pop { border-radius: 2px; }

/* ── explorer ─────────────────────────────────────────────────────────── */
.search-wrap, .basin-panel { padding-left: 0; padding-right: 0; }
.search-wrap input { border-radius: 0; border-color: var(--ink); background: #fff; }
.dropdown { border-radius: 0; left: 0; right: 0; }
.infocard { background: none; border-radius: 0; border-top: 1px solid var(--ink); padding: 10px 0 6px; }
.infocard .k { font-family: var(--sans); font-size: 12.5px; letter-spacing: 0; text-transform: none; font-weight: 500; }
.infocard .v { font-family: var(--serif); font-weight: 600; }
.chip { border-radius: 2px; letter-spacing: 0; font-weight: 600; }
.holders h5 { font-family: var(--sans); font-size: 14px; letter-spacing: 0; text-transform: none; font-weight: 600; color: var(--ink); }
.holderscroll { border-radius: 0; }
#basin-map, #hydro-map, #overmap-map, .leaflet-container { border-radius: 0; }
.hydrogrid, .ag-grid, .overmap-grid, .hydro-legend { padding-left: 0; padding-right: 0; }
.overmap-count .big { font-family: var(--serif); font-weight: 600; }

/* ── footer ───────────────────────────────────────────────────────────── */
.site-footer { background: var(--plane); border-top: 2px solid var(--ink); }
.site-footer h3 { font-size: 14px; letter-spacing: 0; text-transform: none; font-weight: 600; color: var(--ink); }
.cite { background: none; border: 1px solid var(--rule); border-radius: 0; }

/* ── phones ───────────────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .fig > header, .controls, .fig footer, .basin-panel, .search-wrap { padding-left: 0; padding-right: 0; }
  .reading { margin-left: 0; margin-right: 0; }
  .dropdown { left: 0; right: 0; }
  .hydrogrid, .ag-grid, .overmap-grid, .hydro-legend { padding-left: 0; padding-right: 0; }
  .design-steps { gap: 0; }
}
@media (max-width: 599px) {
  body { font-size: 17.5px; }
  .fig > header, .controls, .fig footer { padding-left: 0; padding-right: 0; }
  .reading { margin-left: 0; margin-right: 0; }
  .plotwrap { padding-left: 0; padding-right: 0; }
  .keynum, .keynum + .keynum { padding-left: 0; border-left: 0; border-top: 1px solid var(--rule); }
  .keynum:first-child { border-top: 0; }
  .keynum .v { font-size: 34px; }
}

/* phone header: short title only, controls on one line and never clipped */
@media (max-width: 599px) {
  .site-header .bar { gap: 10px; padding-left: 16px; padding-right: 16px; }
  .site-header .short-title { font-size: 14px; line-height: 1.3; min-width: 0; }
  .site-header .short-title .sub { display: none; }
  .header-links { gap: 8px; flex: 0 0 auto; }
  .header-links a.pdf { white-space: nowrap; padding: 3px 8px; font-size: 13px; }
  .langswitch { flex: 0 0 auto; }
  .langswitch button { padding: 3px 4px; }
}

/* The three tests (Conflict section) as a numbered list of rows, not three
   feature columns (author, 2026-09-24: "not sure about this layout"). Number,
   question, then the explanation and the link to its figure; hairlines between. */
.design-steps.tests {
  display: block; margin: 26px 0 34px; max-width: 900px;
  border-top: 1px solid var(--ink); border-bottom: 1px solid var(--rule);
}
.design-steps.tests > div {
  display: grid; grid-template-columns: 2em minmax(10em, 12.5em) minmax(0, 1fr);
  column-gap: 18px; align-items: baseline;
  border-top: 1px solid var(--rule); padding: 14px 0 13px;
}
.design-steps.tests > div:first-child { border-top: 0; }
.design-steps.tests span { font-size: 20px; margin: 0; color: var(--ink-muted); }
.design-steps.tests strong { font-size: 18px; line-height: 1.3; }
.design-steps.tests p { margin: 0; font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.design-steps.tests a { white-space: nowrap; font-weight: 500; }
.design-steps.tests a::before { content: "→ "; }
@media (max-width: 599px) {
  .design-steps.tests > div { grid-template-columns: 1.6em minmax(0, 1fr); row-gap: 4px; }
  .design-steps.tests p { grid-column: 2; }
}
