/* ==========================================================================
   BeWildfireAware — light theme, fire accents (redesign branch)
   ========================================================================== */

:root {
    --bg: #faf9f6;
    --surface: #ffffff;
    --ink: #21272a;
    --ink-soft: #5b6570;
    --line: #e5e2da;
    --pine: #1b4332;
    --pine-mid: #2d6a4f;
    --pine-deep: #0f2a1d;
    --flame: #e85d04;
    --flame-dark: #c94b02;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(20, 30, 25, 0.08), 0 4px 14px rgba(20, 30, 25, 0.06);
    --danger-low: #2e7d32;
    --danger-moderate: #1565c0;
    --danger-high: #f9a825;
    --danger-very-high: #ef6c00;
    --danger-extreme: #c62828;
}

* { box-sizing: border-box; }

body {
    font-family: "Avenir Next", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", sans-serif;
    margin: 0;
    padding: 0;
    color: var(--ink);
    background-color: var(--bg);
    line-height: 1.6;
}

h1, h2, h3, h4 { line-height: 1.25; letter-spacing: -0.01em; color: var(--pine-deep); }
a { color: var(--flame-dark); }
img { max-width: 100%; }

/* ------------------------------------------------------------------ header */
header {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: 10px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 500;
}

.logo-lockup { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-word { font-weight: 800; font-size: 1.25em; color: var(--pine-deep); letter-spacing: -0.02em; }
.logo-word-wild { color: var(--flame); }
header .logo a { text-decoration: none; }

header nav ul { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; align-items: center; }
header nav ul li { display: inline; }

header nav ul li a,
header nav ul li .dropdown-toggle {
    color: var(--ink);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95em;
    padding: 8px 14px;
    border-radius: 8px;
    display: inline-block;
    cursor: pointer;
}

header nav ul li a:hover,
header nav ul li .dropdown-toggle:hover { background: #f1efe9; }

header nav ul li a.active,
header nav ul li .dropdown-toggle.active { color: var(--flame-dark); }

/* dropdowns */
.dropdown { position: relative; display: inline-block; }

.dropdown-content {
    display: none;
    position: absolute;
    background: var(--surface);
    min-width: 230px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    z-index: 600;
    right: 0;
    padding: 6px;
    margin-top: 4px;
}

.dropdown-content a {
    color: var(--ink);
    padding: 9px 12px;
    text-decoration: none;
    display: block;
    text-align: left;
    border-radius: 8px;
    font-size: 0.93em;
}

.dropdown-content a:hover { background: #f1efe9; color: var(--flame-dark); }
.dropdown.open .dropdown-content { display: block; }
.dropdown .dropdown-toggle::after { content: " ▾"; font-size: 0.8em; }

/* hamburger */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--pine-deep);
    font-size: 1.8em;
    cursor: pointer;
    padding: 5px 10px;
}

/* -------------------------------------------------------------------- hero */
.hero {
    position: relative;
    background:
        linear-gradient(rgba(15, 42, 29, 0.55), rgba(15, 42, 29, 0.75)),
        url('/images/hero.webp') no-repeat center center / cover;
    color: #fff;
    text-align: center;
    padding: 96px 24px 88px;
}

.hero h1 { font-size: clamp(2.2em, 5vw, 3.4em); margin: 0; color: #fff; }
.hero p { font-size: 1.25em; max-width: 640px; margin: 14px auto 0; color: #e9f5ee; }

.cta,
.btn {
    background: var(--flame);
    color: #fff !important;
    padding: 12px 26px;
    text-decoration: none;
    border-radius: 999px;
    display: inline-block;
    margin-top: 24px;
    font-weight: 700;
    border: none;
    font-size: 1em;
    cursor: pointer;
    transition: background 0.15s;
}

.cta:hover, .btn:hover { background: var(--flame-dark); }

.btn-quiet {
    background: transparent;
    color: var(--pine) !important;
    border: 2px solid var(--pine-mid);
}
.btn-quiet:hover { background: #e9f5ee; }

/* --------------------------------------------------------------- sections */
.section { max-width: 1080px; margin: 0 auto; padding: 48px 24px 8px; }
.section > h2 { font-size: 1.7em; margin: 0 0 6px; }
.section > .section-sub { color: var(--ink-soft); margin: 0 0 22px; max-width: 640px; }

.dispatch-areas { padding: 50px 20px; text-align: center; }
.dispatch-areas h2 { font-size: 2em; margin-bottom: 8px; }

.content { max-width: 860px; margin: 0 auto; padding: 32px 24px 48px; }

/* --------------------------------------------------- locate ("near me") card */
.locate-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 26px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 18px;
    justify-content: space-between;
}

.locate-card h3 { margin: 0 0 4px; font-size: 1.2em; }
.locate-card p { margin: 0; color: var(--ink-soft); font-size: 0.95em; max-width: 460px; }
.locate-card .btn { margin-top: 0; white-space: nowrap; }

.locate-result { width: 100%; }

.locate-hit {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    border-top: 1px solid var(--line);
    padding-top: 16px;
}

.locate-hit .danger-chip { font-size: 1.05em; }
.locate-note { color: var(--ink-soft); font-size: 0.9em; }

.redflag-badge {
    background: #fdecea;
    border: 1px solid var(--danger-extreme);
    color: var(--danger-extreme);
    font-weight: 700;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 0.9em;
}

/* ------------------------------------------------------------- area chips */
.area-chips {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 12px;
    margin: 20px 0 40px;
}

.area-chip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 13px 16px;
    text-decoration: none;
    color: var(--ink);
    font-weight: 600;
    font-size: 0.95em;
    box-shadow: var(--shadow);
    transition: transform 0.12s;
}

.area-chip:hover { transform: translateY(-2px); }

.danger-chip {
    border-radius: 999px;
    padding: 3px 12px;
    font-size: 0.82em;
    font-weight: 700;
    white-space: nowrap;
}

/* danger colors (shared: chips, banners, table cells) */
.danger-low        { background: var(--danger-low); color: #fff; }
.danger-moderate   { background: var(--danger-moderate); color: #fff; }
.danger-high       { background: var(--danger-high); color: #201a00; }
.danger-very-high  { background: var(--danger-very-high); color: #fff; }
.danger-extreme    { background: var(--danger-extreme); color: #fff; }
.danger-unknown    { background: #9e9e9e; color: #fff; }

/* -------------------------------------------------------------------- map */
#danger-map {
    height: 72vh;
    max-width: 1080px;
    margin: 0 auto 40px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    background: #eef2ec;
}

.map-wrap { padding: 0 24px; }
.map-noscript { padding: 20px; text-align: center; }

.map-legend {
    background: #fff;
    color: #222;
    padding: 10px 14px;
    border-radius: 8px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.25);
    font-size: 0.9em;
    line-height: 1.7;
}

.map-legend-swatch {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    margin-right: 8px;
    vertical-align: middle;
}

/* richer popups */
.leaflet-popup-content { margin: 14px 16px; }
.map-popup { font-family: inherit; min-width: 210px; }
.map-popup .map-popup-title { font-weight: 800; font-size: 1.05em; margin-bottom: 6px; }
.map-popup .danger-chip { display: inline-block; margin-bottom: 8px; }

.map-popup-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px 14px;
    font-size: 0.88em;
    margin: 6px 0 8px;
    color: #444;
}

.map-popup-stats strong { color: #111; }
.map-popup .map-popup-watchout { color: var(--danger-extreme); font-weight: 700; font-size: 0.88em; margin-bottom: 6px; }
.map-popup a { color: var(--flame-dark); font-weight: 700; }

/* ------------------------------------------------------------ area pages */
.area-page { max-width: 940px; margin: 0 auto; padding: 28px 24px 48px; }

.area-page .dispatch-title {
    margin: 0;
    font-size: 0.85em;
    color: var(--ink-soft);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
}

.area-page h1 { margin: 4px 0 0; font-size: 2em; }
.area-page .area-date { margin: 4px 0 20px; color: var(--ink-soft); }
.area-page h2 { font-size: 1.35em; margin: 34px 0 10px; }

.danger-banner {
    border-radius: var(--radius);
    padding: 26px 20px;
    text-align: center;
    margin-bottom: 14px;
    box-shadow: var(--shadow);
}

.danger-banner .danger-label { display: block; font-size: 1.05em; margin-bottom: 4px; }
.danger-banner .danger-value { display: block; font-size: 2.5em; font-weight: 800; line-height: 1.1; }

.area-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;
    font-size: 0.93em;
    color: var(--ink-soft);
    margin-bottom: 8px;
}

/* observations */
.obs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    margin: 14px 0 8px;
}

.obs-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px 12px;
    text-align: center;
    box-shadow: var(--shadow);
}

.obs-card .obs-value { display: block; font-size: 1.65em; font-weight: 800; color: var(--pine-deep); }
.obs-card .obs-label { display: block; font-size: 0.85em; color: var(--ink-soft); margin-top: 2px; }
.obs-card .obs-limit { display: block; font-size: 0.72em; color: var(--ink-soft); margin-top: 6px; }

.obs-card.triggered { background: #fdecea; border-color: var(--danger-extreme); }
.obs-card.triggered .obs-value { color: var(--danger-extreme); }
.obs-card.triggered .obs-limit { color: var(--danger-extreme); font-weight: 700; }

.watchout-banner {
    background: #fdecea;
    border: 1px solid var(--danger-extreme);
    border-left-width: 5px;
    border-radius: 8px;
    padding: 12px 16px;
    margin: 8px 0 4px;
    font-weight: 700;
    color: var(--danger-extreme);
}

.watchout-summary { color: var(--ink-soft); font-size: 0.93em; margin: 4px 0; }

.thresholds {
    background: var(--surface);
    border: 1px solid var(--line);
    border-left: 5px solid var(--flame);
    border-radius: 8px;
    padding: 14px 18px;
    margin: 0 0 8px;
    white-space: pre-line;
    font-size: 0.95em;
}

/* forecast table */
.table-wrap { overflow-x: auto; margin: 12px 0 8px; -webkit-overflow-scrolling: touch; border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); }

.forecast-table { border-collapse: collapse; width: 100%; font-size: 0.92em; background: var(--surface); }

.forecast-table th, .forecast-table td {
    border-bottom: 1px solid var(--line);
    padding: 9px 12px;
    text-align: center;
    white-space: nowrap;
}

.forecast-table th:first-child, .forecast-table td:first-child {
    text-align: left;
    position: sticky;
    left: 0;
    background: var(--surface);
    border-right: 1px solid var(--line);
}

.forecast-table thead th { background: #f1efe9; color: var(--pine-deep); }
.forecast-table td.danger-low, .forecast-table td.danger-moderate, .forecast-table td.danger-high,
.forecast-table td.danger-very-high, .forecast-table td.danger-extreme { font-weight: 700; }

.raws-note { font-size: 0.85em; color: var(--ink-soft); white-space: pre-line; line-height: 1.5; margin-top: 26px; }
.pdf-note { font-size: 0.85em; color: var(--ink-soft); }

/* local links */
.local-links {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
    margin: 14px 0 8px;
}

.local-link {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px 16px;
    text-decoration: none;
    box-shadow: var(--shadow);
    transition: transform 0.12s;
}

.local-link:hover { transform: translateY(-2px); }
.local-link strong { display: block; color: var(--flame-dark); margin-bottom: 3px; }
.local-link span { color: var(--ink-soft); font-size: 0.88em; display: block; line-height: 1.45; }

/* ------------------------------------------------------------ pocket card */
.pocket-card {
    position: relative;
    margin: 20px 0 8px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 8px;
}

.pocket-card svg { display: block; width: 100%; height: auto; }

.pc-tooltip {
    position: absolute;
    background: #fff;
    color: #222;
    border: 1px solid #bbb;
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.25);
    padding: 8px 12px;
    font-size: 0.85em;
    line-height: 1.6;
    pointer-events: none;
    z-index: 10;
    white-space: nowrap;
}

.pc-tooltip .pc-date { font-weight: bold; border-bottom: 1px solid #ddd; margin-bottom: 4px; }
.pc-tooltip .pc-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }

/* ---------------------------------------------------------- content pages */
.topic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin: 30px 0 40px;
}

.topic-card {
    display: block;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    text-decoration: none;
    color: var(--ink);
    box-shadow: var(--shadow);
    transition: transform 0.12s;
}

.topic-card:hover { transform: translateY(-2px); }
.topic-card h3 { margin: 0 0 8px; color: var(--flame-dark); font-size: 1.15em; }
.topic-card p { margin: 0; font-size: 0.93em; line-height: 1.5; color: var(--ink-soft); }

.fire-danger-level.green  { color: var(--danger-low); }
.fire-danger-level.blue   { color: var(--danger-moderate); }
.fire-danger-level.yellow { color: #b28704; }
.fire-danger-level.orange { color: var(--danger-very-high); }
.fire-danger-level.red    { color: var(--danger-extreme); }

.resource-item {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
}

.resource-item h4 { margin: 0 0 6px; }
.resource-item h4 a { color: var(--flame-dark); text-decoration: none; }
.resource-item h4 a:hover { text-decoration: underline; }
.resource-item p { margin: 0; font-size: 0.95em; line-height: 1.5; color: var(--ink-soft); }

/* team */
.team-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; margin: 24px 0; }

.team-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.team-card img { width: 100%; height: 340px; object-fit: cover; display: block; }
.team-card .team-body { padding: 20px 22px 24px; }
.team-card h3 { margin: 0; font-size: 1.25em; }
.team-card .team-role { color: var(--flame-dark); font-weight: 700; font-size: 0.9em; margin: 2px 0 12px; }
.team-card p { font-size: 0.95em; color: var(--ink); margin: 0 0 10px; }
.team-card .team-caption { font-size: 0.8em; color: var(--ink-soft); font-style: italic; }

.mission {
    background: var(--pine-deep);
    color: #e9f5ee;
    border-radius: var(--radius);
    padding: 34px 34px;
    margin: 10px 0 30px;
}

.mission h2 { color: #fff; margin: 0 0 10px; }
.mission p { margin: 0; font-size: 1.1em; line-height: 1.7; }

.disclaimer { font-size: 0.78em; color: var(--ink-soft); }

/* fems attribution */
.fems-attribution { padding: 34px 20px 44px; text-align: center; }
.fems-content { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.fems-logo { height: 54px; width: auto; }
.fems-attribution p { margin: 0; font-size: 1em; color: var(--ink-soft); }

/* ------------------------------------------------------------------ footer */
footer {
    background: var(--pine-deep);
    color: #cfe3d2;
    padding: 34px 24px;
    text-align: center;
    margin-top: 48px;
}

footer ul { list-style: none; padding: 0; margin: 0 0 8px; display: flex; justify-content: center; gap: 22px; flex-wrap: wrap; }
footer ul li a, footer .dropdown-toggle { color: #cfe3d2; text-decoration: none; font-size: 0.95em; }
footer ul li a:hover { color: #fff; }
footer .dropdown-content { bottom: 100%; top: auto; }
footer .dropdown-content a { color: var(--ink); }
footer p { margin: 10px 0 0; font-size: 0.9em; }

/* ------------------------------------------------------------- responsive */
@media (max-width: 768px) {
    header { flex-wrap: wrap; }
    .menu-toggle { display: block; }
    header nav { display: none; width: 100%; order: 3; }
    header nav.open { display: block; }
    header nav ul { flex-direction: column; gap: 0; padding: 10px 0; align-items: stretch; }
    header nav ul li { display: block; }
    header nav ul li a, header nav ul li .dropdown-toggle { display: block; padding: 12px 14px; }

    .dropdown-content { position: static; box-shadow: none; border: none; min-width: 0; padding-left: 16px; }

    footer ul { flex-direction: column; align-items: center; gap: 10px; }
    footer .dropdown-content { position: static; text-align: center; }

    .hero { padding: 64px 20px 58px; }
    #danger-map { height: 62vh; margin: 0 12px 28px; }
    .team-card img { height: 280px; }
}

/* forecast cells exceeding local watchout thresholds */
.forecast-table td.cell-hit {
    background: #fdecea;
    color: var(--danger-extreme);
    font-weight: 700;
}
