/* Self-hosted fonts (variable woff2, latin + latin-ext subsets), downloaded
   from Google Fonts so visitors' browsers never contact Google for fonts.
   Big Shoulders Display 600-900 (headings), Figtree 400-800 (body). */
/* Big Shoulders Display latin-ext */
@font-face {
  font-family: 'Big Shoulders Display';
  font-style: normal;
  font-weight: 600 900;
  font-display: swap;
  src: url("../fonts/big-shoulders-display-latin-ext.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Big Shoulders Display latin */
@font-face {
  font-family: 'Big Shoulders Display';
  font-style: normal;
  font-weight: 600 900;
  font-display: swap;
  src: url("../fonts/big-shoulders-display-latin.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Figtree latin-ext */
@font-face {
  font-family: 'Figtree';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/figtree-latin-ext.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Figtree latin */
@font-face {
  font-family: 'Figtree';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/figtree-latin.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Shared across every page: tokens, reset, header/nav, footer, buttons,
   and the section-heading/body utility classes. Page-specific styles
   (hero, sessions gallery, page-header banner, etc.) live in each page's
   own stylesheet and load after this one so they can extend these rules. */

:root {
  --white: #FFFFFF;
  --royal-blue: #1D4ED8;
  --royal-blue-dark: #1A3FB0;
  --ink: #0B1220;
  --red: #DC2626;

  --content-size: 800px;
  --wide-size: 1280px;

  --font-display: "Big Shoulders Display", "Arial Narrow", sans-serif;
  --font-body: "Figtree", -apple-system, sans-serif;

  --header-h: 104px;
  --ease-sharp: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-wipe: cubic-bezier(0.76, 0, 0.24, 1);
}

* { box-sizing: border-box; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  background: var(--white);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { text-decoration: none; color: inherit; }

.wide-width {
  max-width: var(--wide-size);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.content-width {
  max-width: var(--content-size);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: var(--white);
  padding: 0.75rem 1.25rem;
  z-index: 999;
  font-family: var(--font-body);
  font-weight: 600;
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

/* ================= HEADER ================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 3px solid var(--ink);
  height: var(--header-h);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.logo-mark {
  height: 52px;
  width: auto;
  /* Recolor gold source emblem to royal blue for on-white header use */
  filter: brightness(0) saturate(100%) invert(20%) sepia(90%) saturate(3000%) hue-rotate(215deg) brightness(95%) contrast(105%);
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  color: var(--ink);
}
.logo-text .primary { font-size: 1.65rem; letter-spacing: 0.02em; }
.logo-text .secondary {
  font-family: var(--font-body);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  color: var(--royal-blue);
  margin-top: 0.25rem;
}

.site-nav ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 2.25rem;
  margin: 0;
  padding: 0;
}

.site-nav a {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink);
  position: relative;
  padding: 0.4rem 0.05rem;
  transition: color 0.15s var(--ease-sharp);
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 3px;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.18s var(--ease-sharp);
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a.active {
  color: var(--royal-blue);
}
.site-nav a:hover::after,
.site-nav a:focus-visible::after,
.site-nav a.active::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* ---------- Mobile nav toggle ---------- */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2.5px;
  background: var(--ink);
  transition: transform 0.2s var(--ease-sharp), opacity 0.2s var(--ease-sharp);
}
.nav-toggle span:nth-child(2) { transition-delay: 0.05s; }
.nav-toggle:active span { transform: scaleX(0.8); }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* ================= BUTTONS ================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.95rem 1.9rem;
  border: 2px solid transparent;
  cursor: pointer;
  will-change: transform; /* own layer: avoids stale-edge artifacts after hover-out */
  transition: transform 0.15s var(--ease-sharp), background-color 0.15s var(--ease-sharp), color 0.15s var(--ease-sharp), border-color 0.15s var(--ease-sharp);
}
.btn svg { transition: transform 0.25s var(--ease-sharp); }

/* The clip-path on the parallelogram buttons would crop an outside outline,
   so the focus ring sits inside the box, in the label's own colour. */
.btn:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: -5px;
}

/* Primary / solid: parallelogram, with the same corner-circle fill as the ghost
   button (see below): base colour stays, red fills in on hover. */
.btn-primary, .btn-solid {
  border-width: 0; /* a border would show as a base-colour edge around the fill */
  padding: calc(0.95rem + 2px) calc(1.9rem + 2px);
  clip-path: polygon(14px 0, 100% 0, calc(100% - 14px) 100%, 0 100%);
  transition: transform 0.15s var(--ease-sharp); /* colour snaps back instantly on hover-away */
}
.btn-primary { background: var(--white); color: var(--ink); }
.btn-solid { background: var(--royal-blue); color: var(--white); }
.btn-primary:hover, .btn-primary:focus-visible,
.btn-solid:hover, .btn-solid:focus-visible { color: var(--white); transition: transform 0.15s var(--ease-sharp), color 0.4s var(--ease-sharp); }
.btn.btn-primary:hover, .btn.btn-solid:hover { transform: none; }

/* Link-out icons nudge towards where they point */
.btn:hover svg, .btn:focus-visible svg { transform: translate(2px, -2px); }

/* Submit button pending state (set from main.js while the form posts) */
.btn:disabled {
  cursor: progress;
  opacity: 0.7;
}

.btn-ghost {
  background: transparent;
  color: var(--white);
  border-color: rgba(255,255,255,0.7);
}
/* Ghost fill: two circles grow from the top-left and bottom-right corners
   and meet in the middle, filling the button red (matches the other buttons'
   hover colour). overflow: hidden (and the parallelogram clip-path) crop them. */
.btn-ghost, .btn-primary, .btn-solid {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.15s var(--ease-sharp); /* colour snaps back instantly on hover-away */
}
.btn-ghost::before, .btn-ghost::after,
.btn-primary::before, .btn-primary::after,
.btn-solid::before, .btn-solid::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 24px; /* radius stays under the 1em offset, so no dot shows at rest */
  height: auto;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--red);
  transform: translate(-50%, -50%);
  transition: none; /* hover-away: instant, no animation */
}
.btn-ghost::before, .btn-primary::before, .btn-solid::before { top: -1em; left: -1em; }
.btn-ghost::after, .btn-primary::after, .btn-solid::after { top: calc(100% + 1em); left: calc(100% + 1em); }
/* Red on blue is low contrast, so the sweep is hard to see on blue buttons: a
   thin white rim on the leading edge of the circles makes it obvious. Ghost
   buttons get it too. */
.btn-solid::before, .btn-solid::after,
.btn-ghost::before, .btn-ghost::after {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9);
}
.btn-ghost:hover::before, .btn-ghost:hover::after,
.btn-ghost:focus-visible::before, .btn-ghost:focus-visible::after,
.btn-primary:hover::before, .btn-primary:hover::after,
.btn-primary:focus-visible::before, .btn-primary:focus-visible::after,
.btn-solid:hover::before, .btn-solid:hover::after,
.btn-solid:focus-visible::before, .btn-solid:focus-visible::after {
  /* Sized relative to the button, so every button takes about the same time
     to fill (shorter buttons sweep slower). 260% puts the radius past the
     button's diagonal, so no rim is left inside; height follows via aspect-ratio. */
  width: 260%;
  transition: width 1s ease; /* hover-in: the slow sweep */
}
/* Blue buttons: a steady linear sweep (the default ease front-loads the motion,
   so most of it is over before the eye registers it on blue) */
.btn-solid:hover::before, .btn-solid:hover::after,
.btn-solid:focus-visible::before, .btn-solid:focus-visible::after {
  transition: width 0.8s linear;
}
.btn-ghost:hover, .btn-ghost:focus-visible {
  border-color: var(--white);
  color: var(--white);
  transition: transform 0.15s var(--ease-sharp), color 0.4s var(--ease-sharp);
}
/* No scale on ghost buttons: the circle fill is the hover effect */
.btn.btn-ghost:hover { transform: none; }

.btn-outline-dark { background: transparent; color: var(--ink); border-color: rgba(11,18,32,0.3); }
.btn-outline-dark:hover, .btn-outline-dark:focus-visible { border-color: var(--ink); background: rgba(11,18,32,0.06); }

/* Hover lift only where a real hover exists (touch taps would leave it
   stuck on); every button also gets press feedback on :active. */
@media (hover: hover) and (pointer: fine) {
  .btn:hover { transform: scale(1.06); }
}
/* Press: quick and sharp . On
   real-hover devices press from the enlarged hover state down to 0.97. */
.btn:active {
  transform: scale(0.97);
  transition-duration: 0.1s;
  transition-timing-function: var(--ease-sharp);
}
@media (hover: hover) and (pointer: fine) {
  .btn:hover:active { transform: scale(0.97); }
}
.btn:disabled:active { transform: none; }

/* ================= PAGE HEADER (banner used by every non-home page) =================
   Base look is a plain ink-colored banner; league.css layers an optional
   photo + tint on top of it for that page's specific header. */
.page-header {
  position: relative;
  background: var(--ink);
  overflow: hidden;
  padding: 3.5rem 0 3.25rem;
}
.page-header-inner { position: relative; z-index: 1; }
.breadcrumb {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.65);
  margin: 0 0 1.5rem 0;
}
.breadcrumb a { color: rgba(255, 255, 255, 0.9); transition: color 0.15s var(--ease-sharp); }
.breadcrumb a:hover, .breadcrumb a:focus-visible { color: var(--white); text-decoration: underline; }
.page-title {
  font-family: var(--font-display);
  font-weight: 900;
  text-transform: uppercase;
  color: var(--white);
  font-size: clamp(2.4rem, 5.5vw, 4rem);
  line-height: 0.95;
  margin: 0 0 1.1rem 0;
}
.page-header-body {
  font-size: 1.05rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.85);
  max-width: 560px;
  margin: 0 0 2rem 0;
}

/* ================= SHARED SECTION STYLES ================= */
main > section[id] { scroll-margin-top: var(--header-h); }

.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--royal-blue);
  margin: 0 0 0.85rem 0;
}
.section-eyebrow .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  flex-shrink: 0;
}
.section-eyebrow--light { color: var(--white); }

.section-heading {
  font-family: var(--font-display);
  font-weight: 900;
  text-transform: uppercase;
  font-size: clamp(1.9rem, 3.6vw, 3rem);
  line-height: 0.98;
  margin: 0 0 1.25rem 0;
  color: var(--ink);
}
.section-heading--light { color: var(--white); }

.section-body {
  font-size: 1.05rem;
  line-height: 1.65;
  color: rgba(11, 18, 32, 0.75);
  max-width: 540px;
  margin: 0 0 1.1rem 0;
}
.section-body--light { color: rgba(255, 255, 255, 0.82); }

/* ================= FOOTER ================= */
.site-footer {
  background: var(--ink);
  border-top: 3px solid var(--royal-blue);
}
.footer-inner {
  padding: 1.5rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
}
.footer-copyright {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(255,255,255,0.65);
  text-align: center;
  margin: 0;
}
.footer-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.25rem;
}
.footer-links a,
.footer-cookie-link {
  background: none;
  border: none;
  padding: 0;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(255,255,255,0.65);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  cursor: pointer;
  transition: color 0.15s ease, text-decoration-thickness 0.15s ease;
}
.footer-links a:hover, .footer-links a:focus-visible,
.footer-cookie-link:hover, .footer-cookie-link:focus-visible {
  color: var(--white);
  text-decoration-thickness: 2px;
}

/* External-link indicator: any new-tab link except buttons (which carry their own icon) */
a[target="_blank"]:not(.btn)::after {
  content: "";
  display: inline-block;
  width: 0.8em;
  height: 0.8em;
  margin-left: 0.3em;
  vertical-align: -0.05em;
  background-color: currentColor;
  -webkit-mask: var(--icon-external) center / contain no-repeat;
  mask: var(--icon-external) center / contain no-repeat;
}
:root {
  --icon-external: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6H6a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3'/%3E%3Cpath d='M14 4h6v6'/%3E%3Cline x1='10' y1='14' x2='20' y2='4'/%3E%3C/svg%3E");
}

/* ================= COOKIE CONSENT BANNER ================= */
.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 200;
  background: var(--ink);
  border-top: 3px solid var(--royal-blue);
}
.cookie-banner-inner {
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
}
.cookie-banner-text {
  margin: 0;
  flex: 1 1 420px;
  font-size: 0.9rem;
  line-height: 1.55;
  color: rgba(255,255,255,0.82);
}
.cookie-banner-actions {
  display: flex;
  gap: 0.75rem;
  flex-shrink: 0;
}
.cookie-banner-actions .btn {
  padding: 0.7rem 1.4rem;
  font-size: 0.82rem;
}

@media (max-width: 520px) {
  .cookie-banner-actions { width: 100%; }
  .cookie-banner-actions .btn { flex: 1 1 0; }
}

/* ---------- Responsive: shared nav/header rules ----------
   860px, matching the site's other content breakpoints. Measured
   2026-11-16: the full desktop nav (logo 264px + gap 32px + 5 links 471px +
   24px side padding each side) needs about 815px on one line, so 860px
   leaves a margin of roughly 45px. Keep js/main.js's resize check (the
   `window.innerWidth >` number in the hamburger menu code) in sync. If a
   nav link or label is ever added, re-measure. */
@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 3px solid var(--ink);
    /* Closed state is clipped, transparent and visibility:hidden (so the
       hidden links also leave the tab order); open reverses all three. */
    clip-path: inset(0 0 100% 0);
    opacity: 0;
    visibility: hidden;
    transition: clip-path 0.2s var(--ease-sharp), opacity 0.2s var(--ease-sharp), visibility 0.2s;
  }
  .site-nav.is-open {
    clip-path: inset(0);
    opacity: 1;
    visibility: visible;
  }
  .site-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem 1.5rem 1.5rem;
  }
  .site-nav a { display: block; padding: 0.9rem 0.1rem; font-size: 1.05rem; }
  .site-nav a::after { bottom: 0.5rem; }
}

@media (max-width: 520px) {
  /* Minimal header height on phones to leave room for page content; the
     44px tap-target toggle sets the floor. Logo + two-line wordmark
     (PERIVALE / TABLE TENNIS CLUB) are sized to fit in it and to avoid
     overflow down to ~320px-wide phones. */
  :root { --header-h: 48px; }
  .header-inner { gap: 0.75rem; }
  .logo-link { gap: 0.5rem; }
  .logo-mark { height: 34px; }
  .logo-text .primary { font-size: 1.05rem; }
  .logo-text .secondary {
    font-size: 0.6875rem;
    letter-spacing: 0.04em;
    margin-top: 0.15rem;
  }
}

/* ---------- Reduced motion (generic) ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
  /* Colour/fill changes stay; movement goes */
  .btn, .btn:hover, .btn:active, .btn:hover:active,
  .btn-primary, .btn-solid, .btn-primary:focus-visible, .btn-solid:focus-visible,
  .btn.btn-primary:hover, .btn.btn-solid:hover, .btn.btn-primary:active, .btn.btn-solid:active,
  .btn:hover svg, .btn:focus-visible svg { transform: none !important; }
}

/* Inline SVG symbol sheet at the top of <body>: takes no space. (A class,
   not a style attribute, because the Content-Security-Policy in .htaccess
   disallows inline styles.) */
.icon-defs { position: absolute; }
