/* The camera tour in the town hero (tour.js), as approved on the tour test page: the
   picture over the town's still, the stop card (a side card on wide screens, a bottom
   sheet on phones, under the picture on a phone held upright), the arrows and site dots,
   Skip tour. Sits on top of styles.css and town.css. */

/* The picture's height on a phone held upright (its full 4:5). */
:root {
  --pic-h: 125vw;
}

#tour-ui {
  --tour-glass: rgba(20, 33, 61, 0.8);
  --tour-glass-line: rgba(255, 255, 255, 0.14);
  --tour-pill: rgba(10, 18, 36, 0.62);
  --tour-mute: rgba(255, 255, 255, 0.72);
  color: var(--navy);
  font-family: var(--font-body);
}

/* The picture: over the still, under the header. Up from setting off until it rests back
   on the hero view; over a still that does not match it, it fades in and out. */
.tour-canvas,
.tour-back {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: 30;
  display: block;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* The page colour under an upright phone's picture, behind the card: from the picture's
   foot down only, so it never washes over the picture or the still behind it as it fades
   (the picture comes and goes at once over the still). Only phones use it. */
.tour-back {
  top: var(--pic-h);
  height: auto;
  bottom: 0;
  background: var(--paper);
}

.tour-showing .tour-canvas,
.tour-upright .tour-back {
  opacity: 1;
  visibility: visible;
}

/* The page colour under an upright phone's picture (behind the card) always fades in and
   out: the picture itself takes over at once where it matches the still. */
.tour-fade .tour-canvas,
.tour-back {
  transition: opacity 0.45s ease, visibility 0s linear 0.45s;
}

.tour-fade.tour-showing .tour-canvas,
.tour-upright .tour-back {
  transition: opacity 0.45s ease;
}

.tour-upright .tour-canvas {
  height: var(--pic-h);
}

/* While the tour is up the line and the pins go; they come back with the hero view. */
.town__line,
.town__pins {
  transition: opacity 0.3s ease, visibility 0s linear 0s;
}

.town.is-touring .town__line,
.town.is-touring .town__pins {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

/* The pins set their own visibility, so they are switched off one by one too: hidden pins
   must not catch a tap or the start of a swipe during the tour. */
.town.is-touring .town__pin {
  visibility: hidden;
  pointer-events: none;
}

.tour-here .town__hint {
  visibility: hidden;
}

/* What floats over the tour shows only at its place in the page. */
#tour-ui > * {
  position: fixed;
  z-index: 5;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0s linear 0.25s;
}

.tour-here #tour-ui > :not([hidden]) {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.25s ease;
}

#tour-ui > [hidden] {
  display: none;
}

/* The stop card (5 November 2026, Ben's tour-card-redesign-v1). On a wide screen: dark navy
   glass in the left third, centred in the room between the header and the controls, scrolling
   if it does not fit. It slides in from the left with a soft fade as the camera settles at a
   stop, its words a beat later, and slides out as the camera sets off; from one stop straight
   to the next its words and photo fade across (.swap). */
#tour-ui > .tour-card {
  --tour-room: calc(100svh - var(--tour-top, 72px) - 96px);
  left: var(--gutter);
  top: calc(var(--tour-top, 72px) + 10px + var(--tour-room) / 2);
  width: clamp(330px, 30vw, 450px);
  max-width: calc(100% - 32px);
  max-height: var(--tour-room);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  color: var(--white);
  background: var(--tour-glass);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  backdrop-filter: blur(18px) saturate(1.3);
  border: 1px solid var(--tour-glass-line);
  border-radius: 22px;
  box-shadow: 0 24px 60px rgba(6, 12, 26, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  transform: translate(-28px, -50%);
  transition: opacity 0.3s ease-in, transform 0.35s ease-in, visibility 0s linear 0.35s;
}

#tour-ui > .tour-card::-webkit-scrollbar {
  display: none;
}

.tour-here #tour-ui > .tour-card:not(.on) {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.tour-here #tour-ui > .tour-card.on {
  transform: translate(0, -50%);
  transition: opacity 0.5s ease, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* The words and photo: a beat after the card comes in; straight out with it. */
.tour-card .tour-body > * {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.tour-card.on .tour-body > * {
  opacity: 1;
  transform: none;
  transition: opacity 0.45s ease 0.14s, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.14s;
}

.tour-card.on .tour-body > .tour-ph {
  transition-delay: 0.18s;
}

.tour-card.on .tour-body > .tour-text,
.tour-card.on .tour-body > .tour-chips,
.tour-card.on .tour-body > .tour-acts {
  transition-delay: 0.22s;
}

.tour-card.on.swap .tour-body > * {
  opacity: 0;
  transform: none;
  transition: opacity 0.18s ease;
}

.tour-card .tour-body {
  padding: 24px 26px 26px;
  /* Everything at its own height but the photo, which gives way on a short screen. */
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.tour-card .tour-body > * {
  flex: none;
}

.tour-card .tour-kick {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-soft);
}

.tour-segs {
  display: flex;
  gap: 4px;
}

.tour-segs i {
  width: 16px;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.22);
}

.tour-segs i.on {
  background: var(--accent);
}

.tour-card h2 {
  margin: 12px 0 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(46px, 4.3vw, 62px);
  line-height: 0.95;
  letter-spacing: -0.005em;
  color: var(--white);
  text-wrap: balance;
}

.tour-card .tour-area {
  margin: 6px 0 0;
  font-size: 17px;
  color: var(--tour-mute);
}

.tour-card .tour-open {
  margin: 12px 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 6px;
  font-size: 15px;
}

.tour-card .tour-open::before {
  content: "";
  flex: none;
  width: 9px;
  height: 9px;
  margin-right: 3px;
  border-radius: 50%;
  background: #8E97A8;
}

.tour-card .tour-open.is-open::before {
  background: #34C759;
  box-shadow: 0 0 0 3px rgba(52, 199, 89, 0.2);
}

.tour-card .tour-open b {
  font-weight: 600;
  color: var(--white);
}

.tour-card .tour-open span {
  color: var(--tour-mute);
}

.tour-card .tour-open span::before {
  content: "\00B7\00A0";
}

/* The photo: 4:3 across the card (shorter, cropped, on a short screen). */
.tour-card .tour-ph {
  position: relative;
  margin-top: 18px;
  aspect-ratio: 4 / 3;
  flex: 0 1 auto;
  min-height: 150px;
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  background: var(--tour-glass-line);
}

.tour-gal {
  display: flex;
  height: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}

.tour-gal::-webkit-scrollbar {
  display: none;
}

.tour-gal picture {
  flex: 0 0 100%;
  height: 100%;
  scroll-snap-align: start;
}

.tour-gal img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* On a touch screen a tap opens the photo full screen. */
.tour-gal[role="button"] {
  cursor: zoom-in;
}

.tour-card .tour-count {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--tour-pill);
  color: var(--white);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.tour-card .tour-zoomhint {
  position: absolute;
  right: 8px;
  top: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--tour-pill) no-repeat center / 14px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 2h4v4M6 14H2v-4M14 2 9 7M2 14l5-5'/%3E%3C/svg%3E");
  pointer-events: none;
}

/* With a mouse: arrows on the photo when there are two. */
.tour-card .tour-ph button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 0;
  background: var(--tour-pill);
  color: var(--white);
  font: 600 21px/1 var(--font-body);
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0 0 3px;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.tour-card .tour-gprev {
  left: 10px;
}

.tour-card .tour-gnext {
  right: 10px;
}

@media (hover: hover) {
  .tour-card .tour-ph:hover button:not(:disabled),
  .tour-card .tour-ph button:focus-visible {
    opacity: 1;
  }
}

@media (hover: none) {
  .tour-card .tour-ph button {
    display: none;
  }
}

.tour-card .tour-text {
  margin: 14px 0 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--tour-mute);
}

.tour-card .tour-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}

.tour-card .tour-chips span {
  font-size: 13px;
  font-weight: 500;
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.26);
  padding: 4px 12px;
  border-radius: 999px;
}

.tour-card .tour-chips span[hidden] {
  display: none;
}

.tour-card .tour-chips span.more {
  border-style: dashed;
  color: var(--tour-mute);
}

/* The everyday services under their own small heading; the Lottery's note as plain text. */
.tour-card .tour-chips span.grp {
  margin-top: 4px;
  padding: 0;
  border: 0;
  border-radius: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tour-mute);
}

.tour-card .tour-chips span.note {
  align-self: flex-end;
  margin: 4px 0 0 auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  font-size: 11px;
  font-weight: 400;
  color: var(--tour-mute);
}

/* Before and after the heading's line. */
.tour-card .tour-chips span.brk {
  flex-basis: 100%;
  height: 0;
  padding: 0;
  border: 0;
}

.tour-card .tour-acts {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.tour-card .tour-acts a {
  flex: 1;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 46px;
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  text-align: center;
  line-height: 1.2;
}

/* Orange with navy words, as the page's own orange buttons (white on this orange is too
   faint to read easily). */
.tour-card .tour-acts a.tour-pri {
  background: var(--accent-bg);
  color: var(--navy);
  box-shadow: 0 8px 22px rgba(236, 98, 20, 0.32);
}

.tour-card .tour-acts a.tour-sec {
  border: 1px solid rgba(255, 255, 255, 0.36);
  color: var(--white);
}

@media (hover: hover) {
  .tour-card .tour-acts a:hover {
    text-decoration: underline;
  }
}

/* Short windows (a laptop at 1280 x 720): the name a little smaller (the photo gives way too). */
@media (min-width: 701px) and (max-height: 780px) {
  .tour-card h2 {
    font-size: clamp(40px, 3.6vw, 52px);
  }

  .tour-card .tour-body {
    padding: 20px 22px 22px;
  }
}

/* The arrows and the five site dots: a dark pill along the bottom. */
#tour-ui > .tour-sites {
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--tour-pill);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 5px;
  border-radius: 999px;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.tour-sites .tour-arrow {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: var(--white);
  color: var(--navy);
  font: 600 22px/1 var(--font-body);
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0 0 3px;
}

.tour-sites .tour-arrow:disabled {
  opacity: 0.35;
  cursor: default;
}

.tour-sdots {
  display: flex;
  gap: 4px;
  padding: 0 4px;
}

.tour-sdots button {
  width: 26px;
  height: 26px;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.tour-sdots button::after {
  content: "";
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.8);
  box-sizing: border-box;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.tour-sdots button.done::after,
.tour-sdots button.past::after {
  background: var(--accent);
  border-color: var(--accent);
}

.tour-sdots button.on::after {
  background: var(--accent);
  border-color: var(--accent);
  transform: scale(1.3);
  box-shadow: 0 0 0 3px rgba(232, 89, 12, 0.3);
}

.tour-sdots button.wait::after {
  animation: tour-wait 0.8s ease-in-out infinite alternate;
}

@keyframes tour-wait {
  to { opacity: 0.3; }
}

#tour-ui > .tour-skip,

#tour-ui > .tour-backmap {
  right: max(var(--gutter), env(safe-area-inset-right, 0px));
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  font: 600 14px var(--font-body);
  color: var(--white);
  background: var(--tour-pill);
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 9px 16px;
  border-radius: 999px;
  cursor: pointer;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.tour-skip::after {
  content: " \2193";
}

/* Back to map (Tom, 6 November 2026): at a stop with a fly-in, its fly-in backwards to the
   overview. Bottom left on a wide screen, opposite Skip tour; top left under the header where
   Skip tour is top right. */
#tour-ui > .tour-backmap {
  right: auto;
  left: max(var(--gutter), env(safe-area-inset-left, 0px));
}

.tour-backmap::before {
  content: "\2190 ";
}

@media (hover: hover) {
  .tour-skip:hover,
  .tour-backmap:hover {
    text-decoration: underline;
  }
}

#tour-ui > .tour-hint,
#tour-ui > .tour-waiting {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--white);
  background: var(--tour-pill);
  padding: 5px 12px;
  border-radius: 999px;
  white-space: nowrap;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

/* The cue at the tour's place, with a button: always a way in besides scrolling on. */
#tour-ui > .tour-hint {
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 5px 5px 14px;
}

.tour-here #tour-ui > .tour-hint {
  transition: opacity 0.3s ease, visibility 0s linear 0s;
}

.tour-here #tour-ui > .tour-hint:not(.on) {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

.tour-hint.ended > span {
  display: none;
}

.tour-start {
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: var(--accent-bg);
  color: var(--navy);
  font: 600 14px var(--font-body);
  cursor: pointer;
}

.tour-start::after {
  content: " \2193";
}

@media (hover: hover) {
  .tour-start:hover {
    text-decoration: underline;
  }
}

/* Phones: the snap areas (tour.js, snapPlaces()). */
.tour-snap-above {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  opacity: 0;
  pointer-events: none;
}

.tour-snap-above {
  scroll-snap-align: end;
}


html.tour-snap {
  scroll-snap-type: y mandatory;
}

#tour-ui > .tour-waiting {
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

#tour-ui button:focus-visible,
#tour-ui a:focus-visible,
#tour-ui [role="button"]:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* "Next stop", where the card was between stops: phones held upright only. */
#tour-ui > .tour-way {
  display: none;
}

/* Phones and narrow screens: the card as a navy sheet along the bottom (the photo beside
   the opening hours and what is there, the buttons under them); the arrows and dots along
   the bottom, Skip tour under the header. */
@media (max-width: 700px), (orientation: portrait) and (max-width: 900px) {
  #tour-ui > .tour-card {
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    width: auto;
    max-width: none;
    max-height: 70svh;
    border-radius: 22px 22px 0 0;
    border-bottom: 0;
    background: var(--navy);
    transform: translateY(24px);
  }

  .tour-here #tour-ui > .tour-card.on {
    transform: translateY(0);
  }

  /* Under the header, clear of the arrows and dots along the bottom. */
  #tour-ui > .tour-skip,
  #tour-ui > .tour-backmap {
    top: var(--tour-top, 72px);
    bottom: auto;
    padding: 7px 13px;
    font-size: 13px;
  }
}

/* The card's layout on phones (and narrow screens), upright or sideways. */
@media (max-width: 700px), (orientation: portrait) and (max-width: 900px), (orientation: landscape) and (max-height: 500px) {
  .tour-card .tour-body {
    display: grid;
    grid-template-columns: 46% minmax(0, 1fr);
    grid-template-areas:
      "kick kick"
      "title title"
      "area area"
      "ph open"
      "ph chips"
      "text text"
      "acts acts";
    grid-template-rows: auto auto auto auto 1fr auto auto;
    column-gap: 14px;
    flex: none;
    align-items: start;
    padding: 16px 18px calc(16px + env(safe-area-inset-bottom, 0px));
  }

  .tour-card .tour-kick { grid-area: kick; }
  .tour-card h2 { grid-area: title; font-size: 40px; margin-top: 8px; }
  .tour-card .tour-area { grid-area: area; font-size: 15px; margin-top: 4px; }
  .tour-card .tour-ph { grid-area: ph; margin-top: 14px; min-height: 0; border-radius: 12px; }
  .tour-card .tour-open { grid-area: open; margin-top: 14px; flex-direction: column; align-items: flex-start; position: relative; padding-left: 16px; font-size: 14px; }
  .tour-card .tour-chips { grid-area: chips; margin-top: 10px; gap: 6px; }
  .tour-card .tour-acts { grid-area: acts; margin-top: 16px; }
  .tour-card .tour-text { grid-area: text; margin-top: 12px; font-size: 14px; line-height: 1.4; }

  .tour-card .tour-open::before {
    position: absolute;
    left: 0;
    top: 6px;
  }

  .tour-card .tour-open span::before {
    content: none;
  }

  .tour-card .tour-chips span {
    font-size: 12px;
    padding: 3px 10px;
  }

  .tour-card .tour-chips span.grp,
  .tour-card .tour-chips span.brk {
    display: none;
  }

  .tour-card .tour-chips span.note {
    order: 1;
    margin: 0;
    align-self: center;
    font-size: 11px;
  }

  .tour-card .tour-acts a {
    min-height: 44px;
    font-size: 15px;
  }
}

/* A phone held sideways (the 16:9 tour): a compact navy glass card down the left, under the
   header, as tall as it needs up to the foot of the screen (scrolling beyond that); the arrows
   and dots along the bottom of the picture beside it, Skip tour under the header on the right.
   (Under 700px wide the rules above apply too; these undo them.) */
@media (orientation: landscape) and (max-height: 500px) {
  #tour-ui > .tour-card,
  .tour-here #tour-ui > .tour-card.on {
    left: max(12px, env(safe-area-inset-left, 0px));
    right: auto;
    top: var(--tour-top, 72px);
    bottom: auto;
    width: 310px;
    max-width: 46vw;
    max-height: calc(100svh - var(--tour-top, 72px) - 10px - env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
    background: var(--tour-glass);
    border: 1px solid var(--tour-glass-line);
    border-radius: 18px;
  }

  #tour-ui > .tour-card {
    transform: translateX(-20px);
  }

  .tour-here #tour-ui > .tour-card.on {
    transform: none;
  }

  .tour-card .tour-body {
    grid-template-areas:
      "kick kick"
      "title title"
      "area area"
      "ph open"
      "ph acts";
    grid-template-columns: 44% minmax(0, 1fr);
    grid-template-rows: auto auto auto auto 1fr;
    padding: 12px 14px 14px;
  }

  .tour-card .tour-chips,
  .tour-card .tour-text {
    display: none;
  }

  .tour-card .tour-open {
    font-size: 13px;
  }

  .tour-card .tour-acts {
    flex-direction: column;
    gap: 6px;
    align-self: end;
  }

  .tour-card .tour-segs {
    display: none;
  }

  .tour-card h2 {
    font-size: 30px;
    margin-top: 4px;
  }

  .tour-card .tour-area {
    font-size: 14px;
    margin-top: 2px;
  }

  .tour-card .tour-ph,
  .tour-card .tour-open {
    margin-top: 10px;
  }

  .tour-card .tour-acts {
    margin-top: 8px;
  }

  .tour-card .tour-acts a {
    min-height: 36px;
    padding: 5px 8px;
    font-size: 14px;
  }

  /* Centred in the picture beside the card. */
  #tour-ui > .tour-sites {
    left: calc((min(310px, 46vw) + 12px + 100vw) / 2);
  }

  #tour-ui > .tour-sites {
    top: auto;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  }

  #tour-ui > .tour-skip,
  #tour-ui > .tour-backmap {
    top: var(--tour-top, 72px);
    bottom: auto;
  }

  /* The cue and Start the tour under the header, top left (6 November 2026): over the middle of
     the town they covered the Bexhill pin on a phone held sideways. */
  #tour-ui > .tour-hint {
    top: var(--tour-top, 72px);
    bottom: auto;
    left: max(var(--gutter), env(safe-area-inset-left, 0px));
    transform: none;
  }
}

/* A phone held upright, once the tour is up: the 4:5 picture at the top, its foot fading into
   the navy panel under it (.tour-back, tour.css above), the arrows and dots in a dark pill
   over the foot of the picture, and in the panel the stop card (or, between stops, the stop
   it is going to), fading across. No box: the panel is part of the page. */
.tour-upright .tour-back {
  z-index: 31;
  background: var(--navy);
}

.tour-upright .tour-back::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: min(34vw, 40%);
  background: linear-gradient(to bottom, rgba(20, 33, 61, 0), rgba(20, 33, 61, 0.55) 55%, var(--navy));
  pointer-events: none;
}

.tour-upright #tour-ui > .tour-sites {
  top: calc(var(--pic-h) - 56px);
  bottom: auto;
}

.tour-upright #tour-ui > .tour-skip,

.tour-upright #tour-ui > .tour-backmap {
  top: var(--tour-top, 72px);
  bottom: auto;
}

.tour-upright #tour-ui > .tour-card,
.tour-upright #tour-ui > .tour-way {
  top: var(--pic-h);
  bottom: 0;
  left: 0;
  right: 0;
  width: auto;
  max-width: none;
}

.tour-upright #tour-ui > .tour-card {
  max-height: none;
  overflow: auto;
  overscroll-behavior: contain;
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.tour-upright #tour-ui > .tour-card,
.tour-upright.tour-here #tour-ui > .tour-card.on {
  transform: none;
}

/* The card and "Next stop" fade across each other in the panel. */
.tour-upright #tour-ui > .tour-card {
  transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

.tour-upright.tour-here #tour-ui > .tour-card.on {
  transition: opacity 0.35s ease 0.1s;
}

.tour-upright .tour-card .tour-body {
  padding-top: 6px;
}

.tour-upright #tour-ui > .tour-way {
  display: block;
  padding: 10px 18px;
  color: var(--tour-mute);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

.tour-upright.tour-here #tour-ui > .tour-way.on {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.35s ease 0.1s;
}

.tour-way strong {
  display: block;
  margin-top: 8px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 34px;
  line-height: 1;
  letter-spacing: 0;
  text-transform: none;
  color: var(--white);
}

/* Short phones (an iPhone SE, or a phone with its browser's bars showing): a compact card
   (no chips), the photo beside the opening hours and the two buttons; where even that would
   not fit, the picture gives up some height (tour.js sets --pic-h). */
.tour-upright.tour-tight .tour-card .tour-body {
  grid-template-areas:
    "kick kick"
    "title title"
    "area area"
    "ph open"
    "ph acts";
  grid-template-columns: 42% minmax(0, 1fr);
  grid-template-rows: auto auto auto auto 1fr;
  padding: 2px 16px calc(10px + env(safe-area-inset-bottom, 0px));
}

.tour-upright.tour-tight .tour-card h2 {
  font-size: 30px;
  margin-top: 6px;
}

.tour-upright.tour-tight .tour-card .tour-area {
  font-size: 14px;
  margin-top: 2px;
}

.tour-upright.tour-tight .tour-card .tour-chips,
.tour-upright.tour-tight .tour-card .tour-text {
  display: none;
}

.tour-upright.tour-tight .tour-card .tour-ph,
.tour-upright.tour-tight .tour-card .tour-open {
  margin-top: 10px;
}

.tour-upright.tour-tight .tour-card .tour-open {
  flex-direction: row;
  flex-wrap: wrap;
  column-gap: 4px;
  font-size: 13px;
}

.tour-upright.tour-tight .tour-card .tour-open::before {
  top: 4px;
}

.tour-upright.tour-tight .tour-card .tour-open span::before {
  content: "\00B7\00A0";
}

.tour-upright.tour-tight .tour-card .tour-acts {
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
  align-self: end;
}

.tour-upright.tour-tight .tour-card .tour-acts a {
  min-height: 36px;
  padding: 5px 8px;
  font-size: 14px;
}

.tour-upright.tour-tight #tour-ui > .tour-sites {
  top: calc(var(--pic-h) - 50px);
  padding: 3px;
}

.tour-upright.tour-tight .tour-sites .tour-arrow {
  width: 32px;
  height: 32px;
  font-size: 20px;
}

.tour-upright.tour-tight .tour-way strong {
  font-size: 28px;
}

/* Compact cards (short phones, phones held sideways): "Google Maps" alone on the button. */
.tour-upright.tour-tight .tour-long {
  display: none;
}

@media (orientation: landscape) and (max-height: 500px) {
  .tour-long {
    display: none;
  }
}

/* Reduced motion: nothing slides; a quick fade. (The tour itself is off then, below.) */
@media (prefers-reduced-motion: reduce) {
  #tour-ui > .tour-card,
  .tour-here #tour-ui > .tour-card.on,
  .tour-card .tour-body > *,
  .tour-card.on .tour-body > * {
    transform: none !important;
    transition-duration: 0.15s !important;
    transition-delay: 0s !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  #tour-ui {
    display: none;
  }
}

/* A card's photo full screen (touch screens), with a close button; swiping down closes it. */
.tour-zoom {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  background: rgb(10, 16, 30);
  opacity: 0;
  transition: opacity 0.2s ease;
  touch-action: none;
}

.tour-zoom.on {
  opacity: 1;
}

.tour-zoom picture {
  display: block;
  width: 100%;
  transition: transform 0.15s ease;
}

.tour-zoom img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 100svh;
  object-fit: contain;
}

.tour-zoom-close {
  position: absolute;
  top: calc(14px + env(safe-area-inset-top, 0px));
  right: max(14px, env(safe-area-inset-right, 0px));
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 0;
  background: var(--white);
  color: var(--navy);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.tour-zoom-close:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
