/* ==========================================================================
   EDSC — Erith & District Swimming Club
   Design system: club red & white, modernised. Mobile-first.
   ========================================================================== */

:root {
  --red:        #C8102E;
  --red-dark:   #97091F;
  --red-bright: #E8173B;
  --navy:       #0B1B2B;
  --ink:        #18242F;
  --slate:      #51606D;
  --mist:       #F4F6F9;
  --line:       #E3E8EE;
  --white:      #FFFFFF;
  --grad-hero:  linear-gradient(115deg, rgba(11,27,43,.92) 0%, rgba(11,27,43,.55) 45%, rgba(200,16,46,.55) 100%);
  --grad-red:   linear-gradient(120deg, var(--red-dark), var(--red) 55%, var(--red-bright));
  --shadow-1:   0 2px 10px rgba(11,27,43,.08);
  --shadow-2:   0 14px 40px rgba(11,27,43,.16);
  --radius:     16px;
  --font-display: "Outfit", system-ui, sans-serif;
  --font-body:    "Inter", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
:target { scroll-margin-top: 92px; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--red); text-decoration: none; }
a:hover { color: var(--red-dark); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.12;
  color: var(--navy);
  margin: 0 0 .5em;
  letter-spacing: -.015em;
}
h1 { font-size: clamp(2.3rem, 5.5vw, 4rem); font-weight: 800; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); font-weight: 800; }
h3 { font-size: 1.25rem; font-weight: 700; }
p  { margin: 0 0 1em; }

.container { width: min(1180px, 92vw); margin-inline: auto; }
.section { padding: clamp(3.2rem, 7vw, 5.5rem) 0; }
.section--mist { background: var(--mist); }
.section--navy { background: var(--navy); }
.section--navy h2, .section--navy h3 { color: var(--white); }
.section--navy p { color: #C6D2DD; }

.kicker {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .82rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: .8rem;
}
.section--navy .kicker { color: #FF6B81; }

.lead { font-size: 1.13rem; color: var(--slate); max-width: 46rem; }

/* --- Buttons -------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  padding: .8rem 1.6rem;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, color .15s ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--grad-red);
  color: var(--white) !important;
  box-shadow: 0 6px 18px rgba(200,16,46,.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(200,16,46,.45); }
.btn-ghost { border-color: var(--navy); color: var(--navy) !important; background: transparent; }
.btn-ghost:hover { background: var(--navy); color: var(--white) !important; }
.btn-ghost--light { border-color: rgba(255,255,255,.85); color: var(--white) !important; }
.btn-ghost--light:hover { background: var(--white); color: var(--navy) !important; }
.btn-lg { font-size: 1.1rem; padding: 1rem 2.1rem; }

/* --- Header / nav ---------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-wrap { display: flex; align-items: center; gap: .8rem; min-height: 76px; }
.brand { display: flex; align-items: center; gap: .6rem; margin-right: auto; flex-shrink: 0; }
.brand img { width: 76px; height: auto; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: .98rem;
  line-height: 1.15;
  color: var(--navy);
  white-space: nowrap;
}
.brand-name em { font-style: normal; color: var(--red); display: block; }
/* Home page gets a larger, bolder crest — only where the full horizontal nav is shown, so it never affects the mobile/burger header. */
@media (min-width: 1264px) { .page-home .brand img { width: 96px; } }

.site-nav > ul { list-style: none; margin: 0; padding: 0; display: flex; gap: .1rem; align-items: center; }
.site-nav a, .sub-toggle {
  display: block;
  white-space: nowrap;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .94rem;
  color: var(--navy);
  padding: .55rem .45rem;
  border-radius: 10px;
  background: none;
  border: 0;
  cursor: pointer;
}
.site-nav a:hover, .sub-toggle:hover, .site-nav a.active { color: var(--red); background: #FBEAED; }
.sub-toggle::after { content: " ▾"; font-size: .72em; }

.has-sub { position: relative; }
.sub {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 240px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-2);
  padding: .45rem;
  margin: 0;
  list-style: none;
  flex-direction: column;
}
.has-sub:hover .sub, .has-sub:focus-within .sub, .has-sub.open .sub { display: flex; }
.sub a { padding: .6rem .8rem; border-radius: 10px; font-weight: 600; }

.nav-actions { display: flex; align-items: center; gap: .7rem; }
.login-link { font-family: var(--font-display); font-weight: 600; font-size: .95rem; color: var(--slate); white-space: nowrap; }
.login-link:hover { color: var(--navy); }

.nav-burger {
  display: none;
  background: none;
  border: 0;
  cursor: pointer;
  padding: .4rem;
  margin-left: .2rem;
}
.nav-burger span { display: block; width: 26px; height: 3px; background: var(--navy); margin: 5px 0; border-radius: 2px; transition: .2s; }

@media (max-width: 1252px) {
  /* the full horizontal nav (8 items + actions + enlarged badge) needs ~1130px of content plus scrollbar allowance; below this it would overflow, so collapse to the burger menu */
  /* backdrop-filter makes the header the containing block for the fixed nav — drop it here */
  .site-header { backdrop-filter: none; background: var(--white); }
  .nav-burger { display: block; }
  .login-link { display: none; }
  .site-nav {
    position: fixed;
    inset: 76px 0 0 0;
    background: var(--white);
    padding: 1rem 4vw 6rem;
    overflow-y: auto;
    display: none;
  }
  .site-nav.open { display: block; }
  .site-nav > ul { flex-direction: column; align-items: stretch; gap: .15rem; }
  .site-nav a, .sub-toggle { font-size: 1.15rem; padding: .85rem .6rem; width: 100%; text-align: left; }
  .sub { position: static; display: none; box-shadow: none; border: 0; padding-left: 1.1rem; }
  .has-sub:hover .sub { display: none; }
  .has-sub.open .sub { display: flex; }
}

@media (max-width: 640px) {
  /* keep the header to one 76px line so the fixed nav lines up beneath it */
  .nav-wrap { gap: .6rem; }
  .brand { gap: .5rem; }
  .brand img { width: 52px; }
  .brand-name { font-size: .76rem; }
  .nav-actions { gap: .5rem; }
  .nav-actions .btn { padding: .55rem 1rem; font-size: .88rem; }
}

/* --- Hero ------------------------------------------------------------------ */
.hero {
  position: relative;
  color: var(--white);
  display: grid;
  align-items: end;
  min-height: clamp(540px, 78vh, 760px);
  isolation: isolate;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--hero-img) center/cover no-repeat;
  z-index: -2;
}
.hero::after { content: ""; position: absolute; inset: 0; background: var(--grad-hero); z-index: -1; }
/* Red club crest centred along the top of the hero, above the swimmer, blended into the water (screen reads as a red glow; soft-light is a subtler alternative). */
.hero-crest {
  position: absolute;
  top: 28px;
  left: 50%;
  transform: translateX(-50%);
  width: clamp(180px, 20vw, 280px);
  height: auto;
  opacity: .6;
  mix-blend-mode: screen;
  z-index: 0;
  pointer-events: none;
  user-select: none;
}
/* Hero text sits centred low in the hero, under the swimmer's head; it deliberately drops into the band between the two corner buttons. Text shadow lifts it off the water. */
.hero > .container {
  position: relative;
  z-index: 1;
  text-align: center;
  padding-bottom: clamp(10px, 2vh, 22px);
  text-shadow: 0 1px 10px rgba(11, 27, 43, .6), 0 1px 3px rgba(11, 27, 43, .55);
}
.hero h1 { color: var(--white); max-width: 24ch; margin-inline: auto; }
.hero .hero-est, .hero .lead { margin-inline: auto; }
/* The two CTAs anchor to the bottom corners, flanking the centred text. */
.hero-cta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: clamp(20px, 4vh, 36px);
  display: flex;
  flex-direction: row-reverse;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-inline: clamp(20px, 4vw, 56px);
  z-index: 2;
}
.hero h1 em { font-style: normal; color: #FF8093; }
.hero .lead { color: #DFE7EE; font-size: 1.2rem; }
.hero-est {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  font-size: .8rem;
  color: #FF8093;
  margin-bottom: 1.1rem;
}
/* On narrow screens the two full-size buttons can't sit in opposite corners, so stack the hero into a centred bottom column with the buttons wrapping centred under the text. */
@media (max-width: 640px) {
  .hero { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
  .hero > .container { padding-bottom: 1.5rem; }
  .hero-cta {
    position: static;
    justify-content: center;
    flex-wrap: wrap;
    padding-inline: 0;
    margin-bottom: 2rem;
  }
}

/* Page hero (subpages) */
.page-hero {
  position: relative;
  color: var(--white);
  padding: clamp(4rem, 9vw, 6.5rem) 0 clamp(2.6rem, 6vw, 4rem);
  isolation: isolate;
  overflow: hidden;
}
.page-hero::before { content: ""; position: absolute; inset: 0; background: var(--hero-img, none) center/cover no-repeat; z-index: -2; }
.page-hero::after { content: ""; position: absolute; inset: 0; background: var(--grad-hero); z-index: -1; }
.page-hero.no-img { background: var(--grad-red); }
.page-hero.no-img::after { display: none; }
.page-hero h1 { color: var(--white); }
.page-hero .lead { color: #F2D8DD; }
.page-hero .kicker { color: #FFD7DE; }

/* --- Cards ------------------------------------------------------------------ */
.grid { display: grid; gap: 1.6rem; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-2); }
.card-img { aspect-ratio: 16/9; object-fit: cover; width: 100%; }
.card-body { padding: 1.4rem 1.5rem 1.6rem; display: flex; flex-direction: column; flex: 1; }
.card-body p { color: var(--slate); flex: 1; }
.card-link { font-family: var(--font-display); font-weight: 700; }
.card-link::after { content: " →"; }

.tile {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem 1.6rem;
  box-shadow: var(--shadow-1);
}
.tile h3 { display: flex; align-items: center; gap: .55rem; }
.tile p { color: var(--slate); margin-bottom: .4em; }
.tile-ico { font-size: 1.25rem; }

/* --- Stats strip -------------------------------------------------------------- */
.stats { background: var(--grad-red); color: var(--white); padding: 2.2rem 0; }
.stats .grid { gap: 1rem; }
.stat { text-align: center; }
.stat b { display: block; font-family: var(--font-display); font-size: clamp(1.9rem, 4vw, 2.7rem); font-weight: 800; line-height: 1.1; }
.stat span { font-size: .92rem; opacity: .92; }

/* --- CTA band ------------------------------------------------------------------ */
.cta-band {
  background: var(--grad-red);
  color: var(--white);
  border-radius: calc(var(--radius) + 6px);
  padding: clamp(2.2rem, 5vw, 3.4rem);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.6rem;
  box-shadow: var(--shadow-2);
}
.cta-band h2 { color: var(--white); margin: 0 0 .3em; }
.cta-band p { color: #FFE0E5; margin: 0; max-width: 44rem; }
.cta-band > div:first-child { flex: 1 1 380px; }
.cta-band .btn-primary { background: var(--white); color: var(--red) !important; box-shadow: 0 8px 22px rgba(0,0,0,.25); }

/* --- Tables -------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); }
table { width: 100%; border-collapse: collapse; background: var(--white); font-size: .97rem; min-width: 560px; }
th { font-family: var(--font-display); text-align: left; background: var(--navy); color: var(--white); padding: .85rem 1.1rem; }
td { padding: .8rem 1.1rem; border-top: 1px solid var(--line); vertical-align: top; }
tbody tr:nth-child(even) { background: var(--mist); }

/* --- Pathway / steps ------------------------------------------------------------ */
.steps { counter-reset: step; display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.step { position: relative; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.9rem 1.4rem 1.4rem; box-shadow: var(--shadow-1); }
.step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  top: -1.1rem;
  left: 1.2rem;
  width: 2.3rem;
  height: 2.3rem;
  border-radius: 50%;
  background: var(--grad-red);
  color: var(--white);
  font-family: var(--font-display);
  font-weight: 800;
  display: grid;
  place-items: center;
  box-shadow: 0 5px 14px rgba(200,16,46,.4);
}
.step h3 { font-size: 1.08rem; margin-top: .2rem; }
.step p { color: var(--slate); font-size: .95rem; margin: 0; }

.pathway { display: flex; flex-wrap: wrap; gap: .55rem; align-items: center; }
.pathway span {
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: .4rem 1rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .9rem;
  color: var(--navy);
}
.pathway span.hot { background: var(--grad-red); color: var(--white); border-color: transparent; }
.pathway i { color: var(--red); font-style: normal; font-weight: 800; }

/* --- Chips / badges ------------------------------------------------------------- */
.chips { display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; list-style: none; }
.chips li {
  background: #FBEAED;
  color: var(--red-dark);
  border-radius: 999px;
  padding: .35rem .95rem;
  font-weight: 600;
  font-size: .9rem;
}
.chips a { color: inherit; text-decoration: none; }
.chips a:hover { text-decoration: underline; }

/* --- People ----------------------------------------------------------------------- */
.person { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.25rem; box-shadow: var(--shadow-1); }
.person b { font-family: var(--font-display); color: var(--navy); display: block; }
.person span { color: var(--slate); font-size: .92rem; }

/* --- FAQ ---------------------------------------------------------------------------- */
details {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem 1.3rem;
  margin-bottom: .8rem;
  box-shadow: var(--shadow-1);
}
summary { font-family: var(--font-display); font-weight: 700; color: var(--navy); cursor: pointer; }
details[open] summary { color: var(--red); margin-bottom: .5rem; }
details p { color: var(--slate); margin: 0 0 .5em; }

/* --- Split media sections -------------------------------------------------------------- */
.split { display: grid; gap: 2.4rem; align-items: center; grid-template-columns: 1fr; }
@media (min-width: 880px) { .split { grid-template-columns: 1.05fr .95fr; } .split.flip > .split-media { order: -1; } }
.split-media img { border-radius: calc(var(--radius) + 6px); box-shadow: var(--shadow-2); width: 100%; object-fit: cover; aspect-ratio: 4/3; }

/* --- Footer ------------------------------------------------------------------------------ */
.site-footer { background: var(--navy); color: #B9C6D2; font-size: .95rem; }
/* The footer lays its own blocks out so the accreditation and partner strips can share one row —
   affiliations left, partners right — instead of stacking into two ragged lines. */
.site-footer > .container { display: flex; flex-wrap: wrap; align-items: center; }
.footer-grid { display: grid; gap: 1.6rem 2.2rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); padding: 2.6rem 0 1.8rem; flex: 1 0 100%; border-bottom: 1px solid rgba(255,255,255,.1); }
.site-footer h4 { color: var(--white); font-size: 1rem; letter-spacing: .04em; text-transform: uppercase; margin-bottom: .9rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: .5rem; }
.site-footer a { color: #B9C6D2; }
.site-footer a:hover { color: var(--white); }
.footer-brand img { width: 76px; margin-bottom: .9rem; }
.footer-brand p { font-size: .92rem; }

.socials { display: flex; gap: .7rem; margin-top: .4rem; }
.socials a {
  width: 42px; height: 42px;
  border-radius: 12px;
  background: rgba(255,255,255,.08);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
  color: var(--white);
  transition: background .15s;
}
.socials a:hover { background: var(--red); color: var(--white); }

.sponsor-strip { flex: 0 1 auto; padding: 1.2rem 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 1rem 1.4rem; }
.sponsor-strip span { font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; opacity: .8; }
/* Partner artwork comes in wildly different aspect ratios — cap the width so one wide banner cannot
   dominate the row, and let the height settle to keep every logo optically the same size. */
.sponsor-strip img { height: 30px; width: auto; max-width: 132px; object-fit: contain; background: var(--white); border-radius: 8px; padding: .3rem .55rem; }
.footer-bottom { flex: 1 0 100%; border-top: 1px solid rgba(255,255,255,.1); padding: 1.1rem 0 3.6rem; font-size: .82rem; display: flex; flex-wrap: wrap; gap: .5rem 1.6rem; justify-content: space-between; align-items: center; }
.footer-bottom-end { display: inline-flex; align-items: center; gap: .6rem; }
.footer-bottom a { color: #fff; text-decoration: underline; }

/* Accreditation logos (footer strip) — shares its row with .sponsor-strip; the divider above the row
   is .footer-grid's bottom border, so this block carries no border of its own. */
.accred-strip { flex: 1 1 auto; padding: 1.2rem 0; display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.4rem; }
.accred-strip span { font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; opacity: .8; }
.accred-strip a { display: inline-flex; }
.accred-strip img { height: 34px; width: auto; background: var(--white); border-radius: 8px; padding: .3rem .6rem; transition: transform .2s ease, box-shadow .2s ease; }
.accred-strip a:hover img { transform: translateY(-2px); box-shadow: var(--shadow-1); }
/* Too narrow for two groups side by side: give each the full width and align them left. */
@media (max-width: 760px) {
  .accred-strip, .sponsor-strip { flex: 1 0 100%; justify-content: flex-start; }
  .accred-strip { padding-bottom: 0; }
}

/* Accreditation logos (welfare page card grid) */
.accred-grid { display: grid; gap: 1.4rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); align-items: stretch; }
.accred-card { display: grid; place-items: center; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.8rem; box-shadow: var(--shadow-1); transition: transform .2s ease, box-shadow .2s ease; }
.accred-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }
.accred-card img { max-height: 80px; width: auto; }

/* --- Trial bar (slim, dismissible) ---------------------------------------------------------- */
.trial-bar {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 70;
  background: var(--navy);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: .6rem 3rem .6rem 1rem;
  font-size: .95rem;
  box-shadow: 0 -6px 22px rgba(11,27,43,.3);
}
.trial-bar b { font-family: var(--font-display); }
.trial-bar .btn { padding: .42rem 1.1rem; font-size: .9rem; }
.trial-bar-close {
  position: absolute;
  right: .6rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: 0;
  color: #B9C6D2;
  font-size: 1.3rem;
  cursor: pointer;
  line-height: 1;
  padding: .3rem;
}
.trial-bar-close:hover { color: var(--white); }
@media (max-width: 640px) { .trial-bar span.hide-sm { display: none; } }

/* --- Reveal animations -------------------------------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* --- Notice / info boxes -------------------------------------------------------------------------- */
.notice {
  border-left: 5px solid var(--red);
  background: #FBEAED;
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.1rem 1.4rem;
  color: var(--red-dark);
  margin: 1.4rem 0;
}
.notice b { font-family: var(--font-display); }

/* --- Centenary banner gallery ------------------------------------------------------------------------ */
.banner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
  margin-top: 1.4rem;
}
.banner-card { margin: 0; }
.banner-card img {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
  transition: transform .18s ease, box-shadow .18s ease;
}
.banner-card a:hover img { transform: translateY(-4px); box-shadow: var(--shadow-2); }
.banner-card figcaption {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .85rem;
  color: var(--slate);
  text-align: center;
  margin-top: .45rem;
}

/* --- Wave divider ----------------------------------------------------------------------------------- */
.wave { display: block; width: 100%; height: 64px; margin-bottom: -1px; }

/* --- Records grids (short / long course) ---------------------------------------------------------- */
.rec-filters { margin: 1.8rem 0 .4rem; display: grid; gap: .9rem; }
.rec-filter-row { display: flex; flex-wrap: wrap; gap: .55rem; align-items: baseline; }
.rec-filter-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--slate);
  flex: 0 0 4rem;
}
.rec-filter-inline { align-items: center; gap: .7rem 1.8rem; }
.rec-group { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.rec-group > .rec-filter-label { flex: 0 0 auto; }
.rec-group-find { flex: 1 1 auto; }
.rec-date { font: inherit; padding: .45rem .7rem; border: 1.5px solid var(--line); border-radius: 10px; background: var(--white); color: var(--ink); }
.rec-date:focus { outline: 2px solid var(--red); outline-offset: 1px; }
.date-sep { color: var(--slate); font-size: .9rem; }
.chipset { display: flex; flex-wrap: wrap; gap: .45rem; }
.chip {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .88rem;
  border: 1.5px solid var(--line);
  background: var(--white);
  color: var(--navy);
  border-radius: 999px;
  padding: .35rem .9rem;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.chip:hover { border-color: var(--red); color: var(--red); }
.chip.on { background: var(--grad-red); color: var(--white); border-color: transparent; box-shadow: 0 4px 12px rgba(200,16,46,.3); }
.chip:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.rec-search {
  font: inherit;
  padding: .5rem .85rem;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  color: var(--ink);
  min-width: 15rem;
}
.rec-search:focus { outline: 2px solid var(--red); outline-offset: 1px; }
.rec-reset { font-family: var(--font-display); font-weight: 600; font-size: .88rem; background: none; border: 0; color: var(--red); cursor: pointer; padding: .5rem .2rem; }

.rec-grid { margin-top: 1.6rem; }
.rec-grid-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .3rem 1rem; margin-bottom: .7rem; }
.rec-grid-head h2 { margin: 0; font-size: clamp(1.3rem, 2.4vw, 1.7rem); }
.rec-count { font-size: .9rem; color: var(--slate); margin: 0; }

.rec-table th { cursor: pointer; user-select: none; white-space: nowrap; }
.rec-table th .dir { opacity: .7; font-size: .8em; }
.rec-table td.t-time { font-family: var(--font-display); font-weight: 700; color: var(--red-dark); white-space: nowrap; }
.rec-table td.t-venue { color: var(--slate); font-size: .9rem; }
.rec-empty { padding: 2rem; text-align: center; color: var(--slate); }
.rec-asof { margin-top: .7rem; color: var(--slate); font-size: .88rem; }
.rec-hide { display: none !important; }
.rec-table tr.is-new td { background: #FFF4F1; }
.rec-new {
  display: inline-block;
  background: var(--grad-red);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: .6rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .1rem .42rem;
  border-radius: 999px;
  vertical-align: middle;
  margin-left: .35rem;
}
.latest-card { position: relative; }
.latest-card .latest-time { font-family: var(--font-display); font-weight: 800; color: var(--red-dark); font-size: 1.7rem; line-height: 1; margin: .1rem 0 .3rem; }
.latest-card .latest-meta { color: var(--slate); font-size: .9rem; margin: 0 0 .2rem; }
.latest-card .latest-name { font-weight: 600; color: var(--navy); }
.latest-card .latest-venue { color: var(--slate); font-size: .82rem; }

/* --- Meet calendar (events list) ------------------------------------------------------------------ */
.cal { display: grid; gap: .9rem; margin-top: 1.6rem; }
.cal-item {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  padding: 1rem 1.3rem;
  color: var(--ink);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.cal-item:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); border-color: #F3C7CE; color: var(--ink); }
.cal-date {
  flex: 0 0 auto;
  width: 76px;
  text-align: center;
  background: var(--grad-red);
  color: var(--white);
  border-radius: 12px;
  padding: .55rem 0;
  font-family: var(--font-display);
  line-height: 1.05;
  box-shadow: 0 5px 14px rgba(200,16,46,.3);
}
.cal-date .d { display: block; font-size: 1.45rem; font-weight: 800; }
.cal-date .d.range { font-size: 1.05rem; }
.cal-date .m { display: block; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; margin-top: .25rem; }
.cal-date .y { display: block; font-size: .64rem; letter-spacing: .1em; opacity: .82; margin-top: .15rem; }
.cal-body { flex: 1 1 auto; }
.cal-body h3 { margin: 0 0 .15rem; }
.cal-body p { margin: 0; color: var(--slate); font-size: .94rem; }
.cal-body .cal-deadline { font-size: .85rem; color: var(--red-dark); font-weight: 600; margin-top: .15rem; }
.cal-go { flex: 0 0 auto; font-family: var(--font-display); font-weight: 800; color: var(--red); font-size: 1.3rem; }
@media (max-width: 520px) { .cal-go { display: none; } .cal-item { gap: .9rem; padding: .9rem 1rem; } }

/* --- Club news (loaded from SwimClub Manager via /api/news) ---------------------------------------- */
/* Each item is a card whose header is a button; the panel below holds the article body. The date
   block reuses .cal-date from the meet calendar, so news and meets read as the same kind of thing. */
.news-item {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  overflow: hidden;
  transition: box-shadow .18s ease, border-color .18s ease;
}
.news-item:hover { box-shadow: var(--shadow-2); border-color: #F3C7CE; }
.news-head {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  width: 100%;
  padding: 1rem 1.3rem;
  background: none;
  border: 0;
  font: inherit;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.news-head:focus-visible { outline: 2px solid var(--red); outline-offset: -3px; }
.news-head-text { flex: 1 1 auto; min-width: 0; }
.news-title { display: block; font-family: var(--font-display); font-weight: 700; font-size: 1.08rem; color: var(--navy); line-height: 1.3; }
.news-teaser { display: block; color: var(--slate); font-size: .94rem; margin-top: .2rem; }
.news-toggle { flex: 0 0 auto; color: var(--red); font-size: 1.2rem; transition: transform .2s ease; }
.news-head[aria-expanded="true"] .news-toggle { transform: rotate(180deg); }
/* The row expands on click, but that is not discoverable on its own — so a strip item also carries a
   plain link through to the article on the news page. */
.news-more { margin: 0; padding: 0 1.3rem 1rem; font-family: var(--font-display); font-weight: 700; font-size: .92rem; }
.news-more a::after { content: " →"; }
.news-panel { padding: 0 1.3rem 1.2rem; border-top: 1px solid var(--line); }
.news-panel[hidden] { display: none; }
.news-loading { color: var(--slate); font-size: .94rem; padding-top: 1rem; margin: 0; }

/* Prose scope for the sanitised SCM article body. Third-party markup lands here, so everything is
   sized and spaced from this block rather than trusting whatever the article carried with it. */
.news-body { padding-top: 1rem; font-size: .97rem; overflow-wrap: anywhere; }
.news-body > :first-child { margin-top: 0; }
.news-body p, .news-body ul, .news-body ol, .news-body blockquote { margin: 0 0 .9em; color: var(--ink); }
.news-body h2, .news-body h3, .news-body h4 { margin: 1.4em 0 .4em; color: var(--navy); }
.news-body h2 { font-size: 1.2rem; }
.news-body h3 { font-size: 1.08rem; }
.news-body h4 { font-size: 1rem; }
.news-body ul, .news-body ol { padding-left: 1.3rem; }
.news-body li { margin-bottom: .3em; }
.news-body img { max-width: 100%; height: auto; border-radius: 10px; }
.news-body hr { border: 0; border-top: 1px solid var(--line); margin: 1.4em 0; }
.news-body blockquote { border-left: 3px solid var(--red); padding-left: 1rem; color: var(--slate); }
/* Articles paste in wide timing tables; let them scroll rather than stretch the page. */
.news-body table { display: block; overflow-x: auto; max-width: 100%; border-collapse: collapse; margin: 0 0 1em; font-size: .9rem; }
.news-body th, .news-body td { border: 1px solid var(--line); padding: .45rem .6rem; vertical-align: top; text-align: left; }
.news-body th { background: var(--mist); font-family: var(--font-display); }
.news-body a.scm-doc::before { content: "📄 "; }
.news-body a.scm-mail { color: var(--red-dark); }

.news-docs { border-top: 1px solid var(--line); padding-top: .9rem; margin-top: .4rem; }
.news-docs h4 { font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--slate); margin: 0 0 .5rem; }
.news-docs ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.news-docs a { font-weight: 600; overflow-wrap: anywhere; }
.news-docs a::before { content: "📄 "; }

.news-truncated { font-size: .9rem; color: var(--slate); margin: .6rem 0 0; }
.news-page-source { margin-top: 1.6rem; color: var(--slate); font-size: .9rem; }
/* Always present, never shouting: the native copy is the point, this is the way back to the source. */
.news-source { margin: 1rem 0 0; padding-top: .8rem; border-top: 1px solid var(--line); font-size: .84rem; }
.news-source a { color: var(--slate); }
.news-source a:hover { color: var(--red); }

/* --- Club news announcement strip ------------------------------------------------------------------ */
/* Sits above the sticky header in normal flow: it scrolls away, and the header still sticks. */
.news-alert { background: var(--grad-red); color: var(--white); font-size: .95rem; }
.news-alert-inner { display: flex; align-items: center; gap: .4rem 1rem; padding: .6rem 0; position: relative; }
.news-alert b { font-family: var(--font-display); flex: 0 0 auto; letter-spacing: .02em; }
.news-alert-link { color: var(--white); font-weight: 600; flex: 1 1 auto; min-width: 0; text-decoration: underline; text-underline-offset: 3px; }
.news-alert-link:hover { color: var(--white); text-decoration-thickness: 2px; }
.news-alert-close {
  flex: 0 0 auto;
  background: none;
  border: 0;
  color: rgba(255,255,255,.8);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  padding: .2rem .3rem;
}
.news-alert-close:hover { color: var(--white); }
@media (max-width: 560px) { .news-alert { font-size: .88rem; } .news-alert b { display: none; } }

/* Utility */
.mt-2 { margin-top: 2rem; }
.center { text-align: center; }
.center .lead { margin-inline: auto; }
