body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    color: #fff;
    background-color: #0F2311; /* Dark green background matching the logo */
}

header {
    background: #0B3D12; /* Darker green for header */
    color: #fff;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header .logo {
    display: flex;
    align-items: center;
}

header .logo img {
    height: 40px;
    margin-right: 20px;
}

header nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
}

header nav ul li {
    display: inline;
}

header nav ul li a {
    color: #fff;
    text-decoration: none;
}

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

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #0B3D12;
    min-width: 200px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
    right: 0;
}

.dropdown-content a {
    color: #fff;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    text-align: left;
}

.dropdown-content a:hover {
    background-color: #0F2311;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown .dropdown-toggle::after {
    content: " ▼";
    font-size: 0.7em;
    vertical-align: middle;
}

.hero {
    background: url('images/hero.webp') no-repeat center center/cover;
    color: #fff;
    text-align: center;
    padding: 100px 0px;
}

.hero h1 {
    font-size: 3em;
    margin: 0;
}

.hero p {
    font-size: 1.5em;
}

.hero .cta {
    background: #FF6600; /* Orange CTA button */
    color: #fff;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
}

.announcement {
    background-color: #FF6600;
    color: #fff;
    text-align: center;
    padding: 16px 20px;
    font-size: 1.1em;
}

.announcement a {
    color: #fff;
    font-weight: bold;
    text-decoration: underline;
}

.announcement a:hover {
    color: #0B3D12;
}

.dispatch-areas {
    padding: 50px 20px;
    text-align: center;
}

.dispatch-areas h2 {
    font-size: 2em;
    margin-bottom: 20px;
}

.dispatch-areas .cta {
    background: #FF6600; /* Orange button */
    color: #fff;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
    display: inline-block;
    margin-top: 20px;
}

footer {
    background: #0B3D12; /* Darker green for footer */
    color: #fff;
    padding: 20px;
    text-align: center;
}

footer ul {
    list-style: none;
    padding: 0;
    display: flex;
    justify-content: center;
    gap: 20px;
}

footer ul li a {
    color: #fff;
    text-decoration: none;
}

footer p {
    margin: 10px 0 0;
}

.social-media {
    margin-top: 10px;
}

.sub-navbar {
    background: #0B3D12;
    color: white;
    padding: 10px 20px;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.sub-navbar a {
    color: white;
    text-decoration: none;
    padding: 5px 10px;
}

.iframe-container {
    margin: 20px; /* Adjusted margin */
    width: calc(100% - 40px); /* Full width minus margin */
    height: 90vh; /* Set height to 90% of the viewport height */
    overflow-y: auto; /* Enable vertical scrolling */
}

iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Media query to adjust iframe container height for smaller screens */
@media (max-width: 600px) {
    .iframe-container {
        height: 80vh; /* On smaller devices, use 80% of the viewport height */
    }
}

.disclaimer {
    font-size: 0.8em;
}

header nav ul li a.active,
header nav ul li .dropdown-toggle.active {
    color: #FF6600; /* Orange color for active link */
}
.sub-navbar a.active {
    color: #FF6600; /* Orange color for active link */
}

/* Hamburger menu button - hidden on desktop */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.8em;
    cursor: pointer;
    padding: 5px 10px;
}

/* Resource page styles */
.resource-item {
    background-color: #0B3D12;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 12px;
}

.resource-item h4 {
    margin: 0 0 6px;
}

.resource-item h4 a {
    color: #FF6600;
    text-decoration: none;
}

.resource-item h4 a:hover {
    text-decoration: underline;
}

.resource-item p {
    margin: 0;
    font-size: 0.95em;
    line-height: 1.5;
}

/* Responsive nav */
@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;
    }

    header nav ul li {
        display: block;
    }

    header nav ul li a,
    header nav ul li .dropdown-toggle {
        display: block;
        padding: 10px 20px;
    }

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

    .dropdown .dropdown-content {
        display: none;
    }

    .dropdown.open .dropdown-content {
        display: block;
    }

    /* Override hover behavior on mobile - use tap instead */
    .dropdown:hover .dropdown-content {
        display: none;
    }

    .dropdown.open:hover .dropdown-content {
        display: block;
    }

    footer ul {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    footer .dropdown-content {
        position: static;
        box-shadow: none;
        min-width: 0;
        text-align: center;
    }

    .topic-grid {
        grid-template-columns: 1fr;
    }
}
    .fire-danger-level.green {
        color: green;
    }
    .fire-danger-level.blue {
        color: blue;
    }
    .fire-danger-level.yellow {
        color: yellow;
    }
    .fire-danger-level.orange {
        color: orange;
    }
    .fire-danger-level.red {
        color: red;
    }
main {
    margin: 0; /* Remove margin from the main content */
}

.content {
    margin: 20px;
}

/* Topic grid for Learn More overview page */
.topic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin: 30px 0 40px;
}

.topic-card {
    display: block;
    background-color: #0B3D12;
    border-radius: 8px;
    padding: 20px;
    text-decoration: none;
    color: #fff;
    transition: background-color 0.2s, transform 0.2s;
}

.topic-card:hover {
    background-color: #14521a;
    transform: translateY(-2px);
}

.topic-card h3 {
    margin: 0 0 10px;
    color: #FF6600;
    font-size: 1.2em;
}

.topic-card p {
    margin: 0;
    font-size: 0.95em;
    line-height: 1.5;
}

/* FEMS Attribution Section */
.fems-attribution {
    padding: 30px 20px;
    text-align: center;
    background-color: #0F2311;
}

.fems-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.fems-logo {
    height: 60px;
    width: auto;
}

.fems-attribution p {
    margin: 0;
    font-size: 1.1em;
    color: #fff;
}

/* ============================================================
   Dispatch area data pages (native rendering, replaces iframes)
   ============================================================ */

.area-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.area-page .dispatch-title {
    margin: 0;
    font-size: 1em;
    color: #cfe3d2;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.area-page h1 {
    margin: 5px 0 0;
    font-size: 2em;
}

.area-page .area-date {
    margin: 4px 0 20px;
    color: #cfe3d2;
}

.danger-banner {
    border-radius: 10px;
    padding: 24px 20px;
    text-align: center;
    margin-bottom: 12px;
}

.danger-banner .danger-label {
    display: block;
    font-size: 1.1em;
    margin-bottom: 6px;
}

.danger-banner .danger-value {
    display: block;
    font-size: 2.4em;
    font-weight: bold;
    line-height: 1.1;
}

.danger-low        { background: #2e7d32; color: #fff; }
.danger-moderate   { background: #1565c0; color: #fff; }
.danger-high       { background: #f9a825; color: #1a1a1a; }
.danger-very-high  { background: #ef6c00; color: #fff; }
.danger-extreme    { background: #c62828; color: #fff; }

.area-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;
    font-size: 0.95em;
    color: #cfe3d2;
    margin-bottom: 24px;
}

.area-meta a { color: #FF6600; }

.obs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin: 16px 0 28px;
}

.obs-card {
    background: #0B3D12;
    border-radius: 8px;
    padding: 14px 12px;
    text-align: center;
}

.obs-card .obs-value {
    display: block;
    font-size: 1.6em;
    font-weight: bold;
}

.obs-card .obs-label {
    display: block;
    font-size: 0.85em;
    color: #cfe3d2;
    margin-top: 4px;
}

.thresholds {
    background: #0B3D12;
    border-left: 4px solid #FF6600;
    border-radius: 0 8px 8px 0;
    padding: 14px 16px;
    margin: 0 0 28px;
    white-space: pre-line;
    font-size: 0.95em;
    line-height: 1.5;
}

.table-wrap {
    overflow-x: auto;
    margin: 12px 0 28px;
    -webkit-overflow-scrolling: touch;
}

.forecast-table {
    border-collapse: collapse;
    width: 100%;
    font-size: 0.92em;
}

.forecast-table th,
.forecast-table td {
    border: 1px solid #1d4023;
    padding: 8px 10px;
    text-align: center;
    white-space: nowrap;
}

.forecast-table th:first-child,
.forecast-table td:first-child {
    text-align: left;
    position: sticky;
    left: 0;
    background: #0F2311;
}

.forecast-table thead th {
    background: #0B3D12;
}

.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: bold;
}

.raws-note {
    font-size: 0.85em;
    color: #cfe3d2;
    white-space: pre-line;
    line-height: 1.5;
}

.pdf-note {
    font-size: 0.85em;
    color: #cfe3d2;
}

.pdf-note a { color: #FF6600; }

.area-page h2 {
    font-size: 1.3em;
    margin: 0 0 4px;
}

/* Pocket card chart (build-time SVG) */
.pocket-card {
    margin: 20px 0 28px;
    background: #fff;
    border-radius: 8px;
    padding: 8px;
}

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

/* Watchout threshold highlighting on Today's Conditions */
.obs-card.triggered {
    background: #6e1b1b;
    box-shadow: inset 0 0 0 2px #ff6b6b;
}

.obs-card .obs-limit {
    display: block;
    font-size: 0.72em;
    color: #b9cfbc;
    margin-top: 6px;
}

.obs-card.triggered .obs-limit {
    color: #ffb3b3;
    font-weight: bold;
}

.watchout-banner {
    background: #6e1b1b;
    border-left: 4px solid #ff6b6b;
    border-radius: 0 8px 8px 0;
    padding: 12px 16px;
    margin: 8px 0 4px;
    font-weight: bold;
}

.watchout-summary {
    color: #cfe3d2;
    font-size: 0.95em;
    margin: 4px 0;
}

/* Pocket card rollover tooltip */
.pocket-card {
    position: relative;
}

.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;
}

/* Dispatch area danger map */
#danger-map {
    height: 78vh;
    margin: 0 20px 30px;
    border-radius: 8px;
    background: #0B3D12;
}

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

.map-legend {
    background: #fff;
    color: #222;
    padding: 10px 14px;
    border-radius: 6px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.3);
    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;
}

.map-popup a {
    color: #c2410c;
    font-weight: bold;
}

@media (max-width: 600px) {
    #danger-map {
        height: 65vh;
        margin: 0 10px 20px;
    }
}
