/* ============================================================================
   Township & Borough — Excursions
   A pinned map with prose scrolling over it. MOBILE.md §6.

   Scrolling is the one gesture nobody has to learn, which is exactly why a
   cold shared link should land here rather than on an instrument: a tour asks
   the reader nothing.
   ========================================================================== */
.tour { position: relative; }

/* the stage is pinned; the prose scrolls past it */
.tour__stage {
  position: sticky;
  top: var(--masthead-h, 3rem);
  height: calc(100svh - var(--masthead-h, 3rem));
  z-index: 0;
  overflow: hidden;
  background: var(--paper-deep);
}
.tour__map { position: absolute; inset: 0; }
.tour__map .ol-control { display: none; }

/* the same gate as The Strip: a film frame is not a sharp quadrangle */
.tour__gate {
  position: absolute; inset: 0; pointer-events: none; z-index: 2;
  box-shadow: inset 0 0 0 1px rgba(42,38,32,0.22);
  background:
    radial-gradient(118% 92% at 50% 42%, transparent 55%, rgba(20,17,12,0.18) 100%),
    /* a wash at the foot so the cards always have something to sit on */
    linear-gradient(to bottom, transparent 45%, rgba(20,17,12,0.28) 100%);
}
/* ---- fixed chrome, above the cards ------------------------------------- */
.tour__hud { position: fixed; inset: 0; z-index: 12; pointer-events: none; }
.tour__year {
  position: absolute; left: 50%; transform: translateX(-50%);
  top: calc(var(--masthead-h, 3rem) + 0.9rem);
  font-family: var(--mono); font-size: 1.25rem; line-height: 1;
  color: var(--ink); background: color-mix(in srgb, var(--paper) 88%, transparent);
  border: 1px solid var(--rule); padding: 0.28rem 0.7rem 0.32rem;
}
.tour__today {
  pointer-events: auto;
  position: absolute; right: 0.9rem;
  top: calc(var(--masthead-h, 3rem) + 0.8rem);
  font: inherit; font-variant: small-caps; letter-spacing: 0.12em; font-size: 0.74rem;
  min-height: 44px; padding: 0 0.8rem;
  color: var(--ink-soft); background: color-mix(in srgb, var(--paper) 90%, transparent);
  border: 1px solid var(--rule); border-radius: 3px; cursor: pointer;
  touch-action: none; user-select: none; -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.tour__today.is-on { color: var(--oxblood); border-color: var(--lathrop);
  background: color-mix(in srgb, var(--lathrop-peach) 55%, var(--paper)); }

/* ---- the scrolling column ---------------------------------------------- */
.tour__scroll {
  position: relative; z-index: 3;
  /* pull the column up over the pinned stage */
  margin-top: calc(-100svh + var(--masthead-h, 3rem));
}
.tour__intro,
.tour__end {
  min-height: calc(100svh - var(--masthead-h, 3rem));
}
/* 1.8 screens per stop. At one screen each, two stops were visible at once and
   the map spun to the next before the reader had found the last one. */
.tour__stop { min-height: calc((100svh - var(--masthead-h, 3rem)) * 1.8); }
.tour__intro,
.tour__stop,
.tour__end {
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 0 var(--gutter) clamp(2rem, 12svh, 6rem);
  pointer-events: none;                       /* the map stays draggable */
}
/* the card rides at the foot of the LAST screen of its section, so the reader
   arrives at the frame before the words arrive over it */
.tour__stop { justify-content: flex-end; }
.tour__intro { justify-content: center; text-align: center; }
.tour__intro h1 { font-size: clamp(2rem, 1rem + 5vw, 3.6rem); }
.tour__intro .kicker {
  display: block; font-variant: small-caps; letter-spacing: 0.24em;
  color: var(--ink-faint); font-size: 0.8rem; margin-bottom: 0.9rem;
}
.tour__dek { max-width: 24rem; margin: 1.2rem auto 0; color: var(--ink-soft); }
.tour__scrollcue {
  margin-top: 2.4rem; font-family: var(--mono); color: var(--oxblood);
  animation: cue 2.4s ease-in-out infinite;
}
@keyframes cue { 50% { transform: translateY(7px); opacity: 0.5; } }

/* the card: a letterpress ticket tipped onto the plate */
.tour__card {
  pointer-events: auto;
  max-width: 30rem; margin: 0 auto;
  background: color-mix(in srgb, var(--paper) 95%, transparent);
  border: 1px solid var(--rule);
  box-shadow: 4px 4px 0 rgba(42,38,32,0.20);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  padding: 1rem 1.15rem 1.1rem;
  transition: opacity .35s ease, transform .35s ease;
  opacity: 0.35; transform: translateY(10px);
}
.tour__stop.is-active .tour__card { opacity: 1; transform: none; }
.tour__num {
  font-family: var(--mono); font-size: 0.7rem; color: var(--ink-faint);
  letter-spacing: 0.1em;
}
.tour__card h2 {
  font-size: 1.15rem; letter-spacing: 0.1em; text-transform: none;
  margin: 0.3rem 0 0.5rem;
}
.tour__card p { font-size: 0.94rem; color: var(--ink-soft); margin: 0 0 0.8rem; }
.tour__links { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; }
.tour__links a {
  font-variant: small-caps; letter-spacing: 0.1em; font-size: 0.8rem;
  border-bottom-color: var(--rule);
  min-height: 44px; display: inline-flex; align-items: center;
}
.tour__pending {
  font-family: var(--archive); font-style: italic; font-size: 0.82rem;
  color: var(--ink-faint); margin: 0.2rem 0 0.7rem;
}

.tour__end { justify-content: center; text-align: center; }
.tour__end p { max-width: 26rem; margin: 0 auto 1.6rem; }
.tour__end .btn { pointer-events: auto; margin: 0.35rem; }
.btn--quiet { box-shadow: none; border-color: var(--rule); color: var(--ink-soft); }

/* On a phone the spyglass is not the preferred way out — the strip is, and a
   second call to action only dilutes the first. The Spy View stays in the menu
   for anyone who wants it. */
@media (max-width: 720px) {
  .tour__end .btn--quiet { display: none; }
}

@media (min-width: 860px) {
  /* room to put the cards in a column beside the plate rather than over it */
  .tour__intro, .tour__stop, .tour__end { justify-content: center; }
  .tour__card { margin: 0 0 0 2vw; }
  .tour__gate { background:
    radial-gradient(118% 92% at 62% 45%, transparent 58%, rgba(20,17,12,0.16) 100%); }
}
