/* Newswire Snapper Map — regional heatmap */

.nsm-map-root {
    font-family: "Source Serif Pro", "Source Serif 4", Georgia, serif;
    color: #1f2937;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px;
    margin: 32px 0;
    box-sizing: border-box;
}
.nsm-map-root *, .nsm-map-root *::before, .nsm-map-root *::after { box-sizing: border-box; }

.nsm-map-loading {
    color: #64748b;
    text-align: center;
    padding: 40px 0;
    font-style: italic;
}

.nsm-map-header {
    display: flex; flex-wrap: wrap; gap: 12px; align-items: baseline;
    justify-content: space-between;
    margin-bottom: 14px; padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
}
.nsm-map-title {
    font-family: "Playfair Display", Georgia, serif;
    font-size: 22px; font-weight: 700; margin: 0; line-height: 1.2;
    color: #0f172a;
}
.nsm-map-subtitle {
    font-size: 13px; color: #64748b; margin: 4px 0 0 0;
}

.nsm-map-canvas {
    width: 100%;
    height: 520px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    position: relative;
}
@media (max-width: 600px) {
    .nsm-map-canvas { height: 360px; }
}

.nsm-map-legend {
    display: flex; align-items: center; gap: 10px;
    margin: 12px 0;
    font-size: 13px;
    color: #475569;
    font-family: system-ui, sans-serif;
}
.nsm-legend-gradient {
    height: 12px; flex: 0 0 180px; border-radius: 6px;
    background: linear-gradient(90deg,
        #b91c1c 0%, #ea580c 25%, #ca8a04 50%, #65a30d 75%, #15803d 100%);
    border: 1px solid #cbd5e1;
}
.nsm-legend-label { font-size: 12px; color: #64748b; }

.nsm-map-timeline-wrap {
    margin-top: 14px;
    font-family: system-ui, sans-serif;
}
.nsm-map-timeline-head {
    font-size: 12px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-bottom: 6px;
}
.nsm-map-timeline {
    display: flex; align-items: center; gap: 12px;
    font-family: system-ui, sans-serif;
}
.nsm-map-timeline input[type="range"] {
    flex: 1;
    accent-color: #0ea5e9;
}
.nsm-map-time-label {
    font-size: 14px; color: #0f172a; font-weight: 600;
    min-width: 140px; text-align: right;
    font-variant-numeric: tabular-nums;
}
.nsm-map-time-sub {
    font-size: 12px; color: #64748b; font-weight: 400;
    display: block;
}

.nsm-map-cell-panel {
    margin-top: 16px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 14px 16px;
    display: none;
}
.nsm-map-cell-panel.is-active { display: block; }

.nsm-map-cell-title {
    font-family: "Playfair Display", Georgia, serif;
    font-size: 18px;
    margin: 0 0 4px 0;
    color: #0f172a;
}
.nsm-map-cell-score {
    font-family: "Playfair Display", Georgia, serif;
    font-size: 40px;
    font-weight: 700;
    line-height: 1;
}
.nsm-map-cell-score.is-excellent { color: #15803d; }
.nsm-map-cell-score.is-good { color: #0369a1; }
.nsm-map-cell-score.is-fair { color: #b45309; }
.nsm-map-cell-score.is-poor { color: #b91c1c; }

.nsm-map-cell-meta {
    font-size: 13px; color: #64748b; margin-bottom: 10px;
    font-family: system-ui, sans-serif;
}

.nsm-map-cell-factors {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    margin-top: 10px;
    font-family: system-ui, sans-serif;
}
@media (max-width: 600px) { .nsm-map-cell-factors { grid-template-columns: repeat(2, 1fr); } }
.nsm-map-cell-factor {
    background: #f8fafc;
    border-radius: 6px;
    padding: 8px 10px;
    border: 1px solid #e2e8f0;
}
.nsm-map-cell-factor-name {
    font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em;
    color: #64748b; font-weight: 600;
}
.nsm-map-cell-factor-value {
    font-size: 15px; color: #0f172a; font-weight: 600; margin-top: 2px;
}
.nsm-map-cell-factor-bar {
    margin-top: 4px; height: 4px; background: #e2e8f0; border-radius: 2px; overflow: hidden;
}
.nsm-map-cell-factor-bar-fill { height: 100%; background: #0ea5e9; }

.nsm-map-footer {
    margin-top: 14px; padding-top: 12px;
    border-top: 1px solid #e2e8f0;
    font-size: 12px; color: #64748b; line-height: 1.5;
    font-family: system-ui, sans-serif;
}
.nsm-map-footer a { color: #0369a1; }
.nsm-map-footer .nsm-safety { color: #b45309; display: block; margin-bottom: 6px; }
.nsm-map-footer .nsm-safety strong { color: #78350f; }

.nsm-map-error {
    padding: 30px 20px; text-align: center;
    color: #991b1b; background: #fef2f2;
    border: 1px solid #fecaca; border-radius: 6px;
}

/* Leaflet customisation */
.nsm-map-root .leaflet-container { background: #c6dfe8; }
