/* Self-hosted instead of Google Fonts — a <link rel="stylesheet"> to
   fonts.googleapis.com was a render-blocking third-party request (DNS +
   TLS + fetch to a host the browser has no connection to yet, even with
   preconnect) on every single page load. Only the "latin" unicode-range
   subset of each weight is kept — this site is English-only, so the
   Vietnamese/Latin-Extended subsets Google Fonts also serves were dead
   weight. font-display: swap matches what the Google Fonts CSS used, so
   text still paints immediately in a fallback font rather than waiting. */
@font-face {
  font-family: "Barlow";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/barlow-400.woff2") format("woff2");
}
@font-face {
  font-family: "Barlow";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/fonts/barlow-500.woff2") format("woff2");
}
@font-face {
  font-family: "Barlow";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/barlow-600.woff2") format("woff2");
}
@font-face {
  font-family: "Barlow Condensed";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/barlow-condensed-400.woff2") format("woff2");
}
@font-face {
  font-family: "Barlow Condensed";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/barlow-condensed-600.woff2") format("woff2");
}
@font-face {
  font-family: "Barlow Condensed";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/barlow-condensed-700.woff2") format("woff2");
}
@font-face {
  font-family: "Barlow Condensed";
  font-style: italic;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/barlow-condensed-700italic.woff2") format("woff2");
}
@font-face {
  font-family: "Barlow Condensed";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("/assets/fonts/barlow-condensed-800.woff2") format("woff2");
}

:root {
  --po-cyan: #00b4e0;
  /* Was #0097bf (3.4:1 on white) — every existing use of this variable is
     either cyan text on a white/light background or a background under
     white text, and #0097bf failed WCAG AA's 4.5:1 minimum in both
     directions. #007a9c passes both ways (4.9:1), so redefining it here
     fixes every one of those spots at once — section labels, status/day/
     results tags, links, the primary button, the footer, etc. — without
     hunting down each rule individually. Anywhere cyan sits on the dark
     hero/finale backgrounds instead (e.g. .finale-text .section-label)
     already passes with the brighter --po-cyan and was left alone. */
  --po-cyan-dark: #007a9c;
  /* For the few spots that darken *from* --po-cyan-dark on hover/active
     (buttons whose resting state already uses --po-cyan-dark) — needs to
     be visibly darker than it, not the same shade. */
  --po-cyan-darker: #00647d;
  --po-cyan-light: #e6f8fd;
  --po-cyan-mid: #b3e9f7;
  --po-bg: #f0fafd;
  --po-surface: #ffffff;
  --po-card-border: rgba(0, 180, 224, 0.28);
  --po-green: #8dc63f;
  --po-navy: #0d2137;
  --po-ink: #0d1a21;
  --po-ink-mid: #3a5464;
  --po-muted: #6b8fa0;
  --po-divider: rgba(0, 180, 224, 0.15);
  --radius-lg: 12px;
  --radius: 4px;
  --shadow: 0 12px 28px -10px rgba(13, 33, 55, 0.18);
  --shadow-hover: 0 18px 36px -12px rgba(13, 33, 55, 0.28);
  font-family: "Barlow", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html, body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--po-bg);
  color: var(--po-ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--po-cyan-dark);
  text-decoration: none;
}

h1, h2, h3, h4 {
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* Display type: Barlow Condensed, uppercase — headlines, labels,
   buttons, chips, nav links. Never body copy (that's plain Barlow). */
.headline, .eyebrow, .hero h1, .page-heading h2, .event-card .info h3,
.section-label, .section-title, .status-tag, .nav-link, .medal {
  font-family: "Barlow Condensed", "Barlow", sans-serif;
}

.topbar {
  background: var(--po-navy);
  color: rgba(255, 255, 255, 0.7);
  font-size: 11px;
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 9px 32px;
  display: flex;
  justify-content: space-between;
}

.topbar a {
  color: rgba(255, 255, 255, 0.7);
  transition: color 0.15s ease;
}

.topbar a:hover {
  color: #fff;
}

.topbar span:last-child {
  color: #fff;
}

header.site-header {
  padding: 14px 32px;
  border-bottom: 1px solid var(--po-cyan-mid);
  box-shadow: 0 2px 14px rgba(0, 180, 224, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  background: var(--po-surface);
  z-index: 10;
}

header.site-header .wordmark {
  display: flex;
  align-items: center;
}

header.site-header .wordmark img {
  height: 44px;
  display: block;
}

header.site-header .nav-link {
  font-size: 13px;
  font-weight: 700;
  color: var(--po-ink-mid);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: color 0.15s ease;
}

header.site-header .nav-link:hover {
  color: var(--po-cyan-dark);
}

/* Hero (homepage only) — dark navy-to-cyan gradient with decorative
   translucent concentric circles for depth. */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, #071e3d 0%, #0d3060 55%, #0097bf 100%);
  padding: 56px 32px 44px;
  text-align: center;
}

.hero::before, .hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  pointer-events: none;
}

.hero::before {
  width: 420px;
  height: 420px;
  top: -200px;
  right: -120px;
}

.hero::after {
  width: 260px;
  height: 260px;
  bottom: -150px;
  left: -70px;
}

.hero-inner {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
}

.hero .eyebrow {
  color: var(--po-cyan);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  max-width: 720px;
  margin: 0 auto 10px;
}

.hero h1 {
  color: #fff;
  font-weight: 800;
  font-size: clamp(34px, 6vw, 52px);
  text-transform: uppercase;
  letter-spacing: 0.01em;
  max-width: 720px;
  margin: 0 auto 12px;
}

.divider {
  width: 44px;
  height: 3px;
  background: var(--po-cyan);
  border-radius: 2px;
  margin: 10px 0 18px;
}

.page-heading .divider {
  margin: 0 0 18px;
}

/* Centered contexts — hero and the sponsor section both center their
   text, so their closing bar should center too rather than sit flush
   left. */
.hero .divider,
.sponsor-section .divider {
  margin-left: auto;
  margin-right: auto;
}

.hero .sub {
  color: rgba(255, 255, 255, 0.85);
  font-size: 15px;
  font-family: "Barlow", sans-serif;
  max-width: 720px;
  margin: 0 auto;
}

/* Reserves the strip's real rendered height before gallery.js populates
   it (it depends on an async fetch, however small) — otherwise <main>
   sits 900px+ higher than its final position for a few hundred ms, then
   gets shoved down all at once the instant the strip (and the finale
   banner below it) mount, which measured as this page's single largest
   layout-shift contributor. Heights are the real rendered sizes for
   today's 3-event season — if the season grows meaningfully, remeasure
   rather than trust these numbers indefinitely. */
#hero-events {
  min-height: 217px;
}

@media (max-width: 640px) {
  #hero-events {
    min-height: 683px;
  }
}

/* Condensed all-events strip inside the hero — a quick-scan overview.
   The featured event (Provincial) gets a white card and cyan CTA; the
   rest sit on translucent dark cards, matching the surrounding hero. */
.hero-events {
  position: relative;
  display: flex;
  gap: 16px;
  margin-top: 32px;
  flex-wrap: wrap;
  justify-content: center;
  text-align: left;
}

.hero-event-card {
  display: block;
  flex: 1 1 220px;
  max-width: 280px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-lg);
  padding: 20px 18px;
  color: #fff;
  transition: transform 0.15s ease, background 0.15s ease;
}

.hero-event-card:hover {
  transform: translateY(-3px);
  background: rgba(255, 255, 255, 0.13);
}

.hero-event-card.is-featured {
  background: #fff;
  border-color: #fff;
}

.hero-event-badge {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: block;
  margin-bottom: 12px;
  background: #fff;
}

.hero-event-name {
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 800;
  text-transform: uppercase;
  font-size: 15px;
  color: #fff;
  margin: 0 0 4px;
}

.hero-event-card.is-featured .hero-event-name {
  color: var(--po-ink);
}

.hero-event-meta {
  font-family: "Barlow", sans-serif;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.5;
  margin-bottom: 12px;
}

.hero-event-card.is-featured .hero-event-meta {
  color: var(--po-ink-mid);
}

.hero-event-tag {
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.hero-event-btn {
  display: inline-block;
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
}

.hero-event-card.is-featured .hero-event-btn {
  color: var(--po-cyan-dark);
}

/* Reserves the banner's real rendered height for the same reason as
   #hero-events above — it mounts from the same async fetch, at the same
   moment, so both need reserving together or main still jumps once by
   their combined height. */
#finale {
  min-height: 293px;
}

@media (max-width: 640px) {
  #finale {
    min-height: 562px;
  }
}

/* Season-finale banner — the Provincial Championship gets its own
   full-bleed dark section (not just a card in the regular grid), same
   treatment the real tournament site gives its marquee event. Breaks
   out of the centered <main> column via negative viewport margins. */
.finale-banner {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  margin-top: 48px;
  margin-bottom: 48px;
  padding: 56px 32px;
  background: linear-gradient(160deg, #071e3d 0%, #0d3060 55%, #0097bf 100%);
  position: relative;
  overflow: hidden;
}

.finale-banner::before {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  width: 340px;
  height: 340px;
  top: -160px;
  right: 10%;
  pointer-events: none;
}

.finale-inner {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 40px;
  flex-wrap: wrap;
}

.finale-badge-card {
  flex-shrink: 0;
  width: 140px;
  height: 140px;
  border-radius: var(--radius-lg);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-hover);
}

.finale-badge-card img {
  width: 112px;
  height: 112px;
  border-radius: 50%;
}

.finale-text .section-label {
  color: var(--po-cyan);
}

.finale-title {
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 800;
  text-transform: uppercase;
  color: #fff;
  font-size: clamp(28px, 4vw, 40px);
  margin: 4px 0 10px;
}

.finale-meta {
  font-family: "Barlow", sans-serif;
  color: rgba(255, 255, 255, 0.8);
  font-size: 15px;
  margin: 0 0 20px;
}

.finale-text a.button-primary {
  margin-bottom: 0;
}

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 48px 64px;
}

@media (max-width: 640px) {
  main, .topbar, header.site-header {
    padding-left: 24px;
    padding-right: 24px;
  }
}

.page-heading h2 {
  font-size: 28px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--po-ink);
  margin: 0 0 8px;
}

.page-heading .meta {
  color: var(--po-ink-mid);
  font-size: 14px;
  margin: 0 0 24px;
  font-family: "Barlow", sans-serif;
}

/* Section labels — the consistent opener for every content section:
   a small cyan label, the section title, then a short cyan bar. */
.section-label {
  color: var(--po-cyan-dark);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  margin: 0 0 6px;
}

.section-title {
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 800;
  text-transform: uppercase;
  color: var(--po-ink);
  margin: 0 0 10px;
}

.event-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 340px));
  gap: 22px;
  margin-bottom: 48px;
}

.featured-strip {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-top: 14px;
}

.featured-strip img {
  height: 180px;
  width: auto;
  display: block;
  border-radius: var(--radius-lg);
  flex-shrink: 0;
  background: var(--po-cyan-light);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.featured-strip img.is-loaded {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .featured-strip img {
    transition: none;
    opacity: 1;
  }
}

.event-card {
  display: block;
  transition: transform 0.18s ease;
}

.event-card:hover {
  transform: translateY(-3px);
}

.event-card-surface {
  background: var(--po-surface);
  border: 1px solid var(--po-card-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow 0.18s ease, border-color 0.18s ease;
}

.event-card:hover .event-card-surface {
  border-color: var(--po-cyan);
  box-shadow: var(--shadow-hover);
}

.event-card .cover {
  aspect-ratio: 4 / 3;
  background: var(--po-cyan-light);
  display: block;
  width: 100%;
  object-fit: cover;
  object-position: center 85%;
}

.event-card .info {
  padding: 22px 18px 16px;
  position: relative;
}

/* The tournament's own badge, shown as a deliberate seal on the card —
   distinct in role from the small watermark baked into the cover photo
   itself (that one's about protecting the image; this one's about
   telling you which tournament you're looking at). Sized and bordered
   so the two don't read as an accidental duplicate. */
.event-card .info .ecard-badge {
  position: absolute;
  top: -30px;
  left: 16px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: var(--shadow);
  background: #fff;
}

/* Event status — completed regionals/championships read as settled and
   archival, still fully clickable, just visually quieter. The current
   season's featured event stays at full contrast. */
.event-card.is-past .event-card-surface {
  background: var(--po-cyan-light);
}

.event-card.is-past .cover {
  opacity: 0.8;
}

.status-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--po-cyan-dark);
  background: var(--po-cyan-light);
  padding: 4px 12px;
  border-radius: 999px;
  margin-top: 6px;
}

/* Cover fallback for events with no photos yet (results-only regionals) —
   the event's own badge shown large, instead of a broken/empty image. */
.event-card .cover-fallback {
  aspect-ratio: 4 / 3;
  background: linear-gradient(145deg, var(--po-navy) 10%, #0d3060 55%, var(--po-cyan) 145%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.event-card .cover-fallback .cover-badge {
  width: 42%;
  max-width: 150px;
  /* The badge's width/height *attributes* (set for CLS, see gallery.js)
     apply as a literal height in px, independent of this width override
     — without an explicit height here too, the box ends up
     (42%-of-container) wide by (natural pixel height) tall, and the
     square source image gets stretched to fill that mismatched box. */
  height: auto;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.35));
}

.event-card .info h3 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--po-ink);
  letter-spacing: 0.01em;
}

.event-card .info .meta {
  color: var(--po-ink-mid);
  font-size: 13px;
  font-family: "Barlow", sans-serif;
}

.empty-state {
  color: var(--po-ink-mid);
  padding: 60px 0;
  text-align: center;
  font-size: 15px;
}

/* Buttons — primary (cyan, filled) and secondary (white, cyan border). */
a.button-primary, button.button-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--po-cyan-dark);
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-family: "Barlow Condensed", sans-serif;
  padding: 12px 22px;
  border: none;
  border-radius: var(--radius);
  margin-bottom: 28px;
  transition: background 0.15s ease, transform 0.15s ease;
}

a.button-primary:hover, button.button-primary:hover {
  background: var(--po-cyan-darker);
  transform: translateY(-1px);
}

a.button-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  color: var(--po-cyan-dark);
  border: 1px solid var(--po-cyan);
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 10px 18px;
  border-radius: var(--radius);
  transition: background 0.15s ease;
}

a.button-secondary:hover {
  background: var(--po-cyan-light);
}

/* Day tab selector — jump to one day's photos instead of scrolling
   past every other day. Single-line pills (like .results-tab) so the
   row never wraps; the active day's blurb shows as one caption line
   below instead of being crammed into every tab. */
.day-tabs {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 8px;
  margin-bottom: 8px;
  padding-bottom: 2px;
}

.day-tab {
  flex-shrink: 0;
  white-space: nowrap;
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--po-cyan-dark);
  background: var(--po-cyan-light);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.day-tab:hover {
  background: var(--po-cyan-mid);
  color: var(--po-cyan-darker);
}

.day-tab.is-active {
  background: var(--po-cyan-dark);
  color: #fff;
}

.day-tab-caption {
  font-size: 13px;
  color: var(--po-ink-mid);
  margin: 0 0 18px;
  min-height: 1.2em;
}

.photo-day-heading {
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--po-navy);
  margin: 28px 0 12px;
}

.photo-day-heading:first-of-type {
  margin-top: 6px;
}

/* Photo grid — CSS multi-column masonry. Deliberately NOT a forced
   square crop: cropping a portrait photo to a square would clip the
   bottom-right corner, which is exactly where the watermark sits. */
.photo-grid {
  column-width: 280px;
  column-gap: 14px;
}

.photo-grid .photo-tile {
  display: block;
  width: 100%;
  margin: 0 0 14px;
  break-inside: avoid;
  background: var(--po-surface);
  border: 1px solid var(--po-card-border);
  border-radius: var(--radius-lg);
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.photo-tile:hover {
  transform: translateY(-2px);
  border-color: var(--po-cyan);
}

.photo-grid img.thumb {
  width: 100%;
  height: auto;
  display: block;
  background: var(--po-bg);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.photo-grid img.thumb.is-loaded {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .photo-grid img.thumb {
    transition: none;
    opacity: 1;
  }
}

/* Find Your Photos */
.finder-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 16px;
}

.finder-field {
  position: relative;
  flex: 1 1 220px;
  max-width: 320px;
}

.finder-field label {
  display: block;
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--po-ink-mid);
  margin-bottom: 6px;
}

.finder-input,
.finder-select {
  width: 100%;
  padding: 11px 16px;
  background: var(--po-surface);
  border: 1px solid var(--po-card-border);
  border-radius: 999px;
  color: var(--po-ink);
  font-size: 14px;
  font-family: "Barlow", sans-serif;
  transition: border-color 0.15s ease;
}

.finder-input:focus,
.finder-select:focus {
  outline: none;
  border-color: var(--po-cyan);
}

.finder-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 5;
  background: #fff;
  border: 1px solid var(--po-card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.finder-suggestion {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 16px;
  background: none;
  border: none;
  font-family: "Barlow", sans-serif;
  font-size: 14px;
  color: var(--po-ink);
  cursor: pointer;
}

.finder-suggestion:hover {
  background: var(--po-cyan-light);
}

.finder-suggestion mark {
  background: none;
  color: var(--po-cyan-dark);
  font-weight: 700;
}

.finder-clear {
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--po-ink-mid);
  background: var(--po-surface);
  border: 1px solid var(--po-card-border);
  border-radius: 999px;
  padding: 10px 18px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.finder-clear:hover {
  border-color: var(--po-cyan);
  color: var(--po-cyan-dark);
}

.finder-summary {
  margin-bottom: 10px;
}

.finder-matches {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 18px;
  font-size: 13px;
  color: var(--po-ink-mid);
}

.finder-match-row {
  padding: 2px 0;
}

.finder-grid {
  margin-bottom: 8px;
}

/* Lightbox — stays dark regardless of site theme; a bright overlay
   would fight the photo it's showing. Ghost/frosted-glass controls. */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 6, 9, 0.94);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  z-index: 1000;
}

/* Fills whatever space is left above the footer and centers the image
   within it, so the footer below always sits in the same place no
   matter this photo's aspect ratio — see lightbox.js for why that
   matters. touch-action:pan-y so swipe gestures reach our own touch
   handlers instead of the browser trying to scroll/zoom the page. */
.lightbox-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  touch-action: pan-y;
}

/* The stage/footer set display explicitly above, which otherwise beats
   the browser's default [hidden]{display:none} rule (author styles win
   over user-agent styles regardless of specificity) — these two rules
   are what actually let toggling .hidden work in lightbox.js. */
.lightbox-stage[hidden],
.lightbox-footer[hidden] {
  display: none;
}

.lightbox-stage img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.6);
  display: block;
}

/* Shrink-wraps to the rendered image's exact box (see lightbox.js) so the
   person-box overlays below can be positioned as plain percentages.
   max-width/max-height alone can't constrain this reliably — a percentage
   height on the <img> resolves against *this* element's height, but this
   element's own height is auto (shrink-to-fit), which is a circular
   reference browsers resolve by ignoring the percentage entirely, letting
   the image render at its raw unconstrained size. Setting aspect-ratio
   explicitly (done in lightbox.js once the image's real dimensions are
   known) breaks that circularity by giving this element a definite
   preferred size the browser can actually fit within max-width/max-height. */
.lightbox-img-wrap {
  position: relative;
  display: inline-block;
  max-width: 100%;
  max-height: 100%;
}

/* Hidden until the "Find people" toggle is on (see lightbox.js) — boxes
   for every detected person, all the time, made ordinary photo browsing
   feel cluttered, especially on crowd shots with a dozen spectators. */
.lightbox-person-box {
  display: none;
  position: absolute;
  border: 2px solid rgba(255, 255, 255, 0.55);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.05);
  cursor: pointer;
  padding: 0;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.lightbox-img-wrap.show-people .lightbox-person-box {
  display: block;
}

.lightbox-person-box:hover,
.lightbox-person-box:focus-visible {
  border-color: var(--po-cyan);
  background: rgba(11, 175, 210, 0.12);
}

.lightbox-person-box::after {
  content: "Find similar";
  position: absolute;
  left: 50%;
  bottom: 100%;
  transform: translate(-50%, 4px);
  background: var(--po-cyan-dark);
  color: #fff;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 8px;
  border-radius: var(--radius);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.lightbox-person-box:hover::after,
.lightbox-person-box:focus-visible::after {
  opacity: 1;
}

/* While building a multi-photo query (see lightbox.js's `confirming`
   state), every box on screen adds to that query instead of launching a
   brand new search - the hover hint needs to say so, or clicking one mid-
   confirm reads as a bug ("why didn't this open results?"). */
.lightbox-img-wrap.confirm-mode .lightbox-person-box::after {
  content: "Add photo";
  background: var(--po-cyan);
}

.lightbox-footer {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 16px 20px;
}

/* A thin status row above the usual counter/controls, only ever visible
   while confirming a multi-photo query - deliberately small and close in
   style to the existing controls row rather than a banner/modal, so
   "add another photo" reads as a lightweight addition to browsing, not a
   new flow bolted onto the lightbox (see lightbox.js's own comment on
   why - the owner wants this feature to stay tucked away). */
.lightbox-confirm-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  padding: 8px 14px;
  border-radius: var(--radius);
  background: rgba(11, 175, 210, 0.14);
  border: 1px solid rgba(11, 175, 210, 0.4);
}

.lightbox-confirm-bar[hidden] {
  display: none;
}

.lightbox-confirm-text {
  color: #fff;
  font-size: 13px;
  font-family: "Barlow", sans-serif;
}

.lightbox-confirm-bar button {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  padding: 6px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-family: "Barlow Condensed", sans-serif;
  flex-shrink: 0;
}

.lightbox-confirm-bar button:hover {
  border-color: var(--po-cyan);
}

.lightbox-confirm-bar button:disabled {
  opacity: 0.4;
  cursor: default;
}

.lightbox-confirm-bar button:disabled:hover {
  border-color: rgba(255, 255, 255, 0.35);
}

@media (max-width: 420px) {
  .lightbox-confirm-bar {
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
  }
}

.lightbox-counter {
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
  margin-bottom: 12px;
  letter-spacing: 0.03em;
  font-family: "Barlow", sans-serif;
}

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

@media (max-width: 420px) {
  .lightbox-controls {
    gap: 8px;
  }

  .lightbox-controls button,
  .lightbox-controls a.button {
    padding: 10px 12px;
    font-size: 12px;
  }
}

.lightbox-controls button,
.lightbox-controls a.button {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  padding: 11px 20px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: "Barlow Condensed", sans-serif;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.lightbox-controls button:hover {
  border-color: var(--po-cyan);
  background: rgba(255, 255, 255, 0.18);
}

.lightbox-controls a.button {
  background: var(--po-cyan-dark);
  color: #fff;
  border-color: var(--po-cyan-dark);
  font-weight: 800;
}

.lightbox-controls a.button:hover {
  background: var(--po-cyan-darker);
}

/* A bare glyph with no background was easy to miss against a light photo
   and gave no visual hint that clicking outside the photo also closes it —
   a solid chip reads as an obviously-clickable control regardless of
   what's behind it, on any photo. */
.lightbox-close {
  position: absolute;
  top: 16px;
  right: 20px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  line-height: 1;
  background: rgba(20, 20, 26, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  z-index: 10;
}

.lightbox-close:hover {
  background: rgba(20, 20, 26, 0.85);
  border-color: var(--po-cyan);
}

.lightbox-results-panel {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 64px 24px 32px;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

.lightbox-results-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 6px;
}

.lightbox-results-back {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  padding: 9px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-family: "Barlow Condensed", sans-serif;
  flex-shrink: 0;
}

.lightbox-results-back:hover {
  border-color: var(--po-cyan);
}

.lightbox-results-title {
  color: #fff;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* Pushed to the far end of the header row (title in the middle, this on
   the right) rather than given its own row - one more small chip next to
   "Back to photo" reads as "another option here", not a new feature
   announcing itself. */
.lightbox-results-addphoto {
  margin-left: auto;
}

@media (max-width: 560px) {
  .lightbox-results-header {
    flex-wrap: wrap;
  }

  .lightbox-results-addphoto {
    margin-left: 0;
    flex-basis: 100%;
  }
}

.lightbox-results-subtitle {
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
  margin: 8px 0 24px;
  max-width: 60ch;
}

.lightbox-results-status {
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  padding: 40px 0;
  text-align: center;
}

.lightbox-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.lightbox-results-loadmore {
  color: rgba(255, 255, 255, 0.55);
  font-size: 13px;
  text-align: center;
  padding: 18px 0 4px;
  min-height: 1.2em;
}

/* Invisible — exists only as an IntersectionObserver target a little
   above the very bottom of the grid, so the next page starts loading
   just before the user actually scrolls past the last row. */
.lightbox-results-sentinel {
  height: 1px;
}

.lightbox-result-item {
  padding: 0;
  border: none;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.06);
  aspect-ratio: 1;
}

.lightbox-result-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.15s ease;
}

.lightbox-result-item:hover img {
  transform: scale(1.05);
}

/* Sponsors — plain logos on the page's own light background, no card
   wrapper needed since most sponsor marks were built for exactly this.
   The section header (label/title/bar) is block-level and centered;
   the strip of logos below it is its own flex row. */
.sponsor-section {
  text-align: center;
  padding-top: 28px;
  border-top: 1px solid var(--po-divider);
  margin-top: 48px;
}

.sponsor-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  align-items: center;
  justify-content: center;
  margin-top: 18px;
}

.sponsor-strip .sponsor-card {
  display: inline-flex;
  align-items: center;
}

.sponsor-strip img {
  height: 26px;
  max-width: 130px;
  width: auto;
  display: block;
  object-fit: contain;
}

/* Event page hero — badge + name/dates/venue on the left, a compact
   "at a glance" card (format/notes/ball) on the right when there's any,
   plus a stat row (days/divisions/players/matches/photos — only the ones
   this event actually has data for) across the bottom. Two columns of
   real content instead of one long column of text. */
.event-hero {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: wrap;
}

.event-hero-main {
  flex: 1 1 380px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.event-hero-top {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.event-hero-badge {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: var(--shadow);
  flex-shrink: 0;
}

.event-hero-aside {
  flex: 1 1 260px;
  max-width: 320px;
  background: var(--po-surface);
  border: 1px solid var(--po-card-border);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  font-size: 13px;
  color: var(--po-ink-mid);
  font-family: "Barlow", sans-serif;
}

.event-hero-aside p {
  margin: 0 0 8px;
}

.event-hero-aside-label {
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--po-cyan-dark);
  margin-bottom: 10px;
}

.event-stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
}

.event-stat-value {
  display: block;
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 800;
  font-size: 30px;
  color: var(--po-navy);
  line-height: 1;
}

.event-stat-label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--po-ink-mid);
  margin-top: 4px;
}

/* Schedule — the only section left using the plain "reference info" rule
   treatment. Photos and Results are dense enough to earn a contained
   panel instead (.content-panel below). */
.section-block {
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid var(--po-divider);
}

.section-block > p {
  font-family: "Barlow", sans-serif;
  color: var(--po-ink-mid);
}

.content-panel {
  margin-top: 40px;
  padding: 32px 36px;
  background: var(--po-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.content-panel > p {
  font-family: "Barlow", sans-serif;
  color: var(--po-ink-mid);
}

@media (max-width: 640px) {
  .content-panel {
    padding: 22px 20px;
  }
}

.notes-list {
  margin: 10px 0 0;
  padding-left: 20px;
  color: var(--po-ink-mid);
  font-size: 13px;
  line-height: 1.6;
  font-family: "Barlow", sans-serif;
}

.schedule-list {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.schedule-day {
  display: flex;
  gap: 10px;
  font-size: 14px;
  flex-wrap: wrap;
  font-family: "Barlow", sans-serif;
}

.schedule-day strong {
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 700;
  color: var(--po-ink);
  min-width: 150px;
  flex-shrink: 0;
}

.schedule-day span {
  color: var(--po-ink-mid);
}

/* Results search */
.results-search {
  margin-bottom: 18px;
}

.results-search-input {
  width: 100%;
  max-width: 420px;
  padding: 11px 16px;
  background: var(--po-surface);
  border: 1px solid var(--po-card-border);
  border-radius: 999px;
  color: var(--po-ink);
  font-size: 14px;
  font-family: "Barlow", sans-serif;
  transition: border-color 0.15s ease;
}

.results-search-input:focus {
  outline: none;
  border-color: var(--po-cyan);
}

/* Category tabs */
.results-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.is-hidden {
  display: none;
}

.results-tabs.is-hidden {
  display: none;
}

.results-tab {
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--po-cyan-dark);
  background: var(--po-cyan-light);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.results-tab:hover {
  background: var(--po-cyan-mid);
  color: var(--po-cyan-darker);
}

.results-tab.is-active {
  background: var(--po-cyan-dark);
  color: #fff;
}

/* Podium card grid */
.podium-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  margin-bottom: 8px;
}

.podium-grid.is-hidden {
  display: none;
}

.podium-card {
  background: var(--po-surface);
  border: 1px solid var(--po-card-border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.podium-card:hover {
  border-color: var(--po-cyan);
  box-shadow: var(--shadow);
}

.podium-category-tag {
  display: inline-block;
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--po-cyan-dark);
  background: var(--po-cyan-light);
  border-radius: 999px;
  padding: 2px 9px;
  margin-bottom: 6px;
}

.podium-division {
  font-family: "Barlow", sans-serif;
  font-weight: 600;
  color: var(--po-ink-mid);
  font-size: 12px;
  line-height: 1.5;
  /* Division names run from one word ("Provincial") to a full skill/age
     clause that wraps to two lines ("Mens Doubles Skill: (3.5) Age: (40
     And Above)"). Reserving two lines' height (2 * 12px * 1.5) always,
     even for a one-line title, keeps every medal list in a row starting
     at the same height — otherwise a grid row full of cards with
     different title lengths reads as visibly misaligned even though the
     card borders themselves line up. */
  min-height: 36px;
  margin-bottom: 8px;
}

/* All three medalists, always visible — a clean ranked list rather than
   a "podium" graphic. Gold gets a soft highlight band; silver/bronze sit
   underneath at lower visual weight. */
.medal-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.medal-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 8px;
}

.medal-row.gold {
  background: rgba(232, 185, 35, 0.14);
}

.medal-rank {
  font-size: 15px;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}

.medal-name {
  font-family: "Barlow", sans-serif;
  font-size: 13px;
  color: var(--po-ink-mid);
  line-height: 1.3;
}

.medal-row.gold .medal-name {
  color: var(--po-ink);
  font-weight: 700;
  font-size: 14px;
}

.podium-card mark {
  background: var(--po-cyan-light);
  color: var(--po-navy);
  font-weight: 700;
  padding: 0 2px;
  border-radius: 2px;
}

.results-section > a {
  margin-top: 20px;
}

/* Footer */
footer.site-footer {
  background: var(--po-cyan-dark);
  text-align: center;
  padding: 22px 24px;
  /* Was rgba(255,255,255,0.8) — the 20% transparency alone dropped this
     under 4.5:1 even against the new darker background (blends toward
     the background color, not toward gray), so this needs full opacity. */
  color: #fff;
  font-size: 13px;
  font-family: "Barlow", sans-serif;
}

/* Admin upload page */
.upload-form {
  max-width: 560px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.upload-form label {
  font-size: 13px;
  font-weight: 600;
  color: var(--po-ink-mid);
  display: block;
  margin-bottom: 6px;
  font-family: "Barlow", sans-serif;
}

.upload-form input[type="text"],
.upload-form input[type="password"],
.upload-form input[type="date"] {
  width: 100%;
  padding: 11px 14px;
  background: var(--po-surface);
  border: 1px solid var(--po-card-border);
  border-radius: var(--radius);
  color: var(--po-ink);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.15s ease;
}

.upload-form input:focus {
  outline: none;
  border-color: var(--po-cyan);
}

.dropzone {
  border: 2px dashed var(--po-cyan-mid);
  border-radius: var(--radius-lg);
  padding: 48px 20px;
  text-align: center;
  color: var(--po-ink-mid);
  background: var(--po-cyan-light);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  font-size: 14px;
  font-family: "Barlow", sans-serif;
}

.dropzone:hover {
  border-color: var(--po-cyan);
}

.dropzone.dragover {
  border-color: var(--po-cyan);
  color: var(--po-ink);
  background: var(--po-cyan-light);
}

.upload-form button[type="submit"] {
  background: var(--po-cyan-dark);
  color: #fff;
  font-weight: 800;
  border: none;
  border-radius: var(--radius);
  padding: 13px;
  cursor: pointer;
  font-size: 15px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-family: "Barlow Condensed", sans-serif;
  transition: background 0.15s ease;
}

.upload-form button[type="submit"]:hover:not([disabled]) {
  background: var(--po-cyan-darker);
}

.upload-form button[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.progress-list {
  max-height: 240px;
  overflow-y: auto;
  font-size: 13px;
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  color: var(--po-ink-mid);
  border: 1px solid var(--po-card-border);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: var(--po-cyan-light);
}

.progress-bar-outer {
  background: var(--po-cyan-light);
  border-radius: 6px;
  overflow: hidden;
  height: 8px;
}

.progress-bar-inner {
  background: var(--po-cyan);
  height: 100%;
  width: 0%;
  transition: width 0.2s ease;
}
