/* ==========================================================================
   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; }
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: 1.2rem; min-height: 76px; }
.brand { display: flex; align-items: center; gap: .7rem; margin-right: auto; }
.brand img { width: 52px; height: auto; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.02rem;
  line-height: 1.15;
  color: var(--navy);
}
.brand-name em { font-style: normal; color: var(--red); display: block; }

.site-nav > ul { list-style: none; margin: 0; padding: 0; display: flex; gap: .2rem; align-items: center; }
.site-nav a, .sub-toggle {
  display: block;
  white-space: nowrap;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .98rem;
  color: var(--navy);
  padding: .55rem .8rem;
  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: .9rem; }
.login-link { font-family: var(--font-display); font-weight: 600; font-size: .95rem; color: var(--slate); }
.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: 1020px) {
  /* 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: 42px; }
  .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: center;
  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; }
.hero h1 { color: var(--white); max-width: 15ch; }
.hero h1 em { font-style: normal; color: #FF8093; }
.hero .lead { color: #DFE7EE; font-size: 1.2rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 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;
}

/* 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;
}

/* --- 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; }
.footer-grid { display: grid; gap: 2.2rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); padding: 3.4rem 0 2.4rem; }
.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: 64px; 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 { border-top: 1px solid rgba(255,255,255,.1); padding: 1.6rem 0; display: flex; flex-wrap: wrap; align-items: center; gap: 1.8rem; }
.sponsor-strip span { font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; }
.sponsor-strip img { height: 44px; width: auto; background: var(--white); border-radius: 10px; padding: .35rem .7rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding: 1.3rem 0 5.4rem; font-size: .85rem; display: flex; flex-wrap: wrap; gap: .6rem 1.6rem; justify-content: space-between; }

/* --- 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); }

/* --- Wave divider ----------------------------------------------------------------------------------- */
.wave { display: block; width: 100%; height: 64px; margin-bottom: -1px; }

/* Utility */
.mt-2 { margin-top: 2rem; }
.center { text-align: center; }
.center .lead { margin-inline: auto; }
