/* ─────────────────────────────────────
   Chiefs Standings — CSS
   Colors: #E31837 (red), #FFB81C (gold),
           #000 (black), #fff (white)
   ───────────────────────────────────── */

.cst-wrap,
.cst-wrap *,
.cst-wrap *::before,
.cst-wrap *::after {
    box-sizing: border-box;
}

.cst-wrap {
    max-width: 1060px;
    width: 100%;
    margin: 2rem auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #1a1a2e;
    line-height: 1.5;
    overflow: hidden;
}

/* WordPress theme resets — prevent theme CSS from breaking tables */
.cst-wrap table {
    border: none;
    border-spacing: 0;
    border-collapse: collapse;
    margin: 0;
}

.cst-wrap th,
.cst-wrap td {
    border: none;
    background: transparent;
}

.cst-wrap img {
    max-width: none;
    height: auto;
}

/* ── Banner ── */
.cst-banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: linear-gradient(135deg, #E31837 0%, #b5102b 100%);
    padding: 1.1rem 1.5rem;
    border-radius: 12px 12px 0 0;
    color: #fff;
}

.cst-banner-text {
    flex: 1;
}

.cst-title {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: #fff;
    line-height: 1.2;
}

.cst-subtitle {
    margin: 0.15rem 0 0;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

/* ── Main Tabs ── */
.cst-main-tabs {
    display: flex;
    background: #1a1a2e;
    border-bottom: 3px solid #E31837;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.cst-main-tab {
    background: none;
    border: none;
    padding: 0.7rem 1.4rem;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.55);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -3px;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
    white-space: nowrap;
    font-family: inherit;
}

.cst-main-tab:hover {
    color: #FFB81C;
    background: rgba(255, 255, 255, 0.05);
}

.cst-main-tab.cst-main-tab-active {
    color: #FFB81C;
    border-bottom-color: #FFB81C;
}

/* ── Content ── */
.cst-content {
    background: #fff;
    border: 1px solid #e2e6ec;
    border-top: none;
    border-radius: 0 0 12px 12px;
    min-height: 200px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.cst-loading {
    text-align: center;
    padding: 3rem 1rem;
    color: #9ca3af;
    font-size: 0.88rem;
}

.cst-pane {
    display: none;
    padding: 1rem 0.75rem;
    animation: cst-fadeIn 0.25s ease;
}

.cst-pane.cst-pane-active {
    display: block;
}

@keyframes cst-fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── Footer ── */
.cst-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding: 0.7rem 0;
    font-size: 0.7rem;
    color: #9ca3af;
    margin-top: 0.5rem;
    gap: 0.5rem;
}

.cst-clinch-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem 1rem;
}

.cst-clinch-item strong {
    color: #6b7280;
}

.cst-updated {
    white-space: nowrap;
}

/* ── Error ── */
.cst-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 1rem;
    color: #991b1b;
    font-weight: 500;
    max-width: 1060px;
    margin: 2rem auto;
}

/* ═══════════════════════════════════════
   STANDINGS TABLE — Desktop-first
   ═══════════════════════════════════════ */
.cst-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    table-layout: auto;
}

.cst-table thead {
    background: #1a1a2e;
}

.cst-table thead th {
    padding: 0.55rem 0.4rem;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #FFB81C;
    text-align: center;
    border-bottom: none;
    white-space: nowrap;
    overflow: hidden;
}

.cst-table thead th:first-child {
    text-align: left;
    padding-left: 0.75rem;
}

/* Column widths */
.cst-th-team     { text-align: left; }
.cst-th-num      { width: 40px; }
.cst-th-rec      { width: 48px; }

/* ── Table body ── */
.cst-table tbody tr {
    border-bottom: 1px solid #f0f1f4;
    transition: background 0.12s;
}

.cst-table tbody tr:hover {
    background: #fff8e6;
}

.cst-table tbody td {
    padding: 0.6rem 0.4rem;
    vertical-align: middle;
    text-align: center;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    overflow: hidden;
}

/* ── Team cell ── */
.cst-team-cell {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    text-align: left;
    padding-left: 0.35rem;
}

.cst-team-logo {
    width: 26px;
    height: 26px;
    object-fit: contain;
    flex-shrink: 0;
}

.cst-team-name {
    font-weight: 700;
    color: #1a1a2e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cst-team-abbr {
    display: none;
    font-weight: 700;
    color: #1a1a2e;
}

.cst-seed {
    font-size: 0.68rem;
    font-weight: 700;
    color: #9ca3af;
    min-width: 14px;
    text-align: right;
    flex-shrink: 0;
}

.cst-clinch {
    font-size: 0.62rem;
    font-weight: 700;
    color: #6b7280;
    flex-shrink: 0;
}

/* ── Highlighted (Chiefs) row ── */
.cst-highlight td {
    background: rgba(227, 24, 55, 0.04);
}

.cst-highlight .cst-team-name,
.cst-highlight .cst-team-abbr {
    color: #E31837;
    font-weight: 800;
}

.cst-highlight td:first-child {
    border-left: 3px solid #E31837;
}

/* ── Stat cells ── */
.cst-td-record {
    font-weight: 700;
    color: #1a1a2e;
}

.cst-td-pct {
    font-weight: 700;
    color: #555;
}

.cst-td-diff-pos {
    color: #15803d;
    font-weight: 600;
}

.cst-td-diff-neg {
    color: #dc2626;
    font-weight: 600;
}

.cst-td-diff-zero {
    color: #9ca3af;
    font-weight: 500;
}

.cst-td-streak-w {
    color: #15803d;
    font-weight: 600;
}

.cst-td-streak-l {
    color: #dc2626;
    font-weight: 600;
}

.cst-td-muted {
    color: #6b7280;
    font-size: 0.8rem;
}

.cst-td-gb {
    color: #6b7280;
    font-weight: 600;
}

/* ── Playoff separator ── */
.cst-playoff-sep td {
    padding: 0 !important;
    border-bottom: 2px dashed #E31837 !important;
}

/* ═══════════════════════════════════════
   RESPONSIVE — Tablet (≤768px)
   ═══════════════════════════════════════ */
@media (max-width: 768px) {
    .cst-wrap {
        margin: 1.5rem 0.5rem;
    }

    .cst-banner {
        padding: 0.9rem 1rem;
    }

    .cst-title {
        font-size: 1.15rem;
    }

    .cst-main-tab {
        padding: 0.6rem 1rem;
        font-size: 0.72rem;
    }

    .cst-table {
        font-size: 0.78rem;
        table-layout: auto;
    }

    .cst-table thead th {
        padding: 0.45rem 0.3rem;
        font-size: 0.58rem;
    }

    .cst-table tbody td {
        padding: 0.5rem 0.3rem;
    }

    /* Show abbreviation, hide full name */
    .cst-team-name {
        display: none;
    }
    .cst-team-abbr {
        display: inline;
    }

    .cst-team-cell {
        padding-left: 0.2rem;
        gap: 0.35rem;
    }

    .cst-team-logo {
        width: 22px;
        height: 22px;
    }

    /* Hide less-essential columns: T, PF, PA, HOME, ROAD */
    .cst-hide-tablet {
        display: none;
    }

    .cst-th-num { width: 34px; }
    .cst-th-rec { width: 40px; }

    .cst-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .cst-clinch-legend {
        font-size: 0.62rem;
    }
}

/* ═══════════════════════════════════════
   RESPONSIVE — Mobile (≤520px)
   ═══════════════════════════════════════ */
@media (max-width: 520px) {
    .cst-wrap {
        margin: 0.5rem 0;
    }

    .cst-banner {
        border-radius: 8px 8px 0 0;
        padding: 0.8rem 0.75rem;
    }

    .cst-title {
        font-size: 1.05rem;
    }

    .cst-subtitle {
        font-size: 0.75rem;
    }

    .cst-content {
        border-radius: 0 0 8px 8px;
    }

    .cst-main-tab {
        padding: 0.5rem 0.65rem;
        font-size: 0.62rem;
    }

    .cst-pane {
        padding: 0.5rem 0.25rem;
    }

    .cst-table {
        font-size: 0.72rem;
        table-layout: auto;
    }

    .cst-table thead th {
        padding: 0.35rem 0.15rem;
        font-size: 0.52rem;
        letter-spacing: 0;
    }

    .cst-table tbody td {
        padding: 0.4rem 0.15rem;
        font-size: 0.72rem;
    }

    .cst-team-cell {
        gap: 0.2rem;
        padding-left: 0.05rem;
    }

    .cst-team-logo {
        width: 18px;
        height: 18px;
    }

    .cst-seed {
        font-size: 0.58rem;
        min-width: 10px;
    }

    .cst-clinch {
        font-size: 0.52rem;
    }

    /* Hide additional columns: GB, DIV, CONF */
    .cst-hide-mobile {
        display: none;
    }

    .cst-th-num { width: 28px; }
}
