/* ==========================================================================
   Brownz League Platform - "Honours Board"
   Baize green, engraved brass, club-noticeboard typography.
   Tenant colours arrive as :root overrides injected by the build.
   ========================================================================== */

:root {
  --bg:        #071612;
  --bg-alt:    #0B211A;
  --panel:     #0F2C22;
  --line:      #1C4433;
  --baize:     #125C42;
  --brass:     #C9A227;
  --brass-lt:  #E4C158;
  --chalk:     #F2EFE4;
  --chalk-dim: #A8B5AA;
  --red:       #B02A22;

  --ball-yellow: #E0B028;
  --ball-green:  #1E6B3A;
  --ball-brown:  #7A4A22;

  --display: 'Fraunces', 'Playfair Display', Georgia, serif;
  --body:    'Chivo', 'Helvetica Neue', system-ui, sans-serif;

  --gut:   clamp(1rem, 4vw, 2.5rem);
  --maxw:  76rem;
  --radius: 2px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--body);
  font-size: clamp(0.95rem, 0.9rem + 0.2vw, 1.05rem);
  line-height: 1.6;
  color: var(--chalk);
  background-color: var(--bg);
  min-height: 100vh;
}

/* Atmosphere layer: painted once, never repainted on scroll. */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(70rem 40rem at 15% -10%, rgba(18,92,66,0.55), transparent 70%),
    radial-gradient(50rem 30rem at 95% 5%, rgba(201,162,39,0.10), transparent 65%),
    linear-gradient(180deg, var(--bg-alt) 0%, var(--bg) 55%);
}

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin: 0 0 0.5em;
  font-variation-settings: 'SOFT' 30, 'WONK' 1;
}
h1 { font-size: clamp(2.1rem, 1.4rem + 3.4vw, 4.2rem); }
h2 { font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.3rem); }
h3 { font-size: clamp(1.1rem, 1rem + 0.5vw, 1.35rem); }

a { color: var(--brass-lt); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--chalk); }

.eyebrow {
  font-family: var(--body);
  font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--brass); margin: 0 0 0.9rem;
}
.lede { font-size: 1.12rem; color: var(--chalk-dim); max-width: 46ch; }
.dim  { color: var(--chalk-dim); }
.tiny { font-size: 0.78rem; }

.plaque {
  display: flex; align-items: baseline; gap: 1rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.6rem; margin-bottom: 1.5rem;
}
.plaque h2 { margin: 0; }
.plaque .plaque-note { margin-left: auto; font-size: 0.78rem; color: var(--chalk-dim); white-space: nowrap; }

/* ---------- Layout ---------- */

.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gut); }
section { padding-block: clamp(1.75rem, 3.5vw, 3rem); }
.grid { display: grid; gap: 1.25rem; }
@media (min-width: 46rem) { .grid-2 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 60rem) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 62rem) { .split { display: grid; grid-template-columns: 1.35fr 1fr; gap: 2.5rem; align-items: start; } }

/* ---------- Panels ---------- */

.board {
  background: linear-gradient(180deg, rgba(255,255,255,0.035), rgba(0,0,0,0.16));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.1rem, 3vw, 1.75rem);
  position: relative;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 12px 28px -18px rgba(0,0,0,0.9);
}
/* thin brass capping line, like a trophy plate */
.board::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--brass), transparent);
  opacity: 0.5;
}

/* ---------- Header / nav ---------- */

.site-head {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(10px);
  background: rgba(7,22,18,0.82);
  border-bottom: 1px solid var(--line);
}
.site-head .wrap { display: flex; align-items: center; gap: 1.25rem; min-height: 4.1rem; }

.brand { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; color: var(--chalk); }
.brand .mark {
  width: 2rem; height: 2rem; flex: none; border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #E8564C, var(--red) 55%, #6E1912);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.35), 0 2px 6px rgba(0,0,0,0.5);
}
.brand b { font-family: var(--display); font-size: 1.05rem; font-weight: 600; letter-spacing: -0.01em; }
.brand span { display: block; font-size: 0.66rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--brass); }

.nav { margin-left: auto; display: flex; gap: 0.35rem; flex-wrap: wrap; }
.nav a {
  font-size: 0.82rem; font-weight: 600; letter-spacing: 0.04em;
  text-decoration: none; color: var(--chalk-dim);
  padding: 0.42rem 0.7rem; border-radius: var(--radius);
  border: 1px solid transparent;
}
.nav a:hover { color: var(--chalk); background: rgba(255,255,255,0.05); }
.nav a[aria-current='page'] { color: var(--brass-lt); border-color: var(--line); background: rgba(201,162,39,0.08); }

@media (max-width: 52rem) {
  .site-head .wrap { flex-wrap: wrap; padding-block: 0.7rem; }
  .nav { margin-left: 0; width: 100%; overflow-x: auto; padding-bottom: 0.2rem; }
  .nav a { white-space: nowrap; }
}

/* ---------- Hero ---------- */

.hero { padding-block: clamp(2.5rem, 7vw, 5rem) clamp(1.5rem, 3vw, 2.5rem); }
.hero h1 { max-width: 22ch; }
.hero h1 em { font-style: italic; color: var(--brass-lt); font-variation-settings: 'SOFT' 60, 'WONK' 1; }
.hero .lede { margin-top: 1.25rem; }

.sponsor-line {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--chalk-dim); border: 1px solid var(--line);
  padding: 0.4rem 0.85rem; border-radius: 100px; margin-bottom: 1.6rem;
}
.sponsor-line b { color: var(--brass); font-weight: 700; letter-spacing: 0.16em; }

/* ---------- Tables ---------- */

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table.ledger {
  width: 100%; border-collapse: collapse;
  font-variant-numeric: tabular-nums; font-size: 0.9rem;
}
table.ledger caption { text-align: left; color: var(--chalk-dim); font-size: 0.8rem; padding-bottom: 0.7rem; }
table.ledger th {
  text-align: right; font-size: 0.66rem; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--brass);
  padding: 0 0.55rem 0.55rem; border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.ledger th:first-child, table.ledger th.left { text-align: left; }
table.ledger td {
  text-align: right; padding: 0.62rem 0.55rem;
  border-bottom: 1px solid rgba(28,68,51,0.5); white-space: nowrap;
}
table.ledger td:first-child, table.ledger td.left { text-align: left; }
table.ledger tbody tr:hover { background: rgba(255,255,255,0.035); }
table.ledger .team-name { font-weight: 600; color: var(--chalk); }
table.ledger .pts { font-weight: 700; color: var(--brass-lt); }
table.ledger .pos { color: var(--chalk-dim); width: 2.6rem; }

/* Snooker-ball position markers: top three, then the rest */
.pip { display: inline-block; width: 0.55rem; height: 0.55rem; border-radius: 50%; margin-right: 0.5rem; vertical-align: 0.05em; }
.pip-1 { background: var(--ball-yellow); }
.pip-2 { background: var(--ball-green); }
.pip-3 { background: var(--ball-brown); }
.pip-x { background: var(--line); }

/* ---------- Fixtures ---------- */

.round-head {
  display: flex; align-items: baseline; gap: 0.9rem;
  margin: 2.2rem 0 0.85rem; padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--line);
}
.round-head h3 { margin: 0; }
.round-head .when { margin-left: auto; font-size: 0.78rem; color: var(--chalk-dim); }

.fixture {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 0.75rem;
  padding: 0.7rem 0.9rem; border: 1px solid var(--line); border-radius: var(--radius);
  background: rgba(255,255,255,0.022); margin-bottom: 0.5rem;
}
.fixture .h { text-align: right; font-weight: 600; }
.fixture .a { text-align: left; font-weight: 600; }
.fixture .v {
  font-family: var(--display); font-size: 0.85rem; color: var(--brass);
  padding: 0.1rem 0.5rem; border: 1px solid var(--line); border-radius: 100px;
}
.fixture .score { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--brass-lt); }
.fixture .venue { grid-column: 1 / -1; font-size: 0.74rem; color: var(--chalk-dim); text-align: center; }
.fixture.is-bye { grid-template-columns: 1fr; text-align: center; color: var(--chalk-dim); font-style: italic; }
.fixture.is-cup { border-color: rgba(201,162,39,0.4); background: rgba(201,162,39,0.06); }

@media (max-width: 34rem) {
  .fixture { grid-template-columns: 1fr; text-align: center; gap: 0.3rem; }
  .fixture .h, .fixture .a { text-align: center; }
}

/* ---------- Cards / stats ---------- */

.stat { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; background: rgba(255,255,255,0.022); }
.stat .n { font-family: var(--display); font-size: clamp(1.8rem, 1.3rem + 1.6vw, 2.6rem); color: var(--brass-lt); line-height: 1; }
.stat .k { font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--chalk-dim); margin-top: 0.5rem; }

.club { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.15rem; background: rgba(255,255,255,0.022); }
.club h3 { margin-bottom: 0.35rem; }
.club ul { list-style: none; margin: 0.7rem 0 0; padding: 0; font-size: 0.88rem; }
.club li { padding: 0.28rem 0; border-top: 1px solid rgba(28,68,51,0.5); color: var(--chalk-dim); }

/* ---------- Notices ---------- */

.notice {
  border: 1px solid var(--line); border-left: 3px solid var(--brass);
  border-radius: var(--radius); padding: 0.9rem 1.1rem;
  background: rgba(201,162,39,0.07); font-size: 0.9rem;
}
.notice.sample { border-left-color: var(--red); background: rgba(176,42,34,0.12); }
.notice strong { color: var(--chalk); }

.empty {
  border: 1px dashed var(--line); border-radius: var(--radius);
  padding: 2rem 1.25rem; text-align: center; color: var(--chalk-dim);
}
.empty strong { display: block; color: var(--chalk); font-family: var(--display); font-size: 1.2rem; margin-bottom: 0.4rem; }

.news-item { border-top: 1px solid var(--line); padding: 1.4rem 0; }
.news-item:first-child { border-top: 0; padding-top: 0; }
.news-item time { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--brass); }
.news-item h3 { margin: 0.4rem 0 0.5rem; }
.news-item p { margin: 0 0 0.6rem; color: var(--chalk-dim); }

/* ---------- Footer ---------- */

.site-foot { border-top: 1px solid var(--line); margin-top: 3rem; padding-block: 2.5rem 3rem; font-size: 0.86rem; color: var(--chalk-dim); }
.site-foot a { color: var(--chalk-dim); }
.site-foot a:hover { color: var(--brass-lt); }
.foot-grid { display: grid; gap: 1.75rem; }
@media (min-width: 52rem) { .foot-grid { grid-template-columns: 2fr 1fr 1fr; } }
.foot-grid h4 { font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--brass); font-family: var(--body); }
.foot-grid ul { list-style: none; margin: 0; padding: 0; }
.foot-grid li { padding: 0.2rem 0; }
.credit { margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 0.6rem 1.25rem; font-size: 0.78rem; }
.credit .spacer { margin-left: auto; }

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(14px); animation: rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
  .reveal:nth-child(1) { animation-delay: 0.04s; }
  .reveal:nth-child(2) { animation-delay: 0.12s; }
  .reveal:nth-child(3) { animation-delay: 0.2s; }
  .reveal:nth-child(4) { animation-delay: 0.28s; }
  .reveal:nth-child(5) { animation-delay: 0.36s; }
  .reveal:nth-child(6) { animation-delay: 0.44s; }
  @keyframes rise { to { opacity: 1; transform: none; } }
  .hero > .wrap > * { animation: rise 0.8s cubic-bezier(0.22, 1, 0.36, 1) both; }
  .hero > .wrap > *:nth-child(2) { animation-delay: 0.08s; }
  .hero > .wrap > *:nth-child(3) { animation-delay: 0.16s; }
  .hero > .wrap > *:nth-child(4) { animation-delay: 0.24s; }
}

@media print {
  body { background: #fff; color: #000; }
  .site-head, .nav, .site-foot { display: none; }
  .board { border-color: #999; }
}

/* ---------- Sponsors ---------- */

/* Strip above the footer on every page - the visibility a sponsor is buying. */
.sponsor-strip {
  border-top: 1px solid var(--line);
  background:
    radial-gradient(40rem 12rem at 50% 120%, rgba(201,162,39,0.14), transparent 70%),
    rgba(255,255,255,0.02);
  padding-block: clamp(1.75rem, 4vw, 2.75rem);
  text-align: center;
}
.sponsor-label {
  margin: 0 0 0.7rem;
  font-size: 0.66rem; font-weight: 700;
  letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--brass);
}
.sponsor-name {
  display: block;
  font-family: var(--display);
  font-size: clamp(1.5rem, 1.1rem + 1.8vw, 2.4rem);
  line-height: 1.1;
  color: var(--chalk);
  font-variation-settings: 'SOFT' 40, 'WONK' 1;
}
.sponsor-strip a { text-decoration: none; }
.sponsor-strip a:hover .sponsor-name { color: var(--brass-lt); }
.sponsor-logo { max-height: 4.5rem; max-width: min(100%, 22rem); width: auto; }
.sponsor-also {
  margin: 0.9rem auto 0; max-width: 52ch;
  font-size: 0.82rem; color: var(--chalk-dim);
}
.sponsor-cta { margin: 1.1rem 0 0; font-size: 0.8rem; }

/* Sponsors page */
.sponsor-hero {
  text-align: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.75rem, 5vw, 3.25rem);
  background: linear-gradient(180deg, rgba(201,162,39,0.10), rgba(0,0,0,0.15));
  position: relative;
}
.sponsor-hero::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--brass), transparent);
}
.sponsor-hero .since { margin: 0.8rem 0 0; font-size: 0.78rem; color: var(--chalk-dim); }

.sponsor-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); }
.sponsor-card {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.4rem 1rem; text-align: center;
  background: rgba(255,255,255,0.022);
  display: flex; align-items: center; justify-content: center; min-height: 6rem;
}
.sponsor-card span { font-weight: 600; }
.sponsor-card img { max-height: 3.5rem; max-width: 100%; width: auto; }

.pitch-list { list-style: none; margin: 1.25rem 0 0; padding: 0; }
.pitch-list li {
  padding: 0.7rem 0 0.7rem 1.6rem; position: relative;
  border-top: 1px solid rgba(28,68,51,0.5); color: var(--chalk-dim);
}
.pitch-list li::before {
  content: ''; position: absolute; left: 0; top: 1.15rem;
  width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--brass);
}

/* ---------- Local imagery ---------- */

/* Hero photograph sits behind the type, dimmed enough to keep text legible
   at AA contrast without washing the image out entirely. */
.hero-photo { position: relative; overflow: hidden; z-index: 0; }
.hero-photo > img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  object-position: 62% 30%;
  z-index: -2;
}
.hero-photo { min-height: min(78vh, 34rem); display: flex; align-items: center; }
.hero-photo > .wrap { width: 100%; }
.hero-photo::after {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(7,22,18,0.94) 0%, rgba(7,22,18,0.72) 42%, rgba(7,22,18,0.18) 100%),
    linear-gradient(180deg, rgba(7,22,18,0.35), rgba(7,22,18,0.82));
}
.hero-credit {
  position: absolute; right: 0.7rem; bottom: 0.5rem; z-index: 1;
  font-size: 0.62rem; letter-spacing: 0.04em;
  color: rgba(242,239,228,0.5);
}
.hero-credit a { color: inherit; text-decoration: none; }
.hero-credit a:hover { color: var(--brass-lt); text-decoration: underline; }

.place-grid { display: grid; gap: 1.5rem; }
@media (min-width: 54rem) { .place-grid { grid-template-columns: repeat(3, 1fr); } }

.place {
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; background: rgba(255,255,255,0.022);
  display: flex; flex-direction: column;
}
.place figure { margin: 0; position: relative; }
.place img {
  display: block; width: 100%; aspect-ratio: 4 / 3;
  object-fit: cover; filter: saturate(0.85) contrast(1.05);
}
.place figcaption {
  position: absolute; inset: auto 0 0 0;
  padding: 0.35rem 0.6rem;
  font-size: 0.6rem; text-align: right;
  color: rgba(242,239,228,0.62);
  background: linear-gradient(180deg, transparent, rgba(7,22,18,0.85));
}
.place figcaption a { color: inherit; text-decoration: none; }
.place figcaption a:hover { color: var(--brass-lt); text-decoration: underline; }
.place-body { padding: 1.1rem; flex: 1; }
.place-body h3 { margin: 0 0 0.15rem; }
.place-body .tie {
  display: inline-block; margin-bottom: 0.6rem;
  font-size: 0.64rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--brass);
}
.place-body p { margin: 0; font-size: 0.88rem; color: var(--chalk-dim); }
