/* ============================================
   Blue Chip Analytics - Base Styles
   Foundation styles shared across all pages
   Tighter, utilitarian design
   ============================================ */

/* ── Design Tokens ───────────────────────── */

:root {
    /* Brand colours */
    --color-brand-dark:     #1a365d;
    --color-brand-mid:      #2c5282;
    --color-brand-light:    #3182ce;
    --color-brand-gradient: linear-gradient(135deg, #1a365d 0%, #2c5282 50%, #3182ce 100%);

    /* Text colours */
    --color-text-primary:   #1a202c;
    --color-text-secondary: #4a5568;
    --color-text-muted:     #64748b;
    --color-text-body:      #333;

    /* Surface colours */
    --color-bg-page:        #f7f7f7;
    --color-bg-card:        #ffffff;
    --color-bg-subtle:      #f7f9fc;
    --color-bg-tint:        #f8fafc;

    /* Border colours */
    --color-border-light:   #f1f5f9;
    --color-border-mid:     #e2e8f0;
    --color-border-strong:  #cbd5e0;

    /* Semantic colours */
    --color-danger:         #e53e3e;
    --color-warning-bg:     #fffbeb;
    --color-warning-border: #f59e0b;

    /* Spacing */
    --space-xs:  4px;
    --space-sm:  8px;
    --space-md:  12px;
    --space-lg:  16px;
    --space-xl:  20px;

    /* Typography */
    --font-stack: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;

    /* Breakpoints (reference only — use literal values in media queries) */
    /* mobile: 480px | tablet: 768px | desktop: 1200px */
}

/* CSS Reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Global link defaults — scoped rules below still override */
a {
    color: var(--color-brand-dark);
    text-decoration: none;
}
a:hover {
    color: var(--color-brand-light);
    text-decoration: underline;
}

/* Body & Typography */
body {
    font-family: var(--font-stack);
    background: var(--color-bg-page);
    color: var(--color-text-body);
    line-height: 1.5;
}

/* Main Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px;
}

/* Generic Data Grid Layout */
.data-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

/* White Card Sections */
.data-section {
    background: white;
    border-radius: 8px;
    padding: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* ── Schedule / game-list table (shared: team pages, weekly hub) ──
   Flex container with a grid header + grid rows. Each page sets its own
   grid-template-columns on its .schedule-header / .schedule-row (column
   counts differ per page); the look below is shared. */
.schedule-table {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--color-border-mid);
    border-radius: 8px;
    overflow: hidden;
}

.schedule-header {
    display: grid;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--color-brand-dark);
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
}

.schedule-row {
    display: grid;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--color-border-mid);
    align-items: center;
}

.schedule-row:last-child {
    border-bottom: none;
}

.schedule-row.completed {
    background: white;
}

.schedule-row.upcoming {
    background: #f8f9fa;
}

.schedule-row:hover {
    background: var(--color-border-mid);
}

/* Win / loss / tie result colours (shared) */
.win {
    color: #2f855a;
    font-weight: 600;
}

.loss {
    color: var(--color-danger);
    font-weight: 600;
}

.tie {
    color: var(--color-text-muted);
    font-weight: 600;
}

/* Section Titles */
.section-title {
    font-size: 1.15em;
    font-weight: 600;
    color: var(--color-brand-dark);
    margin-bottom: 10px;
    border-bottom: 2px solid var(--color-border-mid);
    padding-bottom: 6px;
}

/* Data Rows (Label/Value Pattern) */
.data-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px solid var(--color-border-light);
    font-size: 0.9em;
}

.data-row:last-child {
    border-bottom: none;
}

.data-label {
    font-weight: 500;
    color: var(--color-text-secondary);
}

.data-value {
    font-weight: 600;
    color: var(--color-text-primary);
}

/* Responsive Design - Base Breakpoints */
@media (max-width: 768px) {
    .container {
        padding: 8px;
    }
    
    .data-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .data-section {
        padding: 10px;
    }
    
    .section-title {
        font-size: 1.05em;
        margin-bottom: 8px;
    }
    
    .data-row {
        padding: 3px 0;
        font-size: 0.85em;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 6px;
    }
    
    .data-section {
        padding: 8px;
    }
    
    .section-title {
        font-size: 1em;
        margin-bottom: 6px;
    }
    
    .data-row {
        font-size: 0.8em;
        padding: 2px 0;
    }
    
    .data-value {
        word-break: break-word;
    }
}

/* ── Byline ──────────────────────────────── */

.byline {
    font-size: 0.85em;
    color: var(--color-text-muted);
    margin: 4px 0 16px;
}

.byline a {
    color: var(--color-brand-dark);
    text-decoration: none;
    font-weight: 500;
}

.byline a:hover {
    text-decoration: underline;
}

.byline time {
    color: var(--color-text-muted);
}

/* ── Verdict capsule ─────────────────────── */

.answer-capsule {
    background: #f0f4ff;
    border-left: 4px solid #2e5bff;
    border-radius: 0 6px 6px 0;
    padding: 14px 18px;
    margin: 0 0 10px;
    font-size: 0.97em;
    line-height: 1.6;
    color: #1a202c;
}

.answer-capsule p {
    margin: 0;
}

/* ── Top-10 summary table ────────────────── */

.top10-summary {
    margin-bottom: 20px;
}

.summary-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}

.summary-table th,
.summary-table td {
    padding: 7px 10px;
    text-align: left;
    border-bottom: 1px solid var(--color-border-mid);
}

.summary-table th {
    background: var(--color-bg-subtle);
    font-weight: 600;
    color: var(--color-brand-dark);
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.summary-table tr:last-child td {
    border-bottom: none;
}

.summary-table a {
    color: var(--color-brand-dark);
    text-decoration: none;
}

.summary-table a:hover {
    text-decoration: underline;
}

/* Numeric/measure columns right-aligned; label columns stay left */
.summary-table th.num,
.summary-table td.num {
    text-align: right;
}

/* ── Sources block ───────────────────────── */

.sources-block h2 {
    font-size: 1.1em;
    font-weight: 600;
    color: var(--color-brand-dark);
    margin-bottom: 12px;
}

.sources-category {
    margin-bottom: 14px;
}

.sources-category h3 {
    font-size: 0.88em;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}

.sources-category ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sources-category li {
    font-size: 0.9em;
    padding: 3px 0;
    color: #333;
}

.sources-category a {
    color: var(--color-brand-dark);
    text-decoration: none;
}

.sources-category a:hover {
    text-decoration: underline;
}

/* ── Who-should-skip block ───────────────── */

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

.skip-list li {
    padding: 8px 0 8px 18px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.92em;
    line-height: 1.55;
    position: relative;
    color: #333;
}

.skip-list li::before {
    content: "✕";
    position: absolute;
    left: 0;
    color: var(--color-danger);
    font-size: 0.8em;
    top: 10px;
}

.skip-list li:last-child {
    border-bottom: none;
}

/* ── Verdict echo ────────────────────────── */

.verdict-echo-section {
    border-top: 2px solid var(--color-border-mid);
    padding-top: 16px;
    margin-top: 4px;
}

.verdict-echo {
    font-size: 0.95em;
    font-weight: 500;
    color: var(--color-brand-dark);
    line-height: 1.55;
    margin: 0;
}

/* ── Responsive adjustments ──────────────── */

@media (max-width: 768px) {
    .answer-capsule {
        padding: 12px 14px;
        font-size: 0.93em;
    }

    .summary-table th,
    .summary-table td {
        padding: 6px 8px;
        font-size: 0.85em;
    }

    .skip-list li {
        font-size: 0.88em;
    }
}

@media (max-width: 480px) {
    .byline {
        font-size: 0.8em;
    }

    .summary-table th,
    .summary-table td {
        padding: 5px 6px;
        font-size: 0.8em;
    }
}

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

.site-footer {
    background: var(--color-brand-gradient);
    color: white;
    padding: 1rem 0.5rem;
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.2);
    font-family: var(--font-stack);
    font-size: 0.8rem;
    line-height: 1.4;
    margin-top: auto;
}

.site-footer__inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.site-footer__nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.site-footer__link {
    color: white;
    text-decoration: none;
    padding: 0.25rem;
    font-size: 0.8rem;
    transition: color 0.15s;
}

.site-footer__link:hover {
    color: rgba(255,255,255,0.7);
}

.site-footer__copy {
    color: white;
    font-size: 0.8rem;
    text-align: center;
}

/* ── Site header (moved from header.php) ─── */

.header {
    background: var(--color-brand-gradient);
    color: white;
    padding: 10px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.nav {
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 10px;
}

.nav-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: white;
    white-space: nowrap;
}

.logo-wrapper {
    background-color: white;
    border-radius: 50%;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    width: 44px;
    flex-shrink: 0;
}

.logo {
    height: 36px;
    width: auto;
}

.site-title {
    font-size: 1.2em;
    font-weight: 600;
    line-height: 1;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5em;
    cursor: pointer;
}

.nav-links {
    display: flex;
    gap: 30px;
    align-items: center;
}

.nav-links a {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 5px;
    transition: background 0.3s;
    font-weight: 500;
}

.nav-links a:hover {
    background: rgba(255,255,255,0.2);
}

@media (max-width: 768px) {
    .nav-top {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
    }

    .menu-toggle {
        display: block;
        margin-left: auto;
    }

    .nav-links {
        width: 100%;
        flex-direction: column;
        display: none;
        margin-top: 10px;
        gap: 0;
    }

    .nav-links a {
        padding: 10px 12px;
    }

    .nav-links.show {
        display: flex;
    }

    .logo-wrapper {
        height: 34px;
        width: 34px;
        padding: 3px;
    }

    .logo {
        height: 26px;
    }

    .site-title {
        font-size: 1em;
    }

    .header {
        padding: 20px 0;
    }
}

/* ── Content section ─────────────────────── */

.content-section {
    background: var(--color-bg-card);
    border-radius: 8px;
    padding: 20px 24px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* Headings inside any content section — no class needed on the element */
.content-section h2 {
    font-size: 1.15em;
    font-weight: 600;
    color: var(--color-brand-dark);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--color-border-mid);
    line-height: 1.35;
}

.content-section h3 {
    font-size: 1.0em;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-top: 16px;
    margin-bottom: 6px;
    line-height: 1.35;
}

.content-section h3:first-child {
    margin-top: 0;
}

.content-section p {
    font-size: 0.93em;
    color: var(--color-text-body);
    line-height: 1.65;
    margin-bottom: 12px;
}

.content-section p:last-child {
    margin-bottom: 0;
}

.content-section ul,
.content-section ol {
    font-size: 0.93em;
    color: var(--color-text-body);
    line-height: 1.65;
    padding-left: 1.4em;
    margin-bottom: 12px;
}

.content-section li {
    margin-bottom: 4px;
}

/* ── Narrative / preview component (team pages + game key-factors) ── */
.preview-section {
    background: var(--color-bg-subtle);
}

.narrative-team {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.narrative-item {
    padding: 12px 14px;
    background: var(--color-bg-card);
    border-radius: 4px;
    border-left: 4px solid var(--color-brand-light);
}

.narrative-title {
    display: block;
    margin-bottom: 6px;
    color: var(--color-brand-dark);
    font-size: 1em;
}

.narrative-description {
    margin: 0;
    color: var(--color-text-secondary);
    line-height: 1.6;
    font-size: 0.9em;
}

/* ── Policy section — alias of content-section ── */
/* Used by corrections/editorial/funding/ai pages  */

.policy-section {
    background: var(--color-bg-card);
    border-radius: 8px;
    padding: 20px 24px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.policy-section h2 {
    font-size: 1.15em;
    font-weight: 600;
    color: var(--color-brand-dark);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--color-border-mid);
    line-height: 1.35;
}

.policy-section h3 {
    font-size: 1.0em;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-top: 16px;
    margin-bottom: 6px;
    line-height: 1.35;
}

.policy-section h3:first-child {
    margin-top: 0;
}

.policy-section p {
    font-size: 0.93em;
    color: var(--color-text-body);
    line-height: 1.65;
    margin-bottom: 12px;
}

.policy-section p:last-child {
    margin-bottom: 0;
}

.policy-section ul,
.policy-section ol {
    font-size: 0.93em;
    color: var(--color-text-body);
    line-height: 1.65;
    padding-left: 1.4em;
    margin-bottom: 12px;
}

.policy-section li {
    margin-bottom: 4px;
}

/* ── FAQ block ───────────────────────────── */

.faq-section {
    margin-top: 8px;
}

.faq-item {
    padding: 14px 0;
    border-bottom: 1px solid var(--color-border-light);
}

.faq-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.faq-item h3 {
    font-size: 0.95em;
    font-weight: 600;
    color: var(--color-brand-dark);
    margin-bottom: 6px;
    margin-top: 0;
    border-bottom: none;
}

.faq-item p {
    font-size: 0.9em;
    color: var(--color-text-body);
    line-height: 1.6;
    margin: 0;
}

@media (max-width: 768px) {
    .faq-item {
        padding: 12px 0;
    }

    .faq-item h3 {
        font-size: 0.9em;
    }
}

/* ── Page header (h1 + byline zone) ─────── */

.page-header {
    margin-bottom: 16px;
}

.page-header h1,
h1.page-title {
    text-align: left;
    font-size: 1.6em;
    font-weight: 700;
    color: var(--color-brand-dark);
    line-height: 1.25;
    margin-bottom: 6px;
}

@media (max-width: 768px) {
    .page-header h1,
    h1.page-title {
        font-size: 1.3em;
    }
}

@media (max-width: 480px) {
    .page-header h1,
    h1.page-title {
        font-size: clamp(0.95em, 4.5vw, 1.15em);
        overflow-wrap: break-word;
        word-break: break-word;
    }
}

/* ── Related links strip ─────────────────── */

.related-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--color-border-mid);
}

.related-links a {
    display: inline-block;
    font-size: 0.82em;
    font-weight: 500;
    color: var(--color-brand-dark);
    text-decoration: none;
    padding: 4px 10px;
    border: 1px solid var(--color-border-strong);
    border-radius: 4px;
    background: var(--color-bg-subtle);
    transition: background 0.15s, border-color 0.15s;
}

.related-links a:hover {
    background: var(--color-border-mid);
    border-color: var(--color-brand-mid);
}

/* ── Disclosure callout ──────────────────── */

.disclosure-callout {
    background: var(--color-warning-bg);
    border-left: 4px solid var(--color-warning-border);
    border-radius: 0 6px 6px 0;
    padding: 14px 18px;
    margin-bottom: 16px;
    font-size: 0.93em;
    line-height: 1.6;
    color: var(--color-text-body);
}

/* ── Raised page variant (PR, HFA pages) ── */

body.page-raised {
    background: white;
    padding: 0 20px 20px 20px;
    min-height: 100vh;
}

body.page-raised .container {
    background: white;
    border-radius: 10px;
    padding: 10px 20px 20px 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

/* A second raised container (e.g. editorial sections below the interactive table)
   sits as a cleanly separated card rather than touching the first. */
body.page-raised .container + .container {
    margin-top: 20px;
}

/* Full-width chrome (header + ticker) must span edge-to-edge, ignoring the
   page-raised body padding. Negative margins match that padding per breakpoint. */
body.page-raised .header,
body.page-raised .ticker-container {
    margin-left: -20px;
    margin-right: -20px;
    width: auto;
}

@media (max-width: 768px) {
    body.page-raised {
        padding: 0 10px 10px 10px;
    }
    body.page-raised .container {
        padding: 15px;
        box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    }
    body.page-raised .header,
    body.page-raised .ticker-container {
        margin-left: -10px;
        margin-right: -10px;
    }
}
