/* Interactive fire map. Extends ../static/style.css (the main site's). */

.page-wide {
    max-width: 72rem;
}

.lede {
    max-width: 46rem;
}

/* the poster's key message */
.keymsg {
    max-width: 52rem;
    margin: 1rem 0;
    padding: 0.5rem 1rem;
    border-left: 3px solid #40739E;
    background: #f3f6f9;
    font-size: 1.05rem;
}

.sections-hint {
    max-width: 52rem;
    margin: 1rem 0 0.25rem;
    font-size: 0.9rem;
    color: #444;
}

.sections-hint button {
    font: inherit;
    font-size: 0.85rem;
    padding: 0.1rem 0.5rem;
    margin-left: 0.3rem;
    border: 1px solid #999;
    background: #fff;
    color: #111;
    cursor: pointer;
}

.sections-hint button:hover { background: #f2f2f2; }

/* the poster's sections: one <details class="model"> each, independently collapsible */
.model {
    max-width: 52rem;
    margin: 0.5rem 0;
    border-left: 3px solid #ccc;
    padding: 0.1rem 0 0.1rem 1rem;
}

.model[open] {
    border-left-color: #40739E;
    margin-bottom: 1rem;
}

.model summary {
    cursor: pointer;
    font-size: 1.05rem;
    margin-bottom: 0.4rem;
}

.model p {
    margin: 0.5rem 0;
}

.model ul {
    margin: 0.4rem 0 0.6rem;
    padding-left: 1.3rem;
}

.model li {
    margin: 0.25rem 0;
}

.model math[display="block"] {
    font-size: 1.12rem;
    margin: 0.6rem 0;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0.2rem 0;
}

.model li math[display="block"] {
    margin: 0.4rem 0;
}

.model .lbl {                /* plain-language label under an underbrace */
    font-size: 0.72em;
    color: #444;
}

.model .lbl mtext {
    white-space: nowrap;
}

.model figure {
    margin: 0.8rem 0;
}

.model figure img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
}

.model figcaption {
    font-size: 0.85rem;
    color: #444;
    margin-top: 0.3rem;
}

.model .refs {
    font-size: 0.8rem;
    color: #444;
}

/* --- the map: stacked layers of identical pixel geometry --- */
.map-tags {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.25rem;
    font-size: 0.95rem;
    color: #333;
}

.fire-map {
    position: relative;
    width: 100%;
    margin: 0.3rem 0 0.75rem;
    user-select: none;
    -webkit-user-select: none;
}

.fire-map .layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}

#base {
    position: relative;          /* gives the container its height */
    height: auto;
}

/* the separation: a wide invisible hit zone around a thin line */
.split {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2.5rem;
    margin-left: -1.25rem;
    cursor: ew-resize;
    touch-action: none;
}

.split-line {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    margin-left: -1px;
    background: #111;
}

.split-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2.4rem;
    height: 2.4rem;
    margin: -1.2rem 0 0 -1.2rem;
    border: 2px solid #111;
    border-radius: 50%;
    background: #fff;
    font-family: system-ui, sans-serif;
    font-size: 0.75rem;
    line-height: 2.25rem;
    text-align: center;
    color: #111;
}

.split-handle:focus-visible {
    outline: 3px solid #1a0dab;
    outline-offset: 2px;
}

/* latitude / longitude under the pointer */
.coord {
    position: absolute;
    left: 0;
    top: 0;
    transform: translate(14px, 14px);
    pointer-events: none;
    white-space: nowrap;
    font-family: system-ui, sans-serif;
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
    color: #111;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid #bbb;
    padding: 0.1rem 0.4rem;
}

.coord.flip { transform: translate(calc(-100% - 14px), 14px); }
.coord.touch { transform: translate(-50%, calc(-100% - 28px)); }
.coord[hidden] { display: none; }

.status {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid #ccc;
    padding: 0.4rem 0.8rem;
    font-size: 0.95rem;
}

.status[hidden] { display: none; }

/* --- time controls --- */
.time {
    margin: 0.25rem 0 1rem;
}

.time-labels {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: 1rem;
}

#date-label { font-weight: bold; }
#woy-label { color: #444; }

#week {
    width: 100%;
    margin: 0.4rem 0;
    accent-color: #111;
}

.time-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem;
}

.time-buttons button {
    font: inherit;
    font-size: 0.9rem;
    padding: 0.2rem 0.7rem;
    border: 1px solid #999;
    background: #fff;
    color: #111;
    cursor: pointer;
}

.time-buttons button:hover { background: #f2f2f2; }

#play { min-width: 5rem; }

/* --- colour legend --- */
.legend {
    max-width: 34rem;
    margin: 0.5rem auto 1.5rem;
    font-size: 0.85rem;
    color: #444;
}

.legend-scale {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
}

.legend-under {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.legend-swatch {
    display: block;
    width: 1.2rem;
    height: 0.8rem;
    border: 1px solid #bbb;
}

.legend-bar-wrap {
    position: relative;
    flex: 1;
    padding-bottom: 1.3rem;
}

.legend-bar {
    height: 0.8rem;
    border: 1px solid #bbb;
}

.legend-ticks span {
    position: absolute;
    top: 1rem;
    transform: translateX(-50%);
}

.legend-ticks span::before {
    content: "";
    position: absolute;
    left: 50%;
    top: -0.35rem;
    height: 0.3rem;
    border-left: 1px solid #777;
}

.legend-label {
    text-align: center;
}

#mark { pointer-events: none; }

/* --- time series of the selected cell --- */
.series h2 {
    margin-top: 0.5rem;
}

.series-hint {
    font-size: 0.9rem;
    color: #444;
    margin: 0.2rem 0 0.6rem;
}

.chart {
    position: relative;
    width: 100%;
}

.chart svg {
    display: block;
    width: 100%;
    overflow: visible;
}

.chart text {
    font-family: system-ui, sans-serif;
    font-size: 11px;
    fill: #52514e;
}

.chart-key {
    list-style: none;
    padding: 0;
    margin: 0.3rem 0 1.4rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem 1.2rem;
    font-size: 0.85rem;
    color: #333;
}

.chart-key svg {
    vertical-align: middle;
    margin-right: 0.35rem;
}

.chart-tip {
    position: absolute;
    top: 0;
    pointer-events: none;
    white-space: nowrap;
    font-family: system-ui, sans-serif;
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
    color: #111;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #bbb;
    padding: 0.2rem 0.45rem;
    line-height: 1.35;
}

.chart-tip[hidden] { display: none; }

.caption {
    font-size: 0.9rem;
    color: #333;
    max-width: 46rem;
}

@media (max-width: 600px) {
    .map-tags { font-size: 0.8rem; }
    .time-buttons button { font-size: 0.8rem; padding: 0.2rem 0.5rem; }
}
