/* travelblog — theme v3 "expose card" (light, overlay captions)
   Desktop: near-full-bleed photos, caption overlaid on a soft scrim.
   Mobile: full-screen snap-scroll cards (stories register, calm pacing). */

:root {
  --paper: #faf7f2;
  --paper-dim: #efe9e0;
  --ink: #1f1b16;
  --ink-soft: #57503f;
  --ink-faint: #8a8272;
  --rule: #e3ddd2;
  --serif: Georgia, "Iowan Old Style", "Times New Roman", Times, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --media-max: 1280px;
  --text-measure: 34em;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

/* ---------- header ---------- */
header.essay-head {
  max-width: var(--text-measure);
  margin: 0 auto;
  padding: 5.5rem 1.5rem 4rem;
  text-align: center;
}
header.essay-head .kicker {
  font-family: var(--sans);
  font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--ink-faint); margin-bottom: 1.1rem;
}
header.essay-head h1 {
  font-weight: 400;
  font-size: clamp(2.1rem, 6vw, 3.1rem);
  line-height: 1.15; letter-spacing: -0.01em;
  margin-bottom: 1.2rem;
}
header.essay-head time {
  display: block; font-family: var(--sans);
  font-size: 0.85rem; letter-spacing: 0.08em;
  color: var(--ink-soft); margin-bottom: 2rem;
}
header.essay-head .intro {
  font-size: 1.18rem; line-height: 1.65;
  font-style: italic; color: var(--ink-soft);
}

/* scroll cue */
.scrollcue {
  margin: 3rem auto 0;
  width: 26px; height: 42px;
  border: 1px solid var(--ink-faint);
  border-radius: 14px;
  position: relative;
}
.scrollcue span {
  position: absolute; left: 50%; top: 8px;
  width: 3px; height: 8px; border-radius: 2px;
  background: var(--ink-faint);
  transform: translateX(-50%);
  animation: cue 2.2s ease-in-out infinite;
}
@keyframes cue {
  0%, 100% { opacity: 0.2; top: 8px; }
  50% { opacity: 1; top: 20px; }
}

/* ---------- full-screen snap cards (all viewports) ---------- */
header.essay-head {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4rem 1.5rem;
}

main.essay {
  scroll-snap-type: y proximity;   /* snap when near, glide freely mid-scroll */
}

figure.media {
  width: 100vw;
  height: 100svh;
  margin: 0;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #14100b;   /* letterbox tone matches scrim */
}

figure.media .frame {
  position: relative;
  width: 100vw;
  height: 100svh;
  overflow: hidden;
}

figure.media img,
figure.media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;   /* default: full photo, never cropped */
}

/* dominant photos: cover the viewport completely (no letterbox bars).
   transform is JS-driven (scroll flow) — no static scale here. */
figure.media.fill img,
figure.media.fill video {
  object-fit: cover;
  will-change: transform;
}

/* overlay transitions handled by JS scroll flow */
.overlay { will-change: transform, opacity; }

.overlay {
  position: absolute;
  inset: 0;
  padding: 5rem max(1.4rem, 5vw) 1.6rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.5rem;
  background: linear-gradient(to top,
    rgba(20, 16, 11, 0.55) 0%,
    rgba(20, 16, 11, 0.18) 26%,
    transparent 44%);
  pointer-events: none;   /* caption never blocks the photo */
}

/* chips pinned bottom-left */
.overlay .chip {
  align-self: flex-start;
  margin-bottom: 0.35rem;
}

/* caption: quiet, bottom-right, small */
.overlay figcaption {
  align-self: flex-end;
  text-align: right;
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.92rem;
  line-height: 1.5;
  color: rgba(245, 241, 232, 0.92);
  max-width: min(34em, 60vw);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
}
.overlay figcaption,
.overlay .chip { pointer-events: auto; }

.chip {
  align-self: flex-start;
  font-family: var(--sans);
  font-size: 0.66rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: #f5f1e8;
  background: rgba(20, 16, 11, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
}

.chip.daymark { background: rgba(20, 16, 11, 0.6); }

/* ---------- prose ---------- */
.prose {
  max-width: var(--text-measure);
  margin: 0 auto 3.2rem;
  padding: 0 1.5rem;
  font-size: 1.06rem;
}

/* ---------- footer ---------- */
footer.essay-foot {
  max-width: var(--text-measure);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 5rem;
  text-align: center;
}
footer.essay-foot .endmark {
  font-size: 1.1rem; color: var(--ink-faint);
  letter-spacing: 0.6em; margin-bottom: 1.2rem;
}
footer.essay-foot .colophon {
  font-family: var(--sans); font-size: 0.8rem;
  color: var(--ink-faint); letter-spacing: 0.04em;
}

/* ---------- MOBILE refinements ---------- */
@media (max-width: 700px) {
  body { font-size: 17px; }
  .overlay { padding: 4rem 1.1rem 1.2rem; }
  .overlay figcaption { font-size: 0.85rem; max-width: 82vw; }
  .chip { font-size: 0.6rem; }
  .prose { padding: 3rem 1.4rem; background: var(--paper); }
  footer.essay-foot { padding-bottom: 6rem; }
}

/* ---------- prose: NYT-magazine chapter treatment ---------- */
.prose {
  max-width: var(--text-measure);
  margin: 0 auto;
  padding: 4.5rem 1.5rem;
  font-size: 1.08rem;
  scroll-snap-align: start;
  background: var(--paper);
}

.prose p {
  margin-bottom: 1.4em;
  text-wrap: pretty;
}

.prose p:first-child::first-letter {
  float: left;
  font-size: 3.4em;
  line-height: 0.82;
  padding: 0.06em 0.12em 0 0;
  color: var(--ink);
}

.prose h3.chapter {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 2rem;
}

.prose h2 {
  font-weight: 400;
  font-size: 1.9rem;
  line-height: 1.2;
  margin: 0 0 1.5rem;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .scrollcue span { animation: none; opacity: 0.5; }
}
