﻿/* ============================================================
   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;
    }
}

/* ---- standing tagline ----
   Sits between the title and #bpSub. Separate from the latter because that one is
   rewritten by updateLegend() on every metric and window change; this one says what
   the page is for and never changes. */
.bp-tagline {
    margin: 2px 0 4px;
    font-size: .95rem;
    line-height: 1.4;
    color: var(--text);
}

/* ---- a locked metric ----
   Same shape as the other buttons so the row stays even, but muted and carrying a
   padlock. It is an <a> to the sign-up page rather than a disabled <button>: a
   disabled control tells a reader they cannot have it and offers nothing else. */
.bp-mbtn.is-locked {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
    color: var(--text-muted);
    border-style: dashed;
    opacity: 0.85;
}

    .bp-mbtn.is-locked:hover {
        opacity: 1;
        border-style: solid;
        border-color: var(--ew-color, #DDB785);
        color: var(--text);
    }

    .bp-mbtn.is-locked svg {
        flex: 0 0 auto;
        opacity: 0.8;
    }

/* Tiles are links now. The cursor is the only affordance a treemap can really carry
   without disturbing the colour, which is doing the actual work. */
.hm-tile.is-link {
    cursor: pointer;
}

    .hm-tile.is-link:focus-visible .hm-rect {
        stroke: var(--ew-gold, #DDB785);
        stroke-width: 2;
    }
