﻿/* calendar.css — EW2027 earnings calendar page. */

.cal-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 8px 16px 60px;
}

/* ---- header ---- */
.cal-head {
    margin-bottom: 16px;
}

.cal-titlerow {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

    .cal-titlerow h1 {
        margin: 0;
    }

.cal-icon {
    width: 32px;
    height: 32px;
    flex: 0 0 auto;
    color: var(--ew-gold, #ddb785);
}

/* view toggle */
.cal-viewtoggle {
    margin-left: auto;
    display: inline-flex;
    border: 1px solid var(--border, #d6dce6);
    border-radius: 8px;
    overflow: hidden;
}

.cal-vt-btn {
    padding: 7px 16px;
    border: 0;
    background: var(--surface, #fff);
    color: var(--text-muted, #5b6472);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

    .cal-vt-btn + .cal-vt-btn {
        border-left: 1px solid var(--border, #d6dce6);
    }

    .cal-vt-btn.is-active {
        background: var(--ew-gold, #ddb785);
        color: #050505;
    }

/* date nav */
.cal-navrow {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.cal-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--border, #d6dce6);
    border-radius: 8px;
    background: var(--surface, #fff);
    color: var(--text, #050505);
    cursor: pointer;
}

    .cal-nav:hover {
        border-color: var(--ew-gold, #ddb785);
        color: var(--ew-gold, #ddb785);
    }

    .cal-nav:disabled {
        opacity: 0.35;
        cursor: default;
        pointer-events: none;
    }

.cal-datelabel {
    min-width: 260px;
    text-align: center;
    padding: 7px 14px;
    border: 1px solid var(--border, #d6dce6);
    border-radius: 8px;
    background: var(--surface, #fff);
    color: var(--text, #050505);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
}

    .cal-datelabel:hover {
        border-color: var(--ew-gold, #ddb785);
    }

.cal-hidecb {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    font-size: 0.82rem;
    color: var(--text-muted, #5b6472);
    cursor: pointer;
}

/* ---- body / sections ---- */
.cal-loading, .cal-none {
    padding: 30px 0;
    text-align: center;
    color: var(--text-muted, #5b6472);
}

.cal-section {
    margin: 22px 0;
}

.cal-sectitle {
    margin: 0 0 10px;
    font-size: 1.05rem;
    color: var(--text, #050505);
    padding-bottom: 6px;
    border-bottom: 2px solid var(--ew-gold, #ddb785);
    display: inline-block;
}

.cal-pos {
    color: var(--positive, #0f8a3b);
}

.cal-neg {
    color: var(--negative, #c62828);
}

.cal-na {
    color: var(--text-muted, #9aa4b2);
}

.cal-logo {
    display: inline-block;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--surface-alt, #f3f5f9) center/contain no-repeat;
    border: 1px solid var(--border, #d6dce6);
}

.cal-confirm.is-confirmed {
    color: var(--positive, #0f8a3b);
}

.cal-confirm.is-unconfirmed {
    color: var(--ew-gold, #ddb785);
}

.cal-lock {
    color: var(--text-muted, #9aa4b2);
}

.cal-hidden {
    display: none !important;
}

/* locked subscriber group (free users): centered lock over blurred text */
.cal-lockwrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.cal-lockblur {
    display: flex;
    gap: 24px;
    justify-content: center;
    width: 100%;
    filter: blur(4px);
    opacity: 0.5;
    user-select: none;
}

.cal-blurcell {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-muted, #5b6472);
}

.cal-lockover {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* expectations input (pills modeled on the stocks page) */
.cal-exp {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-top: 1px solid var(--border, #eef1f6);
    padding-top: 8px;
}

.cal-exp-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted, #5b6472);
}

.cal-exp-cols {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: center;
}

.cal-exp-col {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
}

.cal-exp-label {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted, #5b6472);
}

.cal-pill-row {
    display: inline-flex;
    border: 1px solid var(--border, #d6dce6);
    border-radius: 7px;
    overflow: hidden;
}

.cal-pill {
    padding: 4px 12px;
    border: 0;
    background: var(--surface, #fff);
    color: var(--text-muted, #5b6472);
    font-size: 0.76rem;
    font-weight: 600;
    cursor: pointer;
}

    .cal-pill + .cal-pill {
        border-left: 1px solid var(--border, #d6dce6);
    }

    .cal-pill:hover {
        color: var(--ew-gold, #ddb785);
    }

    .cal-pill.is-active {
        background: var(--ew-gold, #ddb785);
        color: #050505;
    }

.cal-exp-hint {
    font-size: 0.64rem;
    color: var(--text-muted, #5b6472);
    text-align: center;
}

.cal-exp-reveal {
    display: flex;
    gap: 14px;
    justify-content: center;
    border-top: 1px solid var(--border, #eef1f6);
    padding-top: 8px;
}

.cal-vol-item {
    text-align: center;
}

.cal-vol-value {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text, #050505);
}

.cal-vol-label {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted, #5b6472);
}

/* compact variant for the list-view cell */
.cal-exp-compact {
    border-top: 0;
    padding-top: 0;
    gap: 5px;
}

    .cal-exp-compact .cal-exp-cols {
        gap: 8px;
    }

    .cal-exp-compact .cal-pill {
        padding: 3px 8px;
        font-size: 0.7rem;
    }

    .cal-exp-compact .cal-exp-reveal {
        border-top: 0;
        padding-top: 4px;
        gap: 10px;
    }

.cal-expbtn {
    padding: 4px 12px;
    border: 1px solid var(--ew-gold, #ddb785);
    border-radius: 6px;
    background: transparent;
    color: var(--ew-gold, #ddb785);
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}

    .cal-expbtn:hover {
        background: var(--ew-gold, #ddb785);
        color: #050505;
    }

/* ================= LIST (table) VIEW ================= */
.cal-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.cal-th {
    text-align: right;
    padding: 8px 10px;
    color: var(--text-muted, #5b6472);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
    border-bottom: 1px solid var(--border, #d6dce6);
}

.cal-th-logo, .cal-th-ticker, .cal-th-company, .cal-th-time {
    text-align: left;
}

.cal-sortable {
    cursor: pointer;
    user-select: none;
}

    .cal-sortable:hover {
        color: var(--ew-gold, #ddb785);
    }

.cal-sort-asc::after {
    content: ' \25B2';
    font-size: 0.7em;
}

.cal-sort-desc::after {
    content: ' \25BC';
    font-size: 0.7em;
}

.cal-row {
    cursor: pointer;
    border-bottom: 1px solid var(--border, #eef1f6);
}
    /* lightly shade every other VISIBLE row (class applied in JS so hide-unconfirmed
   doesn't leave gaps in the striping) */
    .cal-row.cal-stripe {
        background: var(--surface-alt, #f7f8fb);
    }

/* Dark mode only: use a deep blue-gray stripe instead of --surface-alt.
       Mirrors the site's two-trigger dark mode (manual [data-theme="dark"]
       OR system dark unless overridden to light). Light mode keeps the stripe above. */
:root[data-theme="dark"] .cal-row.cal-stripe {
    background: #181820;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .cal-row.cal-stripe {
        background: #181820;
    }
}

.cal-row:hover {
    background: var(--border, #eef1f6);
}

/* Dark mode: a dedicated hover shade that's clearly lighter than BOTH the base
       surface and the #181820 stripe, so every row (striped or not) visibly lifts on
       hover. Scoped to match the stripe override's specificity so it always wins. */
:root[data-theme="dark"] .cal-row:hover,
:root[data-theme="dark"] .cal-row.cal-stripe:hover {
    background: #2a2a36;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .cal-row:hover,
    :root:not([data-theme="light"]) .cal-row.cal-stripe:hover {
        background: #2a2a36;
    }
}

/* volatility super-header (top row of the two-row thead) */
.cal-grouphdr .cal-th {
    border-bottom: 0;
    padding-bottom: 2px;
}

.cal-groupth {
    text-align: center;
    color: var(--text, #050505);
    font-weight: 700;
    border-bottom: 1px solid var(--border, #d6dce6) !important;
}

.cal-row td {
    padding: 7px 10px;
    text-align: right;
    white-space: nowrap;
}

.cal-td-logo {
    width: 34px;
}

.cal-td-ticker {
    text-align: left;
    font-weight: 700;
}

    .cal-td-ticker svg {
        margin-left: 5px;
        vertical-align: -1px;
    }

.cal-row td.cal-td-company {
    text-align: left;
    color: var(--text-muted, #5b6472);
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cal-row td.cal-td-time {
    text-align: left;
}

.cal-row td.cal-td-ticker {
    text-align: left;
}

.cal-row td.cal-td-logo {
    text-align: left;
}

.cal-td-lock, .cal-td-gauge {
    text-align: center;
}

.cal-td-guide {
    text-align: center;
}

.cal-guide {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cal-guide-up {
    color: var(--positive, #0f8a3b);
}

.cal-guide-down {
    color: var(--negative, #c62828);
}

.cal-guide-flat {
    color: var(--ew-gold, #ddb785);
}

.cal-td-gauge .cal-minigauge {
    display: inline-flex;
}

.cal-expcell {
    text-align: center;
}

.cal-unconfirmed .cal-td-ticker {
    color: var(--text-muted, #7a8494);
}

/* ================= DETAIL (bigger, mobile) VIEW ================= */
.cal-detaillist {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

@media (min-width: 760px) {
    .cal-detaillist {
        grid-template-columns: repeat(2, 1fr);
    }
}

.cal-detail {
    background: var(--surface, #fff);
    border: 1px solid var(--border, #d6dce6);
    border-radius: 12px;
    padding: 14px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

    .cal-detail:hover {
        border-color: var(--ew-gold, #ddb785);
    }

.cal-dhead {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cal-logo-lg {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
}

.cal-dnames {
    flex: 1 1 auto;
    min-width: 0;
}

.cal-dticker {
    font-weight: 700;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.cal-dcompany {
    font-size: 0.78rem;
    color: var(--text-muted, #5b6472);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cal-dtime {
    flex: 0 0 auto;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted, #5b6472);
}

.cal-dgrid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    border-top: 1px solid var(--border, #eef1f6);
    padding-top: 8px;
}

.cal-dstat {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.cal-dlabel {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted, #5b6472);
}

.cal-dval {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text, #050505);
}

.cal-minigauge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

    .cal-minigauge svg {
        display: block;
    }

.cal-dlockrow {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    border-top: 1px solid var(--border, #eef1f6);
    padding-top: 8px;
    text-align: center;
}

.cal-dlocktext {
    font-size: 0.78rem;
    color: var(--text-muted, #5b6472);
}

/* ================= SERVER-RENDERED ROSTER =================
   Present in the initial HTML for crawlers and no-JS clients. The client script
   replaces #calBody once /api/caldata returns, so this is normally on screen only
   for a moment. Keep it presentable anyway — it's what a slow connection sees. */
.cal-ssr-lede {
    font-size: 0.95rem;
    color: var(--text-muted, #5b6472);
    margin: 0 0 18px;
}

.cal-ssr .cal-section {
    margin: 18px 0 26px;
}

.cal-ssr-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 2px 18px;
}

.cal-ssr-item {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 5px 0;
    border-bottom: 1px solid var(--border, #eef1f6);
    font-size: 0.86rem;
}

    .cal-ssr-item a {
        display: flex;
        align-items: baseline;
        gap: 8px;
        min-width: 0;
        color: inherit;
        text-decoration: none;
    }

        .cal-ssr-item a:hover .cal-ssr-ticker {
            color: var(--ew-gold, #ddb785);
        }

.cal-ssr-ticker {
    flex: 0 0 auto;
    font-weight: 700;
    color: var(--text, #050505);
}

.cal-ssr-company {
    color: var(--text-muted, #5b6472);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cal-ssr-unconf {
    flex: 0 0 auto;
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--ew-gold, #ddb785);
}

/* the date under the H1 */
.cal-h2 {
    margin: 2px 0 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted, #5b6472);
}

/* ================= CRAWLABLE DATE TRAIL =================
   The prev/next controls in the header are buttons driven by the client script,
   so they leave no link for a crawler to follow. These anchors are the crawl
   path into every dated calendar URL. */
.cal-nearby {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px 14px;
    margin: 34px 0 0;
    padding-top: 18px;
    border-top: 1px solid var(--border, #eef1f6);
    font-size: 0.8rem;
}

.cal-nearby-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 12px;
    margin: 0;
    padding: 0;
}

.cal-nearby a {
    color: var(--text-muted, #5b6472);
    text-decoration: none;
    white-space: nowrap;
}

    .cal-nearby a:hover {
        color: var(--ew-gold, #ddb785);
        text-decoration: underline;
    }

.cal-nearby-arrow {
    font-weight: 600;
}
