/* ==========================================================================
   Bentana Woods Cluster Association (BWCA) — Core Global Stylesheet
   Version: 1.0 (2026 Canonical Design System)
   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;
}



/* ==========================================================================
   Global Navigation Bar
   ========================================================================== */
nav {
    background: rgba(250, 249, 245, 0.96);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 1000;
}
.nav-inner {
    max-width: 1240px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.05rem 6%;
}
.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.5rem; }
.nav-links .nav-link {
    text-decoration: none;
    color: var(--text-body);
    font-size: 0.88rem;
    font-weight: 500;
    transition: color 0.18s ease;
    background: none;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font-sans);
}
.nav-links .nav-link:hover, .nav-links .nav-link.active {
    color: var(--primary-light);
    font-weight: 600;
}
.nav-caret { font-size: 0.65rem; transition: transform 0.2s ease; }
.nav-item { position: relative; }
.nav-item:hover .nav-caret, .nav-item:focus-within .nav-caret {
    transform: rotate(180deg);
}
.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 250px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    box-shadow: var(--shadow-hover);
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    z-index: 1050;
}
.nav-item:hover .nav-dropdown-menu,
.nav-item:focus-within .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.nav-dropdown-item {
    padding: 9px 12px;
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-body);
    font-size: 0.85rem;
    font-weight: 500;
    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: 600;
}
.nav-dropdown-item .item-desc {
    display: block;
    font-size: 0.73rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-top: 1px;
}

.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 Menu Button */
.nav-controls { display: none; }
.mobile-menu-btn {
    background: none;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 7px 9px;
    cursor: pointer;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
}
.mobile-menu-btn svg { width: 22px; height: 22px; fill: currentColor; }

/* ==========================================================================
   Buttons & Links Utilities
   ========================================================================== */
.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;
}

/* Subtle External Link Marker */
a[target="_blank"]:not(.brand-container):not(.btn-download-pdf):not(.modal-launch-btn):not(.woodland-ai-fab):not(.open-modal-trigger):not(.nav-link):not(.nav-dropdown-item):not(.btn-archive-folder):not(.btn-primary-action)::after {
    content: " ↗";
    font-size: 0.78em;
    vertical-align: super;
    line-height: 0;
    opacity: 0.75;
}

/* ==========================================================================
   4-Column Directory Footer
   ========================================================================== */
footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border-light);
    margin-top: 60px;
    padding: 50px 6% 30px;
}
.footer-inner {
    max-width: 1240px;
    margin: 0 auto;
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
    margin-bottom: 40px;
}
.footer-col h4 {
    font-family: var(--font-sans);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--brass);
    margin-bottom: 16px;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 10px; }
.footer-col a {
    text-decoration: none;
    color: var(--text-body);
    font-size: 0.88rem;
    transition: color 0.15s ease;
}
.footer-col a:hover { color: var(--primary-light); text-decoration: underline; }
.footer-desc { font-size: 0.86rem; color: var(--text-muted); margin-bottom: 12px; }
.footer-contact { font-size: 0.86rem; color: var(--text-body); margin-bottom: 8px; }
.footer-contact a { color: var(--primary); font-weight: 600; text-decoration: underline; }
.footer-meeting { font-size: 0.82rem; color: var(--text-muted); line-height: 1.4; }
.footer-bottom {
    border-top: 1px solid var(--border-light);
    padding-top: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}
.footer-logo {
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-heading);
}
.footer-legal {
    font-size: 0.75rem;
    color: #8b9991;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ==========================================================================
   Floating Action Button (Resident AI)
   ========================================================================== */
.woodland-ai-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: linear-gradient(135deg, var(--primary) 0%, #152720 100%);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    padding: 11px 20px;
    display: flex;
    align-items: center;
    gap: 9px;
    font-family: var(--font-sans);
    font-size: 0.88rem;
    font-weight: 600;
    box-shadow: 0 8px 24px -4px rgba(23, 36, 30, 0.35);
    cursor: pointer;
    z-index: 990;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
.woodland-ai-fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px -4px rgba(23, 36, 30, 0.45);
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
}
.woodland-ai-fab svg { width: 17px; height: 17px; fill: var(--brass-soft); }
.woodland-ai-fab-badge {
    background: var(--brass);
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
    letter-spacing: 0.04em;
}

/* ==========================================================================
   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: 580px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 36px;
    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.7rem;
    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: 24px;
}
.features-list { display: flex; flex-direction: column; gap: 14px; margin-bottom: 24px; }
.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: 24px;
}
.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;
}

.modal-footer { 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: 12px;
}
.modal-launch-btn:hover { background: var(--primary-hover); }
.modal-footnote { font-size: 0.75rem; color: var(--text-muted); line-height: 1.4; }

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 960px) {
    .nav-links { display: none; }
    .nav-controls { display: flex; }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 580px) {
    .footer-grid { grid-template-columns: 1fr; }
    .footer-bottom { flex-direction: column; text-align: center; }
    .modal-card { padding: 24px 18px; }
}

/* ==========================================================================
   Print Optimization (@media print)
   ========================================================================== */
@media print {
    nav, 
    footer, 
    .woodland-ai-fab, 
    .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;
    }

    /* Auto-expand accordion and details content in print mode */
    .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;
    }

    a[target="_blank"]::after {
        content: "" !important;
    }

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