﻿/* calcharts.css — EW2027 earnings charts page (/calcharts).
   One session's roster of companies, each with a compact price chart.
   Shares the header language of calendar.css; the card grid is its own thing. */

.cc-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 8px 16px 60px;
}

/* ---------------- header ---------------- */
.cc-head {
    margin-bottom: 16px;
}

.cc-titlerow {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

    .cc-titlerow h1 {
        margin: 0;
    }

.cc-icon {
    width: 32px;
    height: 32px;
    flex: 0 0 auto;
    color: var(--ew-gold, #ddb785);
}

.cc-h2 {
    margin: 2px 0 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted, #5b6472);
}

/* BMO / AMC toggle — anchors, so they carry link semantics as well as tab looks */
.cc-viewtoggle {
    margin-left: auto;
    display: inline-flex;
    border: 1px solid var(--border, #d6dce6);
    border-radius: 8px;
    overflow: hidden;
}

.cc-vt-btn {
    padding: 7px 16px;
    background: var(--surface, #fff);
    color: var(--text-muted, #5b6472);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

    .cc-vt-btn + .cc-vt-btn {
        border-left: 1px solid var(--border, #d6dce6);
    }

    .cc-vt-btn:hover {
        color: var(--text, #050505);
    }

    .cc-vt-btn.is-active {
        background: var(--ew-gold, #ddb785);
        color: #050505;
    }

/* date / session nav */
.cc-navrow {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.cc-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);
    text-decoration: none;
    transition: border-color 0.15s ease, color 0.15s ease;
}

    .cc-nav:hover {
        border-color: var(--ew-gold, #ddb785);
        color: var(--ew-gold, #ddb785);
    }

.cc-datelabel {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text, #050505);
    min-width: 9ch;
    text-align: center;
}

.cc-altlink {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted, #5b6472);
    text-decoration: none;
    border-bottom: 1px solid transparent;
}

    .cc-altlink:hover {
        color: var(--ew-gold, #ddb785);
        border-bottom-color: var(--ew-gold, #ddb785);
    }

.cc-hidecb {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: var(--text-muted, #5b6472);
    cursor: pointer;
    user-select: none;
}

/* ---------------- composite logo banner ---------------- */
.cc-hero {
    margin: 14px 0 6px;
    text-align: center;
}

.cc-hero-img {
    display: block;
    width: 100%;
    max-width: 900px;
    height: auto;
    margin: 0 auto;
    /* the logo grid is a rendered composite, not a saveable asset */
    -webkit-user-drag: none;
    user-select: none;
    -webkit-touch-callout: none;
}

    /* no src yet (hydrating) or a failed load: hold the space, don't flash a
       broken-image glyph. The src is set by script, never by the server. */
    .cc-hero-img:not([src]) {
        min-height: 120px;
    }

/* ---------------- copy ---------------- */
.cc-lede {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text, #050505);
    margin: 10px 0 18px;
}

.cc-none {
    padding: 40px 0;
    text-align: center;
    color: var(--text-muted, #5b6472);
}

    .cc-none a {
        color: var(--ew-gold, #ddb785);
    }

.cc-note {
    margin-top: 26px;
    font-size: 0.78rem;
    color: var(--text-muted, #5b6472);
    text-align: center;
}

/* ---------------- subscriber gate ---------------- */
.cc-gate {
    max-width: 560px;
    margin: 40px auto 24px;
    padding: 32px 26px;
    border: 1px solid var(--border, #d6dce6);
    border-radius: 14px;
    background: var(--surface, #fff);
    text-align: center;
}

.cc-gate-icon {
    width: 40px;
    height: 40px;
    color: var(--ew-gold, #ddb785);
}

.cc-gate-title {
    margin: 10px 0 8px;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text, #050505);
}

.cc-gate-copy {
    margin: 0 auto 22px;
    max-width: 46ch;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-muted, #5b6472);
}

.cc-gate-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.cc-gate-btn {
    display: inline-flex;
    align-items: center;
    padding: 9px 22px;
    border: 1px solid var(--border, #d6dce6);
    border-radius: 8px;
    background: var(--surface, #fff);
    color: var(--text, #050505);
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    transition: border-color 0.15s ease, background 0.15s ease;
}

    .cc-gate-btn:hover {
        border-color: var(--ew-gold, #ddb785);
    }

.cc-gate-primary {
    background: var(--ew-gold, #ddb785);
    border-color: var(--ew-gold, #ddb785);
    color: #050505;
}

    .cc-gate-primary:hover {
        background: color-mix(in srgb, var(--ew-gold, #ddb785) 85%, #050505);
        border-color: color-mix(in srgb, var(--ew-gold, #ddb785) 85%, #050505);
    }

.cc-gate-alt {
    margin: 20px 0 0;
    font-size: 0.82rem;
    color: var(--text-muted, #5b6472);
}

    .cc-gate-alt a {
        color: var(--ew-gold, #ddb785);
    }

/* ---------------- card grid ---------------- */
/* Two per row, always. auto-fill would give four columns at 1400px and the charts
   were too small to read a candle at that width. */
.cc-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.cc-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border, #d6dce6);
    border-radius: 12px;
    background: var(--surface, #fff);
    overflow: hidden;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

    .cc-card:hover {
        border-color: var(--ew-gold, #ddb785);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    }

    /* the toggle hides these; a hidden card never gets a chart built */
    .cc-card.is-hidden {
        display: none;
    }

.cc-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid var(--border, #d6dce6);
}

.cc-logo {
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #fff;
    border: 1px solid var(--border, #d6dce6);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.cc-id {
    display: flex;
    flex-direction: column;
    min-width: 0; /* lets the name ellipsis instead of stretching the card */
}

.cc-ticker {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    color: var(--text, #050505);
    line-height: 1.2;
}

.cc-name {
    font-size: 0.78rem;
    color: var(--text-muted, #5b6472);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cc-badge {
    margin-left: auto;
    flex: 0 0 auto;
    padding: 2px 8px;
    border: 1px solid var(--border, #d6dce6);
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted, #5b6472);
}

/* Fixed height: EWMiniChart uses autoSize, so the container has to be measurable
   before the chart mounts or Lightweight Charts renders at zero height. */
.cc-chart {
    position: relative;
    height: 320px;
}

.cc-chart-ph {
    position: absolute;
    inset: 10px;
    border-radius: 8px;
    background: color-mix(in srgb, var(--text-muted, #5b6472) 7%, transparent);
}

/* ---------------- overflow chips ---------------- */
.cc-more {
    margin-top: 34px;
    padding-top: 22px;
    border-top: 1px solid var(--border, #d6dce6);
}

.cc-more-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text, #050505);
    margin: 0 0 4px;
}

.cc-more-sub {
    font-size: 0.85rem;
    color: var(--text-muted, #5b6472);
    margin: 0 0 14px;
}

.cc-chiplist {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.cc-chip {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    padding: 5px 12px;
    border: 1px solid var(--border, #d6dce6);
    border-radius: 999px;
    text-decoration: none;
    transition: border-color 0.15s ease;
}

    .cc-chip:hover {
        border-color: var(--ew-gold, #ddb785);
    }

.cc-chip-ticker {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text, #050505);
}

.cc-chip-name {
    font-size: 0.75rem;
    color: var(--text-muted, #5b6472);
    max-width: 16ch;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* unconfirmed reads quieter everywhere it appears */
.cc-card.is-unconfirmed .cc-logo,
.cc-chip.is-unconfirmed .cc-chip-ticker {
    opacity: 0.7;
}

.cc-chip.is-unconfirmed {
    border-style: dashed;
}

/* ---------------- crawlable date trail ---------------- */
.cc-nearby {
    margin-top: 34px;
    padding-top: 16px;
    border-top: 1px solid var(--border, #d6dce6);
}

.cc-nearby-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    justify-content: center;
    list-style: none;
    margin: 0;
    padding: 0;
}

    .cc-nearby-list a {
        font-size: 0.8rem;
        color: var(--text-muted, #5b6472);
        text-decoration: none;
    }

        .cc-nearby-list a:hover {
            color: var(--ew-gold, #ddb785);
        }

/* ---------------- focus + motion ---------------- */
.cc-vt-btn:focus-visible,
.cc-nav:focus-visible,
.cc-card-head:focus-visible,
.cc-chip:focus-visible,
.cc-gate-btn:focus-visible,
.cc-altlink:focus-visible {
    outline: 2px solid var(--ew-gold, #ddb785);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .cc-card,
    .cc-nav,
    .cc-chip,
    .cc-vt-btn {
        transition: none;
    }
}

/* ---------------- narrow screens ---------------- */

/* Tablet: still two up, but the columns are half as wide, so the chart comes down
   with them rather than turning into a tall square. */
@media (max-width: 980px) {
    .cc-grid {
        gap: 16px;
    }

    .cc-chart {
        height: 240px;
    }
}

@media (max-width: 700px) {
    .cc-page {
        padding: 8px 12px 48px;
    }

    .cc-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .cc-chart {
        height: 220px;
    }

    .cc-viewtoggle {
        margin-left: 0;
    }

    .cc-hidecb {
        margin-left: 0;
        width: 100%;
    }

    .cc-titlerow h1 {
        font-size: 1.35rem;
    }
}
