﻿/* ============================================================
   heatmap.css — Sector price heat map (EW2027).
   Nested squarified treemap. Uses ew-theme.css tokens.
   ============================================================ */

.hm-page {
    max-width: 100%;
    margin: 0 auto;
    padding: 1.5rem 1.5rem 4rem;
}

.hm-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    text-align: left;
    margin-bottom: 1.25rem;
}

.hm-head-text {
    min-width: 0;
}

.hm-tools {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
}

    /* share bar hidden until a share link is generated */
    .hm-tools .share-bar {
        display: none;
        align-items: center;
        gap: 6px;
    }

        .hm-tools .share-bar.is-visible {
            display: flex;
        }

.hm-head-title {
    font-size: clamp(1.6rem, 3.4vw, 2.3rem);
    font-weight: 800;
    color: var(--text);
    margin: 0 0 .25rem;
}

.hm-head-sub {
    font-size: .95rem;
    color: var(--text-muted);
    margin: 0;
}

/* ---- Heat map host ---- */
.hm-host {
    position: relative;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    background: #1c1c1c; /* dark background in both light and dark mode */
    border: 1px solid var(--border);
}

.hm-svg {
    display: block;
}

.hm-loading,
.hm-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 4rem 1rem;
    font-size: 1rem;
}

/* ---- SVG elements ---- */
.hm-sector-label {
    font-family: inherit;
    font-weight: 800;
    letter-spacing: .3px;
    pointer-events: none;
}

.hm-ticker,
.hm-pct {
    font-family: inherit;
    pointer-events: none;
}

.hm-rect {
    transition: fill-opacity 120ms ease;
}

.hm-tile:hover .hm-rect {
    fill-opacity: 0.82;
}

/* ---- Tooltip ---- */
.hm-tip {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface, #fff);
    color: var(--text, #222);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    box-shadow: 0 6px 20px -8px rgba(0, 0, 0, 0.5);
    font-size: 13px;
    min-width: 120px;
    transition: opacity 100ms ease;
}

.hm-tip-logo {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .hm-tip-logo img {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.92);
        object-fit: contain;
    }

.hm-tip-body {
    min-width: 0;
}

.hm-tip-tk {
    font-weight: 800;
    font-size: 15px;
}

.hm-tip-co {
    color: var(--text-muted);
    font-size: 11px;
    margin: 1px 0 4px;
    max-width: 160px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hm-tip-mv {
    font-weight: 700;
}

.hm-tip-up {
    color: var(--ew-green);
}

.hm-tip-down {
    color: var(--ew-red);
}
