:root {
  --paper: #f4efe6;
  --ink: #1f1c18;
  --soft: #6b6358;
  --rule: #d9d0c1;
  --accent: #8c3a1c;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 19px/1.62 var(--serif);
  font-feature-settings: "onum" 1, "kern" 1;
  -webkit-font-smoothing: antialiased;
}
img, video { display: block; width: 100%; height: auto; background: #e6dfd2; }
.measure { max-width: 36rem; margin-left: auto; margin-right: auto; padding-left: 22px; padding-right: 22px; }

/* cover */
.cover { padding-bottom: 8px; }
.cover-img { margin: 0; }
.cover-img img { height: 78svh; object-fit: cover; }
.cover-text { padding-top: 34px; }
.kicker, .date {
  font: 600 12px/1.4 var(--sans); letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 10px;
}
h1 { font-weight: 400; font-size: clamp(40px, 11vw, 76px); line-height: 1.02; letter-spacing: -.01em; margin: 0 0 8px; }
h2 { font-weight: 400; font-size: clamp(30px, 7.5vw, 46px); line-height: 1.08; margin: 0; }

/* intro */
.intro { padding-top: 18px; }
.intro .lead::first-letter {
  float: left; font-size: 4.1em; line-height: .82; padding: 6px 8px 0 0; color: var(--accent);
}
p { margin: 0 0 1.05em; hyphens: auto; -webkit-hyphens: auto; }

/* day index */
.days { margin-top: 34px; margin-bottom: 30px; border-top: 1px solid var(--rule); }
.days a {
  display: flex; justify-content: space-between; gap: 16px; padding: 11px 0;
  border-bottom: 1px solid var(--rule); color: var(--ink); text-decoration: none;
  font: 15px/1.35 var(--sans);
}
.days a span { color: var(--soft); text-align: right; font-family: var(--serif); font-style: italic; }

/* chapters */
.chapter { padding-top: 64px; }
.chapter-head { margin-bottom: 26px; }
.hero { margin: 0 0 30px; }
.hero img { max-height: 92svh; object-fit: cover; }
.text { margin-top: 4px; }
blockquote {
  margin: 30px auto; font-style: italic; font-size: 25px; line-height: 1.38; color: var(--accent);
  border-left: 2px solid var(--accent); padding-left: 18px;
}
@media (min-width: 640px) { blockquote { padding-left: 22px; } }

/* gallery: justified rows */
.gallery { margin: 30px auto 0; max-width: 1100px; padding: 0 4px; }
.row { display: flex; gap: 4px; margin-bottom: 4px; }
.row figure { margin: 0; min-width: 0; }
.row img, .row video { object-fit: cover; cursor: zoom-in; }

.notes { margin-top: 26px; font: 14px/1.5 var(--sans); color: var(--soft); }
.notes p { margin: 0 0 4px; }

/* tracks */
.track { margin: 34px 0 10px; }
.map { height: 62svh; max-height: 560px; background: #dcd5c7; }
.track-facts { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 14px; padding-top: 12px; font: 14px/1.4 var(--sans); }
.track-facts span { color: var(--soft); }
.profile-wrap { padding-top: 10px; }
.profile { width: 100%; height: 90px; display: block; }
.profile .area { fill: rgba(140, 58, 28, .12); }
.profile .line { fill: none; stroke: var(--accent); stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.profile-scale { display: flex; justify-content: space-between; font: 12px var(--sans); color: var(--soft); }
.leaflet-container { font-family: var(--sans); }

/* outro + facts */
.outro { padding-top: 70px; }
.facts { margin-top: 30px; border-top: 1px solid var(--rule); }
.facts div { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--rule); font: 15px var(--sans); }
.facts dt { color: var(--soft); }
.facts dd { margin: 0; }

footer { padding-top: 70px; padding-bottom: calc(40px + env(safe-area-inset-bottom)); font: 13px var(--sans); color: var(--soft); display: flex; justify-content: space-between; align-items: center; }
footer button { background: none; border: 0; color: var(--soft); font: 13px var(--sans); text-decoration: underline; padding: 0; cursor: pointer; }

/* lightbox */
.lightbox { position: fixed; inset: 0; background: #0d0c0b; z-index: 2000; display: flex; align-items: center; justify-content: center; touch-action: pan-y; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100vw; max-height: 100svh; width: auto; height: auto; object-fit: contain; background: none; }
.lb-close { position: absolute; top: calc(8px + env(safe-area-inset-top)); right: 10px; font-size: 34px; line-height: 1; color: #eee; background: none; border: 0; padding: 8px 12px; }
.lb-time { position: absolute; bottom: calc(12px + env(safe-area-inset-bottom)); left: 0; right: 0; text-align: center; color: #aaa; font: 13px var(--sans); margin: 0; }

/* login */
.gate { min-height: 100svh; display: flex; align-items: center; }
.gate-box { width: 100%; max-width: 26rem; margin: 0 auto; padding: 32px 24px; }
.gate h1 { font-size: 44px; margin-bottom: 28px; }
.gate label { display: block; font: 13px var(--sans); color: var(--soft); margin: 14px 0 6px; }
.gate input { width: 100%; font: 18px var(--sans); padding: 12px; border: 1px solid #bdb3a3; background: #fffdf8; border-radius: 0; color: var(--ink); }
.gate button { margin-top: 18px; width: 100%; font: 600 16px var(--sans); padding: 13px; background: var(--ink); color: var(--paper); border: 0; border-radius: 0; }
.err { color: #a3261b; font: 14px var(--sans); margin: 10px 0 0; }

details.more { margin-top: 18px; }
details.more summary { cursor: pointer; font: 14px/1.4 var(--sans); color: var(--accent); padding-top: 8px; padding-bottom: 8px; list-style: none; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::after { content: " +"; }
details.more[open] summary::after { content: " –"; }
