/* Northline Hydrology: shared styles for every page. Quiet, document-like; one accent color, Spectral for headings. */
:root {
  --bg: #F7F7F4;
  --surface: #FFFFFF;
  --ink: #142231;
  --muted: #5A6672;
  --line: #D8DCDB;
  --accent: #2D6A5F;
  --accent-soft: #E3EEEB;
  --display: "Spectral", Georgia, serif;
  --body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #10171C; --surface: #172028; --ink: #E5EBEE; --muted: #9AA7B0; --line: #2B3740; --accent: #77BFAF; --accent-soft: #163029; color-scheme: dark; }
}
:root[data-theme="dark"] { --bg: #10171C; --surface: #172028; --ink: #E5EBEE; --muted: #9AA7B0; --line: #2B3740; --accent: #77BFAF; --accent-soft: #163029; color-scheme: dark; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.6; }
.wrap { max-width: 1080px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
h1, h2, h3 { font-family: var(--display); font-weight: 600; margin: 0; line-height: 1.15; text-wrap: balance; }
h1 { font-size: clamp(2.1rem, 4.6vw, 3.3rem); }
h2 { font-size: clamp(1.5rem, 2.8vw, 2.05rem); }
h3 { font-size: 1.15rem; }
p { margin: 0; }
a { color: var(--accent); }
code { font-family: var(--mono); font-size: 0.9em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.eyebrow { font-size: 0.74rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }

/* masthead */
.mast .wrap { padding-block: 18px; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand b { font-family: var(--display); font-size: 1.25rem; font-weight: 600; }
.nav { display: flex; gap: 22px; flex-wrap: wrap; font-size: 0.93rem; align-items: center; }
.nav a { color: var(--ink); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--accent); font-weight: 600; }
.nav a.btn { color: var(--surface); }
.navm { display: none; position: relative; }
.navm > summary { list-style: none; cursor: pointer; font-size: 0.93rem; }
.navm > summary::-webkit-details-marker { display: none; }
.navm .menu { position: absolute; right: 0; top: calc(100% + 10px); z-index: 30; min-width: 200px; display: grid; gap: 2px; padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,0.12); }
.navm .menu a { padding: 8px 10px; border-radius: 4px; color: var(--ink); text-decoration: none; }
@media (max-width: 760px) { .nav > a:not(.btn) { display: none; } .navm { display: block; } .nav { gap: 14px; flex-wrap: nowrap; } }

/* buttons */
.btn { display: inline-flex; padding: 10px 16px; border-radius: 4px; background: var(--accent); color: var(--surface); text-decoration: none; font-weight: 600; font-size: 0.93rem; border: 1px solid var(--accent); cursor: pointer; font-family: inherit; }
.btn.ghost { background: transparent; color: var(--accent); }
.ctas { display: flex; gap: 12px; flex-wrap: wrap; }

/* page openings */
.hero .wrap { padding-block: 56px 48px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 380px); gap: 48px; align-items: center; }
.hero-graphic { display: block; width: 100%; height: auto; }
.hero .lede, .opening .lede { font-size: 1.15rem; color: var(--muted); max-width: 62ch; margin-top: 18px; }
.hero .ctas { margin-top: 26px; }
.opening .wrap { padding-block: 48px 36px; }
.opening h1 { margin-top: 10px; max-width: 22ch; }

/* sections */
section.band { padding-block: 52px; border-top: 1px solid var(--line); }
section.band > .wrap > header { display: grid; gap: 10px; max-width: 70ch; margin-bottom: 28px; }
section.band > .wrap > header p { color: var(--muted); }
.more { margin-top: 22px; font-weight: 600; font-size: 0.95rem; }

/* four parts of the practice on the home page */
.parts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.part { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 24px; display: grid; gap: 10px; align-content: start; color: var(--ink); text-decoration: none; }
.part:hover { border-color: var(--accent); }
.part p { color: var(--muted); font-size: 0.95rem; }
.part ul { margin: 0; padding-left: 18px; font-size: 0.93rem; display: grid; gap: 3px; }
.part .go { color: var(--accent); font-weight: 600; font-size: 0.92rem; }

/* cards: data sets, tools, notes, reports */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.cards.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 22px; display: grid; gap: 10px; align-content: start; }
.card p { color: var(--muted); font-size: 0.95rem; }
.card ul { margin: 0; padding-left: 18px; font-size: 0.93rem; display: grid; gap: 3px; }
.card h4 { margin: 4px 0 0; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-family: var(--body); }
.card .ctas { margin-top: 4px; }
.card .when { font-size: 0.84rem; color: var(--accent); font-weight: 600; }
.tag { justify-self: start; font-size: 0.74rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; padding: 2px 8px; border-radius: 3px; background: var(--accent-soft); color: var(--accent); }
.links { display: flex; gap: 16px; flex-wrap: wrap; font-size: 0.92rem; font-weight: 600; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 4px 0; }
.stats div { border-top: 2px solid var(--accent); padding-top: 6px; }
.stats b { display: block; font-family: var(--display); font-size: 1.45rem; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stats span { font-size: 0.8rem; color: var(--muted); }
.fine { font-size: 0.85rem; color: var(--muted); }

/* lists of short points */
.covers { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }
.covers.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cover { border-top: 2px solid var(--accent); padding-top: 12px; display: grid; gap: 6px; align-content: start; }
.cover p { font-size: 0.92rem; color: var(--muted); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: start; }
.points { display: grid; gap: 16px; }
.points div { display: grid; gap: 2px; }
.points div p { color: var(--muted); font-size: 0.95rem; }
.plain { margin: 0; padding-left: 20px; display: grid; gap: 8px; max-width: 72ch; }
.plain li { color: var(--muted); }
.plain li b { color: var(--ink); font-weight: 600; }

.scope { color: var(--muted); font-size: 0.92rem; border-left: 2px solid var(--line); padding-left: 16px; max-width: 70ch; }
.callout { margin-top: 24px; background: var(--accent-soft); border-radius: 6px; padding: 18px 20px; max-width: 76ch; }
.copy { display: inline-flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.copy code { user-select: all; }
.copy button { font: 600 0.82rem var(--body); border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 4px; padding: 4px 10px; cursor: pointer; }
footer .wrap { padding-block: 26px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 0.85rem; color: var(--muted); }
footer a { color: var(--muted); }

/* sample viewer: pages of a sample deliverable with place names blacked out, the rest locked (samples/manifest.json) */
dialog.viewer { width: min(860px, 100vw); max-width: 100vw; height: min(92vh, 100%); max-height: 100vh; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); }
dialog.viewer::backdrop { background: rgba(10, 18, 24, 0.6); }
.viewer .vhead { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; gap: 16px; align-items: start; padding: 16px 20px; background: var(--surface); border-bottom: 1px solid var(--line); }
.viewer .vhead h3 { font-size: 1.1rem; }
.viewer .vhead p { font-size: 0.86rem; color: var(--muted); margin-top: 4px; max-width: 62ch; }
.viewer .vclose { flex: none; font: 600 0.9rem var(--body); background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 4px; padding: 6px 12px; cursor: pointer; }
.viewer .pages { display: grid; gap: 18px; padding: 20px; justify-items: center; }
.viewer figure { margin: 0; width: 100%; max-width: 720px; position: relative; }
.viewer figure img { width: 100%; height: auto; display: block; border: 1px solid var(--line); box-shadow: 0 2px 10px rgba(0,0,0,0.08); background: #fff; }
.viewer figcaption { font-size: 0.8rem; color: var(--muted); margin-top: 6px; text-align: center; }
.viewer figure.locked figcaption { position: absolute; left: 0; right: 0; top: 58%; color: #2D6A5F; font-weight: 600; }

@media (max-width: 880px) {
  .hero .wrap, .split { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .hero-graphic { max-width: 300px; margin: 0 auto; }
  .parts, .cards, .cards.three { grid-template-columns: minmax(0, 1fr); }
  .covers, .covers.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .covers, .covers.three { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  dialog.viewer { width: 100vw; height: 100vh; border-radius: 0; }
  .viewer .pages { padding: 12px; gap: 12px; }
}
.parts.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 880px) { .parts.three { grid-template-columns: minmax(0, 1fr); } }

/* the data page's map: Water Ledger's layers and status colors (site/waterledger/<st>/tracker.js) */
:root { --s-active: #1C6B8A; --s-built: #2C7349; --s-paused: #8E5700; --s-ended: #8A989F; --s-nodate: #5B4FA0; --s-unknown: #142231; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --s-active: #63B5D3; --s-built: #74C493; --s-paused: #E3AB4E; --s-ended: #5E707A; --s-nodate: #B3A7EE; --s-unknown: #E4ECEE; } }
:root[data-theme="dark"] { --s-active: #63B5D3; --s-built: #74C493; --s-paused: #E3AB4E; --s-ended: #5E707A; --s-nodate: #B3A7EE; --s-unknown: #E4ECEE; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs button { font: 600 0.9rem var(--body); padding: 8px 14px; border-radius: 4px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: var(--surface); }
.mapbox { position: relative; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--surface); }
#tmap { width: 100%; height: min(560px, 70vh); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 12px; font-size: 0.85rem; color: var(--muted); }
.legend b { color: var(--ink); font-weight: 600; margin-right: 4px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.legend i.sq { border-radius: 2px; opacity: 0.6; }
.legend i.dia { border-radius: 1px; transform: rotate(45deg); width: 9px; height: 9px; }
.maplibregl-popup-content { font: 0.86rem/1.4 var(--body); color: #142231; padding: 10px 12px; }
.maplibregl-popup-content b { display: block; font-weight: 600; }

/* the approvals table on the reports page */
.table-wrap { overflow-x: auto; }
.decisions { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.decisions th, .decisions td { text-align: left; padding: 12px 14px 12px 0; border-top: 1px solid var(--line); vertical-align: top; }
.decisions th { font-size: 0.74rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 600; border-top: 0; }
.decisions td:first-child { font-weight: 600; width: 32%; }
.decisions td:last-child { color: var(--muted); }

/* home page: one row per part of the work, its items in a strip that scrolls sideways */
.row + .row { margin-top: 44px; }
.row-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 14px; }
.row-head a { font-weight: 600; font-size: 0.92rem; text-decoration: none; white-space: nowrap; }
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 290px); gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 10px; scrollbar-width: thin; }
.item { scroll-snap-align: start; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 18px; display: grid; gap: 8px; align-content: start; color: var(--ink); text-decoration: none; }
a.item:hover { border-color: var(--accent); }
.item h3 { font-size: 1.05rem; }
.item p { color: var(--muted); font-size: 0.9rem; line-height: 1.5; }
.item .meta { font-size: 0.8rem; color: var(--accent); font-weight: 600; }
.item.soon { background: transparent; border-style: dashed; }
.item .shot { display: block; width: calc(100% + 36px); margin: -18px -18px 4px; height: 150px; object-fit: cover; object-position: top center; border-bottom: 1px solid var(--line); border-radius: 6px 6px 0 0; background: var(--bg); }
.item .shot.cover { object-position: top center; }
.item.soon .shot { opacity: 0.6; }
.maplibregl-popup.rec .maplibregl-popup-content { padding: 14px 16px 12px; max-height: 360px; overflow-y: auto; }
.maplibregl-popup.rec .pk { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: #5A6672; margin: 0 0 2px; }
.maplibregl-popup.rec b { font-family: var(--display); font-size: 1.05rem; }
.maplibregl-popup.rec .pw { display: block; color: #5A6672; font-size: 0.82rem; margin-bottom: 8px; }
.maplibregl-popup.rec dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; margin: 0 0 10px; font-size: 0.82rem; }
.maplibregl-popup.rec dt { color: #5A6672; }
.maplibregl-popup.rec dd { margin: 0; color: #142231; }
.maplibregl-popup.rec .pc { font-size: 0.8rem; color: #5A6672; border-top: 1px solid #D8DCDB; padding-top: 8px; margin: 0; }
.maplibregl-popup.rec .pc a { color: #2D6A5F; font-weight: 600; }
.maplibregl-popup.rec .maplibregl-popup-close-button { font-size: 18px; padding: 2px 8px; }

/* home page: measured results, each linked to its proof */
section.band.results { padding-block: 34px; }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin-top: 12px; }
.facts a { display: grid; gap: 4px; align-content: start; border-top: 2px solid var(--accent); padding-top: 10px; color: var(--ink); text-decoration: none; }
.facts a:hover span { color: var(--ink); }
.facts b { font-family: var(--display); font-size: 1.7rem; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.facts span { font-size: 0.86rem; color: var(--muted); line-height: 1.45; }
@media (max-width: 880px) { .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* River channel geometry page: a figure on its own white panel (the plots are white in both themes), and references into the write-ups that open the reader */
figure.plot { margin: 26px 0 0; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 14px; }
figure.plot img { width: 100%; height: auto; display: block; }
figure.plot figcaption { font-size: 0.85rem; color: #4A5560; margin-top: 10px; max-width: 80ch; }
button.ref:not(.btn) { font: inherit; color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; text-align: left; }
.viewer .vhead p a { color: var(--accent); }
pre { margin: 12px 0 0; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; overflow-x: auto; font-size: 0.85rem; line-height: 1.5; }
.decisions td.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* "Request" buttons (request.js): a button that reads as a link, in running text and link rows */
button.linkbtn { font: inherit; font-weight: 600; color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; text-align: left; }
.viewer .vbtns { display: flex; gap: 10px; flex: none; align-items: center; }
.viewer .vbtns .btn { padding: 6px 12px; font-size: 0.9rem; }
