﻿/* ============================================================
   bigpicture.css — The Big Picture (EW2027).
   Loads AFTER heatmap.css and only adds what the sector/industry map
   needs: the metric buttons, the signed window slider, and the extra
   rows in the tooltip. The treemap itself reuses the hm-* classes.
   ============================================================ */

/* ---- non-subscriber gate ---- */
.bp-locked {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    padding: 2.5rem 1.5rem;
    text-align: center;
}

    .bp-locked p {
        color: var(--text-muted);
        margin: 0 auto .9rem;
        max-width: 46ch;
        line-height: 1.5;
    }

.bp-upgrade {
    display: inline-block;
    padding: 9px 20px;
    border-radius: 8px;
    background: var(--ew-color, #DDB785);
    color: #23324a;
    font-weight: 700;
    text-decoration: none;
}

    .bp-upgrade:hover {
        filter: brightness(0.96);
    }

.bp-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px 22px;
    margin: 0 0 .9rem;
}

.bp-controls-lbl {
    font-size: .62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-muted);
    margin-right: 4px;
}

/* ---- metric buttons ---- */
.bp-metrics {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.bp-mbtn {
    padding: 6px 13px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    font-size: .8rem;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
}

    .bp-mbtn:hover {
        border-color: var(--ew-color, #DDB785);
        color: var(--text);
    }

    .bp-mbtn.is-active {
        background: var(--ew-color, #DDB785);
        border-color: var(--ew-color, #DDB785);
        color: #23324a;
    }

/* ---- signed window slider ----
   Left of center reads back over EPSOpenDate, right reads forward over
   NextEPSDate, so the midpoint is "today" and deserves a mark. */
.bp-window {
    display: flex;
    align-items: center;
    gap: 10px;
}

#bpDays {
    width: 240px;
    height: 20px;
    margin: 0;
    -webkit-appearance: none;
    appearance: none;
    background: none;
    cursor: pointer;
}

    #bpDays::-webkit-slider-runnable-track {
        height: 4px;
        border-radius: 2px;
        /* red-tinted past on the left, green-tinted future on the right */
        background: linear-gradient(90deg, color-mix(in srgb, var(--ew-red, #e13232) 45%, var(--border)) 0%, var(--border) 66.7%, color-mix(in srgb, var(--ew-green, #0F8A3B) 45%, var(--border)) 100%);
    }

    #bpDays::-moz-range-track {
        height: 4px;
        border-radius: 2px;
        background: linear-gradient(90deg, color-mix(in srgb, var(--ew-red, #e13232) 45%, var(--border)) 0%, var(--border) 66.7%, color-mix(in srgb, var(--ew-green, #0F8A3B) 45%, var(--border)) 100%);
    }

    #bpDays::-webkit-slider-thumb {
        -webkit-appearance: none;
        appearance: none;
        width: 15px;
        height: 15px;
        margin-top: -6px;
        border-radius: 50%;
        background: var(--surface);
        border: 2px solid var(--ew-color, #DDB785);
    }

    #bpDays::-moz-range-thumb {
        width: 15px;
        height: 15px;
        border-radius: 50%;
        background: var(--surface);
        border: 2px solid var(--ew-color, #DDB785);
    }

    #bpDays:focus-visible {
        outline: 2px solid var(--ew-color, #DDB785);
        outline-offset: 3px;
        border-radius: 4px;
    }

.bp-window-val {
    font-size: .78rem;
    font-weight: 700;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    min-width: 200px;
}

/* ---- tooltip additions ----
   .hm-tip supplies the frame; an industry has no logo, so the body runs full width
   and carries a small stats table the company tooltip doesn't need. */
.bp-tip {
    min-width: 210px;
}

    .bp-tip .hm-tip-body {
        width: 100%;
    }

    .bp-tip .hm-tip-co {
        max-width: none;
    }

.bp-tip-frac {
    font-weight: 400;
    color: var(--text-muted);
}

.bp-tip-stats {
    display: grid;
    grid-template-columns: auto auto;
    gap: 1px 10px;
    margin: 7px 0 0;
    padding: 7px 0 0;
    border-top: 1px solid var(--border);
    font-size: 11.5px;
}

    .bp-tip-stats dt {
        color: var(--text-muted);
        margin: 0;
    }

    .bp-tip-stats dd {
        margin: 0;
        text-align: right;
        font-weight: 700;
        font-variant-numeric: tabular-nums;
    }

@media (max-width: 720px) {
    /* ---- non-subscriber gate ---- */
    .bp-locked {
        border: 1px solid var(--border);
        border-radius: 12px;
        background: var(--surface);
        padding: 2.5rem 1.5rem;
        text-align: center;
    }

        .bp-locked p {
            color: var(--text-muted);
            margin: 0 auto .9rem;
            max-width: 46ch;
            line-height: 1.5;
        }

    .bp-upgrade {
        display: inline-block;
        padding: 9px 20px;
        border-radius: 8px;
        background: var(--ew-color, #DDB785);
        color: #23324a;
        font-weight: 700;
        text-decoration: none;
    }

        .bp-upgrade:hover {
            filter: brightness(0.96);
        }

    .bp-controls {
        gap: 10px;
    }

    #bpDays {
        width: 100%;
    }

    .bp-window {
        width: 100%;
    }

    .bp-window-val {
        min-width: 0;
    }
}
