:root {
  --bg: #faf7f2;
  --surface: #ffffff;
  --text: #2b2622;
  --muted: #7a6f66;
  --accent: #c0532f;
  --line: #e8e1d8;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1816;
    --surface: #24211e;
    --text: #ece6df;
    --muted: #a3988d;
    --accent: #e88a63;
    --line: #36312c;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 var(--sans);
}
a { color: var(--accent); }
img { max-width: 100%; height: auto; display: block; }

.masthead, main, .foot {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 16px;
}
.masthead { padding-top: 40px; padding-bottom: 24px; }
.brand {
  font: 700 2rem/1.1 var(--serif);
  color: var(--text);
  text-decoration: none;
}
.tagline { margin: 6px 0 0; color: var(--muted); }
.site-nav { display: flex; gap: 18px; margin-top: 14px; font-size: 15px; }
.site-nav a { color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; padding-bottom: 2px; }
.site-nav a:hover { color: var(--text); border-color: var(--accent); }

/* Map page: the map gets the full width under the header */
.map-page main { max-width: none; padding: 0; }
#map { height: calc(100dvh - 190px); min-height: 360px; background: var(--line); }
.map-page .empty { max-width: 760px; margin: 0 auto; padding: 16px; }
.map-pop { display: grid; gap: 4px; color: inherit; text-decoration: none; font: 14px/1.4 var(--sans); }
.map-pop img { width: 100%; aspect-ratio: 16 / 9; max-height: 120px; object-fit: cover; border-radius: 6px; }
.map-pop strong { font: 700 16px/1.25 var(--serif); }
.map-pop span { color: #7a6f66; }
.leaflet-container a.map-pop { color: #2b2622; }
.foot { padding-top: 40px; padding-bottom: 40px; color: var(--muted); font-size: 14px; }
.foot a { color: var(--muted); }
.empty { color: var(--muted); padding: 40px 0; }

.meta { margin: 0; color: var(--muted); font-size: 14px; letter-spacing: 0.02em; }

.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 28px; }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.card-link { color: inherit; text-decoration: none; display: block; }
.card-img { position: relative; aspect-ratio: 3 / 2; background: var(--line); }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.play {
  position: absolute; inset: 0; margin: auto;
  width: 64px; height: 64px; border-radius: 50%;
  background: rgb(0 0 0 / 0.5);
}
.play::after {
  content: ""; position: absolute; left: 26px; top: 20px;
  border-style: solid; border-width: 12px 0 12px 20px;
  border-color: transparent transparent transparent #fff;
}
.card-text { padding: 18px 20px 20px; }
.card h2 { font: 700 1.5rem/1.25 var(--serif); margin: 4px 0 8px; }
.card-link:hover h2 { color: var(--accent); }
.excerpt { margin: 0; }
.counts { margin: 10px 0 0; font-size: 14px; color: var(--muted); }

.post h1 { font: 700 2.2rem/1.2 var(--serif); margin: 6px 0 20px; }
.draft-note { background: var(--line); padding: 8px 12px; border-radius: 8px; font-size: 14px; }
.body { font-size: 1.1rem; }
.body p { margin: 0 0 1.1em; }

.gallery {
  margin: 28px 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}
.gallery figure { margin: 0; }
.g-photo a { display: block; aspect-ratio: 1; overflow: hidden; border-radius: 6px; background: var(--line); }
.g-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.g-photo a:hover img { transform: scale(1.03); }
.g-video { grid-column: 1 / -1; }
.g-video.portrait .video-box { max-width: 420px; margin: 0 auto; }
.video-box { width: 100%; border-radius: 6px; overflow: hidden; background: #000; }
.video-box iframe { width: 100%; height: 100%; border: 0; display: block; }
figcaption { font-size: 14px; color: var(--muted); padding: 6px 2px 0; }

.pager { display: flex; justify-content: space-between; gap: 16px; margin: 40px 0 0; font-size: 15px; }

/* Lightbox */
.lb {
  position: fixed; inset: 0; z-index: 10;
  background: rgb(0 0 0 / 0.94);
  display: flex; align-items: center; justify-content: center;
  touch-action: pan-y;
}
.lb img { max-width: 100vw; max-height: 100dvh; object-fit: contain; }
.lb-cap {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  color: #eee; text-align: center; font-size: 15px;
  background: linear-gradient(transparent, rgb(0 0 0 / 0.7));
}
.lb button {
  position: absolute; background: rgb(255 255 255 / 0.12); color: #fff;
  border: 0; width: 48px; height: 48px; border-radius: 50%;
  font-size: 22px; cursor: pointer;
}
.lb-close { top: calc(12px + env(safe-area-inset-top)); right: 12px; }
.lb-prev { left: 12px; }
.lb-next { right: 12px; }
@media (hover: none) { .lb-prev, .lb-next { display: none; } }

@media (max-width: 520px) {
  .masthead { padding-top: 28px; }
  .brand { font-size: 1.7rem; }
  .post h1 { font-size: 1.8rem; }
  .gallery { grid-template-columns: repeat(2, 1fr); gap: 4px; }
}
