/* ==========================================================================
   Upper Beaconsfield Village Festival
   site.css — single stylesheet for the whole site
   --------------------------------------------------------------------------
   Contents
     1.  Design tokens
     2.  Reset & base
     3.  Layout primitives
     4.  Typography
     5.  Buttons
     6.  Header & navigation
     7.  Hero / banner
     8.  Photo strip
     9.  Countdown & donate bands
     10. Cards & quick links
     11. Programme list
     12. Feature rows
     13. Map & notices
     14. Galleries & lightbox
     15. Sponsors
     16. Forms & prose blocks
     17. Modal
     18. Footer
     19. Utilities
   ========================================================================== */


/* ==========================================================================
   1. Design tokens
   ========================================================================== */

:root {
  /* Brand palette. One token per colour — no near-duplicates. */
  --navy:        #20409a;
  --navy-dark:   #1a3480;
  --navy-darker: #14285f;
  --blue:        #004bad;
  --blue-dark:   #003b8a;
  --sky:         #13c3f2;
  --sky-dark:    #0ea5cf;
  --green:       #40ff83;
  --green-dark:  #22e068;
  --yellow:      #f5cf47;
  --cream:       #f7f3e5;   /* Montague Farms' own background */
  --art-bg:      #f1ebeb;   /* the Art Exhibition logo's own background */

  /* Tower Run — each distance carries its sponsor's colour, as the original
     did. Three tokens per distance:
       --accent      the vivid brand colour, for fills and bullets
       --accent-ink  a darker cut for text and button backgrounds, so
                     white-on-colour and colour-on-white both clear 4.5:1
       --accent-tint a pale wash for section backgrounds                     */
  --kids-accent:   #f5890b;  --kids-ink:   #b16307;  --kids-tint:   #fff4e6;  /* Leisure Pools */
  --peake-accent:  #3a2077;  --peake-ink:  #3a2077;  --peake-tint:  #f1eef8;  /* Peake */
  --expert-accent: #00a6ef;  --expert-ink: #007eb6;  --expert-tint: #e8f7fe;  /* My Expert */
  --gp-accent:     #e01b22;  --gp-ink:     #e01b22;  --gp-tint:     #fdedee;  /* GP & Pharmacy */

  /* Neutrals */
  --ink:      #101828;
  --body:     #4a4a4a;
  --muted:    #666666;
  --faint:    #8a8a8a;
  --line:     #e6e6ea;
  --line-soft:#f0f0f3;
  --surface:  #f5f5f7;
  --white:    #ffffff;

  /* Typography */
  --font: "Inter", "Inter Placeholder", -apple-system, BlinkMacSystemFont,
          "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  /* Display serif — the Art & Photography Exhibition's own voice */
  --font-serif: "DM Serif Display", Georgia, "Times New Roman", serif;

  --step--1: 0.9375rem;                            /* 15px */
  --step-0:  1rem;                                 /* 16px */
  --step-1:  1.125rem;                             /* 18px */
  --step-2:  1.375rem;                             /* 22px */
  --step-3:  clamp(1.5rem, 1.2rem + 1.2vw, 2rem);  /* 24 → 32px */
  --step-4:  clamp(1.75rem, 1.3rem + 2vw, 2.5rem); /* 28 → 40px */
  --step-5:  clamp(2rem, 1.4rem + 2.8vw, 3rem);    /* 32 → 48px */

  /* Spacing */
  --section-y:   clamp(2.25rem, 1.7rem + 2.4vw, 3.75rem);
  --gutter:      clamp(1.25rem, 0.9rem + 1.6vw, 2rem);
  --container:   1180px;
  --measure:     62ch;

  /* Shape & motion */
  --radius:    16px;
  --radius-sm: 12px;
  --radius-pill: 100px;
  --shadow:    0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.06);
  --shadow-lg: 0 4px 12px rgba(16, 24, 40, 0.08), 0 24px 48px rgba(16, 24, 40, 0.12);
  --ease:      cubic-bezier(0.2, 0.6, 0.2, 1);
  --ease-back: cubic-bezier(0.34, 1.4, 0.5, 1);   /* slight overshoot, for playful motion */
  --speed:     180ms;

  --header-h: 80px;
}


/* ==========================================================================
   2. Reset & base
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);

  /* Without this the rubber-band overscroll on macOS/iOS drags the whole
     document — sticky header included — leaving it floating mid-page. Must
     sit on the root: overscroll-behavior on <body> does not reach the
     viewport the way overflow does. */
  overscroll-behavior-y: none;
  background: var(--white);
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--step-0);
  font-weight: 500;
  line-height: 1.6;
  color: var(--body);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, p, figure, blockquote, ul, ol, dl { margin: 0; }
ul, ol { padding: 0; list-style: none; }

img, svg, video { display: block; max-width: 100%; height: auto; }

a { color: inherit; text-decoration: none; }

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

:focus-visible {
  outline: 3px solid var(--sky);
  outline-offset: 3px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Keyboard users get a way past the nav */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  padding: 12px 20px;
  background: var(--navy);
  color: var(--white);
  font-weight: 700;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }


/* ==========================================================================
   3. Layout primitives
   ========================================================================== */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container--narrow { max-width: 880px; }

.section { padding-block: var(--section-y); }
.section--tight  { padding-block: calc(var(--section-y) * 0.6); }
.section--flush  { padding-block: 0; }

.section--surface { background: var(--surface); }
.section--navy    { background: var(--navy); color: rgba(255, 255, 255, 0.88); }
.section--sky     { background: var(--sky); }
.section--green   { background: var(--green); color: var(--ink); }
.section--cream   { background: var(--cream); }
/* Montague's logo has the same cream baked in, so drop the media well and let
   it sit directly on the section. */
.section--cream .feature__media { background: transparent; }

/* The Art Exhibition logo is a circle on its own blush ground; matching the
   well to it means the logo sits on colour rather than in a grey box. */
.media--art { background: var(--art-bg) !important; }

/* A section can adopt an accent colour by setting --accent / --accent-tint.
   Everything below keys off those two values, so adding a distance means
   adding one pair of colours — not a new set of rules. */
.section--accent  { background: var(--accent-tint); }
.text-accent      { color: var(--accent-ink); }

/* Section heading block */
.section-head {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  text-align: center;
  margin-bottom: clamp(1.5rem, 1.15rem + 1.4vw, 2.25rem);
}
.section-head--start { align-items: flex-start; text-align: left; }
.section-head p { max-width: var(--measure); }


/* ==========================================================================
   4. Typography
   ========================================================================== */

/* One scale, one family, applied consistently across every section heading. */
h1, h2, h3, h4, .h1, .h2, .h3 {
  font-family: var(--font);
  color: var(--ink);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h1, .h1 { font-size: var(--step-5); }
h2, .h2 { font-size: var(--step-4); }
h3, .h3 { font-size: var(--step-2); line-height: 1.25; letter-spacing: -0.015em; }
h4      { font-size: var(--step-1); line-height: 1.35; letter-spacing: -0.01em; }

.eyebrow {
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sky-dark);
}

p { text-wrap: pretty; }
.lead { font-size: var(--step-1); line-height: 1.65; max-width: var(--measure); }
.prose { max-width: var(--measure); }
.prose p + p { margin-top: 1em; }
.muted { color: var(--muted); }

/* Inline links inside body copy get an underline so they read as links */
.prose a:not(.btn) {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}
.prose a:not(.btn):hover { color: var(--navy); }

.text-navy  { color: var(--navy); }
.text-sky   { color: var(--sky); }
.text-white { color: var(--white); }


/* ==========================================================================
   5. Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 26px;
  border: 2px solid transparent;
  border-radius: var(--radius-pill);
  font-size: var(--step-0);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.01em;
  text-align: center;
  cursor: pointer;
  transition: background-color var(--speed) var(--ease),
              border-color var(--speed) var(--ease),
              color var(--speed) var(--ease),
              transform var(--speed) var(--ease);
}
.btn:hover  { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn--navy  { background: var(--navy); color: var(--white); border-color: var(--navy); }
.btn--navy:hover { background: var(--navy-dark); border-color: var(--navy-dark); }

.btn--blue  { background: var(--blue); color: var(--white); border-color: var(--blue); }
.btn--blue:hover { background: var(--blue-dark); border-color: var(--blue-dark); }

.btn--sky   { background: var(--sky); color: var(--white); border-color: var(--sky); }
.btn--sky:hover { background: var(--sky-dark); border-color: var(--sky-dark); }

.btn--dark  { background: var(--ink); color: var(--white); border-color: var(--ink); }
.btn--dark:hover { background: #000; border-color: #000; }

.btn--white { background: var(--white); color: var(--navy); border-color: var(--white); }
.btn--white:hover { background: var(--surface); border-color: var(--surface); }

/* Outline variant — border colour follows the text colour */
.btn--outline { background: transparent; color: var(--navy); border-color: currentColor; }
.btn--outline:hover { background: var(--navy); color: var(--white); border-color: var(--navy); }

.btn--outline-white { background: transparent; color: var(--white); border-color: currentColor; }
.btn--outline-white:hover { background: var(--white); color: var(--navy); }

.btn--accent { background: var(--accent-ink); color: var(--white); border-color: var(--accent-ink); }
.btn--accent:hover { filter: brightness(0.9); }

.btn--accent-outline { background: transparent; color: var(--accent-ink); border-color: currentColor; }
.btn--accent-outline:hover { background: var(--accent-ink); color: var(--white); }

/* Strava's own orange. White on it measures 3.4:1, which meets AA at large
   sizes only — hence the 19px/700 label rather than the usual 16px. */
.btn--strava {
  background: #fc4c02;
  color: var(--white);
  border-color: #fc4c02;
  gap: 10px;
  font-size: 19px;
  font-weight: 700;
}
.btn--strava:hover { background: #e04402; border-color: #e04402; color: var(--white); }
.btn--strava img { width: 26px; height: 26px; }

/* Registration isn't open yet and we have no 2027 link, so the sign-up
   buttons render as inert <span>s rather than links to a dead page. Rendered
   as spans (not <a href>) so they are not focusable or clickable at all. */
.btn--disabled {
  background: var(--line-soft);
  color: var(--faint);
  border-color: var(--line);
  cursor: not-allowed;
  box-shadow: none;
}
.btn--disabled:hover { background: var(--line-soft); color: var(--faint); transform: none; }

.signup-note {
  margin-top: 10px;
  color: var(--faint);
  font-size: var(--step--1);
  text-align: center;
}

.btn--sm { min-height: 40px; padding: 0 18px; font-size: var(--step--1); }

/* A closed application is a statement, not a link */
.btn[aria-disabled="true"],
.btn:disabled {
  background: var(--line);
  border-color: var(--line);
  color: var(--faint);
  cursor: not-allowed;
  pointer-events: none;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.btn-row--center { justify-content: center; }


/* ==========================================================================
   6. Header & navigation
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}

/* Belt and braces for engines that ignore overscroll-behavior: paints the
   header's own background up over the area a bounce would expose, so the bar
   reads as flush with the top of the window rather than detaching from it. */
.site-header::before {
  content: "";
  position: absolute;
  inset: auto 0 100% 0;
  height: 100vh;
  background: inherit;
  pointer-events: none;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: var(--header-h);
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}
.brand__logo { width: auto; height: 58px; }

@media (max-width: 520px) {
  .brand { gap: 10px; }
  .brand__logo { height: 44px; }
  .social-row img { width: 24px; height: 24px; }
}

.social-row { display: flex; align-items: center; gap: 10px; }
.social-row a { display: block; transition: transform var(--speed) var(--ease); }
.social-row a:hover { transform: translateY(-2px); }
.social-row img { width: 28px; height: 28px; border-radius: 6px; }

.nav { display: flex; align-items: center; gap: 4px; }

.nav a {
  display: block;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--body);
  white-space: nowrap;
  transition: background-color var(--speed) var(--ease), color var(--speed) var(--ease);
}
.nav a:hover { background: var(--surface); color: var(--navy); }

/* Current page is marked with aria-current in the markup */
.nav a[aria-current="page"] { color: var(--navy); background: rgba(32, 64, 154, 0.08); }

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
}
.nav-toggle:hover { background: var(--surface); }
.nav-toggle__bars { position: relative; width: 22px; height: 2px; background: var(--ink); border-radius: 2px; }
.nav-toggle__bars::before,
.nav-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 22px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform var(--speed) var(--ease), top var(--speed) var(--ease);
}
.nav-toggle__bars::before { top: -7px; }
.nav-toggle__bars::after  { top: 7px; }

[aria-expanded="true"] .nav-toggle__bars { background: transparent; }
[aria-expanded="true"] .nav-toggle__bars::before { top: 0; transform: rotate(45deg); }
[aria-expanded="true"] .nav-toggle__bars::after  { top: 0; transform: rotate(-45deg); }

@media (max-width: 900px) {
  .nav-toggle { display: flex; }

  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 12px var(--gutter) 20px;
    background: var(--white);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    display: none;
  }
  .nav[data-open="true"] { display: flex; }
  .nav a { padding: 12px 14px; font-size: var(--step-0); }
}


/* ==========================================================================
   7. Hero / banner
   ========================================================================== */

.hero {
  background: var(--sky);
  color: var(--white);
  padding-block: clamp(2rem, 1.4rem + 2.6vw, 3.25rem);
}

.hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
  gap: clamp(1.75rem, 1.1rem + 2.8vw, 3.25rem);
  align-items: center;
}

.hero__logo { width: 100%; max-width: 300px; margin-inline: auto; }

.hero__title {
  color: var(--navy);
  font-size: var(--step-5);
  margin-bottom: 18px;
}

/* The date/time lines: italic, heavy, white */
.hero__date {
  font-size: clamp(1.25rem, 1rem + 1.2vw, 1.875rem);
  font-weight: 800;
  font-style: italic;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--white);
}
.hero__note {
  margin-top: 6px;
  font-size: clamp(1rem, 0.9rem + 0.5vw, 1.3125rem);
  font-weight: 700;
  font-style: italic;
  color: rgba(255, 255, 255, 0.95);
}

.hero__body {
  margin-top: 20px;
  max-width: 56ch;
  font-size: var(--step-0);
  line-height: 1.7;
  color: var(--navy);
}

.hero__actions { margin-top: 28px; }

@media (max-width: 860px) {
  .hero__inner { grid-template-columns: 1fr; text-align: center; }
  .hero__logo  { max-width: 240px; }
  .hero__body  { margin-inline: auto; }
  .hero__actions { justify-content: center; }
}

/* Compact hero used on interior pages */
.page-hero {
  padding-block: clamp(2rem, 1.5rem + 2vw, 3rem);
  text-align: center;
}
.page-hero__logo { width: min(220px, 60vw); margin: 0 auto 24px; }
.page-hero__title { margin-bottom: 14px; }
.page-hero__sub { max-width: 60ch; margin: 0 auto; font-size: var(--step-1); color: var(--muted); }
.page-hero .btn-row { margin-top: 28px; justify-content: center; }


/* ==========================================================================
   8. Photo strip
   ========================================================================== */

/* The signature band: three photos at different sizes, each tilted a different
   amount so their corners overlap. Hovering one straightens it, scales it up and
   brings it to the front.

   Sizes are the design's own pixel values multiplied by --u, a "scaled pixel"
   that shrinks with the viewport below ~1000px. That keeps the whole
   composition — sizes, angles and overlaps — in exact proportion at every
   width, instead of reflowing into a tidy row. */
.photo-strip {
  padding-block: clamp(1.5rem, 1.1rem + 1.8vw, 2.5rem);
  overflow: hidden;
}

.photo-strip__row {
  --u: min(1px, 0.105vw);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0;                      /* the overlap comes from the rotations */
  min-height: calc(380 * var(--u));
}

.photo-strip figure {
  flex: none;
  border-radius: calc(25 * var(--u));
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(16, 24, 40, 0.14);
  transition: transform 420ms var(--ease-back), box-shadow 420ms var(--ease);
}

.photo-strip img { width: 100%; height: 100%; object-fit: cover; }

.photo-strip figure:nth-child(1) {
  width:  calc(254 * var(--u));
  height: calc(172 * var(--u));
  transform: rotate(-14deg);
  z-index: 0;
}
.photo-strip figure:nth-child(2) {
  width:  calc(429 * var(--u));
  height: calc(290 * var(--u));
  transform: rotate(5deg);
  z-index: 1;                  /* the big one sits on top */
}
.photo-strip figure:nth-child(3) {
  width:  calc(266 * var(--u));
  height: calc(289 * var(--u));
  transform: rotate(-15deg);
  z-index: 0;
}

.photo-strip figure:hover,
.photo-strip figure:focus-within {
  transform: rotate(0deg) scale(1.05);
  box-shadow: 0 18px 44px rgba(16, 24, 40, 0.22);
  z-index: 3;
}

/* Below the point where three tilted photos get cramped, show two at a
   comfortable size and keep the same tilt-and-overlap character. */
@media (max-width: 640px) {
  .photo-strip__row { min-height: 0; }
  .photo-strip figure { border-radius: 18px; }
  .photo-strip figure:nth-child(1) {
    width: 40%; height: auto; aspect-ratio: 254 / 172;
  }
  .photo-strip figure:nth-child(2) {
    width: 56%; height: auto; aspect-ratio: 429 / 290;
  }
  .photo-strip figure:nth-child(3) { display: none; }
}


/* ==========================================================================
   9. Countdown & donate bands
   ========================================================================== */

.band { text-align: center; }
.band__title { margin-bottom: 12px; }
.band__body { max-width: 56ch; margin: 0 auto 24px; }

.band--navy .band__title { color: var(--white); }
.band--navy .band__body  { color: rgba(255, 255, 255, 0.9); }

.countdown {
  display: inline-flex;
  gap: clamp(0.5rem, 0.2rem + 1.5vw, 1.5rem);
  padding: clamp(0.75rem, 0.55rem + 0.9vw, 1.25rem) clamp(1.25rem, 0.8rem + 2vw, 2.5rem);
  background: var(--navy);
  border-radius: var(--radius);
  color: var(--white);
}
.countdown__unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 62px;
}
.countdown__value {
  font-size: clamp(1.75rem, 1.3rem + 2vw, 2.75rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--white);
}
.countdown__label {
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.75);
}

.countdown-meta { margin-top: 24px; }
.countdown-meta__date {
  font-size: var(--step-2);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--navy);
}
.countdown-meta__note {
  margin-top: 4px;
  font-style: italic;
  font-weight: 600;
  color: var(--muted);
}


/* ==========================================================================
   10. Cards & quick links
   ========================================================================== */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: clamp(1rem, 0.6rem + 1.6vw, 1.75rem);
}

/* Four equal columns once there is room, so the run distances don't break 3 + 1 */
.card-grid--4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
@media (min-width: 1000px) {
  .card-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

/* Fixed ratio keeps the quick-link cards aligned regardless of source
   image dimensions. */
.card__media {
  aspect-ratio: 4 / 3;
  background: var(--surface);
  overflow: hidden;
}
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__media--contain img { object-fit: contain; padding: 18px; }

.card__body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 22px 20px 26px;
  text-align: center;
  margin-top: auto;
}
.card__title { color: var(--navy); }


/* --------------------------------------------------------------------------
   Tower Run distance cards
   Each card wears its distance's colour: a thick bar across the top, the
   distance itself in the accent, and a tinted media well behind the logo.
   -------------------------------------------------------------------------- */

.card--run .card__media { background: var(--accent-tint); }
.card--run .card__title {
  color: var(--accent-ink);
  font-size: var(--step-3);
  font-weight: 900;
  letter-spacing: -0.04em;
}
.card--run .card__body { gap: 6px; padding-top: 18px; }

/* The route sections further down the page */
.run-route .feature__title,
.run-route .run-route__title { color: var(--accent-ink); }

.run-route__title {
  font-size: var(--step-3);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 6px;
}

/* Distance set in the accent, oversized, as a label above the title */
.run-route__distance {
  display: block;
  font-size: clamp(2.5rem, 1.6rem + 3.6vw, 4rem);
  font-weight: 900;
  font-style: italic;
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: var(--accent-ink);
  margin-bottom: 4px;
}

.run-route__sponsor { max-width: 200px; margin-bottom: 22px; }

.run-route .detail-list dt { color: var(--accent-ink); }

.run-route .feature__media { background: transparent; }

/* Prize columns pick up the same distance colours */
.prize-col {
  padding: 22px 24px 26px;
  background: var(--accent-tint);
  border-radius: var(--radius);
}
.prize-col__title {
  margin-bottom: 14px;
  font-size: var(--step-2);
  font-weight: 900;
  font-style: italic;
  letter-spacing: -0.03em;
  color: var(--accent-ink);
}
.prize-col .list li::before { background: var(--accent); }


/* ==========================================================================
   11. Programme list
   ========================================================================== */

/* "Activities & Events" — a timeline down the day. A rail runs behind the
   markers; each entry sits against it with its time as a pill where there is
   a single one, or as a note line where the timing needs a sentence. */
.programme {
  position: relative;
  max-width: 680px;
  margin-inline: auto;
  display: grid;
  gap: 4px;
}
/* the rail */
.programme::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 12px;
  bottom: 12px;
  width: 2px;
  background: linear-gradient(var(--navy), var(--sky));
  border-radius: 2px;
}

.programme__item {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 12px 0 12px 40px;
}

/* marker on the rail */
.programme__item::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 1.15em;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--white);
  border: 3px solid var(--navy);
  box-sizing: border-box;
}
.programme__item:nth-child(even)::before { border-color: var(--sky); }

.programme__name {
  font-size: var(--step-2);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--navy);
}
.programme__item:nth-child(even) .programme__name { color: var(--sky-dark); }

/* a single clock time reads as a pill */
.programme__pill {
  flex: none;
  padding: 3px 12px;
  border-radius: var(--radius-pill);
  background: var(--navy);
  color: var(--white);
  font-size: var(--step--1);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.programme__item:nth-child(even) .programme__pill { background: var(--sky-dark); }

/* longer timing text goes on its own line */
.programme__note {
  flex-basis: 100%;
  margin-top: -2px;
  font-size: var(--step--1);
  color: var(--muted);
}

.programme__item .btn { flex: none; }

@media (max-width: 520px) {
  .programme__item { padding-left: 34px; }
  .programme::before { left: 8px; }
  .programme__item::before { left: 1px; }
}

/* Stage lineup — a two-column time/act list */
.timetable { max-width: 640px; margin-inline: auto; border-top: 1px solid var(--line); }
.timetable__row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 20px;
  align-items: baseline;
  padding: 16px 4px;
  border-bottom: 1px solid var(--line);
}
.timetable__time {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--navy);
  letter-spacing: -0.01em;
}
.timetable__act { color: var(--body); }

@media (max-width: 520px) {
  .timetable__row { grid-template-columns: 1fr; gap: 2px; }
}


/* ==========================================================================
   12. Feature rows
   ========================================================================== */

/* Alternating image/text rows (Tower Run, Art, KidsFest). */
.feature {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.5rem, 1rem + 2.6vw, 3rem);
  align-items: center;
}
.feature__media {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}
.feature__media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.feature__media--contain img { object-fit: contain; padding: clamp(0.75rem, 2vw, 1.75rem); }

.feature__title { margin-bottom: 14px; }

/* A short supplier credit, not a full feature. The media box drops its 4:3
   ratio and is capped by height instead, so the row is only as tall as the
   logo needs — roughly half the height of a standard feature row. */
.feature--compact { align-items: center; gap: clamp(1.25rem, 0.9rem + 1.6vw, 2.25rem); }
.feature--compact .feature__media img {
  aspect-ratio: auto;
  max-height: 150px;
  width: auto;
  margin-inline: auto;
  padding: 0;
}

/* Two sections carry their own voice rather than the default heading style.
   These are deliberate, not drift — keep them if you edit the type scale. */

/* Tower Run — heavy italic, borrowed from race-bib typography */
.feature__title--italic {
  font-size: clamp(2.25rem, 1.35rem + 3.6vw, 3.75rem);   /* 36 → 60px */
  font-weight: 900;
  font-style: italic;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--ink);
}

/* Art & Photography — the exhibition's display serif */
.feature__title--serif,
.page-hero__title--serif {
  font-family: var(--font-serif);
  font-weight: 400;
  font-style: normal;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.feature__title--serif    { font-size: clamp(1.875rem, 1.35rem + 2.2vw, 2.5rem); }  /* 30 → 40px */
.page-hero__title--serif  { font-size: clamp(2rem, 1.3rem + 3vw, 3.25rem); }
.feature__logo { width: min(280px, 70%); margin-bottom: 20px; }
.feature__body { max-width: 46ch; color: var(--muted); font-size: var(--step-1); }
.feature .btn-row { margin-top: 26px; }

/* Reversed rows put the image first in the source order for a natural
   reading order on mobile, then swap columns on wide screens. */
.feature--reverse .feature__media { order: -1; }
@media (min-width: 861px) {
  .feature--reverse .feature__media { order: 2; }
}
@media (max-width: 860px) {
  .feature { grid-template-columns: 1fr; }
  .feature__media { order: -1; }
}


/* ==========================================================================
   13. Map & notices
   ========================================================================== */

.map-figure { margin-top: 8px; text-align: center; }
.map-figure a {
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--white);
  transition: box-shadow var(--speed) var(--ease);
}
.map-figure a:hover { box-shadow: var(--shadow-lg); }
.map-figure img { width: 100%; }

.notice {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(1.5rem, 1rem + 3vw, 3rem);
  align-items: center;
}
.notice__title { margin-bottom: 10px; }
.notice__body { max-width: 52ch; color: var(--muted); }
.notice__figure { width: min(220px, 40vw); }

@media (max-width: 720px) {
  .notice { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .notice__body { margin-inline: auto; }
}

/* Green environmental band */
.enviro { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2rem; align-items: center; }
.enviro__title { margin-bottom: 8px; }
.enviro__body { max-width: 48ch; color: rgba(0, 0, 0, 0.75); margin-bottom: 22px; }
.enviro__figure { width: min(160px, 30vw); }

@media (max-width: 720px) {
  .enviro { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .enviro .btn-row { justify-content: center; }
}


/* ==========================================================================
   14. Galleries & lightbox
   ========================================================================== */

/* Every gallery is a plain responsive grid — all the images visible at once,
   no horizontal scrolling, no hidden content. Each thumbnail is a real link to
   the full-size file, so it still works with JavaScript off; site.js upgrades
   that click into the lightbox below. */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr));
  gap: 14px;
}
.media-grid--wide { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }

.media-grid figure { margin: 0; }

.media-grid__item {
  position: relative;
  display: block;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface);
  cursor: zoom-in;
  transition: box-shadow var(--speed) var(--ease), transform var(--speed) var(--ease);
}
.media-grid__item:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }

.media-grid__item img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  transition: transform 500ms var(--ease);
}
.media-grid__item:hover img { transform: scale(1.05); }

/* Expand affordance, so it reads as clickable rather than decorative */
.media-grid__item::after {
  content: "";
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(16, 24, 40, 0.62)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-4.3-4.3M11 8v6M8 11h6'/%3E%3C/svg%3E")
    center / 18px no-repeat;
  opacity: 0;
  transform: scale(0.85);
  transition: opacity var(--speed) var(--ease), transform var(--speed) var(--ease);
}
.media-grid__item:hover::after,
.media-grid__item:focus-visible::after { opacity: 1; transform: scale(1); }

/* A single expandable image that is not part of a grid (the festival map,
   the course maps) gets the same affordance. */
.zoomable {
  position: relative;
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--white);
  cursor: zoom-in;
}


/* ==========================================================================
   14b. Lightbox
   --------------------------------------------------------------------------
   Built by site.js on first use, so the markup lives in one place instead of
   being repeated on every page.
   ========================================================================== */

.lightbox {
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  max-height: 100vh;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: hidden;
}
.lightbox::backdrop { background: rgba(8, 12, 22, 0.92); }

.lightbox__stage {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: clamp(2.25rem, 4vw, 3.25rem) clamp(1rem, 5vw, 4rem);
}

.lightbox__img {
  max-width: 100%;
  max-height: calc(100vh - 11rem);
  width: auto;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  background: #101828;
}

.lightbox__counter {
  position: absolute;
  left: 50%;
  bottom: clamp(1rem, 3vw, 1.75rem);
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.55);
  font-size: var(--step--1);
  font-variant-numeric: tabular-nums;
}


/* Controls */
.lightbox__btn {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(6px);
  transition: background-color var(--speed) var(--ease), transform var(--speed) var(--ease);
}
.lightbox__btn:hover { background: rgba(255, 255, 255, 0.26); }
.lightbox__btn:active { transform: scale(0.94); }
.lightbox__btn svg { width: 24px; height: 24px; }

.lightbox__btn--close { top: clamp(0.75rem, 2vw, 1.25rem); right: clamp(0.75rem, 2vw, 1.25rem); }
.lightbox__btn--prev  { left: clamp(0.5rem, 2vw, 1.5rem);  top: 50%; margin-top: -24px; }
.lightbox__btn--next  { right: clamp(0.5rem, 2vw, 1.5rem); top: 50%; margin-top: -24px; }

/* Hidden when the group holds a single image */
.lightbox[data-single="true"] .lightbox__btn--prev,
.lightbox[data-single="true"] .lightbox__btn--next { display: none; }

@media (max-width: 560px) {
  .lightbox__btn { width: 42px; height: 42px; }
  .lightbox__btn--prev { left: 6px; }
  .lightbox__btn--next { right: 6px; }
  .lightbox__img { max-height: calc(100vh - 12rem); }
}


/* ==========================================================================
   15. Sponsors
   ========================================================================== */

/* Every logo gets an identical tile, so a wide banner and a square badge
   still line up.

   Flex-wrap rather than grid: a grid leaves a short final row hanging on the
   left, whereas flex + justify-content:center centres it. The basis is worked
   out from --cols so full rows still sit flush edge to edge — the tiny
   subtraction absorbs sub-pixel rounding that would otherwise drop the last
   tile onto its own row. Override --cols inline for a one-off block. */
.sponsor-grid {
  --cols: 6;
  --sponsor-gap: 14px;

  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sponsor-gap);
}
.sponsor-grid--top { --cols: 5; }

/* A short row of headline sponsors that should read large */
.sponsor-grid--lg .sponsor { aspect-ratio: 3 / 2; padding: 26px; }

.sponsor-grid > * {
  flex: 0 1 calc(
    (100% - (var(--cols) - 1) * var(--sponsor-gap)) / var(--cols) - 0.02px
  );
}

@media (max-width: 999px) { .sponsor-grid, .sponsor-grid--top { --cols: 4; } }
@media (max-width: 699px) { .sponsor-grid, .sponsor-grid--top { --cols: 3; } }
@media (max-width: 479px) { .sponsor-grid, .sponsor-grid--top { --cols: 2; } }

.sponsor {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 5 / 3;
  padding: 16px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: border-color var(--speed) var(--ease), box-shadow var(--speed) var(--ease),
              transform var(--speed) var(--ease);
}
a.sponsor:hover {
  border-color: var(--line-soft);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.sponsor img { max-width: 100%; max-height: 100%; width: auto; object-fit: contain; }

.sponsor-tier + .sponsor-tier { margin-top: clamp(2rem, 1.4rem + 2vw, 3rem); }
.sponsor-tier__title {
  margin-bottom: 20px;
  font-size: var(--step-2);
  font-weight: 700;
  text-align: center;
  color: var(--muted);
  letter-spacing: -0.02em;
}


/* ==========================================================================
   16. Forms & prose blocks
   ========================================================================== */

.panel {
  padding: clamp(1.25rem, 0.9rem + 1.4vw, 2rem);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.panel--surface { background: var(--surface); border-color: transparent; }

.stack > * + * { margin-top: 1rem; }
.stack--lg > * + * { margin-top: 1.75rem; }

/* Bulleted lists that read as lists. A chevron in a tinted disc rather than a
   plain dot — it stays neutral (no "done"/"included" implication) so it suits
   every list on the site, and picks up --accent-tint / --accent-ink wherever a
   block sets them, e.g. the prize columns. */
.list {
  display: grid;
  gap: 12px;
  max-width: var(--measure);
}
.list li {
  position: relative;
  padding-left: 32px;
  color: var(--body);
}
.list li::before {
  content: "\203A";
  position: absolute;
  left: 0;
  top: 0.15em;
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: var(--accent-tint, #eaeefb);
  color: var(--accent-ink, var(--navy));
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
  padding-bottom: 2px;
}

.list--columns {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  max-width: none;
  gap: 10px 32px;
}

/* Prize / detail definition rows */
.detail-list { display: grid; gap: 8px; }
.detail-list div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
  font-size: var(--step-0);
}
.detail-list dt { font-weight: 700; color: var(--navy); }
.detail-list dd { margin: 0; color: var(--muted); }

.email-link {
  font-weight: 700;
  color: var(--navy);
  text-decoration: underline;
  text-underline-offset: 3px;
  word-break: break-word;
}
.email-link:hover { color: var(--blue); }


/* ==========================================================================
   17. Modal
   ========================================================================== */

.modal {
  border: 0;
  padding: 0;
  max-width: min(680px, calc(100vw - 32px));
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  background: var(--white);
  color: var(--body);
}
.modal::backdrop { background: rgba(16, 24, 40, 0.55); }

.modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 24px 0;
}
.modal__title { font-size: var(--step-3); }
.modal__close {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  color: var(--muted);
  transition: background-color var(--speed) var(--ease);
}
.modal__close:hover { background: var(--surface); color: var(--ink); }

.modal__body {
  padding: 16px 24px 28px;
  max-height: min(60vh, 520px);
  overflow-y: auto;
}
.modal__body > * + * { margin-top: 14px; }


/* ==========================================================================
   18. Footer
   ========================================================================== */

.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding-block: clamp(2rem, 1.5rem + 2vw, 3rem);
}

.site-footer__grid {
  display: grid;
  grid-template-columns: auto 1fr 1fr minmax(0, 320px);
  gap: clamp(1.5rem, 1rem + 2vw, 2.5rem);
  align-items: start;
}

.footer-brand { display: flex; flex-direction: column; gap: 18px; align-items: flex-start; }
.footer-brand__logo { width: 96px; }

.footer-col__title {
  margin-bottom: 12px;
  font-size: var(--step-1);
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.01em;
}
.footer-col p, .footer-col li { font-size: var(--step--1); color: var(--muted); }
.footer-col li + li { margin-top: 6px; }
.footer-col a { transition: color var(--speed) var(--ease); }
.footer-col a:hover { color: var(--navy); text-decoration: underline; text-underline-offset: 3px; }

.footer-map {
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--line);
}
.footer-map iframe { display: block; width: 100%; height: 190px; border: 0; }

.site-footer__base {
  margin-top: clamp(2rem, 1.4rem + 2vw, 3rem);
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  justify-content: space-between;
  font-size: var(--step--1);
  color: var(--faint);
}

@media (max-width: 980px) {
  .site-footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-map { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .site-footer__grid { grid-template-columns: 1fr; }
}


/* ==========================================================================
   19. Utilities
   ========================================================================== */

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.center { text-align: center; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.anchor { scroll-margin-top: calc(var(--header-h) + 24px); }
