/* 
 ---------------------------------
 |   LAST UPDATED: 2026-04-13    |
 ---------------------------------
 */

/* VIEWPORT HEADNOTE: Standard boundaries 1024, 768–1023, ≤767. Charts use the same three-band policy as the rest of the theme. */

/* ========================================================================
   VIEWPORT-AGNOSTIC (base styles)
   ======================================================================== */
zenith-chart {
    display: block;
    width: 100%;
    margin: calc(2.25rem * var(--scale)) 0;
}

.post-content > zenith-chart {
    max-width: 100%;
}

zenith-chart table {
    width: 100%;
    margin: 0;
}

zenith-chart caption {
    caption-side: top;
    margin-bottom: calc(0.75rem * var(--scale));
    text-align: left;
    font-family: var(--ed);
    font-size: clamp(1.2rem, 1rem + 0.7vw, 1.5rem);
    line-height: 1.1;
}

.zenith-chart-shell {
    border: 1px solid var(--text-color-lower-opac);
    background: color-mix(in srgb, var(--background-color) 94%, var(--port) 6%);
    color: var(--text-color);
    padding: calc(1.25rem * var(--scale));
}

.zenith-chart-shell__header {
    margin-bottom: calc(1rem * var(--scale));
}

.zenith-chart-shell__eyebrow,
.zenith-chart-shell__title,
.zenith-chart-shell__dek,
.zenith-chart-shell__notes {
    margin: 0;
}

.zenith-chart-shell__eyebrow {
    margin-bottom: calc(0.5rem * var(--scale));
    font-family: var(--font3);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--port);
}

.zenith-chart-shell__title {
    font-family: var(--ed);
    font-size: clamp(1.4rem, 1.1rem + 1vw, 2rem);
    line-height: 1.08;
}

.zenith-chart-shell__dek {
    margin-top: calc(0.5rem * var(--scale));
    font-family: var(--et);
    font-size: 1rem;
    line-height: 1.4;
    color: var(--text-color);
}

.zenith-chart-shell__surface {
    border: 1px solid var(--text-color-lower-opac);
    background: var(--background-color);
    padding: calc(0.75rem * var(--scale));
}

.zenith-chart-shell__plot {
    width: 100%;
    min-height: 15rem;
}

.zenith-chart-shell__plot > svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}

.zenith-chart-shell__notes {
    margin-top: calc(0.85rem * var(--scale));
    font-family: var(--font3);
    font-size: 0.82rem;
    line-height: 1.45;
    color: var(--text-60-opac);
}

.zenith-chart-shell__summary[hidden] {
    display: none;
}

.zenith-chart__table--sr {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.zenith-chart-shell__plot :is(text, tspan) {
    fill: var(--text-color);
}

.zenith-chart-shell__plot .domain,
.zenith-chart-shell__plot .tick line {
    stroke: color-mix(in srgb, var(--text-color) 26%, transparent);
}

.zenith-chart-shell__plot .grid line {
    stroke: color-mix(in srgb, var(--port) 12%, transparent);
}

/* ========================================================================
   1. DESKTOP (1024px+; 1200px cap)
   ======================================================================== */
@media (min-width: 1024px) {
    zenith-chart {
        margin-top: calc(2.6rem * var(--scale));
        margin-bottom: calc(2.6rem * var(--scale));
    }

    .zenith-chart-shell {
        padding: calc(1.5rem * var(--scale));
    }

    .zenith-chart-shell__surface {
        padding: calc(1rem * var(--scale));
    }
}

@media (min-width: 1200px) {
    .post-content > zenith-chart {
        max-width: 48rem;
    }
}

/* ========================================================================
   2a. TABLET + MOBILE (≤1023px)
   ======================================================================== */
@media (max-width: 1023px) {
    zenith-chart {
        margin-top: 1.6rem;
        margin-bottom: 1.6rem;
    }

    .zenith-chart-shell {
        padding: 1rem;
    }

    .zenith-chart-shell__surface {
        padding: 0.65rem;
    }
}

/* ========================================================================
   2c. MOBILE (≤767px)
   ======================================================================== */
@media (max-width: 767px) {
    .zenith-chart-shell__title {
        font-size: clamp(1.2rem, 1.05rem + 0.9vw, 1.55rem);
    }

    .zenith-chart-shell__plot {
        min-height: 13rem;
    }
}
