/*
 * LEAD Data Story — Shared Stylesheet
 * Requires Bootstrap 5
 *
 * Brand colors are exposed as CSS custom properties for use in HTML.
 * The matching JS constants (N, T, AG, etc.) in lead-datastory.js
 * must stay in sync with these values.
 */

/* ── Brand tokens ─────────────────────────────────────────────────── */
:root {
    --navy:    #003b73;
    --teal:    #00a6a6;
    --comblue: #1f77b4;  /* used for comparison table header */
    --slate:   #2f3a45;
    --agray:   #6b7280;
    --lgbg:    #eef2f6;
    --lineg:   #d9dee5;
    --gold:    #f2b84b;
    --decline: #c44536;
    --link:    #005ea8;
}

/* ── Base overrides (beyond Bootstrap reboot) ─────────────────────── */
html {
    scroll-behavior: smooth;
}
body {
    font-family: Aptos, Calibri, sans-serif;
    font-size: 1.05rem;
    line-height: 1.72;
    color: var(--slate);
    background-color: var(--lgbg);
}
h1,
h2,
h3 {
    font-family: "Aptos Display", Calibri, sans-serif;
    font-weight: 700;
    color: var(--navy);
}
a {
    color: var(--link);
}
a:focus,
button:focus {
    outline: 3px solid var(--teal);
    outline-offset: 2px;
}
#header {
    top: 0;
    z-index: 1;
    background: #092940;
    transition: all 0.5s;
    z-index: 997;
    height: 70px;
}
#header.header-scrolled {
    box-shadow: 0px 2px 15px rgba(0, 0, 0, 0.1);
}

#header .logo {
    font-size: 30px;
    margin: 0;
    padding: 0;
    line-height: 1;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

#header .logo a {
    color: #fff;
}

#header .logo img {
    max-height: 40px;
}

.hover-link:hover {
    color: #217991 !important;
    transition: color 0.3s ease;
}

#footer {
    background: #092940;
    color: #fff;
    font-size: 14px;
    text-align: center;
    padding: 10px 0;
}

#footer a {
    color: #fff
}

/* ── Accessibility ────────────────────────────────────────────────── */
.skip-link {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
    z-index: 100;
    background: var(--teal);
    color: #fff;
    padding: 8px 16px;
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    border-radius: 0 0 4px 0;
}
.skip-link:focus {
    left: 0;
    width: auto;
    height: auto;
}

/* ── Story layout ─────────────────────────────────────────────────── */
.story {
    max-width: 960px;
    padding: 36px 20px 48px;
    background-color: #fff;
    box-shadow: none;
}
.story p {
    margin-bottom: 1.15rem;
}
.story h1 {
    font-weight: 800;
    font-size: 3rem;
    line-height: 1.2;
    margin: 0 0 20px;
    position: relative;
    padding-left: 30px;
}
.story h1::before {
    content: '';
    position: absolute;
    left: 0;
    top: 17px;
    width: 0;
    height: 0;
    border-top: 13px solid transparent;
    border-bottom: 13px solid transparent;
    border-left: 17px solid var(--teal);
}

/* ── Typography components ────────────────────────────────────────── */
.byline {
    color: var(--agray);
    font-size: 0.86rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.2rem;
    border-bottom: 3px solid var(--navy);
}
.teaser {
    font-size: 1.05rem;
    color: var(--slate);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}
.overline {
    font-family: "Aptos Display", Calibri, sans-serif;
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--comblue);
    text-transform: uppercase;
    letter-spacing: 2.5px;
    margin-bottom: 6px;
}
.section-head {
    margin-top: 2.5rem;
    margin-bottom: 0.8rem;
}
.section-head h2 {
    font-size: 1.75rem;
    line-height: 1.3;
    margin: 0;
}
.section-divider {
    border: none;
    width: 48px;
    height: 3px;
    margin: 48px 0 40px;
    background: var(--teal);
    border-radius: 2px;
}
.back-top {
    display: inline-block;
    font-size: 0.78rem;
    color: var(--agray);
    text-decoration: none;
    margin-top: 12px;
    font-family: "Aptos Display", Calibri, sans-serif;
    letter-spacing: 0.5px;
}
.back-top:hover {
    color: var(--teal);
}
.src-lead {
    display: block;
    font-weight: 600;
    color: var(--slate);
    margin-bottom: 3px;
}

/* ── At a glance strip ────────────────────────────────────────────── */
.at-a-glance {
    background: var(--lgbg);
    border-radius: 8px;
    padding: 24px 28px 28px;
    margin: 1.75rem 0;
}
.aag-label {
    font-family: "Aptos Display", Calibri, sans-serif;
    font-weight: 700;
    font-size: 1rem;
    color: var(--comblue);
    text-transform: uppercase;
    letter-spacing: 2.5px;
    margin-bottom: 20px;
}
.aag-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 20px;
}
.aag-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-left: 3px solid var(--teal);
    padding-left: 14px;
}
.aag-num {
    font-family: "Aptos Display", Calibri, sans-serif;
    font-weight: 800;
    font-size: 2.2rem;
    color: var(--teal);
    line-height: 1;
}
.aag-desc {
    font-size: 1rem;
    color: var(--slate);
    font-weight: 600;
    line-height: 1.35;
}
.aag-bullets {
    margin: 0;
    padding-left: 20px;
    font-size: 1.2rem;
    color: var(--slate);
    line-height: 1.7;
    border-top: 1px solid var(--lineg);
    padding-top: 16px;
}
.aag-bullets li + li {
    margin-top: 4px;
}
.aag-inner {
    display: flex;
    gap: 32px;
    align-items: flex-start;
}
.aag-inner .aag-stats {
    grid-template-columns: 1fr;
    flex-shrink: 0;
    margin-bottom: 0;
    min-width: 200px;
}
.aag-inner .aag-bullets {
    border-top: none;
    border-left: 1px solid var(--lineg);
    padding-top: 0;
    padding-left: 28px;
    margin: 0;
}

/* ── Key findings box ─────────────────────────────────────────────── */
.key-findings {
    background: var(--navy);
    border-radius: 8px;
    padding: 24px 28px;
    margin: 2rem 0;
    box-shadow: 0 2px 16px rgba(0, 59, 115, 0.15);
}
.key-findings .kf-label {
    font-family: "Aptos Display", Calibri, sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    margin-bottom: 6px;
}
/* Shared layout for both linked (<a>) and non-linked (<div>) rows */
.key-findings a,
.kf-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    align-items: flex-start;
    text-decoration: none;
    color: #fff;
}
.key-findings a:last-child,
.kf-row:last-child {
    margin-bottom: 0;
}
.key-findings .kf-text a {
    display: inline;
    margin-bottom: 0;
    gap: 0;
}
.key-findings .kf-num {
    font-family: "Aptos Display", Calibri, sans-serif;
    font-weight: 800;
    font-size: 1.2rem;
    color: #00a6a6;
    line-height: 1.4;
    flex-shrink: 0;
}
.key-findings .kf-text {
    font-family: "Aptos Display", Calibri, sans-serif;
    font-weight: 400;
    font-size: 1.05rem;
    color: #fff;
    line-height: 1.5;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}
/* kf-text inside a full-row link gets underline treatment */
.key-findings a .kf-text {
    border-bottom: none;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: rgba(255, 255, 255, 0.4);
}
a.kf-link {
    color: #00a6a6;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ── Section navigation ───────────────────────────────────────────── */
.sec-nav {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 1.5rem 0;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--lineg);
}
.sec-nav-label {
    font-family: "Aptos Display", Calibri, sans-serif;
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--comblue);
    text-transform: uppercase;
    letter-spacing: 2.5px;
}
.kf-pills {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}
.kf-pill {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 10px 14px;
    border: 1px solid var(--lineg);
    border-radius: 6px;
    text-decoration: none;
    transition: border-color 0.15s, background 0.15s;
}
.kf-pill:hover,
.kf-pill:focus {
    border-color: var(--teal);
    background: var(--lgbg);
    outline: none;
}
.kf-pill-label {
    font-family: "Aptos Display", Calibri, sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--comblue);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}
.kf-pill-teaser {
    font-family: "Aptos Display", Calibri, sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--navy);
    line-height: 1.3;
}

/* ── Segmented bar ────────────────────────────────────────────────── */
.seg-label {
    font-family: "Aptos Display", Calibri, sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--slate);
    margin-bottom: 8px;
}
.seg-bar {
    width: 90%;
    height: 40px;
    border-radius: 6px;
    display: flex;
    overflow: visible;
}
.seg-bar div {
    display: flex;
    align-items: center;
    justify-content: center;
}
.seg-bar span {
    font-family: "Aptos Display", Calibri, sans-serif;
    font-weight: 700;
    white-space: nowrap;
}
.seg-legend {
    display: flex;
    gap: 16px;
    margin-top: 8px;
    flex-wrap: wrap;
}
.seg-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
}
.seg-legend-item .dot {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    flex-shrink: 0;
}
.seg-legend-item span:last-child {
    font-family: "Aptos Display", Calibri, sans-serif;
    font-weight: 600;
    font-size: 0.82rem;
}
.seg-sq {
    font-size: 0.78rem;
    font-style: italic;
    color: var(--agray);
    margin-top: 8px;
    line-height: 1.4;
}

/* ── Stat card ────────────────────────────────────────────────────── */
.stat-card {
    background: #fff;
    border-left: 5px solid var(--teal);
    padding: 22px 24px;
    border-radius: 0 8px 8px 0;
    box-shadow: 0 2px 12px rgba(0, 59, 115, 0.08);
    margin: 1rem 0;
}
.stat-card .sc-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
}
.stat-card .sc-num {
    font-family: "Aptos Display", Calibri, sans-serif;
    font-weight: 800;
    font-size: 2.8rem;
    color: #00a6a6;
    line-height: 1;
}
.stat-card .sc-label {
    font-size: 0.95rem;
    color: var(--slate);
    line-height: 1.3;
    font-weight: 600;
}
.stat-card .sc-compare {
    font-family: "Aptos Display", Calibri, sans-serif;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--agray);
    margin-top: 6px;
}
.stat-card .sc-q {
    font-size: 0.75rem;
    font-style: italic;
    color: var(--agray);
    margin-top: 8px;
    line-height: 1.3;
}

/* ── Chart container ──────────────────────────────────────────────── */
.chart-wrap {
    margin: 2rem 0;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 16px rgba(0, 59, 115, 0.1);
    overflow: visible;
}
.chart-title-bar {
    padding: 16px 20px 14px 40px;
    background: var(--navy);
    position: relative;
    border-radius: 8px 8px 0 0;
}
.chart-title-bar .tri {
    position: absolute;
    left: 14px;
    top: 20px;
    width: 0;
    height: 0;
    border-top: 9px solid transparent;
    border-bottom: 9px solid transparent;
    border-left: 12px solid #00a6a6;
}
.chart-title-bar .ct {
    font-family: "Aptos Display", Calibri, sans-serif;
    font-weight: 700;
    font-size: 1.2rem;
    color: #fff;
    line-height: 1.35;
}
.chart-title-bar .cs {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.75);
    margin-top: 4px;
    line-height: 1.4;
}
.chart-area {
    padding: 16px 12px 8px;
    min-height: 100px;
}
.chart-source {
    font-size: 0.75rem;
    color: var(--agray);
    padding: 10px 20px 12px;
    border-top: 1px solid var(--lgbg);
    line-height: 1;
}
.chart-source .sq {
    display: block;
    margin-top: 4px;
    font-style: italic;
}
.chart-source-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 20px 12px;
    border-top: 1px solid var(--lgbg);
    font-size: 0.75rem;
    color: var(--agray);
    line-height: 1.3;
}
.chart-source-row .src-text {
    flex: 1;
}
.chart-source-row .src-text .sq {
    display: block;
    margin-top: 4px;
    font-style: italic;
}
.chart-dl {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    color: var(--agray);
    text-decoration: none;
    cursor: pointer;
    padding: 4px 10px;
    border: 1px solid var(--lineg);
    border-radius: 4px;
    background: #fff;
    font-family: "Aptos Display", Calibri, sans-serif;
    margin-left: 8px;
    transition: all 0.2s;
}
.chart-dl:hover {
    color: var(--navy);
    border-color: var(--teal);
}
.chart-dl svg {
    width: 12px;
    height: 12px;
    fill: currentColor;
}

/* ── VS comparison panel ──────────────────────────────────────────── */
.vs-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1.5rem 0;
    background: #fff;
    border-radius: 8px;
    padding: 28px 20px;
    box-shadow: 0 2px 16px rgba(0, 59, 115, 0.1);
    flex-wrap: wrap;
}
.vs-side {
    flex: 1 1 200px;
    text-align: center;
    padding: 8px 16px;
}
.vs-num {
    font-family: "Aptos Display", Calibri, sans-serif;
    font-weight: 800;
    font-size: 3.2rem;
    line-height: 1;
}
.vs-label {
    font-family: "Aptos Display", Calibri, sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--slate);
    margin-top: 8px;
}
.vs-compare {
    font-family: "Aptos Display", Calibri, sans-serif;
    font-size: 0.75rem;
    color: var(--agray);
    margin-top: 4px;
}
.vs-divider {
    font-family: "Aptos Display", Calibri, sans-serif;
    font-weight: 800;
    font-size: 1.4rem;
    color: var(--agray);
    padding: 0 12px;
}

/* ── Comparison table ─────────────────────────────────────────────── */
.cmp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.cmp-table thead th {
    background: var(--comblue);
    color: #fff;
    padding: 10px 14px;
    font-family: "Aptos Display", Calibri, sans-serif;
    font-weight: 600;
    font-size: 0.83rem;
}
.cmp-table tbody td {
    padding: 10px 14px;
}
.cmp-table tbody tr:nth-child(odd) {
    background: #fff;
}
.cmp-table tbody tr:nth-child(even) {
    background: var(--lgbg);
}

/* ── Callout & CTA blocks ─────────────────────────────────────────── */
.callout-amber {
    background: #fef6e6;
    border-left: 4px solid var(--gold);
    border-radius: 6px;
    padding: 20px 22px;
    margin: 28px 0;
    font-size: 0.92rem;
    line-height: 1.6;
    color: var(--slate);
}
.callout-amber .cl-label {
    font-family: "Aptos Display", Calibri, sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
    color: #7a5800;
}
.cta-block {
    background: #fff;
    border-left: 5px solid var(--teal);
    padding: 24px 28px;
    margin: 2rem 0;
    border-radius: 0 8px 8px 0;
    box-shadow: 0 2px 12px rgba(0, 59, 115, 0.08);
}
.cta-block h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--navy);
}

/* ── Responsive overrides ─────────────────────────────────────────── */
@media (max-width: 576px) {
    .story h1 {
        font-size: 1.55rem;
        padding-left: 22px;
    }
    .story h1::before {
        top: 10px;
        border-top: 9px solid transparent;
        border-bottom: 9px solid transparent;
        border-left: 12px solid var(--teal);
    }
    .stat-card .sc-num {
        font-size: 1.8rem;
    }
    .vs-num {
        font-size: 2.2rem;
    }
    .aag-stats {
        grid-template-columns: 1fr;
    }
    .aag-inner {
        flex-direction: column;
    }
    .aag-inner .aag-stats {
        min-width: 0;
        width: 100%;
    }
    .aag-inner .aag-bullets {
        border-left: none;
        border-top: 1px solid var(--lineg);
        padding-left: 20px;
        padding-top: 16px;
        width: 100%;
    }
    .kf-pills {
        grid-template-columns: 1fr;
    }
}
