/*
 * Site styles on top of Bootstrap 5.3.
 * Every text colour below meets WCAG 2.2 AA contrast (4.5:1+) on its background; ratios noted.
 */

:root {
    --site-ink: #1b1f23;          /* body text: 15.3:1 on page bg */
    --site-muted: #50575e;        /* secondary text: 7.3:1 on white */
    --site-page: #f2f4f6;
    --site-panel: #ffffff;
    --site-dark: #16191c;         /* header/footer bg; white text 17.9:1 */
    --site-line: #d8dde2;
    --site-live: #a1192a;         /* 7.6:1 on white */
    --site-warn: #7a4a00;         /* 7.4:1 on white */
    --bs-link-color: #0a58ca;     /* 6.4:1 on white */
    --bs-link-color-rgb: 10, 88, 202;
    --bs-link-hover-color: #063a87;
    --bs-link-hover-color-rgb: 6, 58, 135;
    --bs-secondary-color: var(--site-muted);
}

body {
    background: var(--site-page);
    color: var(--site-ink);
}

.container-xl {
    --bs-gutter-x: 2rem;          /* 16px side gutter on phones */
}

/* ---------- Focus and skip link ---------- */

:focus-visible {
    outline: 3px solid var(--site-ink);
    outline-offset: 2px;
}

.site-header :focus-visible,
.site-footer :focus-visible {
    outline-color: #ffffff;
}

main:focus {
    outline: none;                /* programmatic target of the skip link, not interactive */
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 1000;
    padding: .75rem 1rem;
    background: #ffffff;
    color: var(--site-ink);
    font-weight: 600;
}

.skip-link:focus {
    left: 1rem;
    top: 1rem;
}

/* ---------- Header, footer, panels ---------- */

.site-header {
    background: var(--site-dark);
}

.site-brand {
    display: inline-block;
    padding: .375rem 0;
    color: #ffffff;
    font-size: 1.125rem;
    font-weight: 700;
    text-decoration: none;
}

.site-brand:hover {
    color: #ffffff;
    text-decoration: underline;
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem 1.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-nav a {
    display: inline-block;
    padding: .5rem .125rem;       /* 24px+ target height */
    color: #ffffff;
    text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current] {
    color: #ffffff;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: .35em;
}

.site-footer {
    background: var(--site-dark);
    color: #e9ecef;               /* 15.1:1 */
}

.site-footer a {
    color: #ffffff;
}

.site-footer li {
    padding: .2rem 0;
}

.panel {
    min-width: 0;
    padding: 1.25rem;
    background: var(--site-panel);
    border-radius: .5rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .06);
}

.breadcrumb {
    font-size: .875rem;
}

/* ---------- Sidebar ---------- */

.side-box {
    background: var(--site-panel);
    border-radius: .5rem;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .06);
}

.side-date {
    margin-bottom: .5rem;
    color: var(--site-muted);
    font-size: .875rem;
}

.side-games {
    margin: 0 0 .5rem;
    padding: 0;
    list-style: none;
}

.side-games li {
    padding: .375rem 0;
    border-bottom: 1px solid var(--site-line);
}

.side-games li:last-child {
    border-bottom: 0;
}

.side-status {
    display: block;
    color: var(--site-muted);
    font-size: .8125rem;
}

/* ---------- Tables ---------- */

caption {
    caption-side: top;
    color: var(--site-ink);
    font-weight: 600;
}

.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.table-responsive[tabindex]:focus-visible {
    outline-offset: 0;
}

.games-table th.matchup,
.team-cell {
    font-weight: 400;
}

.team-cell {
    white-space: nowrap;
}

.team-line {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.team-line + .team-line {
    margin-top: .3rem;
}

.team-line .team-name {
    flex: 1;
}

.team-line .score,
.score-cell {
    min-width: 2ch;
    font-weight: 700;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.team-line.is-winner .team-name {
    font-weight: 700;
}

.at,
.vs {
    color: var(--site-muted);
    font-size: .875em;
}

.team-logo {
    flex: none;
    object-fit: contain;
    vertical-align: middle;
}

.game-status {
    font-weight: 600;
}

.status-live {
    color: var(--site-live);
}

.status-postponed,
.status-cancelled {
    color: var(--site-warn);
}

.game-type {
    display: block;
    color: var(--site-muted);
    font-size: .8125rem;
}

.result-w {
    font-weight: 700;
}

/* ---------- Game detail ---------- */

.box-table caption {
    font-size: .9375rem;
}

.box-table th[scope="row"],
.scoring-table th[scope="row"] {
    font-weight: 600;
}

.sweater {
    display: inline-block;
    min-width: 2ch;
    color: var(--site-muted);
    font-weight: 400;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.three-stars li {
    padding: .2rem 0;
}

.game-info {
    display: grid;
    grid-template-columns: minmax(9rem, max-content) 1fr;
    gap: .35rem 1rem;
}

.game-info dt {
    font-weight: 600;
}

.game-info dd {
    margin: 0;
}

@media (max-width: 575.98px) {
    .game-info {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .game-info dd {
        margin-bottom: .5rem;
    }
}

/* ---------- Sources ---------- */

.sources-list li {
    padding: .2rem 0;
}

.source-credit {
    color: var(--site-muted);
    font-size: .875rem;
}

/* ---------- News ---------- */

.article-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.article-list li {
    padding: .75rem 0;
    border-bottom: 1px solid var(--site-line);
}

.article-list li:last-child {
    border-bottom: 0;
}

.article-date {
    color: var(--site-muted);
    font-size: .875rem;
}

.article-body {
    max-width: 70ch;
    font-size: 1.0625rem;
    line-height: 1.65;
}

/* ---------- Page pieces ---------- */

.game-meta {
    color: var(--site-muted);
}

.team-heading {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.link-grid,
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
    gap: .4rem 1.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.team-grid li {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.pager-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: .75rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--site-line);
}

.pager-nav a {
    display: inline-block;
    padding: .25rem 0;
}

@media (max-width: 575.98px) {
    .panel {
        padding: 1rem;
    }
}
