﻿/* ============================================================
   seasonality.css — /seasonality/{ticker}

   Loads after eventstudy.css and reuses .es-page, .es-head, .es-sub,
   .es-note, .es-empty, .es-chart and .es-chart-wrap so the three study
   tabs read as one family. Only the summary strip, the quarter table
   and the locked panel are new.
   ============================================================ */

.sn-block {
    margin: 0 0 2.5rem;
}

.sn-title {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--text);
    margin: 0 0 0.75rem;
}

/* ---------- headline strip ---------- */
.sn-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 2.5rem;
    margin: 0 0 1.25rem;
    padding: 1rem 1.25rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
}

.sn-stat {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.sn-stat-lbl {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.sn-stat-val {
    font-size: 1.75rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
    color: var(--text);
}

.sn-seasonal {
    color: var(--ew-gold, #DDB785);
}

.sn-base {
    color: var(--text-muted);
}

.sn-stat-note {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* direction colour rides alongside the sign, never alone */
.ss-up {
    color: var(--ew-green, #0F8A3B);
}

.ss-down {
    color: var(--ew-red, #e13232);
}

/* ---------- quarter table ----------
   Table chrome (.ss-table, .ss-num, .ss-baseline, .ss-thin, .ss-tag, .ss-best)
   comes from ew-sentimentstudy.css so the two study tabs match. Only the row
   selection and the colour swatch are new here. */
.sn-table {
    min-width: 46rem;
}

    .sn-table th[scope="row"] {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.15rem;
        width: 24%;
        min-width: 11rem;
        font-weight: 500;
        text-align: left;
    }

.sn-hint {
    display: block;
    font-size: 0.78rem;
    font-weight: 400;
    color: var(--text-muted);
}

/* selectable rows: clicking one isolates that quarter on the chart */
.sn-row {
    cursor: pointer;
    transition: background-color 120ms ease;
}

    .sn-row:hover {
        background: color-mix(in srgb, var(--ew-gold, #DDB785) 8%, transparent);
    }

    .sn-row:focus-visible {
        outline: 2px solid var(--ew-gold, #DDB785);
        outline-offset: -2px;
    }

    /* Selected state is a left rule plus weight, not colour alone, so it survives
       greyscale and forced-colours. */
    .sn-row.is-selected {
        background: color-mix(in srgb, var(--ew-gold, #DDB785) 14%, transparent);
        box-shadow: inset 3px 0 0 var(--ew-gold, #DDB785);
    }

        .sn-row.is-selected th,
        .sn-row.is-selected td {
            font-weight: 650;
        }

/* matches the line colour on the chart; JS fills the background */
.sn-swatch {
    display: inline-block;
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 3px;
    margin-bottom: 0.1rem;
    background: var(--text-muted);
}

@media (forced-colors: active) {
    .sn-row.is-selected {
        outline: 2px solid CanvasText;
    }
}

/* ---------- locked panel ----------
   Says what's behind the wall rather than just refusing. Someone who can't see
   the numbers should still learn what they'd get. */
.sn-locked {
    padding: 1.5rem 1.5rem 1.75rem;
    border: 1px dashed var(--border);
    border-radius: 12px;
    background: var(--surface-alt, var(--surface));
    text-align: center;
}

    .sn-locked p {
        margin: 0 auto 1rem;
        max-width: 56ch;
        color: var(--text-muted);
        font-size: 0.95rem;
        line-height: 1.6;
    }

.sn-cta {
    display: inline-block;
    padding: 0.55rem 1.4rem;
    border-radius: 8px;
    background: var(--ew-gold, #DDB785);
    color: #1b1b1b;
    font-weight: 700;
    text-decoration: none;
}

    .sn-cta:hover {
        filter: brightness(1.06);
    }

/* the chart containers need an explicit width: Lightweight Charts is told its
   pixel width at creation, and a zero-width container silently draws nothing */
#snChart,
#snCycleChart {
    width: 100%;
    min-height: 380px;
}

@media (max-width: 48rem) {
    .sn-summary {
        gap: 1rem 1.5rem;
    }

    .sn-stat-val {
        font-size: 1.4rem;
    }
}
