/* SchoolSportsHub365 public site — SSFA identity in the LeagueHub365 design
   tier: deep navy canvas, soft gradient orbs, glass panels, Plus Jakarta Sans.
   Accent is the crest red rather than LeagueHub's green. Dark by default, with
   a light theme the visitor can pick (see theme.js) that also follows the OS
   preference until they do. */

:root {
  --bg: #070e18;
  --panel: rgba(18, 28, 43, 0.82);
  --panel-solid: #121c2b;
  --text: #eaf0f7;
  --muted: #9cadc1;
  --line: rgba(120, 150, 180, 0.22);
  --accent: #e63946;
  --accent-soft: #ff6b76;
  --gold: #f4c95d;
  --green: #35c977;
  --radius: 18px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.42);
  /* Themeable surfaces — anything that used to hardcode a dark-only value. */
  --canvas-glow: #16324e;
  /* The whole page backdrop, so each theme can pick its own gradient shape
     rather than being forced through one radial. */
  --canvas: radial-gradient(circle at 80% -10%, var(--canvas-glow) 0%, var(--bg) 45%);
  /* Orb strength is themed: the same faint wash that glows on a near-black
     canvas simply disappears on a near-white one. */
  --orb-opacity: 0.26;
  --crest-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
  --hover: rgba(255, 255, 255, 0.05);
  --hover-strong: rgba(255, 255, 255, 0.09);
  --input-bg: rgba(9, 16, 26, 0.75);
  --crest-plate: rgba(255, 255, 255, 0.9);
  --orb-a: rgba(230, 57, 70, 0.26);
  --orb-b: rgba(47, 125, 92, 0.26);
}

/* Light palette. The values live here once; the two selectors below only map
   them, so an OS-driven light theme and a chosen one can never drift apart.
   The accent trio is re-darkened: the dark-mode red/gold/green sit at 1.5–2.6
   contrast on a pale canvas, which fails even the 3.0 needed for large text. */
:root {
  --light-bg: #f4f7fb;
  --light-panel: rgba(255, 255, 255, 0.86);
  --light-panel-solid: #ffffff;
  --light-text: #0f1b2a;
  --light-muted: #55677d;
  --light-line: rgba(15, 27, 42, 0.14);
  --light-shadow: 0 18px 44px rgba(15, 27, 42, 0.12);
  --light-canvas-glow: #d6e6f7;
  /* Layered rather than a single radial: a cool top-right glow over a gentle
     vertical wash that warms slightly towards the SSFA green at the foot.
     Mirrors the app's light shell so the two read as one product. */
  --light-canvas:
    radial-gradient(circle at 80% -10%, var(--light-canvas-glow) 0%, rgba(214, 230, 247, 0) 46%),
    linear-gradient(180deg, #f7fafd 0%, #e9f1f9 52%, #edf6f1 100%);
  /* ~2x the dark value to land at a comparable perceived strength on a pale
     canvas (see --orb-opacity). */
  --light-orb-opacity: 0.5;
  /* A near-black drop shadow reads as grime on a pale canvas. */
  --light-crest-shadow: 0 8px 22px rgba(15, 27, 42, 0.18);
  --light-hover: rgba(15, 27, 42, 0.05);
  --light-hover-strong: rgba(15, 27, 42, 0.09);
  --light-input-bg: rgba(255, 255, 255, 0.92);
  --light-crest-plate: rgba(255, 255, 255, 0.95);
  --light-orb-a: rgba(230, 57, 70, 0.2);
  --light-orb-b: rgba(47, 125, 92, 0.22);
  --light-accent-soft: #c62230;
  --light-gold: #a16207;
  --light-green: #15803d;
}

/* Applied when the visitor picks light, or when their OS prefers it and they
   have not chosen — an explicit data-theme always wins. */
:root[data-theme='light'] {
  --bg: var(--light-bg);
  --panel: var(--light-panel);
  --panel-solid: var(--light-panel-solid);
  --text: var(--light-text);
  --muted: var(--light-muted);
  --line: var(--light-line);
  --shadow: var(--light-shadow);
  --canvas-glow: var(--light-canvas-glow);
  --canvas: var(--light-canvas);
  --orb-opacity: var(--light-orb-opacity);
  --crest-shadow: var(--light-crest-shadow);
  --hover: var(--light-hover);
  --hover-strong: var(--light-hover-strong);
  --input-bg: var(--light-input-bg);
  --crest-plate: var(--light-crest-plate);
  --orb-a: var(--light-orb-a);
  --orb-b: var(--light-orb-b);
  --accent-soft: var(--light-accent-soft);
  --gold: var(--light-gold);
  --green: var(--light-green);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --bg: var(--light-bg);
    --panel: var(--light-panel);
    --panel-solid: var(--light-panel-solid);
    --text: var(--light-text);
    --muted: var(--light-muted);
    --line: var(--light-line);
    --shadow: var(--light-shadow);
    --canvas-glow: var(--light-canvas-glow);
    --canvas: var(--light-canvas);
    --orb-opacity: var(--light-orb-opacity);
    --crest-shadow: var(--light-crest-shadow);
    --hover: var(--light-hover);
    --hover-strong: var(--light-hover-strong);
    --input-bg: var(--light-input-bg);
    --crest-plate: var(--light-crest-plate);
    --orb-a: var(--light-orb-a);
    --orb-b: var(--light-orb-b);
    --accent-soft: var(--light-accent-soft);
    --gold: var(--light-gold);
    --green: var(--light-green);
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--canvas);
  color: var(--text);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  line-height: 1.55;
}

.bg-orb {
  position: fixed;
  filter: blur(90px);
  opacity: var(--orb-opacity);
  z-index: 0;
  pointer-events: none;
  border-radius: 50%;
}

.bg-orb-a {
  width: 440px;
  height: 440px;
  background: var(--orb-a);
  top: -140px;
  left: -140px;
}

.bg-orb-b {
  width: 380px;
  height: 380px;
  background: var(--orb-b);
  bottom: -120px;
  right: -100px;
}

.shell {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  width: calc(100% - 2rem);
}

/* ── header / nav ─────────────────────────────────────────────────────── */

.site-header {
  padding: 26px 0 8px;
  text-align: center;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: inherit;
}

.brand-lockup img {
  width: 96px;
  height: 96px;
  filter: drop-shadow(var(--crest-shadow));
}

.brand-text {
  text-align: left;
}

.brand-text strong {
  display: block;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.brand-text span {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  margin: 18px 0 8px;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.site-nav a:hover {
  color: var(--text);
  background: var(--hover);
}

/* Appearance cog — pinned to the top right of the content column.
   .site-header carries .shell, which is already position: relative. */
.appearance {
  position: absolute;
  top: 22px;
  right: 0;
  z-index: 3;
  text-align: left;
}

.appearance-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.appearance-button:hover,
.appearance-button[aria-expanded='true'] {
  color: var(--text);
  background: var(--hover-strong);
  border-color: rgba(230, 57, 70, 0.5);
}

.appearance-panel {
  position: absolute;
  top: 46px;
  right: 0;
  min-width: 12.5rem;
  padding: 8px;
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 2px;
}

.appearance-panel[hidden] {
  display: none;
}

.appearance-heading {
  margin: 4px 8px 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.appearance-panel button {
  font: inherit;
  font-size: 0.9rem;
  text-align: left;
  color: var(--text);
  background: transparent;
  border: 0;
  border-radius: 9px;
  padding: 9px 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.appearance-panel button:hover {
  background: var(--hover-strong);
}

/* Tick the active choice without needing an icon font. */
.appearance-panel button.is-selected::after {
  content: '✓';
  color: var(--accent-soft);
  font-weight: 700;
}

.site-nav a.active {
  color: var(--text);
  background: rgba(230, 57, 70, 0.16);
  border-color: rgba(230, 57, 70, 0.5);
}

/* ── hero ─────────────────────────────────────────────────────────────── */

.hero {
  text-align: center;
  padding: 30px 0 8px;
}

.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(2rem, 5vw, 3.1rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
  font-weight: 800;
  text-wrap: balance;
}

.hero h1 .accent {
  background: linear-gradient(120deg, var(--accent-soft), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p {
  margin: 0 auto;
  max-width: 44rem;
  color: var(--muted);
  font-size: clamp(1rem, 1.7vw, 1.15rem);
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 22px;
}

/* ── buttons ──────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  /* The forms are grids, which stretches a submit button to full width. Without
     this its label sits at the flex start rather than centred — and text-align
     cannot centre a flex container's items. */
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  padding: 13px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, #b3222f 100%);
  color: #fff;
  box-shadow: 0 12px 30px rgba(230, 57, 70, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 16px 38px rgba(230, 57, 70, 0.42);
}

.btn-ghost {
  background: var(--hover);
  border-color: var(--line);
  color: var(--text);
}

.btn-ghost:hover {
  background: var(--hover-strong);
}

.btn:disabled {
  opacity: 0.55;
  cursor: default;
  box-shadow: none;
}

/* ── sections & cards ─────────────────────────────────────────────────── */

section {
  margin: 46px 0;
}

.section-head {
  margin-bottom: 16px;
}

h2 {
  margin: 0 0 6px;
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  letter-spacing: -0.015em;
  font-weight: 800;
}

.section-head p {
  margin: 0;
  color: var(--muted);
  max-width: 46rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
  gap: 14px;
}

.card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: rgba(230, 57, 70, 0.4);
}

.card h3 {
  margin: 0 0 6px;
  font-size: 1.06rem;
  font-weight: 750;
  letter-spacing: -0.01em;
}

.card .meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.card .meta a {
  color: var(--accent-soft);
  font-weight: 650;
  text-decoration: none;
}

.card .meta a:hover {
  text-decoration: underline;
}

.district-crest {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 10px;
  background: var(--crest-plate);
  padding: 3px;
}

.pill {
  display: inline-block;
  background: rgba(53, 201, 119, 0.16);
  border: 1px solid rgba(53, 201, 119, 0.42);
  color: #8ff0b6;
  border-radius: 999px;
  padding: 3px 11px;
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.pill-gold {
  background: rgba(244, 201, 93, 0.15);
  border-color: rgba(244, 201, 93, 0.45);
  color: var(--gold);
}

.empty {
  color: var(--muted);
  grid-column: 1 / -1;
  margin: 0;
}

/* ── school search ────────────────────────────────────────────────────── */

.search-wrap {
  position: relative;
  max-width: 38rem;
}

.school-search {
  width: 100%;
  font: inherit;
  padding: 15px 18px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--input-bg);
  color: var(--text);
}

.school-search::placeholder {
  color: #74869a;
}

.school-search:focus {
  outline: none;
  border-color: rgba(230, 57, 70, 0.6);
  box-shadow: 0 0 0 4px rgba(230, 57, 70, 0.14);
}

#school-results {
  max-width: 38rem;
}

.school-result {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 16px;
  margin-top: 9px;
  backdrop-filter: blur(8px);
}

.school-result-name {
  font-weight: 750;
}

.school-result a {
  color: var(--accent-soft);
  font-weight: 650;
  text-decoration: none;
}

.school-result a:hover {
  text-decoration: underline;
}

.muted {
  color: var(--muted);
  font-weight: 400;
  font-size: 0.88rem;
}

/* ── forms ────────────────────────────────────────────────────────────── */

.form-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow);
  max-width: 38rem;
  /* The shell is 1100px wide but the card is capped at 38rem, so without this
     it hugs the left edge while the hero above it is centred. */
  margin-inline: auto;
}

form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 6px;
  font-weight: 650;
  font-size: 0.9rem;
}

input,
select,
textarea {
  font: inherit;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--input-bg);
  color: var(--text);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(230, 57, 70, 0.6);
  box-shadow: 0 0 0 4px rgba(230, 57, 70, 0.14);
}

textarea {
  min-height: 110px;
  resize: vertical;
}

/* Volunteer form: "how would you like to help" checkboxes. */
.checkbox-group {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px 14px;
  margin: 0;
  display: grid;
  gap: 8px;
}

.checkbox-group legend {
  padding: 0 6px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--muted);
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.94rem;
  cursor: pointer;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  flex: 0 0 auto;
  cursor: pointer;
}

.checkbox-row.standalone {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}

.form-note {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0;
}

.form-note a {
  color: var(--accent-soft);
}

.form-result {
  font-weight: 700;
  margin: 0;
}

.form-result.ok {
  color: #8ff0b6;
}

.form-result.error {
  color: var(--accent-soft);
}

/* ── footer ───────────────────────────────────────────────────────────── */

.site-footer {
  /* `auto` on the inline axis is load-bearing: .site-footer also carries
     .shell, and this shorthand comes later in the file — a plain 0 here
     overrides .shell's `margin: 0 auto` and the footer drifts to the far
     left while the rest of the page stays centred. */
  margin: 56px auto 30px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.86rem;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.site-footer a {
  color: var(--muted);
}

/* Outbound links to the main SSFA site — About, Contact, Volunteering and
   Sponsorship live there, and duplicating them here would create a second
   copy to keep in step. */
.footer-links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-links a {
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.footer-links a:hover {
  color: var(--text);
  border-bottom-color: var(--line);
}

@media (max-width: 560px) {
  .site-header {
    /* Symmetric, so the crest stays centred while clearing the pinned
       toggle in the top right. */
    padding-left: 46px;
    padding-right: 46px;
  }

  .brand-lockup img {
    width: 72px;
    height: 72px;
  }

  section {
    margin: 34px 0;
  }
}

/* ── policy pages (privacy, terms) ────────────────────────────────────── */

.policy {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 28px 30px;
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow);
  max-width: 48rem;
  margin-inline: auto;
}

.policy-meta {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 0.86rem;
}

.policy h2 {
  margin: 26px 0 8px;
  font-size: 1.08rem;
  font-weight: 750;
  letter-spacing: -0.005em;
}

.policy h2:first-of-type {
  margin-top: 0;
}

.policy p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.97rem;
}

.policy a {
  color: var(--accent-soft);
}
