:root {
    --legend-none: #99ff99;
    --legend-minor: #f1c86a;
    --legend-moderate: #ed7645;
    --legend-major: #ce2754;
    --legend-extreme: #9f00a6;
}

.page-container {
    max-width: 960px;
    margin: 0 auto;
}

/* Ensure [hidden] is respected by CMS override */
[hidden] {
    display: none !important;
}

/* ---- overview text ---- */

#updateTimeOverview {
    margin: 0.25rem 0 0.75rem;
    color: #555;
    font-size: 0.975rem;
    text-align: center;
}

#updateTime {
    margin: 0.25rem 0 0.5rem;
    color: #444;
    text-align: center;
}

p.lede {
    margin: 0.25rem 0 1rem;
    color: #333;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---- detail layout ---- */
.container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.column {
    flex: 1 1 300px;
    min-width: 280px;
}

h2 {
    margin: 0.5rem 0 0.25rem;
}

h3 {
    margin: 0.25rem 0;
}

/* ---- map ---- */
#map {
    width: 100%;
    height: 60vh;
    min-height: 420px;
    border: 1px solid #ccc;
    border-radius: 6px;
    overflow: hidden;
}

/* ---- risk table ---- */
.risk-wrap {
    margin-top: 0.5rem;
}

.risk-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
    overflow: hidden;
    border: 1px solid #e1e1e1;
    border-radius: 10px;
    background: #fff;
}

/* First column is the burn-scar name; remaining columns share the rest. */
.risk-table col:first-child {
    width: 34%;
}

.risk-table thead th {
    background: #fbfbfb;
    text-align: center;
    font-weight: 700;
    padding: 0.65rem 0.55rem;
    border-bottom: 1px solid #e1e1e1;
    border-right: 1px solid #e1e1e1;
    vertical-align: middle;
}

.risk-table thead th:last-child {
    border-right: 0;
}

.risk-table thead th.risk-col-scar {
    text-align: left;
}

.risk-th-dow {
    font-weight: 700;
    line-height: 1.1;
}

.risk-th-date {
    margin-top: 0.15rem;
    font-weight: 500;
    font-size: 0.95em;
    line-height: 1.1;
    color: #444;
}

.risk-table tbody th,
.risk-table tbody td {
    padding: 0.55rem 0.6rem;
    border-bottom: 1px solid #e1e1e1;
    border-right: 1px solid #e1e1e1;
    vertical-align: middle;
    text-align: center;
    font-weight: 600;
}

.risk-table tbody th {
    text-align: left;
    font-weight: 600;
    vertical-align: top;
    background: #fff;
    overflow-wrap: anywhere;
}

.risk-table tbody tr:nth-child(even) th {
    background: #fafafa;
}

.risk-table tbody tr:last-child th,
.risk-table tbody tr:last-child td {
    border-bottom: 0;
}

.risk-table tbody td:last-child,
.risk-table thead th:last-child {
    border-right: 0;
}

.risk-table a {
    color: inherit;
    font-weight: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-thickness: from-font;
}

/* ---- risk colors (shared) ---- */
.off_season {
    background: #646464;
    color: #fff;
}

.none {
    background: var(--legend-none);
    color: #000;
}

.minor {
    background: var(--legend-minor);
    color: #000;
}

.moderate {
    background: var(--legend-moderate);
    color: #000;
}

.major {
    background: var(--legend-major);
    color: #fff;
}

.extreme {
    background: var(--legend-extreme);
    color: #fff;
}

/* ---- infographic + forecast ---- */
.infographic {
    width: 100%;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
}

.forecast img {
    width: 100%;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
}

/* ---- legend ---- */
.legend {
    border: 1px solid #ddd;
    border-radius: 10px;
    overflow: hidden;
    margin: 0.75rem 0 0;
    background: #fff;
}

.legend-title {
    text-align: center;
    font-weight: 600;
    padding: 0.5rem 0.75rem;
    color: #555;
}

.legend-scale {
    display: flex;
    align-items: stretch;
}

.legend-item {
    flex: 1 1 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 0.25rem;
    font-weight: 700;
    font-style: italic;
    line-height: 1;
}

.legend-item + .legend-item {
    box-shadow: inset 2px 0 0 rgba(255, 255, 255, 0.6);
}

/* ---- modal ---- */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    overflow: auto;
    padding: 80px 16px 32px;
}

.modal-content {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    height: auto;
}

#caption {
    margin: 16px auto 0;
    max-width: 900px;
    color: #ccc;
    font-size: 1.125rem;
    text-align: center;
}

.close {
    position: fixed;
    top: 16px;
    right: 24px;
    color: #fff;
    font-size: 40px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

.close:focus,
.close:hover {
    color: #bbb;
    outline: none;
}

/* Leaflet layer control label */
.layer-control-label {
    font-weight: 600;
    padding: 4px 0 6px;
}

@media (max-width: 700px) {
    .modal-content {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .risk-table col:first-child {
        width: 44%;
    }

    .risk-table thead th {
        font-size: 0.95rem;
    }

    .risk-table tbody th {
        font-size: 0.95rem;
    }

    .legend-item {
        font-size: 0.95rem;
        padding: 0.5rem 0.2rem;
    }
}
