/* Homepage: editable-first hero + league-filtered records/stats.
   Loaded only by home.html via {% block extra_css %}. */

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

.home-hero {
    position: relative;
    overflow: hidden;
    padding: 2rem 0 2.5rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.home-hero__inner {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
    align-items: center;
}

.home-hero__card {
    position: relative;
    z-index: 1;
}

.home-hero__eyebrow {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent-1);
    margin-bottom: 0.5rem;
}

.home-hero__title {
    font-size: clamp(2rem, 5.5vw, 3.25rem);
    line-height: 1.04;
    font-weight: 800;
    margin: 0;
}

.home-hero__lede {
    margin-top: 0.75rem;
    font-size: 1.0625rem;
    line-height: 1.55;
    color: var(--text-secondary);
    max-width: 34rem;
}

.home-hero__ctas {
    display: grid;
    gap: 0.5rem;
    margin-top: 1.25rem;
}

.home-hero__ctas .btn {
    justify-content: center;
    text-align: center;
}

/* Grid rather than wrapped flex: the league buttons have very uneven label
   lengths ("Editable NFL ..." vs "Editable College Football ..."), which wraps
   into a ragged 1/2/2/1 stack. Equal columns keep the block tidy. */
.home-hero__leagues-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(13.5rem, 1fr));
    gap: 0.5rem;
}

/* Desktop has the room, so the disclosure is dropped entirely: no summary, and
   the grid sits flush under the primary CTA exactly as it did before. The
   script below only ever closes this at mobile widths. */
.home-hero__leagues-summary {
    display: none;
}

.home-hero__leagues[open] > .home-hero__leagues-summary {
    margin-bottom: 0.5rem;
}

@media (max-width: 639px) {
    .home-hero__leagues-summary {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
        cursor: pointer;
        padding: 0.7rem 0.9rem;
        border: 1px solid var(--border);
        border-radius: 0.5rem;
        background-color: var(--surface);
        font-weight: 600;
        color: var(--text-primary);
        list-style: none;
    }
    /* Safari still paints its own triangle without this. */
    .home-hero__leagues-summary::-webkit-details-marker {
        display: none;
    }
    .home-hero__leagues-summary::after {
        content: '';
        width: 0.5rem;
        height: 0.5rem;
        border-right: 2px solid var(--text-secondary);
        border-bottom: 2px solid var(--text-secondary);
        transform: rotate(45deg) translate(-0.1rem, -0.1rem);
        transition: transform 0.2s ease;
    }
    .home-hero__leagues[open] > .home-hero__leagues-summary::after {
        transform: rotate(-135deg) translate(-0.1rem, -0.1rem);
    }
    .home-hero__leagues-summary:focus-visible {
        outline: 2px solid var(--accent-1);
        outline-offset: 2px;
    }
}

/* Decorative only. Lazy + aria-hidden so it stays out of the accessibility
   tree and off the LCP critical path: the H1 should be the LCP element, not a
   1280px screenshot. */
.home-hero__art {
    display: none;
}

.home-hero__art img {
    width: 100%;
    height: auto;
    border-radius: 0.875rem;
    border: 1px solid var(--border);
}

@media (min-width: 900px) {
    .home-hero__inner {
        grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
        gap: 2.5rem;
    }

    .home-hero__art {
        display: block;
    }

    .home-hero__cta-main {
        flex-basis: auto;
    }
}

/* ── Section band heads (shared by the seasons band and stats) ─────────── */

.home-band__head,
.home-stats__head {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 1rem;
}

/* ── Records + all-time statistics ────────────────────────────────────── */

.home-stats__tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.home-stats__tab {
    border: 1.5px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
    border-radius: 999px;
    padding: 0.4375rem 1.0625rem;
    font-size: 0.8125rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.home-stats__tab:hover {
    border-color: var(--border-hover);
    background: var(--surface-hover);
}

.home-stats__tab.is-active {
    background: var(--accent-1);
    border-color: var(--accent-1);
    color: var(--background);
}

.home-stats__tab:focus-visible {
    outline: 2px solid var(--accent-1);
    outline-offset: 2px;
}

.home-stats__subhead {
    font-size: 1.125rem;
    font-weight: 700;
    margin: 1.25rem 0 0.75rem;
}

.home-stats__note {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin: -0.5rem 0 0.75rem;
}

.home-stats__records {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    gap: 0.875rem;
}

.home-stats__record {
    border: 1px solid var(--border);
    border-radius: 0.875rem;
    background: var(--surface);
    padding: 1rem 1.0625rem;
}

.home-stats__record-label {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.home-stats__record-value {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.1;
    margin-top: 0.5rem;
}

.home-stats__record-unit {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-left: 0.375rem;
}

.home-stats__record-team {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    font-weight: 700;
    font-size: 0.875rem;
}

.home-stats__record-season {
    margin-top: 0.1875rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.home-stats__dot {
    display: inline-block;
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    flex: none;
}

.home-stats__table-wrap {
    overflow-x: auto;
}

.home-stats__table {
    width: 100%;
    text-align: left;
    white-space: nowrap;
    border-collapse: collapse;
}

.home-stats__table th,
.home-stats__table td {
    padding: 0.625rem 0.75rem;
    border-bottom: 1px solid var(--border);
}

.home-stats__table th {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.home-stats__table tbody tr:last-child td {
    border-bottom: 0;
}

.home-stats__table .num {
    text-align: right;
}

/* Dominance bar behind the "led" figure. Pure CSS so it stays crawlable and
   works with JS disabled. */
.home-stats__bar-cell {
    position: relative;
}

.home-stats__bar {
    position: absolute;
    top: 0.25rem;
    bottom: 0.25rem;
    right: 0;
    border-radius: 0.25rem;
    background-color: var(--accent-1);
    opacity: 0.18;
}

.home-stats__bar-value {
    position: relative;
    font-weight: 600;
}

.home-stats__more {
    margin-top: 1rem;
    text-align: center;
}

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