/* jacksfork.org — Jacks Fork Press house style, after the print interior:
   black ink on white paper, letterspaced capitals for heads, the double rule
   (heavy over thin) from the plates' frame. Colour lives only in the maps. */

@font-face { font-family: "Bonum"; src: url("/fonts/texgyrebonum-regular.woff") format("woff"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Bonum"; src: url("/fonts/texgyrebonum-italic.woff") format("woff"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Bonum"; src: url("/fonts/texgyrebonum-bold.woff") format("woff"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "LM Caps"; src: url("/fonts/lmromancaps10-regular.woff") format("woff"); font-display: swap; }

:root {
  --ink: #141414;
  --ink-soft: #4a4a4a;
  --rule: #9a9a9a;
  --hair: #d6d6d6;
  --paper: #ffffff;
  --tint: #f6f4ef;        /* the plates' cream, used only behind map images */
  --water: #5e9fd3;       /* the maps' channel blue; used only for focus rings */
  --measure: 40rem;
  --wide: 76rem;
  --body: "Bonum", "Book Antiqua", Palatino, "Palatino Linotype", Georgia, serif;
  --caps: "LM Caps", "Bonum", Georgia, serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--body); font-size: 1.125rem; line-height: 1.55;
  font-variant-numeric: oldstyle-nums;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--water); outline-offset: 2px; }

.spaced { font-family: var(--caps); text-transform: uppercase; letter-spacing: 0.16em; font-variant-numeric: lining-nums; }

/* ---------- masthead ---------- */
.masthead { border-bottom: 1px solid var(--hair); }
.masthead-inner { max-width: var(--wide); margin: 0 auto; padding: 0.9rem 1rem; display: flex; flex-wrap: wrap; gap: 0.6rem 1.5rem; align-items: baseline; justify-content: space-between; }
.wordmark { text-decoration: none; font-family: var(--caps); text-transform: uppercase; letter-spacing: 0.2em; font-size: 0.95rem; }
.wordmark small { display: block; font-size: 0.68rem; letter-spacing: 0.24em; color: var(--ink-soft); }
.nav { display: flex; flex-wrap: wrap; gap: 0.3rem 1.2rem; font-family: var(--caps); text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.78rem; }
.nav a { text-decoration: none; padding: 0.2rem 0; border-bottom: 1px solid transparent; }
.nav a:hover, .nav a[aria-current="page"] { border-bottom-color: var(--ink); }

/* ---------- page ---------- */
.page { max-width: var(--wide); margin: 0 auto; padding: 2.2rem 1rem 1rem; }
.prose { max-width: var(--measure); }
.prose p { margin: 0 0 0.9em; hyphens: auto; }
.crumbs { font-size: 0.72rem; color: var(--ink-soft); margin-bottom: 1.4rem; }
.crumbs a { text-decoration: none; }
.crumbs span + span::before { content: "  ›  "; white-space: pre; }

.unit-label { font-size: 0.8rem; margin: 0 0 0.4rem; color: var(--ink-soft); }
.unit-title { font-family: var(--caps); text-transform: uppercase; letter-spacing: 0.12em; font-weight: 400; font-size: clamp(1.6rem, 4.5vw, 2.6rem); line-height: 1.15; margin: 0 0 0.6rem; font-variant-numeric: lining-nums; }
.deck { font-style: italic; color: var(--ink-soft); margin: 0.6rem 0 1.6rem; max-width: var(--measure); }
hr.double { border: 0; height: 6px; margin: 0 0 1.2rem; background:
  linear-gradient(var(--ink), var(--ink)) top / 100% 2.5px no-repeat,
  linear-gradient(var(--ink), var(--ink)) bottom / 100% 0.75px no-repeat; }
h2 { font-family: var(--caps); text-transform: uppercase; letter-spacing: 0.14em; font-weight: 400; font-size: 1.05rem; margin: 2.2rem 0 0.8rem; padding-top: 0.6rem; border-top: 1px solid var(--hair); font-variant-numeric: lining-nums; }
h3 { font-weight: 700; font-size: 1.1rem; margin: 1.6rem 0 0.4rem; }

/* ---------- maps and figures ---------- */
figure.plate { margin: 1.6rem 0; background: var(--tint); padding: 0.6rem; }
figure.plate.portrait { max-width: calc(760px + 1.2rem); }
figure.plate figcaption { font-size: 0.82rem; padding-top: 0.5rem; }
figure.plate figcaption .spaced { margin-right: 0.6em; }
.map-hot { position: relative; }
.map-hot a.hot { position: absolute; display: block; border: 1.5px solid transparent; }
.map-hot a.hot:hover, .map-hot a.hot:focus-visible { border-color: var(--ink); background: rgba(255,255,255,0.18); }

/* down-the-river navigation */
.river-nav { display: grid; grid-template-columns: 1fr auto 1fr; gap: 0.8rem; align-items: center; margin: 2.4rem 0 0; padding: 0.8rem 0; border-top: 2.5px solid var(--ink); border-bottom: 0.75px solid var(--ink); font-size: 0.95rem; }
.river-nav .up { text-align: left; } .river-nav .down { text-align: right; } .river-nav .here { text-align: center; font-size: 0.72rem; color: var(--ink-soft); }
.river-nav a { text-decoration: none; }
.river-nav small { display: block; font-size: 0.68rem; color: var(--ink-soft); }

.notice { border: 1px solid var(--rule); padding: 1rem 1.2rem; max-width: var(--measure); margin: 1.4rem 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1rem; margin: 1.4rem 0; }
.card { border-top: 2.5px solid var(--ink); padding-top: 0.6rem; }
.card h3 { margin-top: 0; font-weight: 400; font-family: var(--caps); text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.95rem; }
.card p { margin: 0; font-size: 0.98rem; }

/* ---------- reader box ---------- */
.reader-box { max-width: var(--wide); margin: 3rem auto 0; padding: 0 1rem; }
.reader-box form { border-top: 2.5px solid var(--ink); border-bottom: 0.75px solid var(--ink); padding: 1.2rem 0 1.4rem; max-width: var(--measure); }
.reader-box h2 { border: 0; margin: 0 0 0.3rem; padding: 0; }
.reader-box .lede { margin: 0 0 1rem; font-style: italic; color: var(--ink-soft); }
.reader-box fieldset { border: 0; padding: 0; margin: 0 0 0.9rem; }
.reader-box legend { font-size: 0.85rem; margin-bottom: 0.3rem; padding: 0; }
.checks { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; }
.checks label, .agree label { display: flex; gap: 0.45rem; align-items: baseline; font-size: 0.98rem; }
.reader-box textarea, .reader-box input[type=text], .reader-box input[type=email] {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink); background: #fff;
  border: 1px solid var(--rule); border-radius: 0; padding: 0.55rem 0.65rem; }
.reader-box textarea { min-height: 8rem; resize: vertical; }
.reader-box .row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; margin-bottom: 0.9rem; }
.reader-box .row label, .reader-box .file label { font-size: 0.85rem; display: block; margin-bottom: 0.2rem; }
.reader-box .file { margin: 0.9rem 0; font-size: 0.95rem; }
.reader-box .hint { font-size: 0.8rem; color: var(--ink-soft); margin: 0.2rem 0 0; }
.agree { margin: 0.9rem 0 1rem; display: grid; gap: 0.35rem; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
button.send { font-family: var(--caps); text-transform: uppercase; letter-spacing: 0.16em; font-size: 0.85rem; background: var(--ink); color: #fff; border: 0; padding: 0.75rem 1.4rem; cursor: pointer; }
button.send[disabled] { opacity: 0.55; cursor: progress; }
.status { margin: 0.8rem 0 0; font-size: 0.95rem; }
.status.bad { font-weight: 700; }
@media (max-width: 34rem) { .reader-box .row { grid-template-columns: 1fr; } }

/* ---------- footer ---------- */
.site-foot { max-width: var(--wide); margin: 2rem auto 0; padding: 1.2rem 1rem 2.4rem; font-size: 0.85rem; color: var(--ink-soft); }
.survey-strip { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.6rem 1.4rem; align-items: baseline; padding: 0.9rem 0; border-top: 0.75px solid var(--ink); border-bottom: 0.75px solid var(--ink); color: var(--ink); font-size: 1rem; }
.survey-strip a { font-family: var(--caps); text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.8rem; white-space: nowrap; }
.foot-links { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; margin-top: 0.9rem; }

/* ---------- book pages ---------- */
.text { max-width: var(--measure); }
.text p { margin: 0 0 0.9em; hyphens: auto; }
.text h3 { margin-top: 2rem; scroll-margin-top: 1rem; }
.text h2 { scroll-margin-top: 1rem; }
.text ul, .text ol { padding-left: 1.3rem; }
.text li { margin-bottom: 0.35em; }
.text blockquote { margin: 1rem 0 1rem 1.2rem; font-style: italic; }
p.entry-deck { font-size: 0.9rem; color: var(--ink-soft); margin-top: -0.2rem; }
hr.short { border: 0; border-top: 0.75px solid var(--ink); width: 5rem; margin: 1.6rem auto; }
a.xref { text-decoration-style: dotted; }
.text figure, .page > figure { max-width: none; }
figure.plate.spread { max-width: calc(1200px + 1.2rem); }
figure.plate.portrait, figure.plate.stretch, figure.plate.stretch-card { max-width: calc(760px + 1.2rem); }
figure.plate.stretch-card { margin: 1.4rem 0; }
.pair-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
.pair-cap { font-size: 0.82rem; margin: 0.4rem 0 0; }
figure.chart { margin: 1.6rem 0; max-width: 760px; }
figure.chart.column { max-width: 380px; }
figure.chart figcaption { font-size: 0.8rem; color: var(--ink-soft); padding-top: 0.35rem; }
figure.chart figcaption .spaced { margin-right: 0.6em; color: var(--ink); }
.table-wrap { overflow-x: auto; margin: 1.6rem 0; max-width: 100%; }
.table-wrap table { border-collapse: collapse; font-size: 0.85rem; font-variant-numeric: lining-nums tabular-nums; min-width: 32rem; }
.table-wrap caption { text-align: left; padding-bottom: 0.4rem; font-size: 0.9rem; }
.table-wrap th { text-align: left; font-weight: 400; font-style: italic; border-top: 1.5px solid var(--ink); border-bottom: 0.75px solid var(--ink); padding: 0.35rem 0.6rem 0.35rem 0; vertical-align: bottom; }
.table-wrap td { padding: 0.3rem 0.6rem 0.3rem 0; vertical-align: top; border-bottom: 1px solid var(--hair); }
.table-wrap tbody tr:last-child td { border-bottom: 1.5px solid var(--ink); }
.table-note { font-size: 0.8rem; color: var(--ink-soft); margin-top: 0.4rem; }
.text.notes, .text.biblio, .text.gazetteer, .text.entries, .text.chrono { font-size: 0.95rem; }
p.hang { padding-left: 1.4rem; text-indent: -1.4rem; margin: 0 0 0.55em; }
p.note-head { margin: 1.1rem 0 0.3rem; }
ul.notes { list-style: none; padding-left: 0; }
ul.notes li { padding-left: 1.2rem; text-indent: -1.2rem; }
details.unit-notes { max-width: var(--measure); margin: 2.4rem 0 0; border-top: 2.5px solid var(--ink); padding-top: 0.6rem; }
details.unit-notes summary { cursor: pointer; font-size: 0.85rem; padding: 0.4rem 0; }
details.unit-notes .text { font-size: 0.88rem; }

/* contents */
.toc h2 a { text-decoration: none; }
ol.toc-units { list-style: none; padding: 0; margin: 0 0 1rem; max-width: var(--measure); }
ol.toc-units li { padding: 0.45rem 0; border-bottom: 1px solid var(--hair); }
ol.toc-units a { text-decoration: none; }
ol.toc-units .spaced { font-size: 0.72rem; margin-right: 0.5em; }
ol.toc-units em { font-size: 0.9rem; color: var(--ink-soft); }
.toc-front { margin: 1rem 0; }
ul.map-list { list-style: none; padding: 0; columns: 2 18rem; max-width: var(--wide); }
ul.map-list li { padding: 0.3rem 0; break-inside: avoid; }
ul.map-list a { text-decoration: none; }
ul.map-list .spaced { font-size: 0.72rem; margin-right: 0.4em; }

/* stretch guide */
.stretch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1.2rem; margin: 1rem 0 2rem; }
a.stretch-tile { text-decoration: none; display: block; border-top: 2.5px solid var(--ink); padding-top: 0.5rem; }
a.stretch-tile img { background: var(--tint); }
a.stretch-tile > span { display: block; padding-top: 0.4rem; font-size: 0.98rem; line-height: 1.3; }
a.stretch-tile .spaced { font-size: 0.7rem; margin-right: 0.35em; }
a.stretch-tile small { display: block; color: var(--ink-soft); font-size: 0.8rem; }
a.stretch-tile:hover > span { text-decoration: underline; }
a.start { font-family: var(--caps); text-transform: uppercase; letter-spacing: 0.16em; font-size: 0.85rem; background: var(--ink); color: #fff; text-decoration: none; padding: 0.7rem 1.2rem; display: inline-block; }

/* clickable map areas */
.map-hot { position: relative; }
.map-hot svg.hot { position: absolute; inset: 0; width: 100%; height: 100%; }
.map-hot svg.hot polygon { fill: rgba(255,255,255,0); stroke: transparent; stroke-width: 3; vector-effect: non-scaling-stroke; cursor: pointer; transition: fill .15s; }
.map-hot svg.hot a:hover polygon, .map-hot svg.hot a:focus polygon { fill: rgba(94,159,211,0.18); stroke: var(--ink); }
@media (hover: none) { .map-hot svg.hot polygon { fill: rgba(94,159,211,0.07); } }

/* home: the watershed alone, the title set in its empty corners */
.hero-ws { max-width: var(--wide); margin: 0 auto; padding: 1.6rem 1rem 0; }
.hero-art { position: relative; }
.hero-art img { width: 100%; height: auto; }
.hero-title { position: absolute; left: 0; top: 2%; width: 46%; }
.hero-title .unit-title { font-size: clamp(1.6rem, 3.6vw, 3.1rem); margin: 0; }
.hero-title .unit-label { margin-bottom: 0.3rem; }
.hero-sub { margin: 0.5rem 0 0; font-size: clamp(0.75rem, 1.2vw, 1rem); color: var(--ink-soft); }
.hero-deck { position: absolute; right: 0; bottom: 2%; width: 36%; margin: 0; font-style: italic; color: var(--ink-soft); font-size: clamp(0.85rem, 1.25vw, 1.05rem); line-height: 1.45; text-align: right; }
.hero-ws + .page { padding-top: 0.6rem; }
h2.home-h { border-top: 0; margin-top: 1.4rem; padding-top: 0; }
@media (max-width: 52rem) {
  .hero-title, .hero-deck { position: static; width: auto; text-align: left; }
  .hero-art { display: flex; flex-direction: column; }
  .hero-title { order: -1; margin-bottom: 0.6rem; }
  .hero-deck { margin-top: 0.4rem; }
}

/* about me */
.photo-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.8rem; margin: 0 0 2rem; max-width: 76rem; }
.photo-grid figure { margin: 0; }
.photo-grid img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 16 / 10; }
@media (max-width: 34rem) { .photo-grid { grid-template-columns: 1fr; } }

/* names in the stretch guide that lead into the book */
a.topic { text-decoration-color: var(--water); text-decoration-thickness: 1.5px; }
a.topic:hover { text-decoration-color: var(--ink); }
aside.more-in-book { max-width: var(--measure); margin: 2rem 0 0; border-top: 2.5px solid var(--ink); padding-top: 0.4rem; }
aside.more-in-book h2 { border: 0; margin: 0.4rem 0 0.6rem; padding: 0; }
aside.more-in-book ul { list-style: none; padding: 0; margin: 0; }
aside.more-in-book li { padding: 0.3rem 0; border-bottom: 1px solid var(--hair); }
aside.more-in-book .hint { font-size: 0.85rem; color: var(--ink-soft); }

/* notes beside their phrases, glossary words on tap */
button.nm { font: inherit; font-family: var(--caps); font-size: 0.62em; line-height: 1; vertical-align: super; color: var(--water); background: none; border: 0; padding: 0 0.1em; margin: 0 0 0 0.05em; cursor: pointer; font-variant-numeric: lining-nums; }
button.nm:hover, button.nm[aria-expanded="true"] { color: var(--ink); text-decoration: underline; }
button.gl { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: help; text-decoration: underline dotted var(--rule); text-decoration-thickness: 1.5px; text-underline-offset: 0.2em; }
button.gl:hover, button.gl[aria-expanded="true"] { text-decoration-color: var(--ink); }
div.pop { position: absolute; z-index: 50; background: #fff; color: var(--ink); border: 1px solid var(--ink); border-top: 2.5px solid var(--ink); box-shadow: 0 6px 18px rgba(0,0,0,0.12); padding: 0.7rem 0.85rem; font-size: 0.9rem; line-height: 1.45; }
div.pop.pop-gl { border-top-color: var(--water); }
div.pop a.pop-more { display: inline-block; margin-top: 0.3rem; font-size: 0.82rem; }
span.gz-links { font-size: 0.85rem; color: var(--ink-soft); }
