/* Shared styles for every page. */

/* ---- Change these five values and the whole page re-skins. ---- */
:root {
  /* Greens and gold are sampled from the logo artwork itself:
     deep #023924 · mid #0e6747 · Southern Cross gold #efd526 */
  --ink:        #013724;
  --slate:      #0b6645;
  --chalk:      #eef2ee;
  --muted:      #93ab9d;
  --floodlight: #f0d02b;
  --hairline:   rgba(238, 242, 238, .16);

  /* Bootstrap reads these, so components inherit the palette automatically */
  --bs-body-bg: var(--ink);
  --bs-body-color: var(--chalk);
  --bs-body-font-family: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bs-border-color: var(--hairline);
  --bs-link-color: var(--floodlight);
  --bs-link-hover-color: #f7e274;
  /* Links are coloured from these, not the two above. Keep them in step. */
  --bs-link-color-rgb: 240, 208, 43;
  --bs-link-hover-color-rgb: 247, 226, 116;
  --bs-emphasis-color: var(--chalk);
}

body { -webkit-font-smoothing: antialiased; }

/* Condensed jersey-numeral face, used only for headings and the board */
.face-display {
  font-family: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  line-height: .95;
  letter-spacing: .005em;
}

.eyebrow {
  font-family: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .22em;
  font-size: .85rem;
  color: var(--floodlight);
}

/* ---- Navigation ---- */
.navbar { border-bottom: 1px solid var(--hairline); background: var(--ink); }
.navbar-brand { display: flex; align-items: center; gap: .6rem; }
/* Emblem is ~1.9:1, so height drives the size and width follows. */
.brand-mark { height: 1.9rem; width: auto; }
.brand-name {
  font-family: "Barlow Condensed", sans-serif; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  font-size: 1.05rem; color: var(--chalk);
}
.navbar .nav-link {
  font-family: "Barlow Condensed", sans-serif; font-weight: 600;
  text-transform: uppercase; letter-spacing: .1em;
  font-size: .95rem; color: var(--chalk);
}
.navbar .nav-link:hover { color: var(--floodlight); }
.navbar .nav-link.disabled { color: var(--muted); opacity: .75; }
.navbar .nav-link[aria-current="page"] { color: var(--floodlight); }

/* ---- Hero: pitch markings behind the headline ---- */
.hero {
  position: relative; overflow: hidden;
  padding: clamp(4rem, 12vw, 8rem) 0 clamp(3rem, 8vw, 5rem);
}
.hero::before, .page-head::before {
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(90deg, var(--hairline) 0 1px, transparent 1px 92px);
  opacity: .5;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 85%);
  mask-image: linear-gradient(to bottom, #000 0%, transparent 85%);
  pointer-events: none;
}
.hero > *, .page-head > * { position: relative; }
.hero h1 { font-size: clamp(2.9rem, 7vw, 5.5rem); margin: 1rem 0 0; }
.hero h1 .quiet { color: var(--muted); display: block; }
.hero p.lead { color: var(--muted); max-width: 42ch; font-size: 1.05rem; }
.hero p.lead a { text-underline-offset: .2em; }

/* Transparent emblem sits straight on the dark ground; the wordmark that used to be
   baked into the artwork is set in HTML so it themes with the rest of the page. */
.hero-crest {
  max-width: 24rem; margin-inline: auto; text-align: center;
  container-type: inline-size;
}
.hero-crest img {
  display: block; width: 100%; height: auto;
  filter: drop-shadow(0 1rem 2rem rgba(0, 0, 0, .45));
}
.crest-wordmark {
  font-family: "Barlow Condensed", sans-serif; font-weight: 700;
  text-transform: uppercase; color: var(--chalk);
  /* The emblem above is sized off this container, so the wordmark must be too.
     Sizing it off the viewport let the two drift apart: on a 390px screen the
     emblem stayed ~366px while 5vw bottomed the text out at its 2.1rem floor.
     12.5cqw is the desktop ratio, now held at every width. vw line is the
     fallback for anything without container query support. */
  font-size: clamp(2.1rem, 5vw, 3rem);
  font-size: 12.5cqw;
  line-height: .95;
  margin: .6rem 0 0;
}
.crest-wordmark span {
  display: block; font-weight: 600; color: var(--floodlight);
  font-size: .44em; letter-spacing: .34em;
  margin-top: .35rem;
  /* letter-spacing adds a trailing gap after the last letter, which throws the
     centring off by half a space — the indent pulls it back. */
  text-indent: .34em;
}
.hero-crest.reveal { animation-delay: .2s; }

.rule { width: 3.5rem; height: 2px; background: var(--floodlight); margin-bottom: 1.1rem; }

/* ---- Signature: the fixture board, showing this week's games and the home ground. ----
   The band is --slate darkened toward --ink. At full --slate the gold values only reach
   4.6:1 and read as a duller gold than the same colour elsewhere on the page; darkening
   the ground brings them back in line without leaving the logo's green. */
.board {
  border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline);
  background: color-mix(in srgb, var(--slate) 55%, var(--ink));
  /* --muted is still short of 4.5:1 on the band, so anything muted in here mixes
     toward --chalk. Kept low enough that the gold stays the loud element. */
  --muted: color-mix(in srgb, var(--chalk) 68%, var(--slate));
}
.board-cell { padding: 1.6rem 1.25rem; }
.board-label {
  display: block; color: var(--muted);
  font-family: "Barlow Condensed", sans-serif; font-weight: 600;
  text-transform: uppercase; letter-spacing: .16em; font-size: .78rem;
  margin-bottom: .35rem;
}
.board-value {
  font-family: "Barlow Condensed", sans-serif; font-weight: 700;
  text-transform: uppercase; font-size: 1.75rem; color: var(--floodlight);
}
@media (min-width: 576px) {
  .board-cell + .board-cell { border-left: 1px solid var(--hairline); }
}
@media (max-width: 575.98px) {
  .board-cell + .board-cell { border-top: 1px solid var(--hairline); }
}

/* This week's games (home page). One column per game day, sized by how many games
   that day has, so on wide screens every game gets the same width: three Sunday
   games take three fifths, Monday and Tuesday a fifth each. Narrower than that,
   a day with three games gets its own row and one-game days pair up below it. */
.week-head {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem 1rem;
  padding: 1.6rem 1.25rem 1.1rem;
}
.week-title {
  font-family: "Barlow Condensed", sans-serif; font-weight: 700;
  text-transform: uppercase; font-size: 1.75rem; line-height: 1;
  color: var(--floodlight); margin: 0;
}
.week-round, .week-day-head {
  font-family: "Barlow Condensed", sans-serif; font-weight: 600;
  text-transform: uppercase; letter-spacing: .16em; font-size: .85rem;
}
.week-round { color: var(--muted); }
.week-link {
  margin-left: auto; white-space: nowrap;
  font-family: "Barlow Condensed", sans-serif; font-weight: 600;
  text-transform: uppercase; letter-spacing: .1em; text-decoration: none;
}
.week-link:hover { text-decoration: underline; }
.week-msg {
  margin: 0; padding: 0 1.25rem 1.1rem; font-size: .95rem; color: var(--muted);
}
.week-error { color: #f0a493; }

/* Lines between columns and rows come from each day's shadow; overflow trims the
   ones that would fall on the outside edge, wherever the columns wrap. */
.week-days { display: flex; flex-wrap: wrap; overflow: hidden; }
.week-day {
  flex: var(--games) 1 min(100%, calc(var(--games) * 33.34%)); min-width: 0;
  box-shadow: -1px 0 var(--hairline), 0 -1px var(--hairline);
}
.week-day-head {
  margin: 0 1.25rem; padding: .9rem 0 .45rem;
  border-bottom: 1px solid var(--floodlight); color: var(--chalk);
}
.week-day .games { display: grid; grid-template-columns: repeat(var(--games), minmax(0, 1fr)); }
.week-day .game {
  grid-template-columns: minmax(0, 1fr); align-content: start; gap: .45rem;
  padding: .9rem 1.25rem 1.5rem; border-bottom: 0;
}
.week-day .game + .game { box-shadow: -1px 0 var(--hairline); }
.week-day .game-meta { flex-direction: row; align-items: baseline; gap: .75rem; white-space: nowrap; }
.week-day .at { display: none; }
.week-day .team-line { max-width: none; }
.week-day .team-logo { width: 2rem; height: 2rem; }
/* ~ not +: the @ and a hidden "at" sit between the two team lines. */
.week-day .team-line ~ .team-line { margin-top: .55rem; }
/* Tight leading so a long name that wraps reads as one team, not two. */
.week-day .team-name {
  font-family: "Barlow Condensed", sans-serif; font-weight: 700;
  text-transform: uppercase; font-size: 1.2rem; line-height: 1.1; letter-spacing: .02em;
}
.week-day .team-score { font-size: 1.3rem; line-height: 1.1; }
.week-day .game-where { font-size: .85rem; }
.week-ground { border-top: 1px solid var(--hairline); }
@media (min-width: 1200px) {
  .week-days.one-row-xl { flex-wrap: nowrap; }
  .one-row-xl .week-day { flex-basis: 0; }
}
@media (min-width: 1400px) {
  .week-days.one-row-xxl { flex-wrap: nowrap; }
  .one-row-xxl .week-day { flex-basis: 0; }
}
@media (max-width: 575.98px) {
  .week-day { flex-basis: 100%; }
  .week-day .games { grid-template-columns: minmax(0, 1fr); }
  .week-day .game { padding-bottom: 1.1rem; }
  .week-day .game + .game { box-shadow: 0 -1px var(--hairline); }
}

/* ---- Contact ---- */
.contact { padding: clamp(3.5rem, 9vw, 6rem) 0; }
.contact-email {
  font-family: "Barlow Condensed", sans-serif; font-weight: 700;
  font-size: clamp(1.6rem, 5vw, 2.75rem);
  color: var(--chalk); text-decoration: none;
  border-bottom: 2px solid var(--floodlight);
  padding-bottom: .1rem;
}
.contact-email:hover { color: var(--floodlight); }

footer { border-top: 1px solid var(--hairline); padding: 2rem 0; color: var(--muted); font-size: .9rem; }

/* ---- Inner pages (schedule, standings, policies) ---- */
.page-head {
  position: relative; overflow: hidden;
  padding: clamp(2.75rem, 8vw, 5rem) 0 clamp(1.75rem, 4vw, 2.5rem);
}
.page-head h1 { font-size: clamp(2.6rem, 6.5vw, 4.5rem); margin: .9rem 0 0; }
.page-head .lead { color: var(--muted); max-width: 52ch; font-size: 1.05rem; margin-top: 1.1rem; }
.page-body { padding-bottom: clamp(3.5rem, 9vw, 6rem); }

.section-title { font-size: clamp(1.6rem, 3.6vw, 2.2rem); margin: 0 0 1.25rem; }
.section-title + .section-note { margin-top: -.75rem; }
.section-note { color: var(--muted); font-size: .95rem; }
.page-section + .page-section { margin-top: clamp(2.5rem, 6vw, 3.75rem); }

/* Status messages: loading, errors, and the "this is test data" warning */
.notice {
  border-left: 3px solid var(--floodlight);
  background: color-mix(in srgb, var(--slate) 35%, var(--ink));
  padding: .8rem 1rem; margin-bottom: 1.75rem; font-size: .95rem;
}
.notice-error { border-left-color: #e8826f; }
.empty { color: var(--muted); border: 1px dashed var(--hairline); padding: 1.25rem; margin: 0; }

/* Division filter */
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 2.25rem; }
.chip {
  font-family: "Barlow Condensed", sans-serif; font-weight: 600;
  text-transform: uppercase; letter-spacing: .1em; font-size: .92rem;
  padding: .4rem 1rem; border-radius: 999px;
  border: 1px solid var(--hairline); background: transparent; color: var(--chalk);
}
.chip:hover { border-color: var(--floodlight); }
.chip[aria-pressed="true"] { background: var(--floodlight); border-color: var(--floodlight); color: var(--ink); }

/* Schedule: one block per date, one row per game */
.day + .day { margin-top: 1.75rem; }
.day-head {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .75rem;
  font-family: "Barlow Condensed", sans-serif; font-weight: 700; text-transform: uppercase;
  font-size: 1.2rem; letter-spacing: .04em;
  padding-bottom: .5rem; margin: 0; border-bottom: 1px solid var(--floodlight);
}
.day-head .round { color: var(--floodlight); font-weight: 600; font-size: .95rem; letter-spacing: .14em; }
.games { list-style: none; margin: 0; padding: 0; }
.game {
  display: grid; gap: .35rem 1.5rem; align-items: center;
  grid-template-columns: 7.5rem minmax(0, 1fr) minmax(0, 17rem);
  padding: .9rem 0; border-bottom: 1px solid var(--hairline);
}
.game-meta { display: flex; flex-direction: column; gap: .15rem; }
.game-time { font-family: "Barlow Condensed", sans-serif; font-weight: 600; font-size: 1.1rem; }
.tag {
  justify-self: start; align-self: flex-start;
  font-family: "Barlow Condensed", sans-serif; font-weight: 600; text-transform: uppercase;
  letter-spacing: .1em; font-size: .75rem; color: var(--muted);
}
.team-line { display: flex; justify-content: space-between; align-items: center; gap: 1rem; max-width: 22rem; }
/* Club logo beside each team name; an empty circle stands in for a team without one. */
.team-name { display: inline-flex; align-items: center; gap: .55rem; }
.team-logo { width: 1.6rem; height: 1.6rem; flex: none; object-fit: contain; }
span.team-logo { border: 1px dashed var(--hairline); border-radius: 50%; }
.game.is-final-score .team-line:not(.won) .team-logo { opacity: .55; }
.at { font-family: "Barlow Condensed", sans-serif; font-weight: 600; font-size: 1.05rem; color: var(--muted); }

/* Schedule page: "Away @ Home" on one line. Names sit outside, logos and scores meet
   at the @, and every row is the same width, so logos line up down the page. */
.day .game-teams {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center; column-gap: .9rem; width: 100%; max-width: 36rem;
}
.day .team-line { max-width: none; justify-content: flex-end; gap: .9rem; }
.day .team-line.away .team-name { flex-direction: row-reverse; text-align: right; }
.day .team-line.home { flex-direction: row-reverse; }
.day .team-line.home .team-score { text-align: left; }
/* Fixed width so a bye (no @) keeps the same columns as every other row. */
.day .at { width: 1.25rem; text-align: center; }
.team-score {
  font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: 1.15rem;
  font-variant-numeric: tabular-nums; min-width: 2ch; text-align: right;
}
.game.is-final-score .team-line { color: var(--muted); }
.game.is-final-score .team-line.won { color: var(--chalk); }
.game.is-final-score .team-line.won .team-score { color: var(--floodlight); }
.game-where { color: var(--muted); font-size: .9rem; display: flex; flex-direction: column; gap: .1rem; }
.game-note { color: var(--floodlight); }
@media (max-width: 575.98px) {
  .day .game-teams, .day .team-line { column-gap: .6rem; }
  .game { grid-template-columns: minmax(0, 1fr); }
  .game-meta { flex-direction: row; align-items: baseline; gap: .75rem; }
  .team-line { max-width: none; }
}

/* Standings tables */
.standings-table {
  --bs-table-bg: transparent; --bs-table-color: var(--chalk);
  --bs-table-border-color: var(--hairline);
  margin: 0; font-variant-numeric: tabular-nums;
}
.standings-table th, .standings-table td { text-align: right; white-space: nowrap; padding: .7rem .6rem; }
.standings-table .pos, .standings-table .team { text-align: left; }
.standings-table .pos { color: var(--muted); width: 2.5rem; }
.standings-table .team-logo { display: inline-block; vertical-align: middle; margin: -.2rem .6rem 0 0; }
.standings-table tbody .team { white-space: normal; min-width: 9rem; }
.standings-table thead th {
  font-family: "Barlow Condensed", sans-serif; font-weight: 600; text-transform: uppercase;
  letter-spacing: .1em; font-size: .8rem; color: var(--muted);
  border-bottom-color: var(--floodlight);
}
.standings-table .pts { color: var(--floodlight); font-weight: 700; }
.standings-table thead .pts { color: var(--floodlight); }
@media (max-width: 575.98px) {
  .standings-table .not-phone { display: none; }
  .standings-table th, .standings-table td { padding: .65rem .4rem; }
  .standings-table tbody .team { min-width: 7rem; }
}
.standings-table abbr[title] { text-decoration: none; cursor: help; }
.standings-key { color: var(--muted); font-size: .9rem; margin-top: 2.5rem; max-width: 60ch; }

/* Policies */
.doc-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--hairline); }
/* The list shows itself, and the "being prepared" message hides, once a policy is added. */
.doc-list:not(:has(li)) { display: none; }
.doc-list:has(li) + .empty { display: none; }
.doc-list li {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem 2rem;
  padding: 1.1rem 0; border-bottom: 1px solid var(--hairline);
}
.doc-name { font-family: "Barlow Condensed", sans-serif; font-weight: 700; text-transform: uppercase; font-size: 1.3rem; }
.doc-desc { color: var(--muted); margin: .15rem 0 0; max-width: 60ch; }
.doc-link {
  font-family: "Barlow Condensed", sans-serif; font-weight: 600; text-transform: uppercase;
  letter-spacing: .1em; white-space: nowrap;
}

/* Teams: a card per club. Cards are centred so a short last row looks deliberate:
   five across on wide screens, fewer as it narrows, two across on phones. */
.clubs {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem;
}
.club {
  flex: 0 1 13rem;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 1.75rem 1.1rem 1.4rem;
  border: 1px solid var(--hairline);
  background: color-mix(in srgb, var(--slate) 30%, var(--ink));
}
.club-logo {
  width: min(100%, 9.5rem); height: auto; aspect-ratio: 1; object-fit: contain;
  filter: drop-shadow(0 .6rem 1.1rem rgba(0, 0, 0, .4));
}
.club-name {
  font-family: "Barlow Condensed", sans-serif; font-weight: 700; text-transform: uppercase;
  font-size: 1.4rem; line-height: 1.05; margin: 1.1rem 0 0;
}
.club-teams { list-style: none; margin: .55rem 0 0; padding: 0; font-size: .9rem; color: var(--muted); }
.club-teams li + li { margin-top: .2rem; }
.club-division {
  display: block; font-family: "Barlow Condensed", sans-serif; font-weight: 600;
  text-transform: uppercase; letter-spacing: .12em; font-size: .72rem; color: var(--chalk);
}
/* A round icon button per link, pushed to the bottom so they line up across a row. */
.club-links {
  display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem;
  margin-top: auto; padding-top: 1.1rem;
}
.club-link {
  display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 50%;
  border: 1px solid var(--floodlight); color: var(--floodlight);
}
.club-link svg { width: 1.25rem; height: 1.25rem; }
.club-link:hover { background: var(--floodlight); color: var(--ink); }
@media (max-width: 575.98px) {
  .club { flex-basis: calc(50% - .5rem); padding: 1.25rem .75rem 1.1rem; }
  .club-name { font-size: 1.2rem; }
}

/* ---- Accessibility + motion ---- */
:focus-visible { outline: 2px solid var(--floodlight); outline-offset: 3px; }
.skip-link {
  position: absolute; left: -999px; top: .5rem; z-index: 1080;
  background: var(--floodlight); color: var(--ink); padding: .5rem .9rem;
}
.skip-link:focus { left: .5rem; }

.reveal { opacity: 0; animation: rise .7s cubic-bezier(.2,.7,.3,1) forwards; }
.reveal:nth-child(2) { animation-delay: .08s; }
.reveal:nth-child(3) { animation-delay: .16s; }
.reveal:nth-child(4) { animation-delay: .24s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; animation: none; }
}
