/* General Page */
:root {
    --brand-primary: #087DC1;
}
body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f5f5f5;
    overflow: hidden;
}

/* Header */

header {
    background: var(--brand-primary);
    color: white;
    padding: 18px 24px;
}

header h1 {
    margin: 0;
}

/* Main Layout */

.app-container {
    display: flex;
    height: calc(100vh - 74px);
}

/* Sidebar */

.sidebar {
    width: 275px;
    background: white;
    padding: 20px;
    box-shadow: 2px 0px 8px rgba(0,0,0,.10);

    overflow-y: auto;
    box-sizing: border-box;
}

.sidebar h2 {
    margin-top: 0;
}

.sidebar button {

    width: 100%;

    padding: 12px;

    margin-bottom: 10px;

    border: none;

    background:var(--brand-primary);

    color: white;

    cursor: pointer;

    border-radius: 6px;
}

.sidebar button:hover {

    background: var(--brand-primary);

}

/* Map Area */

.map-container {

    flex: 1;

    min-height: 600px;

}

#map {
    width: 100%;
    height: 100%;
    min-height: 600px;
    border-radius: 8px;
}
/* Resource information popup */

.resource-popup {
    width: 260px;
    font-family: Arial, Helvetica, sans-serif;
    color: #333333;
}

.resource-popup__title {
    margin: 0 0 4px;
    font-size: 20px;
    color: var(--brand-primary);
}

.resource-popup__category {
    margin: 0 0 16px;
    font-weight: 700;
}

.resource-popup p {
    margin: 0 0 12px;
    line-height: 1.4;
}

.resource-popup__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.resource-popup__actions a {
    display: inline-block;
    padding: 9px 12px;
    border-radius: 5px;
    background: var(--brand-primary);
    color: #ffffff;
    font-weight: 700;
    text-decoration: none;
}

.resource-popup__actions a:hover,
.resource-popup__actions a:focus {
    background: var(--brand-primary);
}

/* Map loading and error status */

.map-container {
    position: relative;
}

.map-status {
    position: absolute;
    inset: 0;
    z-index: 10;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 24px;
    background: rgba(255, 255, 255, 0.96);
    text-align: center;
}

.map-status[hidden] {
    display: none;
}

.map-status__content {
    width: min(100%, 420px);
}

.map-status__spinner {
    width: 44px;
    height: 44px;
    margin: 0 auto 18px;

    border: 5px solid #d9e2e8;
    border-top-color: var(--brand-primary);
    border-radius: 50%;

    animation: map-status-spin 0.8s linear infinite;
}

.map-status h2 {
    margin: 0 0 8px;
    color: var(--brand-primary);
}

.map-status p {
    margin: 0;
    line-height: 1.5;
}

.map-status--error .map-status__spinner {
    display: none;
}

.map-status--error h2 {
    color: #a61b1b;
}

.map-status__retry {
    margin-top: 18px;
    padding: 10px 16px;

    border: 0;
    border-radius: 5px;

    background: var(--brand-primary);
    color: #ffffff;

    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.map-status__retry:hover,
.map-status__retry:focus {
    background: var(--brand-primary);
}

@keyframes map-status-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===========================
   Resource Search
   =========================== */

.resource-search {
    margin-bottom: 24px;
}

.resource-search label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.resource-search__controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.resource-search input {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
}

#resource-search-submit {
    grid-column: 1 / -1;
    width: 100%;
    margin-bottom: 0;
}

#resource-search-clear {
    grid-column: 2;
    width: 100%;
    margin-bottom: 0;
}

/*
 * When Clear is visible, Search uses the left half
 * and Clear uses the right half.
 */
.resource-search__controls:has(
    #resource-search-clear:not([hidden])
) #resource-search-submit {
    grid-column: 1;
}

/* Split Search and Clear evenly when Clear is visible */
.resource-search__controls--with-clear {
    grid-template-columns: 1fr 1fr;
}

.resource-search input {
    flex: 1;
    padding: 10px 12px;

    border: 1px solid #c8c8c8;
    border-radius: 6px;

    font-size: 14px;
}

.resource-search input:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(0,85,140,.15);
}

.resource-search button {
    white-space: nowrap;
}

.resource-search__results {
    margin-top: 8px;
    font-size: 13px;
    color: #666;
    min-height: 18px;
}


/* ===========================
   Sidebar Sections
   =========================== */

.sidebar-section-title {
    margin: 18px 0 10px;
    padding-top: 12px;

    border-top: 1px solid #dddddd;

    font-size: 15px;
    font-weight: 600;
}

.resource-results-list {
    margin-top: 8px;
    min-height: 20px;
}

.resource-result {
    padding: 10px;

    margin-bottom: 8px;

    border: 1px solid #dddddd;
    border-radius: 6px;

    cursor: pointer;

    transition: background .2s;
}

.resource-result:hover {
    background: #f5f5f5;
}

.resource-result h4 {
    margin: 0 0 4px;
    font-size: 14px;
}

.resource-result p {
    margin: 0;
    font-size: 12px;
    color: #666;
}

.resource-result__category {
    margin-bottom: 5px !important;

    font-size: 11px !important;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;

    color: var(--brand-primary) !important;
}

.resource-result__distance {
    margin: 4px 0 !important;
    font-weight: 600;
    color: #333 !important;
}

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.mobile-resource-button {
    display: none;
}

@media (max-width: 768px) {

.mobile-resource-button {
    display: block;
    width: auto;
    flex-shrink: 0;

    padding: 10px 12px;

    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 6px;

    background: #ffffff;
    color: var(--brand-primary);

    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}
    header {
        padding: 12px 16px;
    }

    header h1 {
        font-size: 20px;
    }

    .app-container {
    position: relative;
    display: block;
    height: calc(100dvh - 100px);
    overflow: hidden;
}

.sidebar {
    
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;

    z-index: 20;

    width: min(88vw, 340px);
    box-sizing: border-box;
    padding: 16px;

    overflow-y: auto;

    transform: translateX(-105%);
    transition: transform 0.25s ease;
}
.sidebar.sidebar--open {
    transform: translateX(0);
}
.map-container {
    width: 100%;
    height: 100%;
    min-height: 0;
}

#map {
    width: 100%;
    height: 100%;
    min-height: 0;
    border-radius: 0;
}
}

/* ===========================
   Demo Mode Overlay
   =========================== */

.demo-overlay {
    position: fixed;
    inset: 0;

    z-index: 1000;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 24px;

    background: rgba(0, 0, 0, 0.65);

    box-sizing: border-box;
}

.demo-overlay[hidden] {
    display: none;
}

.demo-overlay__notice {
    width: min(100%, 825px);

    padding: 48px 36px 34px;

    box-sizing: border-box;

    background: #000000;
    color: #ffffff;

    text-align: center;
}

.demo-overlay__notice h2 {
    margin: 0 0 32px;

    font-size: 42px;
    line-height: 1.15;
}

.demo-overlay__notice p {
    max-width: 760px;

    margin: 0 auto 40px;

    font-size: 28px;
    line-height: 1.4;
}

#demo-overlay-dismiss {
    width: auto;

    min-width: 265px;

    padding: 10px 28px;

    border: 0;
    border-radius: 12px;

    background: #e5e5e5;
    color: #000000;

    font-size: 30px;
    font-weight: 700;

    cursor: pointer;
}

#demo-overlay-dismiss:hover,
#demo-overlay-dismiss:focus {
    background: #ffffff;
}

body.demo-mode-active {
    overflow: hidden;
}

@media (max-width: 768px) {

    .demo-overlay {
        padding: 18px;
    }

    .demo-overlay__notice {
        padding: 32px 22px 26px;
    }

    .demo-overlay__notice h2 {
        margin-bottom: 22px;
        font-size: 30px;
    }

    .demo-overlay__notice p {
        margin-bottom: 28px;
        font-size: 18px;
    }

    #demo-overlay-dismiss {
        min-width: 0;
        width: 100%;

        font-size: 22px;
    }
}
/* Veterans map: bold field labels in popups and sidebar cards */
.resource-popup p > strong,
.resource-result__eligibility > strong {
    font-weight: 800;
    color: var(--brand-primary, #005291);
    font-size: 1em;
    letter-spacing: 0.02em;
}
/* Veterans map: keep popup buttons visible while details scroll */
.resource-popup__actions {
    position: sticky;
    bottom: 0;
    z-index: 1;
    background: #ffffff;
    padding-top: 10px;
    padding-bottom: 6px;
    margin-top: 8px;
    box-shadow: 0 -6px 8px -6px rgba(0, 0, 0, 0.25);
}
/* ================================================================
   Veterans map: "About this map" button, panel, and page layout
   Paste this at the very bottom of css/styles.css
   ================================================================ */

.about-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 12px;
    padding: 6px 12px;
    border: 1px solid var(--brand-primary, #005291);
    border-radius: 999px;
    background: #ffffff;
    color: var(--brand-primary, #005291);
    font: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    flex-shrink: 0;
}

.about-button:hover,
.about-button:focus-visible {
    background: #eef4fa;
}

.about-button__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--brand-primary, #005291);
    color: #ffffff;
    font-size: 0.75rem;
    font-style: italic;
    font-family: Georgia, "Times New Roman", serif;
}

.about-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.45);
}

.about-overlay[hidden] {
    display: none;
}

.about-panel {
    position: relative;
    width: 100%;
    max-width: 480px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 22px 24px;
    border-radius: 12px;
    background: #ffffff;
    color: #1f1f1f;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.about-panel h2 {
    margin: 0 32px 12px 0;
    color: var(--brand-primary, #005291);
    font-size: 1.25rem;
}

.about-panel p {
    margin: 0;
    line-height: 1.55;
}

.about-panel a {
    color: var(--brand-primary, #005291);
    font-weight: 700;
    overflow-wrap: anywhere;
}

.about-panel__close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #555555;
    font-size: 1.1rem;
    cursor: pointer;
}

.about-panel__close:hover,
.about-panel__close:focus-visible {
    background: #f0f0f0;
}

/* Desktop: message typed out in the header */
.about-inline {
    flex: 1 1 320px;
    max-width: 900px;
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.4;
    color: inherit;
    opacity: 0.95;
}

.about-inline a {
    color: inherit;
    font-weight: 700;
    text-decoration: underline;
    overflow-wrap: anywhere;
}

/* Desktop: hide the button, show the typed-out message */
@media (min-width: 769px) {
    .about-button {
        display: none;
    }

    /* Keep the title on one line; the description wraps instead */
    header h1 {
        flex-shrink: 0;
    }
}

/* Phones and small tablets: hide the message, show the button */
@media (max-width: 768px) {
    .about-inline {
        display: none;
    }

    /* Push About to the right, next to the Resources button */
    .about-button {
        margin-left: auto;
        padding: 6px 10px;
    }
}

/* ================================================================
   Veterans map: page layout
   The header takes whatever height it needs (description on
   desktop, a wrapped title on phones) and the map fills the rest,
   instead of assuming a fixed header height.
   ================================================================ */

body {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
}

header {
    flex: 0 0 auto;
}

.app-container {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
}

.map-container,
#map {
    min-height: 0;
}