/* ── Shared league page shell ────────────────────────────────────────────────
   The hero band, breadcrumb, driver auth block, link toolbar and footer common
   to every public league page. Markup is injected by script/league_shell.js
   into the page's <div id="league-shell"> placeholder.

   Used by: every page carrying body.lh-page — league_home, tables, results,
            penalties, licence, analysis2, ai, carchange, attendance,
            register, teamregister, live
   Served at: /league_shell.css
   Depends on: /modern.css, /admin.css (loaded first; admin.css supplies the
               .stew-toolbar component this file only repositions)

   Landing-page-only components (quick-link cards, the two-column summary,
   standings blocks, calendar rows) live in /league_home.css instead.

   Accents key off the league's theme variables (--primary-color /
   --neon-color), which applyColorTheme() sets from ./colortheme, so every
   page keeps its league's colour.
   ───────────────────────────────────────────────────────────────────────── */

body.lh-page {
    background: var(--dark-bg);
    color: var(--text-primary);
    min-height: 100vh;
}

.lh-shell {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 28px;
}

@media (max-width: 768px) {
    .lh-shell { padding: 0 20px; }
}

/* ── Content-area consistency for pages using the legacy .container/
   .full_width_table components (Standings, Results, Penalties, Licence
   Points) instead of .lh-shell — brings their left/right inset and card
   styling in line with the hero/toolbar/.lh-shell above. Scoped to
   body.lh-page so it never touches driverstats.html/driver_login.html/
   auth_error.html (also .container, no body.lh-page) or the admin/
   Stewarding interface (also .full_width_table/.stew-detail-card, no
   body.lh-page). ───────────────────────────────────────────────────────── */
body.lh-page .container {
    max-width: 1400px;
    padding: 0 28px;
}

@media (max-width: 768px) {
    body.lh-page .container { padding: 0 20px; }
}

/* Same card recipe as .table-container (css/league.css) so Results/
   Penalties (previously bare striped rows) and Licence Points (previously
   only its table was carded) get a themed card matching Standings. */
body.lh-page .full_width_table {
    background: var(--card-bg);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

/* Licence Points nests a second, hardcoded-dark admin card
   (.stew-detail-card, css/admin.css) inside the themed card above via
   script/licencepoints_admin.js — neutralised here so only one themed card
   shows. The admin/Stewarding page renders the same JS but has no
   body.lh-page, so its .stew-detail-card is untouched. */
body.lh-page .stew-detail-card {
    background: transparent;
    border: none;
    padding: 0;
}


/* ── Hero band ───────────────────────────────────────────────────────────── */

.lh-hero {
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--border-subtle);
}

/* The image URL itself is set inline in league_home.html, not here: relative
   URLs in a stylesheet resolve against the stylesheet (/league_home.css), so
   "./img/hero.jpg" written here would always resolve to the site-wide image
   instead of the current league's. app.js serves the per-league file with a
   fall back to the site-wide one. */
.lh-hero-bg {
    position: absolute;
    inset: 0;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    opacity: 0.6;
    filter: grayscale(0.15);
}

/* Darkens toward the bottom so the band blends into the page and the title
   keeps its contrast; kept light at the top so the image still reads */
.lh-hero-fade {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg,
        rgba(10, 10, 10, 0.30) 0%,
        rgba(10, 10, 10, 0.65) 60%,
        var(--dark-bg) 100%);
}

.lh-hero-inner {
    position: relative;
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 28px 56px;
}

@media (max-width: 768px) {
    .lh-hero-inner { padding: 28px 20px 36px; }
}

/* Breadcrumb on the left, driver auth state on the right */
.lh-hero-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px 24px;
    margin-bottom: 28px;
}

.lh-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.lh-breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.lh-breadcrumb a:hover { color: #fff; }

/* The brand mark is the same logo image used in the navbar on the home page
   (.nav-logo-img in css/index.css), scaled down to match the breadcrumb's
   smaller size regardless of the league's own theme colour. */
.lh-breadcrumb a.lh-crumb-home {
    display: inline-flex;
    align-items: center;
}

.lh-crumb-home-img {
    height: 23px;
    width: auto;
    display: block;
}

.lh-breadcrumb .lh-crumb-sep { color: #55555c; }

.lh-breadcrumb .lh-crumb-current { color: var(--text-primary); }

.lh-eyebrow-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

/* League title on the left, stat block on the right, centred against each other */
.lh-hero-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px 32px;
}

.lh-hero-main .lh-title {
    min-width: 0;   /* let a long league name wrap instead of forcing the row wider */
}

.lh-eyebrow {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--neon-color);
}

.lh-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--primary-color);
    background: rgba(var(--primary-rgb, 46, 204, 113), 0.12);
    border: 1px solid rgba(var(--primary-rgb, 46, 204, 113), 0.35);
}

.lh-status-pill::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary-color);
}

/* Statuses other than Active are informational rather than "live" */
.lh-status-pill.lh-status-neutral {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.14);
}

.lh-status-pill.lh-status-neutral::before { background: var(--text-secondary); }

.lh-stats {
    display: flex;
    gap: 28px;
    padding: 14px 22px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
}

.lh-stat-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--primary-color);
}

.lh-stat:nth-child(2) .lh-stat-value { color: var(--neon-color); }

.lh-stat-label {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.lh-title {
    /* clamp() rather than a fixed size: league names vary a lot in length and
       the header sizes itself to its content (see the 2026-07-09 layout fix) */
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(1.7rem, 4.2vw, 3.4rem);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: 0.02em;
    margin: 0;
    color: var(--text-primary);
}

/* Margin on the subtitle rather than the title, so a league with no
   description leaves no dangling gap under the name */
.lh-subtitle {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin: 12px 0 0;
    max-width: 620px;
}


/* ── Compact hero (every page except the landing page) ───────────────────────
   Same image, breadcrumb and auth block, but a much shorter band: the league
   name shrinks to an eyebrow-scale link back to the landing page and the page's
   own name becomes the heading. No stat block. Keeps data tables and forms
   near the top of the viewport.
   ───────────────────────────────────────────────────────────────────────── */

.lh-hero--compact .lh-hero-inner {
    padding: 26px 28px 30px;
}

@media (max-width: 768px) {
    .lh-hero--compact .lh-hero-inner { padding: 20px 20px 24px; }
}

.lh-hero--compact .lh-hero-top { margin-bottom: 18px; }

/* League name above the page title, linking back to the landing page */
.lh-league-link {
    display: inline-block;
    margin-bottom: 4px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--neon-color);
    text-decoration: none;
    transition: color 0.2s;
}

.lh-league-link:hover { color: var(--primary-color); }

.lh-hero--compact .lh-title {
    font-size: clamp(1.4rem, 2.6vw, 2.1rem);
}


/* ── Shared admin/stewarding toolbar, reused here ────────────────────────────
   .stew-toolbar / #stew-nav-links are defined once in css/admin.css and used by
   the Admin and Stewarding shells, where they float fixed beneath a fixed
   navbar. This page has no fixed navbar — the toolbar sits in normal flow under
   the hero — so only the positioning is overridden here.
   ───────────────────────────────────────────────────────────────────────── */

/* Scoped on the extra .lh-toolbar class the shell adds rather than a body
   class, so these win over admin.css's .stew-toolbar regardless of which page
   is loading it or of stylesheet order.
   The box itself (not just its content) needs to sit 28px in from the edge to
   match .lh-hero-inner's content above — padding alone can't do that since it
   sits inside the border and never moves the visible card. `width: calc(100%
   - 56px)` paired with `margin: auto` and a max-width 56px narrower than the
   hero's reproduces .lh-hero-inner's left-edge formula exactly at every
   viewport width (not just below the 1400px centring threshold): the toolbar
   box's own left edge lands exactly on the hero's content-start position. */
.stew-toolbar.lh-toolbar {
    position: static;
    width: calc(100% - 56px);
    max-width: 1344px;
    margin: 22px auto;
}

/* Nine links don't fit one line on a narrow viewport; wrap rather than overflow */
.lh-toolbar #stew-nav-links {
    flex-wrap: wrap;
    padding: 0;
}

@media (max-width: 768px) {
    /* Simple fixed margins here (matching .lh-hero-inner's mobile padding)
       rather than the calc() trick above, which assumes centring on wider
       screens the mobile layout never reaches. */
    .stew-toolbar.lh-toolbar { width: auto; max-width: none; margin: 16px 20px; }
    .lh-toolbar #stew-nav-links li a { height: 40px; padding: 0 10px; }
}


/* ── Driver auth state (hero, top right) ──────────────────────────────────── */

.lh-auth {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

/* Both children start hidden so neither flashes before /driver/status
   resolves; league_home.js reveals exactly one of them. */
#google-btn,
#user-section { display: none; }

.google-btn {
    align-items: center;
    gap: 0.5rem;
    background: #fff;
    color: #222;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.4rem 0.9rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.2s;
}

.google-btn:hover { background: #e8e8e8; }

.google-icon { width: 16px; height: 16px; }

.lh-user {
    align-items: center;
    gap: 14px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.9rem;
}

/* Links to the driver portal — the only route there from this page now */
.lh-user-name {
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s;
}

.lh-user-name:hover { color: var(--primary-color); }

.lh-logout {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    letter-spacing: 0.03em;
    transition: color 0.2s;
}

.lh-logout:hover { color: var(--primary-color); }


/* ── Footer ──────────────────────────────────────────────────────────────── */

.lh-footer {
    /* The protest pages lay out with floats; without this the appended footer
       rides up alongside them instead of sitting below the content */
    clear: both;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    max-width: 1400px;
    margin: 60px auto 0;
    padding: 24px 48px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.85rem;
    color: #6a6a72;
}

.lh-footer-links {
    display: flex;
    gap: 24px;
}

.lh-footer a {
    color: #6a6a72;
    text-decoration: none;
    transition: color 0.2s;
}

.lh-footer a:hover { color: var(--primary-color); }

@media (max-width: 768px) {
    .lh-footer { padding: 20px; justify-content: center; text-align: center; }
}
