/* ──────────────────────────────────────────────────────────────────────
   /section/sports editorial broadsheet styling.

   Goals (parallels /finance):
   - Two-column layout (main article column + sidebar) at desktop widths.
   - Sidebar holds the live-scoreboard widget vertically so it stays
     visible in peripheral vision as the reader scrolls.
   - On mobile, the scoreboard sits as a horizontal top strip ABOVE
     the lead story — zero clicks to scores, mirroring the friend's
     ask "scores at the top of the page". Achieved by reordering the
     sidebar above the main column at narrow widths via grid `order`,
     so the source markup stays in reading order (article column
     first, scoreboard sidebar second) for screen readers / SEO while
     mobile rendering surfaces the scores up top.
   - Higher information density than the homepage thumbnail grid: the
     article list below the lead is a stack of headline + summary +
     meta with no thumbnail.

   Breakpoints match the rest of the site:
     >= 1000px  → two columns (main + sidebar with vertical scoreboard)
     <  1000px  → stacked (sidebar/scores on top → main column below)
   ────────────────────────────────────────────────────────────────────── */

/* ─── Masthead ─────────────────────────────────────────────────────── */

.sports-masthead {
    border-top: 3px solid #0a2540;
    border-bottom: 1px solid #ddd;
    padding: 1rem 1rem 0.5rem 1rem;
    max-width: 1280px;
    margin: 0 auto;
}

.sports-masthead-row {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.sports-masthead-title {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 2.4rem;
    font-weight: 700;
    margin: 0;
    color: #0a2540;
    letter-spacing: -0.5px;
}

.sports-masthead-tagline {
    font-style: italic;
    color: #555;
    margin: 0;
    font-size: 1rem;
}

/* ─── Two-column layout ────────────────────────────────────────────── */

.sports-layout {
    max-width: 1280px;
    margin: 1.5rem auto 2rem auto;
    padding: 0 1rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 1000px) {
    /* Desktop: pills row spans both columns at the top, main + sidebar
       below.  Areas drive placement so DOM order can stay
       pills → main → sidebar. */
    .sports-layout {
        grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
        grid-template-areas:
            "pills    pills"
            "main     sidebar";
        gap: 0.75rem 2.5rem;
    }
    .sports-filter-pills { grid-area: pills; }
    .sports-main         { grid-area: main; }
    .sports-sidebar      { grid-area: sidebar; }
}

/* Mobile (< 1000px): single column, explicit `order` so the visual
   stack is scoreboard → pills → main, regardless of DOM order.
   Friend's ask: scores at the top, no tabs, no clicks; pills sit
   immediately under the scoreboard so the league filter is the next
   thing the reader interacts with after eyeballing the score strip. */
.sports-sidebar      { order: 1; }
.sports-filter-pills { order: 2; }
.sports-main         { order: 3; }

.sports-main {
    min-width: 0;
}

.sports-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-width: 0;
}

/* The pills nav inherits .section-filter-pills--inline from the global
   stylesheet (left-aligned, tight gap, smaller font).  No additional
   styling needed here; just guarantee a small bottom margin on mobile
   so the lead story doesn't kiss the active pill. */
@media (max-width: 999px) {
    .sports-filter-pills { margin: 0 0 0.5rem 0; }
}

/* ─── Lead story ───────────────────────────────────────────────────── */

/* Lead story — image + text side-by-side on desktop, stacked on
   mobile. The image is constrained to a fixed column width so the
   text column gets predictable space regardless of image aspect. */
.sports-lead {
    border-bottom: 2px solid #0a2540;
    padding-bottom: 1.25rem;
    margin-bottom: 1rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

@media (min-width: 600px) {
    .sports-lead {
        grid-template-columns: 280px 1fr;
        gap: 1.25rem;
    }
}

.sports-lead-thumb {
    display: block;
    overflow: hidden;
    border-radius: 2px;
}

.sports-lead-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.sports-lead-body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    min-width: 0;
}

/* Title-only links: only the headline and image are clickable. */
.sports-lead-title a,
.sports-article-title a {
    color: inherit;
    text-decoration: none;
}

.sports-lead-title a:hover,
.sports-article-title a:hover {
    color: #0a2540;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.sports-lead-title {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.7rem;
    line-height: 1.2;
    margin: 0;
    font-weight: 700;
    color: #1a1a1a;
}

.sports-lead-summary {
    margin: 0;
    color: #444;
    font-size: 0.95rem;
    line-height: 1.45;
}

/* ─── Article list (below the lead) ────────────────────────────────── */

/* Dense, no-thumbnail stack — same MarketWatch / FT pattern as
   .finance-article-list. Reads as "a lot of sports news at a glance". */
.sports-article-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid #eee;
}

.sports-article-item {
    border-bottom: 1px solid #eee;
    padding: 0.85rem 0;
}

.sports-article-title {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.15rem;
    line-height: 1.25;
    margin: 0.25rem 0 0.3rem 0;
    font-weight: 600;
    color: #1a1a1a;
}

.sports-article-summary {
    margin: 0 0 0.35rem 0;
    color: #555;
    font-size: 0.9rem;
    line-height: 1.4;
    /* Two-line clamp keeps the list scannable on narrow screens. */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ─── Meta line ────────────────────────────────────────────────────── */

.sports-meta {
    margin: 0;
    font-size: 0.78rem;
    color: #888;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.sports-meta-sep {
    color: #bbb;
}

.sports-tag {
    color: #555;
    text-decoration: none;
    font-size: 0.78rem;
}
.sports-tag:hover {
    color: #0a2540;
    text-decoration: underline;
}

/* ──────────────────────────────────────────────────────────────────────
   Sports scoreboard widget.

   Layout-agnostic: at desktop widths the parent container places it
   in the right-rail sidebar (vertical column of game cards); at
   mobile widths it sits in the .sports-sidebar slot which the mobile
   tab toggles into view. Orientation switch is purely a media query
   on .sports-scores-grid (flex-direction: row → column at 1000px).
   ────────────────────────────────────────────────────────────────────── */

.sports-scoreboard-strip {
    padding: 0;
    margin: 0;
}

/* ── League tabs (sport-league switcher; stays horizontal in both
   orientations — only the scorecard list flips to a column) ───── */

.sports-league-tabs {
    display: flex;
    gap: 0;
    overflow-x: auto;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    padding: 0 0.4rem;
}

.sports-tab {
    background: none;
    border: none;
    padding: 0.4rem 0.85rem;
    font-family: sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.4px;
    color: #777;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    transition: color 0.15s;
}

.sports-tab:hover {
    color: #222;
}

.sports-tab--active {
    color: #0a2540;
    border-bottom-color: #e53935;
}

/* Tiny red dot appended to a tab when that league has live games right
   now (state === "in"). Painted by sports.js after the boot-time
   parallel probe of all leagues. NOT painted for state === "pre"
   (TBD-scheduled) — those aren't actually live, just on the slate. */
.sports-tab-badge {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #e53935;
    margin-left: 0.35rem;
    vertical-align: middle;
    animation: sports-tab-badge-pulse 1.6s ease-in-out infinite;
}

@keyframes sports-tab-badge-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.45; }
}

/* ── Scores container ────────────────────────────────────────── */

.sports-scores-container {
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 6px 6px;
    padding: 0.55rem;
    background: #fafafa;
}

.sports-scores-loading,
.sports-scores-empty {
    color: #888;
    text-align: center;
    padding: 0.5rem;
    margin: 0;
    font-size: 0.85rem;
}

/* ── Game cards ───────────────────────────────────────────────── */

/* Default = horizontal row scroller (mobile shape). Desktop sidebar
   flips to a vertical column (see media query below). */
.sports-scores-grid {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 0.15rem;
}

@media (min-width: 1000px) {
    /* Desktop sidebar: stack scorecards vertically. The container
       caps height so a 30-game NCAAF Saturday slate doesn't push
       any other future widgets off-screen — readers can scroll
       within the panel instead. */
    .sports-scores-grid {
        flex-direction: column;
        overflow-x: hidden;
        overflow-y: auto;
        max-height: 70vh;
        gap: 0.4rem;
        padding-bottom: 0;
    }
    /* Cards take the full sidebar width when stacked; remove the
       horizontal-scroller min/max-width caps. */
    .sports-scoreboard-strip .sports-game-card {
        min-width: 0;
        max-width: none;
        width: 100%;
    }
}

.sports-game-card {
    flex: 0 0 auto;
    min-width: 165px;
    max-width: 210px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 0.45rem 0.65rem;
    font-size: 0.85rem;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.sports-game-status {
    font-size: 0.7rem;
    color: #888;
    margin-bottom: 0.3rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.sports-game-status--live {
    color: #e53935;
    font-weight: 700;
}

/* ── Team rows ───────────────────────────────────────────────── */

.sports-game-team {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.18rem 0;
    border-top: 1px solid #f0f0f0;
}

.sports-game-team:first-of-type {
    border-top: none;
}

.sports-game-team--winner {
    font-weight: 700;
}

.sports-game-team--winner .sports-team-score {
    color: #0a2540;
}

.sports-team-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 130px;
    color: #333;
    font-weight: 500;
}

.sports-team-score {
    font-weight: 700;
    font-size: 0.95rem;
    min-width: 26px;
    text-align: right;
    color: #555;
    font-variant-numeric: tabular-nums;
}

/* ── Broadcast / detail line ─────────────────────────────────── */

.sports-game-detail {
    font-size: 0.68rem;
    color: #999;
    margin-top: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-style: italic;
}

/* ── Mobile tightening ───────────────────────────────────────── */
@media (max-width: 600px) {
    .sports-tab {
        padding: 0.35rem 0.65rem;
        font-size: 0.7rem;
    }
    .sports-game-card {
        min-width: 150px;
    }
    .sports-masthead-title {
        font-size: 1.9rem;
    }
}
