/* ==========================================================================
   Bentana Woods Cluster Association (BWCA) — Core Global Stylesheet
   Version: 2.0 (2026 Canonical Design System — Consolidated & Hardened)
   Reston, VA 20190
   ========================================================================== */

:root {
    --bg-canvas: #faf9f5;
    --bg-card: #ffffff;
    --bg-subtle: #f3f1ea;
    --bg-accent-soft: #eaf1ec;

    --border-light: #e6e3da;
    --border-hover: #1e3a2f;

    /* High-contrast accessible color hierarchy (WCAG AAA compliant) */
    --text-heading: #111e17;   /* Deepest charcoal forest */
    --text-body: #24332b;      /* High contrast charcoal body */
    --text-muted: #4b5b52;     /* Enhanced contrast muted text */

    --primary: #1e3a2f;        /* Deep Virginia Forest Spruce */
    --primary-hover: #142820;
    --primary-light: #2d5646;

    --brass: #9b7238;          /* Reston Architectural Brass Accent */
    --brass-soft: #fbf6ee;
    --brass-border: #e3d2ba;

    --danger: #991b1b;
    --danger-soft: #fef2f2;
    --danger-border: #fee2e2;

    --shadow-subtle: 0 1px 3px rgba(23, 36, 30, 0.04), 0 4px 12px rgba(23, 36, 30, 0.03);
    --shadow-hover: 0 8px 24px -4px rgba(23, 36, 30, 0.08), 0 2px 6px -1px rgba(23, 36, 30, 0.04);
    --shadow-modal: 0 24px 48px -12px rgba(23, 36, 30, 0.22);

    --font-serif: "Newsreader", "Charter", "Iowan Old Style", "Palatino", Georgia, serif;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    background-color: var(--bg-canvas);
    color: var(--text-body);
    font-family: var(--font-sans);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a:focus-visible, button:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
    border-radius: 4px;
}

/* ==========================================================================
   Unified Global Dropdown Navigation Bar
   ========================================================================== */
nav {
    padding: 0.85rem 0;
    width: 100%;
    background: rgba(250, 249, 245, 0.96);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 1000;
}
.nav-inner {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 3.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
}
.brand-container {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}
.brand-crest {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background-color: var(--primary);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(30, 58, 47, 0.25);
}
.brand-crest svg { width: 20px; height: 20px; fill: currentColor; }
.brand-titles { display: flex; flex-direction: column; }
.brand-name {
    font-family: var(--font-serif);
    font-size: 1.22rem;
    font-weight: 700;
    color: var(--text-heading);
    letter-spacing: -0.015em;
    line-height: 1.1;
}
.brand-subtitle {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    line-height: 1.2;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.75rem;
    margin-left: auto;
}
.nav-item { position: relative; }
.nav-link {
    text-decoration: none;
    color: var(--text-body);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 8px 6px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: color 0.18s ease;
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}
.nav-link:hover, .nav-link.active, .nav-item:hover > .nav-link {
    color: var(--primary);
    font-weight: 700;
}
.nav-caret {
    font-size: 0.65rem;
    transition: transform 0.2s ease;
    display: inline-block;
}
.nav-item:hover .nav-caret, .nav-item:focus-within .nav-caret {
    transform: rotate(180deg);
}
.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 260px;
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(17, 30, 23, 0.12);
    padding: 8px 0;
    margin-top: 4px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    z-index: 1001;
}
.nav-item.nav-item-right .nav-dropdown-menu {
    left: auto;
    right: 0;
}
.nav-item:hover .nav-dropdown-menu,
.nav-item:focus-within .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.nav-dropdown-item {
    display: block;
    padding: 10px 18px;
    color: var(--text-body);
    text-decoration: none;
    font-size: 0.88rem;
    line-height: 1.35;
    transition: background 0.15s ease, color 0.15s ease;
}
.nav-dropdown-item:hover, .nav-dropdown-item.active {
    background-color: var(--bg-subtle);
    color: var(--primary);
    font-weight: 700;
}
.nav-dropdown-item .item-desc {
    display: block;
    font-size: 0.74rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-top: 2px;
}

.nav-ai-button {
    background-color: var(--bg-card);
    color: var(--primary) !important;
    border: 1px solid var(--brass-border);
    padding: 7px 15px;
    border-radius: 999px;
    font-size: 0.84rem;
    font-weight: 600 !important;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.nav-ai-button:hover {
    background-color: var(--primary);
    color: #ffffff !important;
    border-color: var(--primary);
    transform: translateY(-1px);
}
.nav-ai-button svg { width: 14px; height: 14px; fill: currentColor; }

/* Mobile Hamburger & Controls */
.nav-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}
.mobile-menu-btn {
    display: none;
    background: none;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 8px 10px;
    cursor: pointer;
    color: var(--primary);
    align-items: center;
    justify-content: center;
    transition: background 0.18s ease;
}
.mobile-menu-btn:hover { background-color: var(--bg-subtle); }
.mobile-menu-btn svg { width: 22px; height: 22px; fill: currentColor; }

/* Mobile Navigation Drawer */
.mobile-nav-drawer {
    display: none;
    position: fixed;
    top: 68px;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ffffff;
    overflow-y: auto;
    padding: 24px 6%;
    z-index: 9999;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.18);
}
.mobile-nav-drawer.open { display: block; }
.mobile-section-title {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--brass);
    font-weight: 800;
    margin: 20px 0 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border-light);
}
.mobile-section-title:first-child { margin-top: 0; }
.mobile-link {
    display: block;
    padding: 11px 0;
    color: var(--text-body);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    border-bottom: 1px solid #f3f1ea;
    transition: color 0.15s ease;
}
.mobile-link.active {
    color: var(--primary);
    font-weight: 800;
}

/* ==========================================================================
   Consistent Page Header & Utilities
   ========================================================================== */
.page-header {
    padding: 64px 6% 40px;
    text-align: center;
    max-width: 880px;
    margin: 0 auto;
}
.page-header-tag {
    display: inline-block;
    font-family: var(--font-sans);
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--brass);
    background-color: var(--brass-soft);
    border: 1px solid var(--brass-border);
    padding: 4px 12px;
    border-radius: 4px;
    margin-bottom: 14px;
}
.page-header h1 {
    font-family: var(--font-serif);
    font-size: clamp(2.1rem, 4.2vw, 3.1rem);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--text-heading);
    margin-bottom: 14px;
}
.page-header p, .page-header .intro-text {
    font-size: 1.08rem;
    color: var(--text-muted);
    line-height: 1.55;
    max-width: 680px;
    margin: 0 auto;
}
.header-divider {
    width: 64px;
    height: 3px;
    background-color: var(--brass);
    margin: 26px auto 0;
    border-radius: 2px;
}

.post-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
}
.btn-download-pdf {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: var(--bg-card);
    color: var(--primary) !important;
    border: 1px solid var(--border-light);
    padding: 7px 14px;
    border-radius: 6px;
    font-size: 0.84rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.18s ease;
    box-shadow: var(--shadow-subtle);
}
.btn-download-pdf:hover {
    background-color: var(--primary);
    color: #ffffff !important;
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 58, 47, 0.15);
}
.btn-download-pdf svg {
    width: 15px;
    height: 15px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ==========================================================================
   4-Column Directory Footer
   ========================================================================== */
footer {
    background: #ffffff;
    border-top: 1px solid var(--border-light);
    padding: 56px 6% 36px;
    margin-top: 72px;
}
.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 36px;
    margin-bottom: 48px;
}
.footer-col h4 {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-heading);
    font-weight: 700;
    margin-bottom: 16px;
}
.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul li a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.88rem;
    transition: color 0.18s ease;
}
.footer-col ul li a:hover {
    color: var(--primary);
    text-decoration: underline;
}
.footer-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 12px;
}
.footer-contact, .footer-meeting {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    line-height: 1.4;
}
.footer-contact a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}
.footer-contact a:hover { text-decoration: underline; }
.footer-bottom {
    padding-top: 24px;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}
.footer-logo {
    font-family: var(--font-serif);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-heading);
}
.footer-legal {
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* ==========================================================================
   Resident AI Modal Dialog
   ========================================================================== */
.modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(17, 30, 23, 0.65);
    backdrop-filter: blur(4px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-backdrop.active { display: flex; }
.modal-card {
    background: var(--bg-card);
    border-radius: 16px;
    max-width: 560px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 32px;
    box-shadow: var(--shadow-modal);
    position: relative;
    border: 1px solid var(--border-light);
}
.modal-close {
    position: absolute;
    top: 16px;
    right: 18px;
    background: var(--bg-subtle);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.25rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}
.modal-close:hover { background: var(--border-light); color: var(--text-heading); }
.modal-badge {
    display: inline-block;
    background: var(--brass-soft);
    color: var(--brass);
    border: 1px solid var(--brass-border);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 3px 9px;
    border-radius: 4px;
    margin-bottom: 12px;
}
.modal-title {
    font-family: var(--font-serif);
    font-size: 1.65rem;
    color: var(--text-heading);
    margin-bottom: 8px;
    line-height: 1.2;
}
.modal-subtitle {
    font-size: 0.92rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 20px;
}
.features-list { display: flex; flex-direction: column; gap: 14px; margin-bottom: 20px; }
.feature-row { display: flex; gap: 12px; align-items: flex-start; }
.feature-row-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: var(--bg-accent-soft);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.feature-row-icon svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; }
.feature-row strong { font-size: 0.88rem; color: var(--text-heading); display: block; }
.feature-row p { font-size: 0.8rem; color: var(--text-muted); margin-top: 1px; }

.prompt-section {
    background: var(--bg-canvas);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 20px;
}
.prompt-section-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}
.prompt-label { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; color: var(--text-muted); }
.prompt-hint { font-size: 0.72rem; color: var(--brass); font-weight: 600; }
.prompt-list { display: flex; flex-direction: column; gap: 8px; }
.prompt-chip {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    padding: 9px 12px;
    text-align: left;
    font-family: var(--font-sans);
    font-size: 0.82rem;
    color: var(--text-body);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    transition: all 0.15s ease;
}
.prompt-chip:hover { border-color: var(--primary-light); background-color: #fafbf9; transform: translateX(2px); }
.copy-pill {
    font-size: 0.68rem;
    font-weight: 600;
    background: var(--bg-subtle);
    color: var(--text-muted);
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}
.toast-banner {
    display: none;
    margin-top: 8px;
    background: var(--primary);
    color: #ffffff;
    font-size: 0.78rem;
    padding: 6px 12px;
    border-radius: 6px;
    text-align: center;
}
.toast-banner.show { display: block; }

.modal-footer { border-top: 1px solid var(--border-light); padding-top: 18px; text-align: center; }
.modal-launch-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    background: var(--primary);
    color: #ffffff !important;
    padding: 13px 24px;
    border-radius: 8px;
    font-size: 0.96rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.18s ease;
    margin-bottom: 10px;
}
.modal-launch-btn:hover { background: var(--primary-hover); }
.modal-launch-btn svg { width: 17px; height: 17px; fill: currentColor; }
.modal-footnote { font-size: 0.75rem; color: var(--text-muted); line-height: 1.4; }

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 960px) {
    .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 28px; }
}
@media (max-width: 768px) {
    .nav-inner { padding: 0 1.25rem; }
    .nav-links { display: none; }
    .mobile-menu-btn { display: inline-flex; }
    .page-header { padding: 48px 5% 32px; }
    .footer-grid { grid-template-columns: 1fr; gap: 24px; }
    .footer-bottom { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 580px) {
    .modal-card { padding: 24px 18px; }
}

/* ==========================================================================
   Print Optimization (@media print)
   ========================================================================== */
@media print {
    nav,
    footer,
    .modal-backdrop,
    .toast-banner,
    .controls-bar,
    .btn-expand,
    .nav-controls,
    .mobile-menu-btn,
    .mobile-nav-drawer {
        display: none !important;
    }

    body {
        background: #ffffff !important;
        color: #000000 !important;
        font-size: 11pt !important;
        line-height: 1.4 !important;
    }

    .container, .content-container, main {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
    }

    .card, .post-card, .accordion-item {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        page-break-inside: avoid;
        margin-bottom: 1.2rem !important;
    }

    .expanded-content, .accordion-content {
        display: block !important;
        max-height: none !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    a {
        color: #000000 !important;
        text-decoration: underline !important;
    }

    h1, h2, h3, h4 {
        color: #000000 !important;
        page-break-after: avoid;
    }
}
