/* The town hero (town.js): the Blender model village, held at the top of the window
   while a stretch of page scrolls past under it (.town-scrub). The intro lifts away,
   the town sharpens, and the orange line draws from the header's wordmark through
   the five sites, then drops out of the bottom into the Tap line. The header over
   it, and the header on phones. Sits on top of styles.css. */

/* The header lies over the top of the town, on a light frosted strip. While the town is held the header is held with it (town.js
   switches it from fixed to resting where the Tap line has covered it). It sits
   under everything that follows the hero, so the Tap line slides over it too. */
.site-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1;
  background: rgba(255, 255, 255, 0.86);
  border-bottom-color: rgba(229, 226, 220, 0.8);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.js .site-header.is-held {
  position: fixed;
}

.js .site-header.is-free {
  top: var(--town-free, 0px);
}

.site-header .site-nav {
  margin-left: auto;
}

/* The stage: as tall as the largest viewport, so the town always reaches the foot of
   the window as a phone's address bar comes and goes. */
.town {
  --town-dim: rgba(20, 33, 61, 0.34);
  --town-scrim: rgba(247, 246, 243, 0.84);
  position: relative;
  height: 100vh;
  height: 100lvh;
  min-height: 520px;
  overflow: hidden;
  background: #46503F;
  color: var(--navy);
}

/* Held while the stretch below scrolls past, then covered by the Tap line. Everything
   after the hero sits above it (styles.css does the same when the curtain runs). */
.js #hero {
  position: sticky;
  top: 0;
  z-index: 0;
}

.js main > :not(#hero) {
  position: relative;
  z-index: 1;
}

/* The stretch of page that scrolls past under the held town. It paints nothing and
   must not catch the pointer on its way over the pins. */
.town-scrub {
  display: none;
  pointer-events: none;
}

.js .town-scrub {
  display: block;
  height: 200vh;
  height: 200svh;
}

.town__view {
  position: absolute;
  inset: 0;
}

/* The picture's own box: the area the still covers (as object-fit: cover would),
   worked out here from the town's size (container units), so nothing moves when the
   page has loaded. The pins, the line and the masks are placed in it by the picture's
   own percentages. Where container units are missing, town.js sizes it instead. No
   transform, so the line inside can sit above the curtain's dimming. */
.town {
  container-type: size;
}

.town__frame {
  --fw: max(100cqw, 100cqh * 16 / 9);
  --fh: max(100cqh, 100cqw * 9 / 16);
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--fw);
  height: var(--fh);
  margin-left: calc(var(--fw) / -2);
  margin-top: calc(var(--fh) / -2);
}

@media (orientation: portrait) {
  .town__frame {
    --fw: max(100cqw, 100cqh * 9 / 16);
    --fh: max(100cqh, 100cqw * 16 / 9);
  }
}

@supports not (width: 1cqw) {
  .town__frame {
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    margin: 0;
  }
}

.town__img,
.town__soft {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
}

/* A blurred copy over the sharp picture, faded out as the intro lifts. */
.town__soft {
  opacity: 0;
  filter: blur(10px) saturate(0.9);
  transform: scale(1.04);
}

.motion .town__soft {
  opacity: 1;
}

/* Highlighting a site: the town dims a little, and the site, cut from the same picture
   by its alpha mask, sits on top undimmed. */
.town__dim,
.town__lit {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.town__dim {
  background: var(--town-dim);
}

.town__lit {
  background-size: 100% 100%;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  filter: brightness(1.06);
}

.town.is-lit .town__dim,
.town.is-lit .town__lit {
  opacity: 1;
}

/* The line, in the picture's pixels (town.js draws it). Above the curtain's dimming,
   like the Tap line it joins, so the two stay one colour. */
.town__line {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 31;
  overflow: visible;
  pointer-events: none;
}

.town__line path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.town__ghost {
  stroke: rgba(255, 255, 255, 0.6);
  stroke-width: 3;
  stroke-dasharray: 2 9;
}

.town__live {
  stroke: var(--accent);
  stroke-width: 4;
}

/* The intro, on a soft wash of the page colour across the left of the town. */
.town__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--town-scrim) 0%, var(--town-scrim) 36%, rgba(247, 246, 243, 0) 80%);
  pointer-events: none;
}

.town__intro {
  position: absolute;
  z-index: 5;
  left: 0;
  right: 0;
  top: max(22%, 116px);
}

.town__mark {
  display: flex;
  align-items: center;
  gap: 0.14em;
  margin: 0;
  font-size: clamp(76px, 11vw, 160px);
  line-height: 0.8;
  color: var(--navy);
}

.town__tap {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0.005em;
}

.town__bar {
  display: block;
  width: 0.04em;
  min-width: 3px;
  height: 0.74em;
  border-radius: 2px;
  background: var(--accent);
}

.town__retail {
  font-size: 0.46em;
  font-weight: 400;
}

.town__title {
  max-width: 18ch;
  margin: clamp(22px, 3.4vh, 32px) 0 0;
  font-size: clamp(30px, 3.4vw, 50px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.town__sub {
  max-width: 40ch;
  margin: 12px 0 0;
  font-size: clamp(17px, 1.35vw, 20px);
  line-height: 1.5;
  color: #3E4659;
}

/* It moves the town on, so only while the script runs. */
html:not(.js) .town__explore {
  display: none;
}

.town__explore {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 26px;
}

/* Pins: a dot and the site's name. They appear as the line reaches them. */
/* Above the line (31), so the line runs under the dots, names, card and panel. */
/* The layer covers the whole town but lets clicks through to what is under it ("Explore
   our sites" was unclickable under it until 8 November 2026); only the pins take them. */
.town__pins {
  position: absolute;
  inset: 0;
  z-index: 32;
  pointer-events: none;
}

.town__pin {
  position: absolute;
  display: flex;
  align-items: center;
  padding: 0;
  border: 0;
  background: none;
  color: var(--navy);
  font: 600 15px/1.2 var(--font-body);
  cursor: pointer;
  pointer-events: auto;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -50%) scale(0.5);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0s linear 0.3s;
}

.town__pin.is-on {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0s;
}

.town__pin:focus-visible {
  outline: none;
}

.town__dot {
  flex: none;
  width: 22px;
  height: 22px;
  border: 4px solid var(--white);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s ease;
}

.town__pin:hover .town__dot,
.town__pin.is-sel .town__dot {
  transform: scale(1.18);
}

.town__pin:focus-visible .town__dot {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.town__label {
  position: absolute;
  left: 30px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--white);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.28);
  white-space: nowrap;
}

.town__pin.is-left .town__label {
  left: auto;
  right: 30px;
}

.town__pin.is-up .town__label {
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
}

.town__pin.is-down .town__label {
  left: 50%;
  top: 28px;
  transform: translateX(-50%);
}

.town__pin:focus-visible .town__label {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* The card: name, area, what is there, and the way to the map. */
.town__card {
  position: absolute;
  z-index: 33;
  width: 300px;
  max-width: calc(100% - 32px);
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--white);
  box-shadow: 0 18px 44px rgba(20, 33, 61, 0.2);
  color: var(--navy);
}

.town__card-name {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.15;
}

.town__card-area {
  margin: 2px 0 0;
  font-size: 15px;
  color: var(--ink-soft);
}

.town__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.town__chips li {
  padding: 3px 10px;
  border-radius: 20px;
  background: #F0ECE5;
  font-size: 14px;
}

/* The everyday services' heading, the Lottery's note and "+N more" (a phone's card). */
.town__chips li.grp {
  flex-basis: 100%;
  margin-top: 4px;
  padding: 0;
  background: none;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.town__chips li.note {
  align-self: center;
  padding: 0 2px;
  background: none;
  font-size: 12px;
  color: var(--ink-soft);
}

.town__chips li.more {
  border: 1px dashed var(--line);
  background: none;
  color: var(--ink-soft);
}

.town__maplink {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 4px;
  font-size: 16px;
  font-weight: 600;
  color: var(--accent-deep);
  text-decoration: none;
}

.town__maplink:hover {
  color: var(--accent-deep);
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* The panel: the site's close-up, larger, over the town. */
.town__panel {
  position: absolute;
  inset: 0;
  z-index: 34;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 96px var(--gutter) 40px;
  background: rgba(20, 33, 61, 0.42);
}

.town__panel-box {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  width: min(1080px, 100%);
  max-height: 100%;
  overflow: hidden;
  border-radius: 18px;
  background: var(--white);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.town__panel-photo {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #DAD5CB;
}

/* The views, side by side; swiped or scrolled sideways, snapping to each. */
.town__shots {
  display: flex;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow-x: auto;
  overflow-y: hidden;
  list-style: none;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}

.town__shots::-webkit-scrollbar {
  display: none;
}

.town__shot {
  flex: 0 0 100%;
  height: 100%;
  scroll-snap-align: start;
}

.town__shot picture,
.town__shot img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
}

.town__step {
  position: absolute;
  top: 50%;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-top: -22px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--navy);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  cursor: pointer;
}

.town__step--prev {
  left: 12px;
}

.town__step--next {
  right: 12px;
}

.town__step:disabled {
  opacity: 0;
  pointer-events: none;
}

.town__dots {
  position: absolute;
  left: 50%;
  bottom: 12px;
  display: flex;
  gap: 6px;
  margin: 0;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(20, 33, 61, 0.45);
  transform: translateX(-50%);
}

.town__dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
}

.town__dots i.is-on {
  background: var(--white);
}

.town__caption {
  margin: 10px 0 0;
  font-size: 15px;
  font-weight: 600;
}

.town__caption:empty {
  display: none;
}

.town__panel-body {
  padding: 24px 22px;
}

.town__close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--white);
  color: var(--navy);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  cursor: pointer;
}

/* The hint, along the foot of the town. */
.town__hint {
  position: absolute;
  z-index: 6;
  left: 50%;
  bottom: calc(22px + 100lvh - 100svh);
  margin: 0;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  font-size: 14px;
  font-weight: 600;
  transform: translateX(-50%);
  transition: opacity 0.3s ease;
  pointer-events: none;
}

/* Phones (and any window taller than it is wide): the wash runs down from the top. */
@media (orientation: portrait) {
  .town__scrim {
    background: linear-gradient(180deg, var(--town-scrim) 0%, var(--town-scrim) 50%, rgba(247, 246, 243, 0) 82%);
  }

  .town__panel-box {
    grid-template-columns: minmax(0, 1fr);
    width: min(460px, 100%);
    overflow: auto;
  }

  .town__panel-photo {
    aspect-ratio: 4 / 5;
    max-height: 56svh;
  }
}

@media (max-width: 759px) {
  .town__intro {
    top: 104px;
  }

  .town__mark {
    font-size: clamp(64px, 21vw, 96px);
  }

  .town__title {
    margin-top: 20px;
    font-size: clamp(28px, 8.4vw, 36px);
  }

  .town__sub {
    margin-top: 10px;
    font-size: 16px;
    line-height: 1.45;
  }

  .town__explore {
    margin-top: 22px;
  }

  .town__pin {
    font-size: 14px;
  }

  .town__label {
    padding: 2px 8px;
  }

  .town__hint {
    display: none;
  }

  .town__panel {
    padding: 76px 16px calc(24px + 100lvh - 100svh);
  }

  .town__panel-body {
    padding: 18px 18px 20px;
  }
}

/* With reduced motion: nothing blurs, fades or draws; the states simply change. */
@media (prefers-reduced-motion: reduce) {
  .town__pin,
  .town__pin.is-on,
  .town__dim,
  .town__lit,
  .town__hint {
    transition: none;
  }
}
