/* wovoka.org: one stylesheet for every page. */
:root {
  --paper: #f6f2ea;
  --paper-2: #ece6da;
  --ink: #23201c;
  --ink-2: #5a544b;
  --rule: #d6cdbd;
  --accent: #7a4a2a;
  --accent-2: #4f5d3f;
  --measure: 40rem;
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Inter Tight', -apple-system, 'Segoe UI', sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1b1916;
    --paper-2: #24211d;
    --ink: #ece6da;
    --ink-2: #b3aa9c;
    --rule: #3a352e;
    --accent: #d9a27a;
    --accent-2: #a9b893;
  }
}
:root[data-theme="dark"] {
  --paper: #1b1916; --paper-2: #24211d; --ink: #ece6da; --ink-2: #b3aa9c;
  --rule: #3a352e; --accent: #d9a27a; --accent-2: #a9b893;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 18px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
[hidden] { display: none !important; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Header */
.top {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.top-in {
  max-width: 72rem; margin: 0 auto; padding: .7rem 16px;
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.mark { font: 600 1.25rem/1 var(--serif); color: var(--ink); text-decoration: none; letter-spacing: -.01em; }
.nav { display: flex; gap: 1.1rem; flex-wrap: wrap; font-size: .9rem; }
@media (max-width: 30rem) { .nav { row-gap: .35rem; } }
.nav a { color: var(--ink-2); text-decoration: none; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; }

/* Hero */
.hero { position: relative; color: #faf6ee; background: #2b2722; }
.hero img { width: 100%; height: min(64vh, 40rem); object-fit: cover; object-position: 50% 88%; opacity: .92; }
.hero-text {
  position: absolute; inset: auto 0 0 0; padding: 4rem 16px 2.2rem;
  background: linear-gradient(180deg, rgba(28,24,20,0) 0%, rgba(28,24,20,.78) 70%);
}
.hero-text > * { max-width: 72rem; margin-left: auto; margin-right: auto; }
.hero h1 { font: 600 clamp(3rem, 11vw, 7rem)/.95 var(--serif); letter-spacing: -.02em; margin: 0 auto; }
.hero .sub { font-size: clamp(1rem, 2.4vw, 1.25rem); margin-top: .8rem; opacity: .95; }
.hero .credit { font-size: .78rem; opacity: .75; margin-top: 1.2rem; }

/* Page head (pages without a hero) */
.page-head { max-width: var(--measure); margin: 0 auto; padding: 3.5rem 16px 1rem; }
.page-head h1 { font: 600 clamp(2.2rem, 7vw, 3.6rem)/1.05 var(--serif); margin: 0 0 .8rem; letter-spacing: -.015em; }
.page-head p { color: var(--ink-2); font-size: 1.1rem; margin: 0; }

/* Long-form text */
.prose { max-width: var(--measure); margin: 0 auto; padding: 0 16px; }
.prose > section { padding-top: 3rem; }
.prose h2 { font: 600 clamp(1.6rem, 4.5vw, 2.2rem)/1.15 var(--serif); margin: 0 0 1rem; letter-spacing: -.01em; }
.prose h3 { font: 600 1.25rem/1.3 var(--serif); margin: 2rem 0 .5rem; }
.prose p { margin: 0 0 1.1rem; }
.lede { font: 400 clamp(1.2rem, 3vw, 1.45rem)/1.5 var(--serif); padding-top: 2.5rem; }
.kicker { font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); margin: 0 0 .4rem; }
.src { font-size: .78em; color: var(--ink-2); }
.src a { color: inherit; }
blockquote {
  margin: 1.6rem 0; padding: .2rem 0 .2rem 1.2rem;
  border-left: 3px solid var(--accent);
  font: 400 1.18rem/1.5 var(--serif);
}
blockquote p { margin: 0 0 .5rem; }
blockquote footer { font: .85rem/1.4 var(--sans); color: var(--ink-2); }
.note {
  background: var(--paper-2); border-radius: 6px; padding: 1rem 1.2rem; font-size: .95rem; color: var(--ink-2);
  margin: 1.5rem 0;
}
.note p:last-child { margin-bottom: 0; }
.toc { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 1rem 0; margin-top: 2rem; font-size: .95rem; }
.toc ol { margin: 0; padding-left: 1.3rem; columns: 2 14rem; column-gap: 2rem; }
.toc li { margin: .15rem 0; }
.fig { margin: 2rem 0; }
.fig figcaption { font-size: .82rem; color: var(--ink-2); margin-top: .5rem; }
.next { margin: 3rem 0 0; padding-top: 1.5rem; border-top: 1px solid var(--rule); }

/* Timeline */
.tl { max-width: 52rem; margin: 0 auto; padding: 0 16px; }
.tl-filter { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.5rem 0 2rem; }
.tl-filter button {
  font: 500 .85rem/1 var(--sans); padding: .55rem .8rem; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--rule); background: transparent; color: var(--ink-2);
}
.tl-filter button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.tl-era { font: 600 1.5rem/1.2 var(--serif); margin: 2.5rem 0 1rem; padding-top: 1rem; border-top: 1px solid var(--rule); }
.tl-list { list-style: none; margin: 0; padding: 0; }
.tl-item { display: grid; grid-template-columns: 7.5rem 1fr; gap: 1rem; padding: .85rem 0; border-bottom: 1px dotted var(--rule); }
.tl-date { font: 600 .95rem/1.4 var(--serif); color: var(--accent); }
.tl-body p { margin: 0; }
.tl-body .src { display: block; margin-top: .25rem; white-space: normal; }
.tag { display: inline-block; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-2); margin-right: .5rem; }
@media (max-width: 34rem) {
  .tl-item { grid-template-columns: 1fr; gap: .2rem; }
}

/* Library */
.lib { max-width: 52rem; margin: 0 auto; padding: 0 16px; }
.lib h2 { font: 600 1.5rem/1.2 var(--serif); margin: 3rem 0 1rem; padding-top: 1rem; border-top: 1px solid var(--rule); }
.book { padding: 1rem 0; border-bottom: 1px dotted var(--rule); scroll-margin-top: 5rem; }
.book h3 { font: 600 1.12rem/1.35 var(--serif); margin: 0 0 .2rem; }
.book .meta { color: var(--ink-2); font-size: .9rem; margin: 0 0 .5rem; }
.book p { margin: 0 0 .5rem; }
.book .links { font-size: .9rem; }
.book .links a { margin-right: 1rem; }

/* Footer */
.foot { margin-top: 5rem; border-top: 1px solid var(--rule); background: var(--paper-2); }
.foot-in { max-width: 72rem; margin: 0 auto; padding: 2rem 16px 3rem; font-size: .88rem; color: var(--ink-2); display: grid; gap: 1rem; }
.foot-in p { margin: 0; max-width: 46rem; }
.foot a { color: inherit; }

@media print {
  .top, .tl-filter { display: none; }
  .hero img { height: auto; }
  body { background: #fff; color: #000; }
}

/* Map */
.map { width: 100%; height: auto; display: block; }
.map-states path { fill: var(--paper-2); stroke: var(--rule); stroke-width: 1; }
.map-arrows path { fill: none; stroke: var(--accent); stroke-width: 1.6; opacity: .85; }
.map-ah { fill: var(--accent); }
.map-dots circle { fill: var(--accent-2); }
.map-src circle { fill: var(--accent); stroke: var(--paper); stroke-width: 2; }
.map-wk circle { fill: none; stroke: var(--ink); stroke-width: 1.6; }
.map-wk .map-wk-c { fill: var(--ink); stroke: none; }
.map-l { font: 600 17px/1 var(--sans); fill: var(--ink); }
.map-s { font-weight: 400; font-size: 14.5px; fill: var(--ink-2); }
.map-small { font-weight: 400; font-size: 11.5px; fill: var(--ink-2); }
.map-strong { font-size: 18px; }

/* Story page */
.lede { padding-top: 2.5rem; margin-bottom: 1rem; }
.lede-2 { font: 400 1.15rem/1.6 var(--serif); }
.in-short { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: .75rem; margin: 2rem 0 1rem; }
.in-short a {
  display: block; padding: 1rem 1.1rem; border-radius: 8px; background: var(--paper-2);
  color: var(--ink-2); text-decoration: none; font-size: .95rem; line-height: 1.45;
  border: 1px solid transparent;
}
.in-short a:hover { border-color: var(--accent); }
.in-short .n { display: block; font: 600 1.2rem/1.2 var(--serif); color: var(--accent); margin-bottom: .3rem; }
.prose > section { padding-top: 3.5rem; }
.prose h2 { font-size: clamp(1.9rem, 5.5vw, 2.6rem); }
blockquote.pull { border-left: 0; padding: 0; margin: 2rem 0; font-size: clamp(1.3rem, 3.4vw, 1.55rem); line-height: 1.4; color: var(--accent); }
blockquote.pull p::before { content: "\201C"; }
blockquote.pull p::after { content: "\201D"; }
blockquote.pull.big { font-size: clamp(1.35rem, 3.6vw, 1.7rem); }
blockquote.pull footer { color: var(--ink-2); margin-top: .5rem; }
q { font-style: italic; }
blockquote.song { border-left: 2px solid var(--accent); padding: .2rem 0 .2rem 1.2rem; margin: 1.5rem 0; font: italic 1.15rem/1.55 var(--serif); }
blockquote.song p:last-child { margin-bottom: 0; }
blockquote.song p[lang] { font-style: normal; color: var(--ink-2); font-size: 1rem; margin-bottom: .8rem; }
.sources { font-size: .8rem; color: var(--ink-2); margin-top: 1.5rem !important; padding-top: .6rem; border-top: 1px dotted var(--rule); }
.sources a { color: inherit; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1rem; margin: 2rem 0; }
.stat { background: var(--paper-2); border-radius: 8px; padding: 1.1rem 1.2rem; font-size: .95rem; color: var(--ink-2); line-height: 1.5; }
.stat .big { display: block; font: 600 clamp(1.7rem, 5vw, 2.2rem)/1.1 var(--serif); color: var(--ink); margin-bottom: .4rem; letter-spacing: -.01em; }
.teaching { list-style: none; padding: 0; margin: 1.2rem 0 1.5rem; display: grid; gap: .6rem; }
.teaching li { padding: .8rem 1rem; border-left: 3px solid var(--accent-2); background: var(--paper-2); border-radius: 0 6px 6px 0; }
.map-fig { margin: 2rem 0; }
@media (min-width: 52rem) { .map-fig { margin-left: -4rem; margin-right: -4rem; } }
@media (max-width: 34rem) {
  .map-l { font-size: 23px; }
  .map-strong { font-size: 24px; }
  .map-s { display: none; }
}

/* Vanishing map (map.html) */
.vm { max-width: min(72rem, calc(72vh * 3800 / 3210 + 32px)); margin: 1.5rem auto 0; padding: 0 16px; scroll-margin-top: 4rem; }
.vm-frame {
  position: relative; overflow: hidden; aspect-ratio: 3800 / 3210;
  background: var(--paper-2); border: 1px solid var(--rule); border-radius: 6px;
}
.vm-stage { position: absolute; inset: 0; transform-origin: 0 0; transition: transform .9s cubic-bezier(.4, 0, .2, 1); will-change: transform; }
.vm-layer { position: absolute; inset: 0; width: 100%; height: 100%; }
.vm-layer + .vm-layer { opacity: 0; }
.vm-year {
  position: absolute; left: 12px; bottom: 12px; margin: 0; padding: .2rem .7rem;
  font: 600 clamp(1.3rem, 4vw, 2.2rem)/1.2 var(--serif); color: #faf6ee; background: rgba(43, 39, 34, .85); border-radius: 4px;
  pointer-events: none;
}
.vm-controls { display: grid; gap: .6rem; margin-top: .9rem; }
.vm-years, .vm-places { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.vm-places { margin-top: .9rem; }
.vm-label { font-size: .85rem; color: var(--ink-2); margin-right: .2rem; }
.vm button, .vm-show {
  font: 500 .88rem/1 var(--sans); padding: .6rem .9rem; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--rule); background: transparent; color: var(--ink-2);
}
.vm button:hover, .vm-show:hover { border-color: var(--accent); color: var(--ink); }
.vm button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.vm-years button[data-v] { font-family: var(--serif); font-weight: 600; font-size: 1rem; }
.vm .vm-play { margin-left: auto; }
.vm-range { width: 100%; accent-color: var(--accent); margin: 0; }
.vm figcaption { font-size: .9rem; color: var(--ink-2); margin-top: .8rem; max-width: 46rem; }
.vm-place-text { display: block; color: var(--ink); margin-bottom: .3rem; }
.vm-credit { display: block; font-size: .8rem; }
.vm-show { margin-top: .2rem; }
.prov { width: 100%; border-collapse: collapse; font-size: .88rem; margin: 1.2rem 0; }
.prov caption { text-align: left; font-weight: 600; margin-bottom: .4rem; }
.prov th, .prov td { text-align: left; vertical-align: top; padding: .6rem .5rem .6rem 0; border-top: 1px solid var(--rule); }
.prov tbody th { font: 600 1rem/1.4 var(--serif); color: var(--accent); white-space: nowrap; }
.prov .hash { display: block; margin-top: .3rem; font-size: .72rem; color: var(--ink-2); word-break: break-all; }
.see-map { margin: 1.5rem 0; }
@media (max-width: 34rem) {
  .prov thead { display: none; }
  .prov tr { display: grid; grid-template-columns: 1fr; border-top: 1px solid var(--rule); padding: .4rem 0; }
  .prov th, .prov td { border: 0; padding: .2rem 0; }
  .vm .vm-play { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) { .vm-stage { transition: none; } }

/* Buffalo page chart */
.chart-svg { width: 100%; height: auto; display: block; }
.chart-svg .bar { fill: var(--accent); }
.chart-svg .grid { stroke: var(--rule); stroke-width: 1; }
.chart-svg .val { font: 600 15px/1 var(--sans); fill: var(--ink); }
.chart-svg .yr { font: 600 15px/1 var(--sans); fill: var(--ink-2); }
.chart-svg .ax { font: 400 12px/1 var(--sans); fill: var(--ink-2); }

/* Infographics: chart titles, stat tiles, unit grid */
.chart-title { font: 600 1.15rem/1.3 var(--serif); color: var(--ink); margin: 0 0 .35rem; }
.chart-note { font-size: .92rem; line-height: 1.5; color: var(--ink-2); margin: 0 0 .9rem; }
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; margin: .5rem 0 1.75rem; }
.tile, .prose .tile { margin: 0; background: var(--paper-2); border-radius: 8px; padding: .9rem 1rem; border-top: 3px solid var(--rule); }
.tile b { display: block; font: 600 1.55rem/1.1 var(--serif); color: var(--ink); }
.tile span { display: block; margin-top: .3rem; font-size: .85rem; line-height: 1.4; color: var(--ink-2); }
.tile.hl { border-top-color: var(--accent); }
.tile.hl b { color: var(--accent); }
.unit-svg { width: 100%; height: auto; display: block; }
.unit-svg .u-sq { fill: var(--ink-2); opacity: .45; }
.unit-svg .u-one { fill: var(--accent); }
.unit-key { font-size: .82rem; color: var(--ink-2); margin: .6rem 0 0; }
.unit-key .k { display: inline-block; width: .7rem; height: .7rem; border-radius: 2px; vertical-align: -.05rem; margin: 0 .3rem 0 0; }
.unit-key .k-sq { background: var(--ink-2); opacity: .45; }
.unit-key .k-one { background: var(--accent); margin-left: .9rem; }

/* Before and after (home page) */
.then-now { margin: 2.5rem 0 1rem; padding: 1.5rem 0 0; border-top: 1px solid var(--rule); }
.then-now h2 { margin-top: 0; }
.tn { margin: 1.25rem 0 0; }
.tn-head { display: none; }
.tn-row { padding: 1rem 0; border-top: 1px solid var(--rule); }
.tn-row dt { font: 600 1.15rem/1.3 var(--serif); color: var(--ink); margin-bottom: .5rem; }
.tn-row dd { margin: 0; font-size: .95rem; line-height: 1.5; }
.tn-b { color: var(--ink-2); }
.tn-a { color: var(--ink); margin-top: .5rem !important; padding-left: .75rem; border-left: 3px solid var(--accent); }
.tn-l { display: block; font: 600 .7rem/1.4 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.tn-a .tn-l { color: var(--accent); }
@media (min-width: 40rem) {
  .tn-head, .tn-row { display: grid; grid-template-columns: 7.5rem 1fr 1fr; gap: 1.25rem; }
  .tn-head { font: 600 .72rem/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); margin-top: 1.25rem; }
  .tn-head span:last-child { color: var(--accent); }
  .tn { margin-top: .5rem; }
  .tn-row dt { margin: 0; font-size: 1.05rem; }
  .tn-a { margin-top: 0 !important; }
  .tn-l { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}

/* Playable herd map (buffalo page; assets/herds.js) */
/* Buffalo range map (buffalo.html): the playable version of Hornaday's 1889 map. Built by assets/herds.js. */
.herds {
  --hb-alive: #9c6136;
  --hb-red: #c4432a;
  --hb-blue: #2c6a92;
  --hb-green: #2f7a3a;
  --hb-halo: var(--paper-2);
  margin: 2rem 0;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .herds {
    --hb-alive: #c98e5c; --hb-red: #f07a5d; --hb-blue: #82b6dc; --hb-green: #8ccc8d;
  }
}
:root[data-theme="dark"] .herds { --hb-alive: #c98e5c; --hb-red: #f07a5d; --hb-blue: #82b6dc; --hb-green: #8ccc8d; }
@media (min-width: 52rem) { .herds { margin-left: -4rem; margin-right: -4rem; } }

/* Without JavaScript (or until the data loads) the static map shows; once live, it gives way. */
.herds.is-live .herds-fallback { display: none; }
.herds:not(.is-live) .herds-live-only { display: none; }
.herds.is-live .herds-static-only { display: none; }

.herds-frame {
  position: relative; overflow: hidden;
  max-width: max(20rem, calc((100vh - 15rem) * 800 / 737)); margin: 0 auto;
  border: 1px solid var(--rule); border-radius: 6px; background: var(--paper);
}
.herds-map { display: block; width: 100%; height: auto; font-family: var(--sans); }

.hb-water { fill: var(--paper); }
.hb-land { fill: var(--paper-2); stroke: var(--rule); stroke-width: 1; }
.hb-lakes { fill: var(--paper); stroke: var(--rule); stroke-width: .6; }
.hb-admin { fill: none; stroke: var(--rule); stroke-width: .7; }
.hb-borders { fill: none; stroke: var(--ink-2); stroke-width: .8; stroke-dasharray: 4 3; opacity: .55; }

/* Cells are opaque and the group carries the transparency, so shared edges leave no seams. */
.hb-cells { opacity: .42; }
.hb-cell { fill: var(--hb-alive); stroke: var(--hb-alive); stroke-width: 1.5; transition: opacity .35s linear; }
.hb-range { fill: none; stroke: var(--hb-red); stroke-width: 2.4; stroke-linejoin: round; opacity: .9; }
.hb-ab { fill: none; stroke: var(--hb-red); stroke-width: 1.4; stroke-dasharray: 7 5; opacity: .7; }

.hb-herd { opacity: 0; stroke-width: 2.6; stroke-linejoin: round; transition: opacity .5s ease, fill-opacity .5s ease; }
.hb-herd.is-on { opacity: 1; fill-opacity: .14; }
.hb-herd.is-past { opacity: .5; fill-opacity: 0; stroke-width: 1.2; }
.hb-h1870 { fill: var(--hb-blue); stroke: var(--hb-blue); }
.hb-h1875 { fill: var(--hb-blue); stroke: var(--hb-blue); stroke-dasharray: 9 4; stroke-width: 3; }
.hb-h1880 { fill: var(--hb-green); stroke: var(--hb-green); }
.hb-h1884 { fill: var(--hb-blue); stroke: var(--hb-blue); stroke-dasharray: .1 5; stroke-linecap: round; stroke-width: 3.6; }
.hb-h1884.is-on { fill-opacity: .25; }

.hb-places circle { fill: var(--ink-2); }
.hb-places text { font-size: 13px; font-style: italic; fill: var(--ink-2); paint-order: stroke; stroke: var(--paper-2); stroke-width: 3px; stroke-linejoin: round; }

.hb-date circle { fill: var(--hb-red); opacity: .8; transition: opacity .3s; }
.hb-date text {
  font-size: 15px; font-weight: 600; text-anchor: middle; fill: var(--hb-red);
  paint-order: stroke; stroke: var(--hb-halo); stroke-width: 3px; stroke-linejoin: round;
  opacity: 0; transition: opacity .3s;
}
.hb-date.is-now text { opacity: 1; }
.hb-date.is-past text { opacity: .55; }
.hb-date.is-past circle { opacity: .45; }
.hb-dates.is-dim .hb-date text { opacity: .28; }
.hb-dates.is-dim .hb-date circle { opacity: .25; }

.hb-counts { opacity: 0; transition: opacity .6s ease; }
.hb-counts.is-on { opacity: 1; }
.hb-count circle { fill: var(--hb-green); stroke: var(--paper); stroke-width: 1.5; }
.hb-count-protected circle, .hb-count-estimated circle { fill: none; stroke: var(--hb-green); stroke-width: 2.4; }
.hb-count text {
  font-size: 19px; font-weight: 600; fill: var(--hb-green);
  paint-order: stroke; stroke: var(--hb-halo); stroke-width: 4px; stroke-linejoin: round;
}

.herds-year {
  position: absolute; right: 10px; top: 10px; margin: 0; padding: .15rem .65rem;
  font: 600 clamp(1.3rem, 5vw, 2.4rem)/1.2 var(--serif); font-variant-numeric: tabular-nums;
  color: #faf6ee; background: rgba(43, 39, 34, .85); border-radius: 4px; pointer-events: none;
}

.herds-controls { display: grid; gap: .6rem; margin: .9rem auto 0; max-width: 46rem; }
.herds-row { display: flex; gap: .8rem; align-items: center; }
.herds-range { flex: 1; min-width: 0; margin: 0; accent-color: var(--accent); }
.herds-stops { display: flex; flex-wrap: wrap; gap: .4rem; }
.herds button {
  font: 500 .88rem/1 var(--sans); padding: .6rem .9rem; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--rule); background: transparent; color: var(--ink-2);
}
.herds button:hover { border-color: var(--accent); color: var(--ink); }
.herds button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.herds-stops button { font-family: var(--serif); font-weight: 600; font-size: .95rem; padding: .5rem .75rem; }
.herds .herds-play { min-width: 6.5rem; background: var(--ink); color: var(--paper); border-color: var(--ink); }
.herds .herds-play[aria-pressed="true"] { background: transparent; color: var(--ink); }
.herds-status { margin: 0; min-height: 3.2em; font-size: .95rem; color: var(--ink); }

.herds-legend { list-style: none; margin: 1rem auto 0; padding: .8rem 0 0; border-top: 1px dotted var(--rule); max-width: 46rem; display: grid; gap: .35rem; font-size: .8rem; color: var(--ink-2); }
.herds-legend li { display: grid; grid-template-columns: 28px 1fr; gap: .6rem; align-items: start; }
.herds-sw { margin-top: .15rem; overflow: visible; }
.herds-sw .hb-herd { opacity: 1; fill-opacity: .2; }
.herds-sw .hb-cell { opacity: .42; stroke: none; }
.hb-sw-date { font: 600 10px/1 var(--sans); fill: var(--hb-red); text-anchor: middle; }

.herds figcaption { font-size: .82rem; color: var(--ink-2); margin: .8rem auto 0; max-width: 46rem; }

/* Narrow screens show the range only (a tighter viewBox), so text is set a little larger. */
.herds.is-narrow .hb-date text { font-size: 17px; }
.herds.is-narrow .hb-places text { font-size: 15px; }
.herds.is-narrow .hb-count text { font-size: 22px; }
@media (max-width: 34rem) { .herds-year { right: 6px; top: 6px; } }
@media (prefers-reduced-motion: reduce) {
  .hb-cell, .hb-herd, .hb-date circle, .hb-date text, .hb-counts { transition: none; }
}
@media print {
  .herds-controls { display: none; }
}

/* Carousels (assets/carousel.js): pictures and page scans, one at a time */
.carousel { margin: 2rem 0; }
.car-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; gap: 0; border-radius: 6px; background: var(--paper-2); outline-offset: 3px; }
.car-slide { flex: 0 0 100%; scroll-snap-align: start; margin: 0; display: flex; flex-direction: column; }
.car-slide picture, .car-slide img { display: block; width: 100%; }
.car-slide img { height: clamp(15rem, 58vw, 28rem); object-fit: contain; background: var(--paper-2); }
.car-slide .car-cap { margin: 0; padding: .6rem .9rem .8rem; font-size: .82rem; line-height: 1.45; color: var(--ink-2); background: var(--paper); border-top: 1px solid var(--rule); flex: 1; }
.car-slide .car-cap q, .car-slide .car-cap em { color: var(--ink); }
.car-nav { display: flex; align-items: center; justify-content: center; gap: 1rem; margin: .6rem 0 0; }
.car-nav button { font: 600 1.4rem/1 var(--serif); width: 2.4rem; height: 2.4rem; border-radius: 50%; border: 1px solid var(--rule); background: var(--paper); color: var(--ink); cursor: pointer; }
.car-nav button:disabled { opacity: .35; cursor: default; }
.car-nav button:not(:disabled):hover { border-color: var(--accent); color: var(--accent); }
.car-count { font: 500 .85rem/1 var(--sans); color: var(--ink-2); min-width: 3.5rem; text-align: center; }
.carousel > figcaption { font-size: .82rem; color: var(--ink-2); margin-top: .5rem; }
.carousel .car-title { font: 600 1.1rem/1.3 var(--serif); color: var(--ink); margin: 0 0 .5rem; }
@media (min-width: 52rem) { .carousel { margin-left: -4rem; margin-right: -4rem; } }

.car-slide img[role="button"] { cursor: zoom-in; }
.car-zoom { border: 0; padding: 0; margin: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; background: rgba(20,16,12,.94); }
.car-zoom::backdrop { background: rgba(20,16,12,.94); }
.car-zoom-in { width: 100%; height: 100%; overflow: auto; display: flex; align-items: center; justify-content: center; }
.car-zoom-in img { display: block; max-width: 96vw; max-height: 92dvh; object-fit: contain; background: #f4efe6; }
.car-zoom.scan .car-zoom-in { display: block; }
.car-zoom.scan .car-zoom-in img { width: 820px; max-width: none; max-height: none; margin: 3.75rem auto 2rem; }
.car-close { position: fixed; top: .75rem; right: .75rem; z-index: 2; width: 2.6rem; height: 2.6rem; border-radius: 50%; border: 0; background: #f4efe6; color: #1c1611; font: 600 1.6rem/1 var(--sans); cursor: pointer; }
/* Galleries (data-gallery): the large picture, then its caption, stepped with ‹ › or a swipe */
.car-zoom:not(.gallery) .car-zoom-bar, .car-zoom:not(.gallery) .car-zoom-cap, .car-zoom.single .car-zoom-bar { display: none; }
.car-zoom.gallery[open] { display: flex; flex-direction: column; }
.car-zoom.gallery .car-zoom-in { position: relative; flex: 1 1 auto; min-height: 8rem; height: auto; overflow: hidden; }
.car-zoom.gallery .car-zoom-in img { position: absolute; top: 3.75rem; left: 1rem; width: calc(100% - 2rem); height: calc(100% - 3.75rem); max-width: none; max-height: none; object-fit: contain; background: none; }
.car-zoom-bar { flex: none; display: flex; align-items: center; justify-content: center; gap: 1rem; padding: .7rem 0 0; }
.car-zoom-bar button { font: 600 1.4rem/1 var(--serif); width: 2.6rem; height: 2.6rem; border-radius: 50%; border: 1px solid rgba(244,239,230,.35); background: transparent; color: #f4efe6; cursor: pointer; }
.car-zoom-bar button:hover, .car-zoom-bar button:focus-visible { border-color: #f4efe6; background: rgba(244,239,230,.1); }
.car-zoom-count { font: 500 .85rem/1 var(--sans); color: #d8d0c2; min-width: 3.5rem; text-align: center; }
.car-zoom-cap { flex: none; box-sizing: border-box; width: 100%; max-width: 46rem; max-height: 30dvh; overflow-y: auto; margin: 0 auto; padding: .6rem 1rem max(1rem, env(safe-area-inset-bottom)); color: #ece6da; font-size: .92rem; line-height: 1.5; }
.car-zoom-cap .credit { display: block; margin-top: .3rem; color: #b3aa9c; font-size: .8rem; }
.car-zoom-cap a { color: #e8b48c; }
.zoom-btn { display: block; margin: .7rem auto 0; font: 500 .85rem/1 var(--sans); padding: .55rem .9rem; border-radius: 999px; border: 1px solid var(--rule); background: var(--paper); color: var(--ink); cursor: zoom-in; }
.zoom-btn:hover { border-color: var(--accent); color: var(--accent); }
.zoom-btn[hidden] { display: none; }

/* "Use this map" box under the herd map (buffalo.html); the map itself is also served alone at /embed/buffalo-map */
.embed-share { max-width: 46rem; margin: 1.2rem auto 0; font-size: .9rem; color: var(--ink-2); }
.embed-share summary { cursor: pointer; color: var(--ink); font-weight: 500; }
.embed-share textarea { width: 100%; box-sizing: border-box; font: .8rem/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--ink); background: var(--paper-2, transparent); border: 1px solid var(--rule); border-radius: 4px; padding: .6rem; resize: vertical; }

/* For teachers (teach.html): one document per printed sheet */
.sheet-label { font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); margin: 1.4rem 0 .3rem; }
.sheet-doc { font-family: var(--serif); font-size: 1.05rem; }
.sheet-qs { padding-left: 1.4rem; }
.sheet-qs li { margin: .35rem 0; }
.teach-note { font-size: .9rem; color: var(--ink-2); }
@media print {
  .teach .foot { display: none; }
  .teach .sheet { break-before: page; }
  @page { margin: 1.4cm; }
  .teach { font-size: 10pt; }
  .teach .sheet h2 { font-size: 18pt; margin: .2rem 0 .4rem; }
  .teach .sheet .fig { margin: .6rem 0; }
  .teach .sheet .fig img { max-height: 7.5cm; width: auto; max-width: 100%; }
  .teach .sheet-label { margin: .8rem 0 .2rem; }
  .teach .sheet .sources { margin-top: .8rem !important; }
  .teach #about-teach { display: none; }
  .teach a { color: inherit; text-decoration: none; }
}

/* On this day (today.html): the timeline's look, grouped by month */
.od-today { margin-bottom: 2.5rem; padding-bottom: 1rem; border-bottom: 1px dotted var(--rule); }
.od-today > p { color: var(--ink-2); }
.od-months { display: flex; flex-wrap: wrap; gap: .4rem .9rem; margin: 0 0 1.5rem; font-size: .9rem; }
.od-months a { color: var(--ink); }
.od-jump { font-size: .9rem; }

/* Lake levels chart on the home page */
.lakes-svg .tick { stroke: var(--rule); }
.lakes-svg .ev { stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 3 3; opacity: .7; }
.lakes-svg .evl { font: 400 11.5px/1 var(--sans); fill: var(--ink-2); }
.lakes-svg .lab { font: 600 14px/1 var(--serif); fill: var(--ink); }
.lakes-svg .lab-w { font-size: 12.5px; fill: var(--accent-2); }
.lakes-svg .sub { font: 400 11.5px/1 var(--sans); fill: var(--ink-2); }
.lakes-svg path { fill: none; stroke-linejoin: round; stroke-linecap: round; }
.lakes-svg .lk-p, .lakes-svg .lk-k { stroke: var(--accent); stroke-width: 2; }
.lakes-svg .lk-early { stroke: var(--accent); stroke-width: 1.2; stroke-dasharray: 2 3; opacity: .8; }
.lakes-svg .lk-pd, .lakes-svg .lk-kd { fill: var(--accent); }
.lakes-svg .lk-w { stroke: var(--accent-2); stroke-width: 1.6; stroke-dasharray: 5 3; }
.lakes-svg .lk-wd { fill: var(--accent-2); }
.lakes-svg .sub-w { fill: var(--accent-2); }
.lakes-n { display: none; }
@media (max-width: 540px) { .lakes-w { display: none; } .lakes-n { display: block; } }

/* Whose land was this? (land.html) */
.ld { max-width: 72rem; margin: 0 auto; padding: 0 16px 3rem; }
.ld-wrap { display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 60rem) { .ld-wrap { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); align-items: start; } .ld-side { position: sticky; top: 4.5rem; } }
.ld-fig { margin: 0; }
.ld-map { display: block; width: 100%; height: auto; cursor: crosshair; touch-action: manipulation; }
.ld-areas path { stroke: var(--paper); stroke-width: .45; }
.ld { --ld-0: #2a1736; --ld-1: #5e2450; --ld-2: #93344a; --ld-3: #c45c34; --ld-4: #e0962e; --ld-5: #ecd27a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ld { --ld-0: #fbe3a0; --ld-1: #f2b150; --ld-2: #de7a3e; --ld-3: #b9504c; --ld-4: #87395e; --ld-5: #573060; } }
:root[data-theme="dark"] .ld { --ld-0: #fbe3a0; --ld-1: #f2b150; --ld-2: #de7a3e; --ld-3: #b9504c; --ld-4: #87395e; --ld-5: #573060; }
.ld .b0 { fill: var(--ld-0); background: var(--ld-0); }
.ld .b1 { fill: var(--ld-1); background: var(--ld-1); }
.ld .b2 { fill: var(--ld-2); background: var(--ld-2); }
.ld .b3 { fill: var(--ld-3); background: var(--ld-3); }
.ld .b4 { fill: var(--ld-4); background: var(--ld-4); }
.ld .b5 { fill: var(--ld-5); background: var(--ld-5); }
.ld-areas .bx { fill: var(--paper-2); }
.ld-states { fill: none; stroke: var(--ink); stroke-opacity: .35; stroke-width: .6; pointer-events: none; }
.ld-hi path { fill: var(--ink); fill-opacity: .14; stroke: var(--ink); stroke-width: 1.6; pointer-events: none; }
.ld-pin { pointer-events: none; }
.ld-pin circle { fill: var(--ink); stroke: var(--paper); stroke-width: 2; }
.ld-key { display: flex; flex-wrap: wrap; gap: .35rem .45rem; align-items: center; font-size: .8rem; color: var(--ink-2); margin: .6rem 0 0; padding: 0; list-style: none; font-variant-numeric: tabular-nums; }
.ld-key li { display: flex; }
.ld-key i { display: inline-block; width: 1.4rem; height: .85rem; border-radius: 2px; }
.ld-tools { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin: 0 0 1rem; }
.ld-tools button, .ld-tools select { font: 500 .9rem/1.2 var(--sans); color: var(--ink); background: var(--paper-2); border: 1px solid var(--rule); border-radius: 3px; padding: .5rem .75rem; }
.ld-tools button { cursor: pointer; }
.ld-tools button:hover { border-color: var(--ink-2); }
.ld-msg { font-size: .85rem; color: var(--ink-2); margin: 0 0 .8rem; min-height: 1.2em; }
.ld-side h2 { font: 600 1.35rem/1.2 var(--serif); margin: 0 0 .2rem; text-wrap: balance; }
.ld-place { color: var(--ink-2); font-size: .9rem; margin: 0 0 1rem; }
.ld-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.ld-list li { border-top: 1px solid var(--rule); padding-top: .8rem; }
.ld-list button.ld-entry { all: unset; cursor: pointer; display: block; }
.ld-date { font: 600 1.05rem/1.3 var(--serif); margin: 0; font-variant-numeric: tabular-nums; }
.ld-who { margin: .15rem 0 0; font-size: .95rem; }
.ld-kind { color: var(--ink-2); font-size: .85rem; margin: .1rem 0 0; }
.ld-note { margin: .45rem 0 0; font: 400 .95rem/1.5 var(--serif); }
.ld-links { margin: .3rem 0 0; font-size: .82rem; color: var(--ink-2); }
.ld-none { color: var(--ink-2); }
.ld-about { max-width: var(--measure); margin: 2.5rem auto 0; }
.ld-about h2 { font: 600 clamp(1.4rem, 4vw, 1.9rem)/1.15 var(--serif); margin: 0 0 .8rem; }
.ld-about ol { padding-left: 1.2rem; display: grid; gap: .7rem; }
.ld-howto { max-width: var(--measure); margin: 1.2rem auto 0; padding: 0 16px; }
.ld-howto ul { margin: .4rem 0 0; padding-left: 1.1rem; display: grid; gap: .35rem; color: var(--ink-2); font-size: .98rem; }
.ld-picks { max-width: 72rem; margin: 1.4rem auto .6rem; padding: 0 16px; display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; font-size: .88rem; }
.ld-picks span { color: var(--ink-2); margin-right: .2rem; }
.ld-picks button, .ld-key button { font: 500 .85rem/1.2 var(--sans); color: var(--ink); background: var(--paper-2); border: 1px solid var(--rule); border-radius: 999px; padding: .35rem .7rem; cursor: pointer; }
.ld-picks button:hover, .ld-key button:hover { border-color: var(--ink-2); }
.ld-key button { display: flex; gap: .4rem; align-items: center; border-radius: 3px; padding: .25rem .5rem; font-size: .8rem; }
.ld-key button[aria-pressed="true"] { border-color: var(--ink); background: var(--paper); }
.ld-map[data-only] .ld-areas path { fill-opacity: .13; }
.ld-map[data-only="0"] .ld-areas .b0, .ld-map[data-only="1"] .ld-areas .b1, .ld-map[data-only="2"] .ld-areas .b2, .ld-map[data-only="3"] .ld-areas .b3, .ld-map[data-only="4"] .ld-areas .b4, .ld-map[data-only="5"] .ld-areas .b5 { fill-opacity: 1; }
.ld-explain { margin: .45rem 0 0; font-size: .9rem; color: var(--ink-2); }
.ld-doc { margin: .7rem 0 0; padding: .75rem .85rem; background: var(--paper-2); border-radius: 3px; }
.ld-doc-k, .ld-flag-k { font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); margin: 0; }
.ld-doc-t { font: 600 1rem/1.3 var(--serif); margin: .15rem 0 0; }
.ld-doc-m { font-size: .8rem; color: var(--ink-2); margin: .1rem 0 0; font-variant-numeric: tabular-nums; }
.ld-quote { margin: .55rem 0 0; font: 400 .95rem/1.55 var(--serif); }
.ld-margin { display: block; font: italic 400 .82rem/1.3 var(--serif); color: var(--ink-2); margin-bottom: .15rem; }
.ld-doc details { margin: .45rem 0 0; font-size: .9rem; }
.ld-doc summary { cursor: pointer; color: var(--accent); }
.ld-doc details p { font: 400 .92rem/1.55 var(--serif); margin: .5rem 0 0; }
.ld-scan { margin: .6rem 0 0; }
.ld-scan img { display: block; width: 100%; height: auto; border: 1px solid var(--rule); background: #fff; }
.ld-scan figcaption { font-size: .75rem; color: var(--ink-2); margin-top: .25rem; }
.ld-flag { margin: .7rem 0 0; padding: .7rem .85rem; border: 1px solid var(--accent); border-radius: 3px; }
.ld-flag p { margin: .35rem 0 0; font-size: .93rem; }
.ld-flag blockquote { margin: .5rem 0 0; font: italic 400 .93rem/1.5 var(--serif); }
.ld-flag .ld-flag-k { color: var(--accent); font-weight: 600; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
