/* ==================================================================
   Leagues & courses (leagues.html). Shares events.css's panels, facts
   and form; this file adds the page's own parts.

   Colour as taxonomy, as on the events page: the two tracks own one hue
   each — the pool league cyan, the snooker course lime — and keep it on
   their label, dot, rail and numbers. Neither is Lincoln's yellow/red
   (brand/CTA, logo/alert) nor any of the five event hues.
   ================================================================== */

.page-leagues {
  --lg-league: #2ad4f0;
  --lg-course: #b8f35c;
}

/* ---- hero over the drift wall --------------------------------------------- */

.lg-hero {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: calc(var(--nav-h) + 48px) var(--pad) clamp(80px, 12vh, 140px);
}
.lg-hero__wall { position: absolute; inset: 0; z-index: -2; }
/* grade: the wall stays alive at the top, the copy sits on near-black at the bottom-start */
.lg-hero::after {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(to top, rgba(8, 9, 10, .96) 6%, rgba(8, 9, 10, .6) 42%, rgba(8, 9, 10, .1) 78%),
    linear-gradient(to left, rgba(8, 9, 10, .75), rgba(8, 9, 10, 0) 62%);
}
.lg-hero__copy { position: relative; max-width: 980px; pointer-events: none; }
.lg-hero__copy a, .lg-hero__copy button { pointer-events: auto; }
.lg-hero .display { max-width: 11ch; text-shadow: 0 10px 60px rgba(0, 0, 0, .7); }
.lg-hero .lede { color: var(--chalk); text-shadow: 0 1px 16px rgba(0, 0, 0, .8); max-width: 46ch; }

/* track pills: ghost, outlined in the track's own hue */
.lg-pill { border-color: color-mix(in srgb, var(--hue) 70%, transparent); color: var(--chalk); gap: 12px; }
.lg-pill:hover { border-color: var(--hue); background: color-mix(in srgb, var(--hue) 12%, transparent); }
.lg-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--hue); box-shadow: 0 0 12px var(--hue); }

/* ---- the two tracks ---------------------------------------------------------- */

.lg-track { scroll-margin-top: calc(var(--nav-h) + 16px); }
.lg-label {
  margin: 0 0 6px;
  font: 700 clamp(22px, 2vw, 28px)/1 var(--body); color: var(--hue);
}
.lg-split {
  display: grid; gap: clamp(28px, 4vw, 64px);
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  align-items: start;
}
.lg-copy { display: grid; gap: 16px; }
.lg-copy p { margin: 0; max-width: 60ch; color: #dde1dc; font-size: clamp(16px, 1.15vw, 18px); line-height: 1.75; }
.lg-callout {
  padding: 16px 20px; border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--hue) 40%, transparent);
  background: color-mix(in srgb, var(--hue) 7%, transparent);
}
.lg-callout strong { color: var(--hue); }

.lg-side { display: grid; gap: 22px; }
.lg-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; }
.lg-facts strong { color: var(--hue); }
.lg-form { grid-template-columns: 1fr 1fr; max-width: none; }
.lg-form__title { grid-column: 1 / -1; margin: 0; font-weight: 500; color: var(--chalk); }

/* ---- the course: six meetings on a felt rail ------------------------------------ */

.lg-course { margin-top: clamp(8px, 2vw, 20px); }
.lg-rail {
  position: relative; height: 34px; margin: 0 4px 18px;
  border-radius: 999px; border: 5px solid #3a2414;
  background: linear-gradient(#0f6e3d, #0a5530 60%, #073d22);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .08), inset 0 -4px 10px rgba(0, 0, 0, .5);
}
.lg-rail__cue {
  position: absolute; top: 50%; right: 4px;
  width: 24px; height: 24px; margin-top: -12px; border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #fff, #ece8de 45%, #b8b2a5);
  box-shadow: 0 4px 8px rgba(0, 0, 0, .55);
  will-change: transform;
}
.lg-rail__cue::after { content: ''; position: absolute; top: 5px; left: 10px; width: 5px; height: 5px; border-radius: 50%; background: var(--red); }

.lg-meets {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px;
}
.lg-meets li {
  display: grid; gap: 4px; justify-items: start; align-content: start;
  padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: rgba(8, 9, 10, .45);
  transition: border-color .4s ease, background-color .4s ease;
}
.lg-meets__ball {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  font: 800 13px/1 var(--body); color: #141414;
  background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, .7), rgba(255, 255, 255, 0) 36%), #cfd4cf;
  transition: background-color .4s ease, box-shadow .4s ease;
}
.lg-meets strong { font-size: 15px; }
.lg-meets span:last-child { font-size: 13px; color: var(--dim); }
/* reached: the meeting takes the course's colour */
.lg-meets li.is-reached { border-color: color-mix(in srgb, var(--hue) 55%, transparent); background: color-mix(in srgb, var(--hue) 8%, rgba(8, 9, 10, .45)); }
.lg-meets li.is-reached .lg-meets__ball { background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, .7), rgba(255, 255, 255, 0) 36%), var(--hue); box-shadow: 0 0 14px color-mix(in srgb, var(--hue) 60%, transparent); }
.lg-meets__final strong { color: var(--hue); }
.lg-course__note { margin: 20px 0 0; max-width: 70ch; color: #dde1dc; line-height: 1.75; }

/* ---- the coach ---------------------------------------------------------------- */

.lg-coach {
  margin-top: clamp(32px, 5vw, 64px); padding-top: clamp(28px, 4vw, 48px);
  border-top: 1px solid var(--line);
}
.lg-coach__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 24px; margin-bottom: 22px; }
.lg-coach__title { margin: 0; font-family: var(--display); font-weight: 700; font-size: clamp(40px, 4.4vw, 68px); line-height: .95; }
.lg-coach__crown { margin: 0; color: var(--hue); font-weight: 700; }
.lg-stats {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px;
}
.lg-stats li { display: grid; gap: 6px; padding: 18px; border-radius: 12px; border: 1px solid var(--line); background: rgba(8, 9, 10, .45); }
.lg-stats strong { font-family: var(--display); font-weight: 700; font-size: clamp(64px, 7vw, 112px); line-height: .85; color: var(--hue); }
.lg-stats span { font-size: 14px; color: var(--dim); line-height: 1.4; }
.lg-honors {
  margin: 20px 0 0; padding-inline-start: 20px;
  display: grid; gap: 6px 36px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  color: #dde1dc;
}
.lg-honors li::marker { color: var(--hue); }

.lg-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; margin-top: clamp(28px, 4vw, 48px); }
.lg-cta p { margin: 0; color: var(--dim); }

/* ---- league photos: a CardSwap stack (js/cardswap.js) --------------------------------
   The stack fans up and to the right from its bottom-left corner, so the wrapper keeps
   room above it; the dealt card drops out through the bottom and is clipped there. */
.lg-copy .lg-facts { margin-top: 6px; }
.lg-swap {
  position: relative; margin: 0;
  height: clamp(400px, 34vw, 460px);
  overflow: hidden;
}
.lg-swap .card-swap-container { left: 2%; bottom: 34px; }
.card-swap-container > .card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lg-chip {
  position: absolute; inset-block-end: 12px; inset-inline-start: 12px;
  padding: 6px 12px; border-radius: 999px;
  background: rgba(8, 9, 10, .72);
  border: 1px solid color-mix(in srgb, var(--hue) 60%, transparent);
  color: var(--hue); font: 700 13px/1 var(--body);
}
.lg-signup { margin-top: clamp(24px, 3vw, 40px); padding-top: clamp(24px, 3vw, 40px); border-top: 1px solid var(--line); }
.lg-signup .lg-form { max-width: 880px; grid-template-columns: 1fr 1fr auto; align-items: end; }
.lg-signup .lg-form .ev-form__row { grid-column: auto; margin: 0; }
.lg-signup .lg-form .ev-form__status { grid-column: 1 / -1; }

/* ---- the course story: pinned, scroll-driven (js/story.js) ----------------------------
   Full-bleed between the two panels — outside them on purpose: the panels animate their
   transform, and a pin can't sit inside a transformed parent. */
.lg-story {
  position: relative; isolation: isolate; overflow: hidden;
  height: 100vh; height: 100svh;
  margin-block: 0 clamp(36px, 6vw, 72px);
  background: var(--ink);
}
.lg-story__canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: -2; }
.lg-story::after {                                   /* grade: the caption corner stays dark */
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(to top, rgba(8, 9, 10, .9), rgba(8, 9, 10, .15) 55%, rgba(8, 9, 10, .35)),
    linear-gradient(to left, rgba(8, 9, 10, .7), rgba(8, 9, 10, 0) 55%);
}
.lg-story__captions { position: absolute; inset: auto var(--pad) clamp(72px, 12vh, 120px); }
.lg-story__cap { position: absolute; inset-inline-start: 0; bottom: 0; opacity: 0; will-change: opacity, transform; }
.lg-story__n { margin: 0 0 12px; font: 700 14px/1 var(--body); letter-spacing: .08em; color: var(--hue); }
.lg-story__line {
  margin: 0; font-family: var(--display); font-weight: 700;
  font-size: clamp(48px, 7vw, 120px); line-height: .92; color: var(--chalk);
  text-shadow: 0 10px 50px rgba(0, 0, 0, .6);
}
.lg-story__bar { position: absolute; inset-inline: var(--pad); bottom: 36px; height: 2px; background: rgba(245, 242, 234, .16); }
.lg-story__bar i { position: absolute; inset: 0; background: var(--hue); transform-origin: right; transform: scaleX(0); }

/* ---- the classes: a CircularGallery of six cohorts (js/circulargallery.js) ------------- */
.lg-classes { margin-top: clamp(32px, 5vw, 64px); padding-top: clamp(28px, 4vw, 48px); border-top: 1px solid var(--line); }
.lg-classes__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 24px; }
.lg-classes__hint { margin: 0; font-size: 13px; letter-spacing: .2em; color: var(--dim); }
.lg-classes__gallery {
  height: clamp(320px, 32vw, 440px);
  margin-inline: calc(-1 * clamp(32px, 5vw, 72px));       /* bleed to the panel's edges */
}

@media (max-width: 900px) {
  .lg-split { grid-template-columns: 1fr; }
  .lg-swap { height: 380px; }
  .lg-signup .lg-form { grid-template-columns: 1fr 1fr; }
  .lg-signup .lg-form .ev-form__row { grid-column: 1 / -1; }
  .lg-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lg-meets { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lg-rail { display: none; }                 /* six stops don't fit one rail on narrow screens */
}
@media (max-width: 760px) {
  .lg-classes__gallery { margin-inline: -20px; height: 300px; }     /* the panel's phone padding */
}
@media (max-width: 520px) {
  .lg-form, .lg-signup .lg-form { grid-template-columns: 1fr; }
  .lg-swap { height: 320px; }
  .lg-facts { grid-template-columns: 1fr 1fr; }
  .lg-meets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
