/* Out and Back. Region colors come from site.toml and are injected per page. */

:root {
  --bg: #E9EFF1;
  --surface: #F5F8F9;
  --ink: #13283C;
  --muted: #536576;
  --rule: #C5D1D8;
  --link: #1B5E78;
  --display: "Overpass", "Helvetica Neue", Arial, sans-serif;
  --text: "Newsreader", Georgia, "Times New Roman", serif;
  --gutter: clamp(16px, 4vw, 40px);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0E1A24;
    --surface: #142330;
    --ink: #E2E9ED;
    --muted: #97A8B5;
    --rule: #2B3C4A;
    --link: #7CC3DD;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.125rem;
  line-height: 1.6;
}
a { color: var(--link); text-underline-offset: 0.15em; }
a:focus-visible { outline: 3px solid var(--link); outline-offset: 3px; border-radius: 2px; }
code { font-size: 0.85em; overflow-wrap: anywhere; }
.wrap { max-width: 64rem; margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- masthead ---------- */

.masthead { padding: clamp(40px, 9vw, 104px) 0 36px; }
.masthead h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.75rem, 10vw, 6rem);
  line-height: 0.92;
  letter-spacing: -0.025em;
  margin: 0;
}
.tagline { font-size: 1.25rem; color: var(--muted); margin: 18px 0 0; max-width: 32em; }
.legend {
  list-style: none;
  padding: 0;
  margin: 28px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--muted);
}
.legend li { display: flex; align-items: center; gap: 8px; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 2px; background: var(--c); flex: none; }

/* ---------- year sections ---------- */

.year { padding: 36px 0 64px; border-top: 3px solid var(--ink); }
.year-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 22px; }
.year-num {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(3.25rem, 11vw, 6.5rem);
  line-height: 0.9;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
  margin: 0;
}
.year-count { font-family: var(--display); font-size: 1rem; color: var(--muted); margin: 0; }

/* ---------- the year band ---------- */

.band-scroll { margin: 20px 0 4px; padding: 48px 2px 6px; overflow-x: clip; }
.band { position: relative; }
.ticks { position: absolute; inset: 0; pointer-events: none; }
.ticks span { position: absolute; top: -10px; bottom: -24px; border-left: 1px solid var(--rule); }
.lane { position: relative; height: 24px; margin-bottom: 6px; }
.lane-local { height: 10px; margin-top: 12px; }
.months {
  position: relative;
  height: 20px;
  margin-top: 6px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--muted);
}
.months span { position: absolute; top: 0; padding-left: 5px; }

.seg {
  position: absolute;
  top: 0;
  bottom: 0;
  min-width: 5px;
  background: var(--c);
  border-radius: 2px;
}
.lane-local .seg { min-width: 10px; border-radius: 5px; }
.seg:hover, .seg:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; z-index: 3; }
.tip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  width: max-content;
  max-width: min(22rem, 45vw);
  background: var(--ink);
  color: var(--bg);
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.8125rem;
  line-height: 1.3;
  padding: 6px 9px;
  border-radius: 3px;
  opacity: 0;
  pointer-events: none;
  z-index: 4;
}
.seg.tip-end .tip { left: auto; right: 0; }
.seg:hover .tip, .seg:focus-visible .tip, .seg.is-current .tip { opacity: 1; }
.band.has-current .seg:not(.is-current) { opacity: 0.25; }
.band.has-current .seg:not(.is-current):hover,
.band.has-current .seg:not(.is-current):focus-visible { opacity: 1; }
.band.has-current .seg:not(.is-current):hover ~ .seg.is-current .tip { opacity: 0; }

@media (prefers-reduced-motion: no-preference) {
  .tip { transition: opacity 0.12s; }
  .band.animate .seg {
    transform-origin: left center;
    animation: draw 0.55s cubic-bezier(0.2, 0.7, 0.2, 1) both;
    animation-delay: calc(var(--i) * 28ms);
  }
  @keyframes draw { from { transform: scaleX(0); } }
}

/* ---------- post lists ---------- */

.rows { list-style: none; margin: 28px 0 0; padding: 0; border-top: 1px solid var(--rule); }
.rows li { border-bottom: 1px solid var(--rule); }
.row {
  display: grid;
  grid-template-columns: 8.75rem minmax(0, 1fr) 10.5rem 8.5rem;
  gap: 2px 20px;
  align-items: baseline;
  padding: 14px 10px 14px 14px;
  border-left: 5px solid var(--c);
  color: inherit;
  text-decoration: none;
}
.row:hover { background: var(--surface); }
.row:focus-visible { outline-offset: -3px; }
.unplaced .row { border-left-style: dashed; }
.row-when {
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.row-title { display: block; font-family: var(--display); font-weight: 800; font-size: 1.25rem; line-height: 1.2; }
.row-where { display: block; color: var(--muted); font-size: 1rem; line-height: 1.4; margin-top: 3px; }
.row-region, .row-state { font-family: var(--display); font-size: 0.875rem; color: var(--muted); }
.row-state { text-align: right; }
.row-state.is-published { color: var(--ink); font-weight: 600; }

.sub { font-family: var(--display); font-weight: 800; font-size: 1.375rem; margin: 48px 0 6px; }
.sub-note { color: var(--muted); max-width: 36em; margin: 0; font-size: 1.0625rem; }

@media (max-width: 680px) {
  .months { font-size: 0.6875rem; }
  .months span { padding-left: 3px; }
  .lane { height: 20px; }
  .row { grid-template-columns: minmax(0, 1fr) auto; }
  .row-when, .row-what { grid-column: 1 / -1; }
  .row-region { margin-top: 6px; }
  .row-state { margin-top: 6px; }
}

/* ---------- post page ---------- */

.top { padding: 22px 0 0; }
.home { font-family: var(--display); font-weight: 800; font-size: 1.125rem; color: var(--ink); text-decoration: none; }
.home:hover { text-decoration: underline; }

.post-head { margin-top: clamp(28px, 6vw, 64px); padding-left: 20px; border-left: 6px solid var(--c); }
.post-head .when { font-family: var(--display); font-weight: 600; color: var(--muted); margin: 0 0 10px; }
.post-head h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.25rem, 7.5vw, 4.5rem);
  line-height: 0.98;
  letter-spacing: -0.02em;
  margin: 0;
  max-width: 14em;
}
.post-head .where { font-size: 1.375rem; line-height: 1.35; margin: 14px 0 0; max-width: 30em; }
.post-head .region {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--display);
  font-size: 0.9375rem;
  color: var(--muted);
  margin: 12px 0 0;
}
.post-head .sw { background: var(--c); }

.mini { margin-top: 12px; }
.cover { margin: 32px 0 0; }
.cover img { display: block; width: 100%; height: auto; border-radius: 4px; }

.video, .video-empty { aspect-ratio: 16 / 9; margin: 32px 0; border-radius: 4px; }
.video { background: #000; overflow: hidden; }
.video iframe, .video video { display: block; width: 100%; height: 100%; border: 0; }
.video-empty {
  aspect-ratio: 21 / 9;
  display: grid;
  place-content: center;
  gap: 8px;
  padding: 20px;
  text-align: center;
  border: 2px dashed var(--rule);
  color: var(--muted);
}
.video-empty strong { font-family: var(--display); font-weight: 800; font-size: 1.375rem; color: var(--ink); }
.video-empty span { font-size: 1rem; max-width: 30em; }
.video-link { font-family: var(--display); font-weight: 600; margin: 32px 0; }

.notes { margin: 32px 0; padding: 18px 22px; background: var(--surface); border-left: 4px solid var(--c); max-width: 40em; }
.notes h2 { font-family: var(--display); font-weight: 800; font-size: 1.125rem; margin: 0 0 6px; }
.notes ul { margin: 0; padding-left: 1.2em; }
.notes p { margin: 10px 0 0; }
.notes .file { font-size: 0.9375rem; color: var(--muted); }

/* The research outline: folded by default, only on unpublished pages. */
.outline { margin: -16px 0 32px; max-width: 40em; background: var(--surface); border-left: 4px solid var(--c); }
.outline summary {
  padding: 14px 22px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.125rem;
  cursor: pointer;
}
.outline summary:focus-visible { outline: 3px solid var(--link); outline-offset: -3px; }
.outline[open] summary { border-bottom: 1px solid var(--rule); }
.outline-body { padding: 4px 22px 4px; font-size: 1.0625rem; line-height: 1.55; }
.outline-body h2 {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.375rem;
  margin: 28px 0 4px;
  padding-top: 18px;
  border-top: 2px solid var(--ink);
}
.outline-body h2:first-of-type { border-top: 0; padding-top: 0; }
.outline-body h3 { font-family: var(--display); font-weight: 800; font-size: 1.0625rem; margin: 20px 0 4px; }
.outline-body p { margin: 8px 0; }
.outline-body ul, .outline-body ol { margin: 4px 0; padding-left: 1.2em; }
.outline-body li { margin: 3px 0; }
.outline-body li a, .outline-body p a { overflow-wrap: anywhere; }
.outline .file { margin: 0; padding: 12px 22px 16px; font-size: 0.9375rem; color: var(--muted); }

.prose { max-width: 36em; font-size: 1.1875rem; line-height: 1.65; }
.prose h2, .prose h3, .prose h4 { font-family: var(--display); font-weight: 800; line-height: 1.2; margin: 1.8em 0 0.5em; }
.prose h2 { font-size: 1.75rem; }
.prose h3 { font-size: 1.375rem; }
.prose img, .prose video, .prose iframe { max-width: 100%; height: auto; border-radius: 3px; }
.prose blockquote { margin: 1.5em 0; padding-left: 1em; border-left: 3px solid var(--rule); color: var(--muted); }
.prose pre { overflow-x: auto; padding: 12px 14px; background: var(--surface); border-radius: 3px; }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 2em 0; }

.empty { color: var(--muted); font-style: italic; max-width: 36em; }
.written { font-family: var(--display); font-size: 0.9375rem; color: var(--muted); margin: 40px 0 0; }

.pager {
  display: flex;
  gap: 20px;
  margin: 64px 0 0;
  padding: 22px 0 56px;
  border-top: 1px solid var(--rule);
  font-family: var(--display);
}
.pager a { display: block; max-width: 48%; color: var(--ink); text-decoration: none; }
.pager a:hover strong { text-decoration: underline; }
.pager small { display: block; font-weight: 600; font-size: 0.8125rem; color: var(--muted); }
.pager strong { font-weight: 800; font-size: 1.125rem; line-height: 1.25; }
.pager .next { margin-left: auto; text-align: right; }

.site-foot { padding: 22px 0 44px; border-top: 1px solid var(--rule); font-family: var(--display); font-size: 0.875rem; color: var(--muted); }
