/* ==========================================================================
   [EVENT NAME] – shared stylesheet
   Mobile-first. Colours are CSS custom properties defined in :root.

   Contrast note: #FB710B on white is about 2.8:1, which fails WCAG for text
   of any size. In light mode orange is therefore only used for accents,
   borders, underlines and button backgrounds (with black text, ~7.5:1).
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  --orange: #FB710B;
  --orange-hover: #FF8A33;
  --black: #000000;
  --white: #FFFFFF;

  --font: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --radius: 10px;
  --radius-small: 6px;
  --gutter: 1rem;
  --max-width: 72rem;
  --header-height: 4rem;
  --transition: 180ms ease;

  /* Colours */
  --bg: #FFFFFF;
  --bg-alt: #F4F4F4;
  --surface: #FFFFFF;
  --text: #000000;
  --text-muted: #4D4D4D;      /* 8.4:1 on white */
  --border: #E0E0E0;
  --heading-accent: var(--orange);
  --link: #000000;            /* links are black with an orange underline */
  --link-underline: var(--orange);
  --focus: #000000;           /* focus ring must contrast with the background */
  --header-bg: rgba(255, 255, 255, 0.92);
  --placeholder-bg: #EDEDED;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(0, 0, 0, 0.06);

  color-scheme: light;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 1rem);
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
}

main:focus {
  outline: none;
}

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

h1, h2, h3 {
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 0.75rem;
}

h1 { font-size: clamp(2.25rem, 7vw, 4rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.1rem); }
h3 { font-size: 1.2rem; }

p {
  margin: 0 0 1rem;
}

a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-color: var(--link-underline);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  transition: color var(--transition), text-decoration-color var(--transition);
}

a:hover {
  text-decoration-thickness: 3px;
}

/* Visible keyboard focus everywhere */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 2px;
}

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

.small { font-size: 0.875rem; }
.muted { color: var(--text-muted); }

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 1000;
  padding: 0.75rem 1rem;
  background: var(--orange);
  color: var(--black);
  font-weight: 700;
  text-decoration: none;
  border-radius: var(--radius-small);
  transform: translateY(-200%);
  transition: transform var(--transition);
}

.skip-link:focus {
  transform: translateY(0);
  outline: 3px solid var(--black);
  outline-offset: 2px;
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.container.narrow {
  max-width: 46rem;
}

.section {
  padding: 3.5rem 0;
}

.section-alt {
  background: var(--bg-alt);
}

@media (min-width: 48em) {
  :root { --gutter: 2rem; }
  .section { padding: 5rem 0; }
}

/* Short orange bar above section headings (accent, not text) */
.section h2::before,
.page-intro h1::before {
  content: "";
  display: block;
  width: 3rem;
  height: 4px;
  margin-bottom: 1rem;
  background: var(--heading-accent);
  border-radius: 2px;
}

.cta-band h2::before {
  display: none;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  backdrop-filter: saturate(180%) blur(10px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-height);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text);
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
}

.brand img {
  height: 40px;
  width: auto;
}

/* On narrow phones the wide logo + name don't fit beside the icons:
   keep the logo and hide the name visually (screen readers still read it) */
@media (max-width: 30em) {
  .brand img + .brand-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

/* Logo placeholder: remove once a real logo image is added */
.logo-placeholder {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 2px dashed var(--orange);
  border-radius: var(--radius-small);
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  color: var(--text);
  border: 1px solid transparent;
  border-radius: 50%;
  cursor: pointer;
  transition: background-color var(--transition), border-color var(--transition);
}

.icon-button:hover {
  background: var(--bg-alt);
  border-color: var(--border);
}

/* ---------- Navigation (mobile first) ---------- */
.site-nav {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: none;
}

.site-nav.is-open {
  display: block;
}

/* Without JavaScript the menu button can't work, so always show the nav */
.no-js .site-nav {
  position: static;
  display: block;
  box-shadow: none;
  border: 0;
}
.no-js .nav-toggle { display: none; }

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0.5rem var(--gutter) 1rem;
}

.site-nav a {
  display: block;
  padding: 0.85rem 0.25rem;
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}

.site-nav li:last-child a {
  border-bottom: 0;
}

.site-nav a[aria-current="page"] {
  box-shadow: inset 4px 0 0 var(--orange);
  padding-left: 1rem;
}

@media (min-width: 48em) {
  .nav-toggle { display: none; }

  .site-nav,
  .no-js .site-nav {
    position: static;
    display: block;
    background: none;
    border: 0;
    box-shadow: none;
  }

  .site-nav ul {
    display: flex;
    gap: 0.25rem;
    padding: 0;
    margin-right: 0.5rem;
  }

  .site-nav a,
  .site-nav li:last-child a {
    padding: 0.5rem 0.85rem;
    border: 0;
    border-radius: var(--radius-small);
    position: relative;
    transition: background-color var(--transition);
  }

  .site-nav a:hover {
    background: var(--bg-alt);
  }

  .site-nav a[aria-current="page"] {
    box-shadow: inset 0 -3px 0 var(--orange);
    padding-left: 0.85rem;
    border-radius: var(--radius-small) var(--radius-small) 0 0;
  }
}

/* ---------- Buttons ---------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.7rem 1.4rem;
  background: var(--orange);
  color: var(--black);              /* black on orange: ~7.5:1 */
  font-family: inherit;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
  border: 2px solid var(--orange);
  border-radius: 999px;
  cursor: pointer;
  transition: background-color var(--transition), border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.button:hover {
  background: var(--orange-hover);
  border-color: var(--orange-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(251, 113, 11, 0.3);
}

.button:active {
  transform: translateY(0);
}

.button-large {
  padding: 0.95rem 2rem;
  font-size: 1.1rem;
}

.button-block {
  width: 100%;
}

.button-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--text);
}

.button-ghost:hover {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
  box-shadow: none;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 2.5rem 0 3rem;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

/* Bristol scene with the title overlaid on the sky (stacked above it on phones) */
.hero-banner {
  position: relative;
  display: flex;
  flex-direction: column-reverse;
  gap: 1.5rem;
}

.hero-banner img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: 70% 60%;
  border-radius: var(--radius);
  background: var(--placeholder-bg);
}

.hero-title h1 {
  margin-bottom: 0.5rem;
}

.hero-title .lead {
  margin-bottom: 0;
}

@media (min-width: 30em) {
  .hero-banner {
    display: block;
    overflow: hidden;
    container-type: inline-size;
    border-radius: var(--radius);
  }

  .hero-title {
    position: absolute;
    inset: 0 0 auto 0;
    padding: clamp(1rem, 3vw, 2rem) clamp(1rem, 3.5vw, 2.5rem) 3rem;
    /* Soft light wash so the black text stays readable on any part of the sky */
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0));
  }

  /* Text is sized from the photo's width (cqi) so it stays in the left
     two thirds of the sky and never runs over the tower on the right */
  .hero-title h1 {
    color: #000000;
    font-size: 4.8cqi;
    white-space: nowrap;
    margin-bottom: 0.25rem;
  }

  .hero-title .lead {
    max-width: 60cqi;
    color: #000000;
    font-size: max(0.85rem, 2.1cqi);
  }
}

@media (min-width: 48em) {
  .hero-banner img {
    aspect-ratio: 21 / 9;
  }
}

.eyebrow {
  margin-bottom: 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.lead {
  max-width: 36rem;
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  color: var(--text-muted);
}

.event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 2.5rem;
  margin: 2rem 0;
}

.event-meta div {
  padding-left: 1rem;
  border-left: 4px solid var(--orange);
}

.event-meta dt {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.event-meta dd {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
}

@media (min-width: 48em) {
  .hero { padding: 3rem 0 4rem; }
}

/* ---------- Page intro (inner pages) ---------- */
.page-intro {
  padding: 3rem 0 1rem;
}

@media (min-width: 48em) {
  .page-intro { padding: 4.5rem 0 1.5rem; }
}

/* ---------- Section headings ---------- */
.section-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  margin-bottom: 1.75rem;
}

.section-heading h2 {
  margin: 0;
}

.text-link {
  font-weight: 600;
}

/* ---------- Teaser strip ---------- */
.teaser-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

@media (min-width: 48em) {
  .teaser-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
  }
}

.teaser {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--placeholder-bg);
  aspect-ratio: 4 / 3;
}

.teaser img,
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 400ms ease;
}

.teaser:hover img,
.gallery-item:hover img {
  transform: scale(1.04);
}

.teaser-label {
  position: absolute;
  left: 0.6rem;
  bottom: 0.6rem;
  padding: 0.2rem 0.6rem;
  background: var(--black);
  color: var(--white);
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 999px;
}

/* ---------- Year sections + gallery ---------- */
.year-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.year-jump a {
  padding: 0.4rem 1rem;
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  border: 2px solid var(--border);
  border-radius: 999px;
  transition: border-color var(--transition), background-color var(--transition);
}

.year-jump a:hover {
  border-color: var(--orange);
}

.year + .year {
  border-top: 1px solid var(--border);
}

.year-header {
  max-width: 46rem;
  margin-bottom: 1.75rem;
}

.year-header p {
  color: var(--text-muted);
}

.gallery {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

@media (min-width: 48em) {
  .gallery {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
  }
}

.gallery-item {
  display: block;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--placeholder-bg);
  aspect-ratio: 4 / 3;
  cursor: zoom-in;
}

/* Portrait flyers: show the top (logos and title) in the tile; the full flyer opens in the lightbox */
.gallery-item-flyer img {
  object-position: top;
}

/* ---------- Lightbox ---------- */
.lightbox {
  width: 100%;
  max-width: 100vw;
  height: 100%;
  max-height: 100vh;
  margin: 0;
  padding: 3.5rem 1rem 1rem;
  background: transparent;
  border: 0;
  color: var(--white);
}

.lightbox[open] {
  display: grid;
  place-items: center;
}

.lightbox::backdrop {
  background: rgba(0, 0, 0, 0.9);
}

.lightbox figure {
  margin: 0;
  max-width: min(100%, 70rem);
}

.lightbox-image {
  max-height: calc(100vh - 8rem);
  width: auto;
  margin: 0 auto;
  border-radius: var(--radius-small);
}

.lightbox-caption {
  margin-top: 0.75rem;
  text-align: center;
  font-size: 0.9rem;
  color: #D0D0D0;
}

.lightbox-close {
  position: fixed;
  top: 0.75rem;
  right: 0.75rem;
  color: var(--white);
  background: rgba(255, 255, 255, 0.1);
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: transparent;
}

.lightbox-close:focus-visible {
  outline-color: var(--orange);
}

/* ---------- Sign up ---------- */
.signup-grid {
  display: grid;
  gap: 2.5rem;
}

.signup-info h3 {
  font-size: 1.3rem;
  margin-top: 2.25rem;
}

.signup-card {
  padding: 1.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 5px solid var(--orange);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.signup-card h3 {
  font-size: 1.3rem;
}

.details-list {
  margin: 0 0 1.75rem;
}

.details-list div {
  display: flex;
  flex-direction: column;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
}

.details-list dt {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.details-list dd {
  margin: 0;
  font-weight: 700;
  font-size: 1.1rem;
}

.signup-card .small {
  margin: 0.75rem 0 0;
  text-align: center;
}

@media (min-width: 56em) {
  .signup-grid {
    grid-template-columns: 1.4fr 1fr;
    gap: 4rem;
    align-items: start;
  }

  .signup-card {
    position: sticky;
    top: calc(var(--header-height) + 1.5rem);
  }
}

/* ---------- CTA band ---------- */
.cta-band {
  background: var(--black);
  color: var(--white);
}

.cta-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.25rem;
}

.cta-inner h2 {
  margin: 0;
}

.cta-meta {
  margin: 0.5rem 0 0;
  color: #D0D0D0;
}

.cta-band .button:focus-visible {
  outline-color: var(--orange);
}

@media (min-width: 48em) {
  .cta-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

/* ---------- Footer ---------- */
.site-footer {
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--text-muted);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.footer-inner p {
  margin: 0;
}

@media (min-width: 48em) {
  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

/* Ordinal suffixes (21st): raise without changing the line height */
sup {
  font-size: 0.6em;
  line-height: 0;
  vertical-align: 0.6em;
}

/* Venue address in the Key details card */
address {
  font-style: normal;
}
