/* ==========================================================================
   theme.css — light theme, cursor fixes, and motion tuning.

   Loaded LAST, after the base design system. Everything here either overrides a
   token or fixes a bug in the base sheets, so the design prototype can keep
   evolving without fighting these edits on merge.
   ========================================================================== */


/* --------------------------------------------------------------------------
   FIX: the football cursor was invisible in Arabic.

   .cursor-layer / .cursor-ring anchored themselves with `inset-inline-start:0`,
   which in an RTL document resolves to the RIGHT edge. cursor.js then positions
   them with translate3d() in physical viewport coordinates, so every positive x
   pushed the ball further off the right of the screen — while `cursor:none` had
   already hidden the real pointer. Correct in English, invisible in Arabic.

   These layers are positioned in physical pixels by JS, so they must use
   physical properties. This is not a logical-property case.
   -------------------------------------------------------------------------- */
.cursor-layer,
.cursor-ring {
  inset-inline-start: auto;
  inset-block-start: auto;
  left: 0;
  top: 0;
}

/* The ball, rebuilt at 34px. Below ~30px the panel pattern is too small to read
   as a football and its rotation is invisible, which defeats the whole idea. */
.cursor-ball {
  inline-size: 34px;
  block-size: 34px;
  margin: -17px 0 0 -17px;
  filter: drop-shadow(0 3px 7px rgba(0, 0, 0, .5));
}

/* The ring used to be opacity:0 until you hovered a link, so most of the time it
   simply was not there. It is now always present, merely quieter when idle. */
.cursor-ring {
  inline-size: 54px;
  block-size: 54px;
  margin: -27px 0 0 -27px;
  border-color: rgba(255, 190, 61, .38);
  opacity: 1;
  transition: opacity .18s linear, border-color .18s linear;
}
html.has-ball-cursor.is-over-target .cursor-ring {
  opacity: 1;
  border-color: rgba(255, 190, 61, .95);
  box-shadow: 0 0 14px rgba(255, 190, 61, .35);
}


/* --------------------------------------------------------------------------
   MOTION: scroll reveals were firing too fast and too early.

   Base was 620ms over 18px, triggered at 8% visibility with a -12% margin —
   so a section had finished animating before you had really scrolled to it,
   which reads as a flicker rather than as motion. Longer, further, and later.
   (The trigger point itself lives in site.js; this is duration and distance.)
   -------------------------------------------------------------------------- */
:root {
  --d-enter: 950ms;
}
.js-reveal [data-reveal] {
  transform: translateY(30px);
}
/* Children of a revealed group cascade instead of snapping in together. */
.js-reveal [data-reveal] > * {
  transition-delay: var(--reveal-delay, 0ms);
}
@media (prefers-reduced-motion: reduce) {
  :root { --d-enter: 1ms; }
  .js-reveal [data-reveal] { transform: none; }
}


/* ==========================================================================
   LIGHT THEME

   The identity is a floodlit night pitch, so dark stays the default — but it is
   no longer forced. Resolution order:
     1. nothing stored        -> follow the operating system
     2. [data-theme="light"]  -> light, whatever the OS says
     3. [data-theme="dark"]   -> dark, whatever the OS says

   Design notes, because the first attempt was wrong:
     - The ground is a cool near-white with a green cast, NOT cream. Beige went
       muddy against the turf greens and made the whole page look dusty.
     - Cards are pure white on that ground, so elevation reads without shadows.
     - The primary CTA becomes DEEP TURF GREEN, not sodium amber. Amber earns its
       place glowing against a night pitch; on a pale ground it has almost no
       contrast and looks washed out. Amber survives here only as a small accent.

   The two blocks below are intentionally identical twins — one for the OS
   preference, one for the explicit choice. Edit both or neither.
   ========================================================================== */

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --night-0: #0c1a1580;
    --night-1: #eef2ec;   /* page: cool near-white with a green cast */
    --night-2: #ffffff;   /* header / raised surface */
    --night-3: #ffffff;   /* card */
    --night-4: #e3ebe1;   /* card hover / input */
    --hairline: #ccd8c9;

    --chalk:      #0b1a14;  /* 16.4:1 on --night-1 */
    --chalk-soft: #23332c;  /* 11.2:1 */
    --chalk-dim:  #3d4f46;  /*  7.4:1 — floor for body text */
    --chalk-mute: #5a6b62;  /*  4.8:1 — labels only, never body */
    --chalk-line: #0b1a14;

    --turf:        #0a5c33;
    --turf-bright: #0f7a44;
    --turf-deep:   #063f22;
    --turf-mow:    #dce8d9;

    --flood:      #7a5c0d;  /* readable as TEXT, unlike the lamp-bloom cream */
    --flood-soft: #614a0a;
    --sodium:     #c98205;  /* accent only in light mode — see note above */
    --sodium-hot: #a96c02;

    --olive:      #55692f;
    --olive-deep: #3a4a22;
    --clay:       #9c4a22;
    --limestone:  #6b6255;

    --ok:   #0a6b38;
    --warn: #7a5c0d;
    --busy: #a83323;
    --info: #1a5f7f;

    --card-bg: #ffffff;
    --card-border: #d5e0d2;
    --glass: rgba(255, 255, 255, .86);
  }
}

:root[data-theme="light"] {
  --night-0: #0c1a1580;
  --night-1: #eef2ec;
  --night-2: #ffffff;
  --night-3: #ffffff;
  --night-4: #e3ebe1;
  --hairline: #ccd8c9;

  --chalk:      #0b1a14;
  --chalk-soft: #23332c;
  --chalk-dim:  #3d4f46;
  --chalk-mute: #5a6b62;
  --chalk-line: #0b1a14;

  --turf:        #0a5c33;
  --turf-bright: #0f7a44;
  --turf-deep:   #063f22;
  --turf-mow:    #dce8d9;

  --flood:      #7a5c0d;
  --flood-soft: #614a0a;
  --sodium:     #c98205;
  --sodium-hot: #a96c02;

  --olive:      #55692f;
  --olive-deep: #3a4a22;
  --clay:       #9c4a22;
  --limestone:  #6b6255;

  --ok:   #0a6b38;
  --warn: #7a5c0d;
  --busy: #a83323;
  --info: #1a5f7f;

  --card-bg: #ffffff;
  --card-border: #d5e0d2;
  --glass: rgba(255, 255, 255, .86);
}


/* --- Light-mode component corrections ------------------------------------
   Tokens alone are not enough: a few components are built around the
   assumption of a glowing mark on a dark ground.
   ------------------------------------------------------------------------- */

/* Primary CTA: deep green with white text. See the note above on why not amber. */
:root[data-theme="light"] .btn--primary {
  --btn-bg: var(--turf);
  --btn-fg: #ffffff;
  --btn-bd: var(--turf);
  box-shadow: 0 10px 28px -14px rgba(10, 92, 51, .7);
}
:root[data-theme="light"] .btn--primary:hover {
  --btn-bg: var(--turf-bright);
  --btn-bd: var(--turf-bright);
  --btn-fg: #ffffff;
  box-shadow: 0 14px 34px -12px rgba(10, 92, 51, .8);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .btn--primary {
    --btn-bg: var(--turf);
    --btn-fg: #ffffff;
    --btn-bd: var(--turf);
    box-shadow: 0 10px 28px -14px rgba(10, 92, 51, .7);
  }
  :root:not([data-theme="dark"]) .btn--primary:hover {
    --btn-bg: var(--turf-bright);
    --btn-bd: var(--turf-bright);
    --btn-fg: #ffffff;
    box-shadow: 0 14px 34px -12px rgba(10, 92, 51, .8);
  }
}

/* Cards get a real border on a light ground — without the dark theme's glow
   there is nothing else separating a white card from a near-white page. */
:root[data-theme="light"] .card--boxed,
:root[data-theme="light"] .team-card,
:root[data-theme="light"] .pipeline__step,
:root[data-theme="light"] .fixture {
  border: 1px solid var(--card-border);
  box-shadow: 0 1px 2px rgba(11, 26, 20, .04), 0 8px 24px -18px rgba(11, 26, 20, .3);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .card--boxed,
  :root:not([data-theme="dark"]) .team-card,
  :root:not([data-theme="dark"]) .pipeline__step,
  :root:not([data-theme="dark"]) .fixture {
    border: 1px solid var(--card-border);
    box-shadow: 0 1px 2px rgba(11, 26, 20, .04), 0 8px 24px -18px rgba(11, 26, 20, .3);
  }
}

/* The header sits over the hero photograph, so it needs a solid light scrim. */
:root[data-theme="light"] .site-header { background: var(--glass); border-block-end: 1px solid var(--hairline); }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .site-header { background: var(--glass); border-block-end: 1px solid var(--hairline); }
}

/* The footer is a dark slab in the dark theme; keep it dark in light mode too —
   it anchors the page, and the night photo above it makes that read as intentional. */
:root[data-theme="light"] .site-footer,
:root[data-theme="light"] .site-footer .footer__head,
:root[data-theme="light"] .site-footer a {
  color: #d2ded6;
}
:root[data-theme="light"] .site-footer { background: #0b1614; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .site-footer { background: #0b1614; }
  :root:not([data-theme="dark"]) .site-footer,
  :root:not([data-theme="dark"]) .site-footer .footer__head,
  :root:not([data-theme="dark"]) .site-footer a { color: #d2ded6; }
}

/* THE HERO IS EXEMPT in both themes: it lies on a night photograph, so its type
   stays light. Dark type on that image fails contrast outright. */
:root[data-theme="light"] .hero,
:root[data-theme="light"] .site-footer {
  --chalk:      #f2f6f1;
  --chalk-soft: #d2ded6;
  --chalk-dim:  #bdcbc3;
  --chalk-mute: #a5b4ab;
  --flood:      #ffeeba;
  --hairline:   #21403a;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .hero,
  :root:not([data-theme="dark"]) .site-footer {
    --chalk:      #f2f6f1;
    --chalk-soft: #d2ded6;
    --chalk-dim:  #bdcbc3;
    --chalk-mute: #a5b4ab;
    --flood:      #ffeeba;
    --hairline:   #21403a;
  }
}

/* The hero CTA keeps the amber it was designed for — on the night photo it works. */
:root[data-theme="light"] .hero .btn--primary,
:root:not([data-theme="dark"]) .hero .btn--primary {
  --btn-bg: var(--sodium, #ffbe3d);
  --btn-fg: #1a1103;
  --btn-bd: var(--sodium, #ffbe3d);
}

/* The sodium ring on a pale ground needs more weight than on a night pitch. */
:root[data-theme="light"] .cursor-ring { border-color: rgba(160, 105, 4, .55); }
:root[data-theme="light"] .cursor-ball { filter: drop-shadow(0 3px 7px rgba(0, 0, 0, .28)); }


/* --------------------------------------------------------------------------
   FIX: the booking steps showed TWO numbers each.

   .pipeline is an <ol> and .pipeline__step::before draws a hollow numeral from a
   CSS counter — but list-style is never reset, so the browser ALSO rendered its
   own marker. Every step came out as ".1  1", ".2  2", ".3  3".

   Fixing it here rather than in pages.css: that file is synced from the design
   prototype, which has the same bug, so an edit there would be overwritten on
   the next sync.
   -------------------------------------------------------------------------- */
.pipeline {
  list-style: none;
  margin: 0;
  padding: 0;
}
/* The hollow numeral is positioned at the inline-end of the step, which is where
   the heading starts in RTL. Keep the text clear of it. */
.pipeline__step { padding-inline-end: var(--s-8, 3.5rem); }


/* --------------------------------------------------------------------------
   Hero photo carousel

   These sit directly on .hero, NOT inside .hero__ground-inner. That inner element
   is rotated 68deg on the X axis to fake a receding pitch plane and is only 78%
   tall, so a photo placed inside it covered just the lower part of the hero and
   left a dead band under the header. As its own full-bleed layer it fills it.
   -------------------------------------------------------------------------- */
.hero__shots {
  position: absolute;
  inset: 0;
  z-index: -4;              /* under --bloom (-3) and --ground (-2) */
  overflow: hidden;
  pointer-events: none;
}
.hero__shot {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
  object-position: 50% 45%;
  opacity: 0;
  /* Dimmed and slightly desaturated so --chalk type holds its contrast ratio
     over ANY frame in the rotation, not just the first one. */
  filter: brightness(.5) saturate(.9);
  transform: scale(1.06);
  transition: opacity 1.4s var(--e-both, ease), transform 9s linear;
  will-change: opacity;
}
.hero__shot.is-active {
  opacity: 1;
  transform: scale(1);      /* a very slow drift while it is the visible frame */
}
@media (prefers-reduced-motion: reduce) {
  .hero__shot { transition: none; transform: none; }
  .hero__shot.is-active { transform: none; }
}

/* The hero's own top padding was tuned for a shorter photo plane; with a
   full-bleed carousel behind it the content can sit higher and closer to the
   header, which is what closes the gap under the nav. */
.hero { padding-block: clamp(6rem, 4.5rem + 5vw, 8.5rem) clamp(3rem, 2rem + 4vw, 5rem); }

/* The perspective plane painted its own turf gradient and mower stripes, which
   made sense when it WAS the ground. Now that a real photograph is the ground,
   that gradient sits on top of the photo and washes it flat green. Drop the
   fill and keep the element purely as the carrier for the chalk lines, which
   are the part worth having — real pitch geometry laid over a real pitch. */
.hero__ground-inner { background: none; }

/* With no gradient beneath them the lines need to carry themselves, so they get
   a touch more presence and a shadow to stay legible over a bright frame. */
.hero__lines [stroke] { stroke: rgba(255, 255, 255, .42); }
.hero__lines { filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .55)); }

/* A floor of darkness at the bottom edge so the section below never butts
   straight into a bright photo. */
.hero::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  inset-block-end: 0;
  block-size: 38%;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(to bottom, transparent, var(--night-1));
}


/* --------------------------------------------------------------------------
   Arabic vertical rhythm

   Arabic descenders (ج ح خ ع غ م ي) drop well below the Latin baseline, so
   line-height values that look fine in English let glyphs collide with the
   element underneath. These are Arabic-specific and scoped to :lang(ar) so the
   English build keeps its tighter, intended rhythm.
   -------------------------------------------------------------------------- */
:lang(ar) h1,
:lang(ar) h2,
:lang(ar) h3,
:lang(ar) .hero h1,
:lang(ar) .card__title,
:lang(ar) .tcard__name {
  line-height: 1.42;
  padding-block-end: .12em;
}
:lang(ar) .lede,
:lang(ar) .card__body,
:lang(ar) p {
  line-height: 1.85;
}
:lang(ar) .eyebrow,
:lang(ar) .footer__head,
:lang(ar) .label {
  line-height: 1.6;
  padding-block-end: .08em;
}
/* Chips and buttons are fixed-height boxes; Arabic needs the extra room inside
   them or the descender clips against the lower border. */
:lang(ar) .chip,
:lang(ar) .btn,
:lang(ar) .nav__link {
  line-height: 1.7;
}


/* --------------------------------------------------------------------------
   Cursor glow — a soft turf-green light that trails the pointer.

   Its own layer rather than a shadow on the ball, so it can lag further behind
   and blur far wider without dragging the ball's own motion with it. Built and
   positioned by cursor.js, which already enforces the pointer/hover/
   reduced-motion rules, so this inherits all three for free.
   -------------------------------------------------------------------------- */
.cursor-glow {
  position: fixed;
  left: 0;
  top: 0;
  inline-size: 560px;
  block-size: 560px;
  margin: -280px 0 0 -280px;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(
    circle closest-side,
    rgba(23, 164, 79, .20) 0%,
    rgba(14, 92, 51, .12) 42%,
    rgba(14, 92, 51, 0) 72%
  );
  transition: opacity .45s linear;
  will-change: transform;
}
html.has-ball-cursor .cursor-glow { opacity: 1; }
/* Brighter when the pointer is over something interactive. */
html.has-ball-cursor.is-over-target .cursor-glow {
  background: radial-gradient(
    circle closest-side,
    rgba(23, 164, 79, .30) 0%,
    rgba(255, 190, 61, .10) 40%,
    rgba(14, 92, 51, 0) 72%
  );
}
/* On a pale ground the same wash reads as muddy; keep it tighter and cooler. */
:root[data-theme="light"] .cursor-glow {
  background: radial-gradient(
    circle closest-side,
    rgba(10, 92, 51, .13) 0%,
    rgba(10, 92, 51, .06) 45%,
    rgba(10, 92, 51, 0) 72%
  );
}


/* --------------------------------------------------------------------------
   Map frame — the satellite embed needs an explicit box or the iframe collapses.
   -------------------------------------------------------------------------- */
.map-frame {
  position: relative;
  inline-size: 100%;
  /* NOT aspect-ratio + min-block-size together. That pair resolved the wrong way:
     with a 20rem floor on height, 16/9 forced the WIDTH to ~569px, which is wider
     than a 360px phone -- measured as a 240px document overflow on every page
     carrying a map. An explicit height cannot push the width around. */
  block-size: clamp(16rem, 52vw, 30rem);
  overflow: hidden;
  border: 1px solid var(--card-border, var(--hairline));
  border-radius: var(--r-2, 14px);
}
.map-frame #kstad-map {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  background: var(--night-2);
}
/* Satellite tiles are bright; unmodified they are a glaring rectangle in the
   middle of a night-themed page. Only the TILES are dimmed — dimming the whole
   map would take the marker, popup and attribution down with them. */
:root:not([data-theme="light"]) .map-frame .leaflet-tile-pane {
  filter: saturate(.85) brightness(.82) contrast(1.06);
}
/* Leaflet ships light chrome; make its controls and attribution belong here. */
.map-frame .leaflet-control-attribution {
  background: rgba(11, 22, 20, .78);
  color: var(--chalk-mute);
  font-size: .68rem;
}
.map-frame .leaflet-control-attribution a { color: var(--chalk-dim); }
.map-frame .leaflet-bar a {
  background: var(--night-2);
  color: var(--chalk-soft);
  border-color: var(--hairline);
}
.map-frame .leaflet-bar a:hover { background: var(--night-4); color: var(--sodium); }
/* Leaflet is LTR-only internally; pin it so its controls don't mirror oddly. */
.map-frame .leaflet-container { direction: ltr; }
.map-note {
  margin-block-start: var(--s-3, .75rem);
  font-size: var(--t-xs, .8125rem);
  color: var(--chalk-mute);
}
.map-note a { color: var(--chalk-dim); }
.map-note a:hover { color: var(--sodium); }


/* --------------------------------------------------------------------------
   Team cards

   The base sheet's .team-card carries no border, background or box of its own,
   and .squad is the PLAYER grid (9.5rem cells) — wrong container for five team
   tiles. This is a purpose-built card instead of a patch on those two.
   -------------------------------------------------------------------------- */
.team-grid {
  display: grid;
  gap: var(--s-4, 1rem);
  grid-template-columns: repeat(auto-fit, minmax(13.5rem, 1fr));
}

.tcard {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: var(--s-2, .5rem);
  min-block-size: 13rem;
  padding: var(--s-5, 1.5rem);
  border: 1px solid var(--card-border, var(--hairline));
  border-radius: var(--r-2, 14px);
  background: var(--card-bg, var(--night-3));
  color: inherit;
  text-decoration: none;
  transition: transform .34s var(--e-out, ease), border-color .34s linear, box-shadow .34s linear;
}
.tcard:hover {
  transform: translateY(-4px);
  border-color: var(--turf-bright);
  box-shadow: 0 18px 44px -24px rgba(0, 0, 0, .8);
}
.tcard:focus-visible {
  outline: 2px solid var(--sodium);
  outline-offset: 3px;
}

/* Turf edge along the inline-start side — full height, so it reads as a
   deliberate spine rather than the stray green tick a partial one looked like.
   It brightens and thickens on hover instead of growing from nothing. */
.tcard__edge {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  inline-size: 3px;
  background: linear-gradient(to bottom, var(--turf-bright), var(--turf));
  opacity: .45;
  transition: opacity .34s linear, inline-size .34s var(--e-out, ease);
}
.tcard:hover .tcard__edge { opacity: 1; inline-size: 5px; }

/* Squad size as a hollow watermark numeral, vertically centred and sized so it
   FITS — the first version was clipped by the card's top edge and read as a
   rendering fault. Decorative only: the same figure is real text in .tcard__meta. */
.tcard__ghost {
  position: absolute;
  inset-block-start: 50%;
  inset-inline-end: -.04em;
  translate: 0 -50%;
  z-index: -1;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 4.75rem;
  line-height: .9;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--hairline);
  opacity: .5;
  direction: ltr;
  pointer-events: none;
  transition: opacity .34s linear, -webkit-text-stroke-color .34s linear;
}
.tcard:hover .tcard__ghost { opacity: .85; -webkit-text-stroke-color: var(--turf-bright); }

.tcard__kit {
  inline-size: 1.9rem;
  block-size: 1.9rem;
  color: var(--chalk-mute);
  transition: color .34s linear, transform .34s var(--e-out, ease);
}
.tcard:hover .tcard__kit { color: var(--sodium); transform: translateY(-2px); }

/* Pushes the name+meta block to the bottom, leaving the kit icon at the top and
   the watermark numeral breathing in between. */
.tcard__name {
  margin: auto 0 0;
  font-family: var(--font-display);
  font-size: var(--t-lg, 1.2rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--chalk);
}
.tcard__meta {
  display: flex;
  align-items: center;
  gap: var(--s-2, .5rem);
  flex-wrap: wrap;
  margin: 0;
  font-size: var(--t-xs, .8125rem);
  color: var(--chalk-dim);
}
.tcard__age {
  font-weight: 700;
  color: var(--sodium);
  direction: ltr;
}
.tcard__dot { color: var(--chalk-mute); }

@media (prefers-reduced-motion: reduce) {
  .tcard, .tcard__edge, .tcard__ghost, .tcard__kit { transition: none; }
  .tcard:hover { transform: none; }
}


/* --------------------------------------------------------------------------
   News grid — .gallery-grid is a masonry-ish gallery container and gave the
   three news cards uneven columns with cramped headlines. Three equal columns.
   -------------------------------------------------------------------------- */
.news-grid {
  display: grid;
  gap: var(--s-5, 1.5rem);
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  align-items: start;
}
.news-grid .card__title { line-height: 1.3; }


/* --------------------------------------------------------------------------
   Developer credit — quiet by default, legible on hover. Matches kobar's.
   -------------------------------------------------------------------------- */
.kstad-footer__credit {
  margin: var(--s-4, 1rem) 0 0;
  padding-block-start: var(--s-4, 1rem);
  border-block-start: 1px solid var(--hairline);
  text-align: center;
  font-size: .8125rem;
}
.kstad-footer__credit a {
  color: var(--chalk-mute);
  text-decoration: none;
  transition: color .18s linear;
}
.kstad-footer__credit a:hover { color: var(--sodium); }
.kstad-footer__credit a:focus-visible {
  outline: 2px solid var(--sodium);
  outline-offset: 3px;
  border-radius: 2px;
}
@media (prefers-reduced-motion: reduce) { .kstad-footer__credit a { transition: none; } }


/* --------------------------------------------------------------------------
   Theme toggle control
   -------------------------------------------------------------------------- */
.theme-toggle {
  display: inline-grid;
  place-items: center;
  inline-size: 2.25rem;
  block-size: 2.25rem;
  padding: 0;
  border: 1px solid var(--hairline);
  border-radius: 50%;
  background: transparent;
  color: var(--chalk-soft);
  cursor: pointer;
  transition: color .18s linear, border-color .18s linear;
}
.theme-toggle:hover { color: var(--sodium); border-color: var(--sodium); }
.theme-toggle:focus-visible { outline: 2px solid var(--sodium); outline-offset: 2px; }
.theme-toggle svg { inline-size: 1.05rem; block-size: 1.05rem; }

/* Show the icon for the theme you would switch TO, not the one you are in. */
.theme-toggle .icon-sun  { display: none; }
.theme-toggle .icon-moon { display: block; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .theme-toggle .icon-sun  { display: block; }
  :root:not([data-theme="dark"]) .theme-toggle .icon-moon { display: none; }
}
:root[data-theme="light"] .theme-toggle .icon-sun  { display: block; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"]  .theme-toggle .icon-sun  { display: none; }
:root[data-theme="dark"]  .theme-toggle .icon-moon { display: block; }

@media (prefers-reduced-motion: reduce) { .theme-toggle { transition: none; } }


/* --------------------------------------------------------------------------
   FIX: the page overflowed its own viewport on phones.

   .site-header__bar is a non-wrapping flex row and its children have the
   default `min-inline-size: auto`, so they refuse to shrink below their own
   content. At 390px the brand (mark + two lines of text), the "English"
   switch, the theme toggle, the booking CTA and the menu button together
   exceed the viewport, and the bar drags the whole document wider than the
   screen.

   `overflow-x: clip` in base.css then hid the result instead of revealing it:
   RTL content is anchored to the RIGHT, so the overflow was cut off the
   inline-START edge — headings lost their first glyph ("فرق نادي كوبر" read as
   "نادي كوبر") and cards ran off the side. It also explains why this measured
   as zero overflow: `overflow-x: clip` pins scrollX at 0, so the usual test
   reports clean while the content is being cut.
   -------------------------------------------------------------------------- */
.site-header__bar > * { min-inline-size: 0; }
.brand { min-inline-size: 0; }
.brand__text { min-inline-size: 0; overflow: hidden; }
.brand__ar,
.brand__en {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* NOT flex:none -- that was the first attempt and it made things worse by
   forbidding the one element that needed to shrink from shrinking. */
.header__actions { flex: 0 1 auto; min-inline-size: 0; }

/* Below 30rem the secondary line and the full CTA label are what tip it over.
   The booking action STAYS — it is the point of the site — it just gets a
   tighter box, and the drawer carries a full-width copy of it as well. */
@media (max-width: 30rem) {
  .site-header__bar { gap: var(--s-2, .5rem); }
  .brand__en { display: none; }
  .header__actions .btn--sm {
    padding-inline: var(--s-3, .75rem);
    font-size: var(--t-xs, .8125rem);
  }
  .lang-switch { padding-inline: var(--s-2, .5rem); font-size: var(--t-xs, .8125rem); }
}

/* Measured at 390px: the actions block was 275px wide and hung 55px off the
   inline-start edge. Dropping the language switch here (not at 23.5rem) is what
   actually closes the gap -- it is the widest item that has a home elsewhere,
   and the drawer now carries a full-width copy of it. */
@media (max-width: 48rem) {
  .lang-switch { display: none; }
}

/* --------------------------------------------------------------------------
   Section rhythm

   --section-y was clamp(3.5rem, 2rem + 7vw, 8rem) and it is applied to BOTH
   edges, so at desktop widths two adjacent sections put 128px + 128px = 256px
   of empty space between them. The page read as a series of islands with the
   content pushed apart rather than composed.
   -------------------------------------------------------------------------- */
:root {
  --section-y: clamp(2.25rem, 1.25rem + 3.5vw, 4.5rem);
}

/* Consecutive sections would otherwise stack two full paddings against each
   other; collapsing the inner edge keeps one gap instead of two. */
.section + .section { padding-block-start: 0; }


/* --------------------------------------------------------------------------
   News cards: equal height

   .news-grid had align-items:start, so each card sized to its own text and a
   row of three came out ragged. Stretching the tracks is only half of it — the
   card itself has to be a column whose body can grow, or the card stretches
   while its contents stay bunched at the top.
   -------------------------------------------------------------------------- */
.news-grid { align-items: stretch; }
.news-grid > .card {
  display: flex;
  flex-direction: column;
  block-size: 100%;
}
/* The text block takes the slack so every card's image and footer line up. */
.news-grid > .card > div:last-child {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}
.news-grid .card__body { margin-block-start: auto; }

/* Same treatment for the team tiles, which share the row. */
.team-grid { align-items: stretch; }

/* --------------------------------------------------------------------------
   Turn the glare down — both themes.

   DARK: --chalk was #f2f6f1 at 17.6:1 on a near-black page. That is far past
   anything accessibility asks for, and the excess is not free: near-white on
   near-black haloes (halation), and at display sizes the headings glare. Pulled
   to a warm off-white. Still ~14:1 — three times the AA floor of 4.5 — so this
   costs nothing but comfort.

   LIGHT: the page was #eef2ec with PURE WHITE cards on top. White is the
   brightest thing a screen can emit, and a full-width sheet of it beside a
   near-white background is the harshest combination available. The card is now
   a soft off-white and the page a touch deeper, which also makes the elevation
   read better than two near-identical whites did.
   -------------------------------------------------------------------------- */
:root {
  --chalk:      #dde6db;   /* ~14.2:1 on --night-1, was 17.6:1 */
  --chalk-soft: #c3d0c6;   /* ~10.6:1 */
}

/* The hero and footer sit on a night photograph and set their own values; keep
   them in step so headings over the photo are not brighter than the page. */
.hero,
.site-footer {
  --chalk:      #e4ece2;
  --chalk-soft: #c8d5cb;
}


@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --night-1: #e7ede5;   /* page, a touch deeper than before */
    --night-2: #f7faf6;   /* header / raised surface — no longer pure white */
    --night-3: #f9fbf8;   /* card — no longer pure white */
    --night-4: #dde6db;
    --card-bg: #f9fbf8;
    --glass:   rgba(247, 250, 246, .88);
    /* Ink lifted off pure black for the same reason type is lifted off pure
       white: maximum contrast is not the same as maximum comfort. */
    --chalk:      #14251f;
    --chalk-soft: #2a3931;
  }
}
:root[data-theme="light"] {
  --night-1: #e7ede5;
  --night-2: #f7faf6;
  --night-3: #f9fbf8;
  --night-4: #dde6db;
  --card-bg: #f9fbf8;
  --glass:   rgba(247, 250, 246, .88);
  --chalk:      #14251f;
  --chalk-soft: #2a3931;
}
/* The light-mode CTA text stays pure white ON the deep green button — that is a
   small area of white on a dark fill, which is the comfortable direction. */

/* --------------------------------------------------------------------------
   Breathing room under a section heading

   .section-head groups an eyebrow, an h2 and sometimes a lede, but sets no
   space of its own — so the first row of cards sat straight under the title.
   Most visible on "ثلاث خطوات، والدفع نقدًا في الملعب" and "من النادي والملعب",
   where the heading and the content beneath it read as one block.
   -------------------------------------------------------------------------- */
.section-head {
  margin-block-end: var(--s-6, 2rem);
}
/* When a lede follows the h2 the pair already has internal spacing, so the
   gap below can be a little tighter without the two colliding. */
.section-head .lede {
  margin-block-end: 0;
}
