/* The story map (story-map.js): a tall section whose stage stays on screen. Scrolling
   through it chooses a stop, and the trip there plays by itself. The script sets the
   section's height. */

.journey {
  position: relative;
  background: #c9dde4;
}
.journey[hidden] {
  display: none;
}
.journey-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}

/* Map: story-map.js paints it on the canvas in these colours. */

.journey-map {
  --sea: #c9dde4;
  --land: #f6f2e6;
  --coast: #9fbcc6;
  --border: #b3a48c;
  --state: #b9ab94;
  --county: #d3c8b3;
  --route: #d2042d; /* the strand of beads */
  pointer-events: none;
}
.journey-map,
.journey-map > canvas,
.journey-markers {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Markers: each is a zero-size point that story-map.js moves to its place on the map. */

.journey-dot,
.journey-fan,
.journey-travellers {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
}
.journey-dot::before {
  content: '';
  position: absolute;
  left: -6px;
  top: -6px;
  width: 12px;
  height: 12px;
  border: 2px solid var(--white);
  border-radius: 50%;
  background: var(--red);
  scale: 0;
  transition: scale 260ms cubic-bezier(0.2, 1.4, 0.4, 1);
}
.journey-dot.visited::before {
  scale: 1;
}
.journey-dot.here::before {
  scale: 1.35;
}
.journey-dot span {
  position: absolute;
  top: 10px;
  translate: -50% 0;
  color: var(--text-soft);
  font: italic 13px/1.2 var(--serif);
  white-space: nowrap;
  text-shadow:
    0 0 3px #f6f2e6,
    0 0 3px #f6f2e6;
  opacity: 0;
  transition: opacity 200ms ease;
}
.journey-dot.named span {
  opacity: 1;
}
/* Names of seas and of states and countries, so the map reads at a glance. */
.journey-label {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  opacity: 0;
  transition: opacity 300ms ease;
}
.journey-label.shown {
  opacity: 1;
}
.journey-label span {
  position: absolute;
  translate: -50% -50%;
  white-space: nowrap;
}
.journey-label.water span {
  color: #5f8794;
  font: italic 15px/1.2 var(--serif);
  letter-spacing: 0.06em;
}
.journey-label.bay span {
  font-size: 12px;
  letter-spacing: 0.03em;
}
/* A town: a small ring with its name beside it. */
.journey-label.town::before {
  content: '';
  position: absolute;
  left: -3px;
  top: -3px;
  width: 6px;
  height: 6px;
  border: 1.5px solid #8f8271;
  border-radius: 50%;
  background: #f6f2e6;
}
.journey-label.town span {
  left: 8px;
  translate: 0 -50%;
  color: #6f6456;
  font: 12px/1.2 var(--serif);
}
.journey-label.land span {
  color: #7f7262;
  font: 700 10px/1.2 var(--sans);
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

/* Photos not on show are hidden outright once they have faded, so they cost nothing. */
.journey-fan {
  visibility: hidden;
  transition: visibility 0s 280ms;
}
.journey-fan.shown {
  visibility: visible;
  transition-delay: 0s;
}
/* The photos taken at a stop, in an overlapping row centred just above it. */
.journey-prints {
  --print: clamp(104px, 13vw, 168px);
  position: absolute;
  bottom: 20px;
  left: 0;
  display: flex;
  width: max-content;
  translate: -50% 0;
  transform-origin: 50% 100%;
}
.journey-prints img {
  width: auto;
  max-width: none;
  height: var(--print);
  border: clamp(3px, 0.45vw, 6px) solid var(--white);
  box-shadow:
    0 2px 5px #32282a30,
    0 9px 18px #32282a1f;
  opacity: 0;
  transform: translateY(16px) scale(0.6);
  transform-origin: 50% 100%;
  transition:
    opacity 200ms ease,
    transform 260ms ease;
}
.journey-prints img + img {
  margin-left: calc(var(--print) * -0.16);
}
.journey-fan.shown img {
  opacity: 1;
  transform: rotate(var(--tilt)) scale(1);
  transition:
    opacity 300ms ease calc(var(--n) * 90ms),
    transform 520ms cubic-bezier(0.2, 1.3, 0.3, 1) calc(var(--n) * 90ms);
}

.journey-travellers svg {
  position: absolute;
  left: -33px;
  top: -62px;
  width: 66px;
  max-width: none;
  height: 56px;
  overflow: visible;
  color: var(--red);
  fill: var(--white);
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  scale: 0.7;
  transform-origin: 50% 100%;
  transition:
    opacity 200ms ease,
    scale 260ms ease;
}
.journey-travellers.shown svg {
  opacity: 1;
  scale: 1;
}

/* Words over the map */

.journey-head {
  position: absolute;
  left: max(48px, calc((100% - 1320px) / 2));
  top: clamp(28px, 7vh, 80px);
  max-width: 420px;
}
.journey-head .section-heading {
  margin-bottom: 0;
}
.journey-caption {
  position: absolute;
  left: max(48px, calc((100% - 1320px) / 2));
  bottom: clamp(28px, 8vh, 84px);
  min-width: 250px;
  max-width: 340px;
  padding: 22px 26px;
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: 0 9px 26px #32282a14;
}
.journey-caption p {
  margin: 0;
}
.journey-caption .eyebrow {
  color: var(--red-dark);
}
.journey-caption h3 {
  margin: 8px 0 10px;
  color: var(--ink);
  font: 400 clamp(24px, 2.4vw, 32px)/1.15 var(--serif);
  letter-spacing: -0.02em;
}
.journey-count {
  color: var(--text-muted);
  font-size: 12px;
}
.journey-skip {
  position: absolute;
  right: max(48px, calc((100% - 1320px) / 2));
  bottom: clamp(28px, 8vh, 84px);
  padding: 8px 14px;
  background: var(--white);
  border: 1px solid var(--line);
  color: var(--red-dark);
  font-size: 12px;
  text-decoration: none;
}
.journey-list {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 900px) {
  .journey-head,
  .journey-caption {
    left: 18px;
  }
  .journey-head {
    top: 22px;
  }
  .journey-caption {
    bottom: 22px;
    min-width: 0;
    max-width: calc(100% - 170px);
    padding: 14px 18px;
  }
  .journey-skip {
    right: 18px;
    bottom: 22px;
  }
}
