/**
 * header.css — PRODUCTION READY (MOBILE MENU FIXED)
 * @version 2.5.0
 *
 * CRITICAL FIXES:
 * - Mobile menu now 100% VERTICAL (column layout)
 * - Removed ALL horizontal/row layout CSS
 * - Proper stacking context for mobile menu
 * - Isolation layer prevents content bleed
 * - Z-index architecture rebuilt
 * - Fixed left/top gaps in header
 */

/* ============================================
   Design Tokens
   ============================================ */
:root {
    --color-primary: #0b6b3a;
    --color-primary-dark: #094d29;
    --color-primary-light: #148a49;
    --color-accent: #d4af37;

    --color-text: #1a1a1a;
    --color-text-muted: #6b7280;
    --color-text-light: #9ca3af;

    --color-bg: #ffffff;
    --color-bg-subtle: #f9fafb;
    --color-bg-muted: #f3f4f6;

    --color-border: #e5e7eb;
    --color-border-light: #f3f4f6;

    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --font-weight-extrabold: 800;

    --header-height: 4.5rem;
    --max-width: 1400px;
    --container-padding: 1.5rem;

    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);

    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 350ms cubic-bezier(0.4, 0, 0.2, 1);

    --z-content: 1;
    --z-header: 9000;
    --z-backdrop: 9998;
    --z-mobile-menu: 9999;
}

@media (min-width: 768px) {
    :root { --container-padding: 2rem; }
}
@media (min-width: 1024px) {
    :root { --container-padding: 2.5rem; }
}

/* ============================================
   Global Reset — fixes left/top gap
   ============================================ */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    -webkit-text-size-adjust: 100%;
    background-color: var(--color-bg);
    box-sizing: border-box;
}

*, *::before, *::after {
    box-sizing: inherit;
}

/* ============================================
   Base & Resets
   ============================================ */
.site-header,
.site-header ul,
.site-header li,
.mobile-menu,
.mobile-menu ul,
.mobile-menu li {
    margin: 0;
    padding: 0;
    list-style: none;
    font-family: var(--font-sans);
}

.site-header a,
.mobile-menu a {
    color: inherit;
    text-decoration: none;
}

/* ============================================
   Accessibility
   ============================================ */
.skip-link {
    position: absolute;
    top: -100%;
    left: var(--space-4);
    z-index: 99999;
    padding: var(--space-4) var(--space-6);
    background: var(--color-primary);
    color: white;
    font-weight: var(--font-weight-bold);
    border-radius: var(--radius-md);
    transition: top var(--transition-fast);
}
.skip-link:focus {
    top: var(--space-4);
    outline: 3px solid var(--color-accent);
    outline-offset: 2px;
}

/* ============================================
   Header Layout
   ============================================ */
.site-header {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    z-index: var(--z-header);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border);
    transition: transform var(--transition-base), box-shadow var(--transition-base);
    will-change: transform;
    isolation: isolate;
}
.site-header.bt4t-is-scrolled { box-shadow: var(--shadow-md); }
.site-header.bt4t-is-hidden { transform: translateY(-100%); }

.header-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding-inline: var(--container-padding);
    box-sizing: border-box;
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    height: var(--header-height);
}

.header-brand { flex-shrink: 0; z-index: 2; position: relative; }
.brand-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2);
    margin: calc(var(--space-2) * -1);
    color: var(--color-primary);
    font-weight: var(--font-weight-extrabold);
    font-size: var(--font-size-lg);
    border-radius: var(--radius-md);
    transition: transform var(--transition-fast), opacity var(--transition-fast);
}
.brand-link:hover { transform: translateY(-1px); opacity: 0.9; }
.brand-link:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 3px; }

.brand-icon { display:flex; width:2rem; height:2rem; flex-shrink:0; }
.brand-text { letter-spacing: -0.02em; }

@media (min-width: 768px) {
    .brand-link { font-size: var(--font-size-xl); }
    .brand-icon { width:2.25rem; height:2.25rem; }
}

/* ============================================
   Desktop Navigation
   ============================================ */
.header-nav { display: none; flex:1; justify-content:center; }
@media (min-width:1024px) { .header-nav { display:flex; } }

.bt4t-nav-list {
    display:flex;
    align-items:center;
    gap: clamp(0.5rem, 2vw, 1.5rem);
}
.bt4t-nav-item { margin:0; }
.bt4t-nav-link {
    display:flex;
    align-items:center;
    padding: var(--space-3) clamp(0.875rem, 2vw, 1.5rem);
    color: var(--color-text);
    font-weight: var(--font-weight-semibold);
    font-size: clamp(0.9375rem, 1.5vw, 1rem);
    white-space: nowrap;
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
    position: relative;
}
.bt4t-nav-link::after {
    content: '';
    position:absolute;
    bottom:0.5rem;
    left:1rem;
    right:1rem;
    height:0;
    background:var(--color-primary);
    border-radius:2px;
    transition:height var(--transition-fast);
}
.bt4t-nav-link:hover {
    color:var(--color-primary);
    background: rgba(11,107,58,0.06);
    transform: translateY(-2px);
}
.bt4t-nav-link:focus-visible {
    outline:2px solid var(--color-primary);
    outline-offset:2px;
}

.bt4t-nav-item.is-active .bt4t-nav-link,
.bt4t-nav-item.current-menu-item .bt4t-nav-link,
.bt4t-nav-item.current_page_item .bt4t-nav-link {
    color: var(--color-primary);
    background: rgba(11, 107, 58, 0.1);
    font-weight: var(--font-weight-bold);
}
.bt4t-nav-item.is-active .bt4t-nav-link::after,
.bt4t-nav-item.current-menu-item .bt4t-nav-link::after,
.bt4t-nav-item.current_page_item .bt4t-nav-link::after {
    height: 3px;
}

.header-actions {
    display:flex;
    align-items:center;
    gap:var(--space-3);
    flex-shrink:0;
    z-index:2;
    position: relative;
}

.btn {
    display: inline-flex;
    align-items:center;
    justify-content:center;
    gap:var(--space-2);
    padding: var(--space-3) var(--space-5);
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-sm);
    line-height:1.5;
    white-space:nowrap;
    border:none;
    border-radius:var(--radius-lg);
    cursor:pointer;
    transition: all var(--transition-base);
    text-decoration: none;
}
.btn:focus-visible {
    outline:3px solid var(--color-accent);
    outline-offset:2px;
}
.btn-primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
    color:white;
    box-shadow: var(--shadow-md);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-text { display:none; }
@media (min-width:640px) { .btn-text { display:inline-block; } }
@media (min-width:768px) {
    .btn {
        padding: var(--space-4) var(--space-6);
        font-size: var(--font-size-base);
    }
}
.btn-block { width:100%; }

/* ============================================
   Mobile Menu Toggle
   ============================================ */
.menu-toggle {
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:3rem;
    height:3rem;
    padding:0;
    background:transparent;
    border:none;
    border-radius:var(--radius-md);
    cursor:pointer;
    transition: background var(--transition-fast);
    position:relative;
}
.menu-toggle:hover { background: var(--color-bg-muted); }
.menu-toggle:focus-visible {
    outline:2px solid var(--color-primary);
    outline-offset:2px;
}

.toggle-icon {
    display:block;
    width:1.5rem;
    height:1.5rem;
    position:relative;
}
.toggle-line,
.toggle-line::before,
.toggle-line::after {
    display:block;
    width:100%;
    height:2.5px;
    background:var(--color-primary);
    border-radius:2px;
    position:absolute;
    transition: all var(--transition-base);
}
.toggle-line { top:50%; transform: translateY(-50%); }
.toggle-line::before { content:''; top:-0.5rem; }
.toggle-line::after { content:''; bottom:-0.5rem; }

.menu-toggle.bt4t-is-active .toggle-line,
.menu-toggle[aria-expanded="true"] .toggle-line {
    background: transparent;
}
.menu-toggle.bt4t-is-active .toggle-line::before,
.menu-toggle[aria-expanded="true"] .toggle-line::before {
    top:0;
    transform: rotate(45deg);
}
.menu-toggle.bt4t-is-active .toggle-line::after,
.menu-toggle[aria-expanded="true"] .toggle-line::after {
    bottom:0;
    transform: rotate(-45deg);
}

@media (min-width: 1024px) { .menu-toggle { display:none; } }

/* ============================================
   CRITICAL: Mobile Menu - 100% VERTICAL LAYOUT
   ============================================ */

/* Backdrop */
.menu-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: var(--z-backdrop);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-smooth),
                visibility 0s var(--transition-smooth);
    pointer-events: none;
    isolation: isolate;
}

.menu-backdrop[data-state="visible"] {
    opacity: 1;
    visibility: visible;
    transition: opacity var(--transition-smooth), visibility 0s;
    pointer-events: auto;
}

/* Mobile menu container */
.mobile-menu {
    position: fixed;
    inset: var(--header-height) 0 0 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: var(--z-mobile-menu);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px);
    transition: opacity var(--transition-smooth),
                visibility 0s var(--transition-smooth),
                transform var(--transition-smooth);
    pointer-events: none;
    isolation: isolate;
    contain: layout style paint;
}

.mobile-menu[data-state="open"] {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity var(--transition-smooth),
                visibility 0s,
                transform var(--transition-smooth);
    pointer-events: auto;
}

.mobile-menu-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: var(--space-6) var(--container-padding) var(--space-8);
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(249,250,251,0.98));
    position: relative;
    z-index: 1;
}

.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: var(--space-6);
    margin-bottom: var(--space-8);
    border-bottom: 2px solid rgba(11,107,58,0.1);
}

.mobile-brand {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    color: var(--color-primary);
}

.mobile-icon { display: flex; width: 2rem; height: 2rem; }

.mobile-title {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-text);
}

.mobile-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    padding: 0;
    background: rgba(11,107,58,0.08);
    border: none;
    border-radius: 50%;
    color: var(--color-primary);
    cursor: pointer;
    transition: all var(--transition-base);
}

.mobile-close:hover {
    background: rgba(11,107,58,0.15);
    transform: rotate(90deg);
}

.mobile-close:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* ============================================
   CRITICAL: Mobile Navigation - FORCED VERTICAL
   ============================================ */
.mobile-nav {
    flex: 1;
    margin-bottom: var(--space-8);
    position: relative;
    z-index: 1;
}

/* NUCLEAR OPTION: Maximum specificity for vertical layout */
#bt4t-mobile-menu .mobile-nav-list,
.mobile-menu .mobile-nav-list,
.mobile-menu .mobile-nav .mobile-nav-list,
nav.mobile-nav ul.mobile-nav-list {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: var(--space-4) !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
}

/* Force each menu item to be a block */
#bt4t-mobile-menu .mobile-nav-list > li,
.mobile-menu .mobile-nav-list > li,
.mobile-menu .mobile-nav .mobile-nav-list > li,
nav.mobile-nav ul.mobile-nav-list > li {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    flex: none !important;
}

/* Force links to be full-width blocks */
#bt4t-mobile-menu .mobile-nav-list > li > a,
.mobile-menu .mobile-nav-list > li > a,
.mobile-menu .mobile-nav .mobile-nav-list > li > a,
nav.mobile-nav ul.mobile-nav-list > li > a {
    display: block !important;
    width: 100% !important;
    padding: var(--space-4) var(--space-5) !important;
    color: var(--color-text) !important;
    font-weight: var(--font-weight-semibold) !important;
    font-size: var(--font-size-lg) !important;
    text-align: center !important;
    background: white !important;
    border: 1.5px solid var(--color-border) !important;
    border-radius: var(--radius-xl) !important;
    box-shadow: var(--shadow-sm) !important;
    transition: all var(--transition-base) !important;
    white-space: normal !important;
    word-break: break-word !important;
}

#bt4t-mobile-menu .mobile-nav-list > li > a:hover,
#bt4t-mobile-menu .mobile-nav-list > li > a:focus,
.mobile-menu .mobile-nav-list > li > a:hover,
.mobile-menu .mobile-nav-list > li > a:focus {
    color: var(--color-primary) !important;
    background: rgba(11,107,58,0.04) !important;
    border-color: var(--color-primary) !important;
    transform: translateY(-2px) !important;
    box-shadow: var(--shadow-md) !important;
}

#bt4t-mobile-menu .mobile-nav-list > li.current-menu-item > a,
#bt4t-mobile-menu .mobile-nav-list > li.current_page_item > a,
.mobile-menu .mobile-nav-list > li.current-menu-item > a,
.mobile-menu .mobile-nav-list > li.current_page_item > a {
    color: var(--color-primary) !important;
    background: rgba(11,107,58,0.1) !important;
    border-color: var(--color-primary) !important;
    font-weight: var(--font-weight-bold) !important;
}

/* Animation */
.mobile-menu[data-state="open"] .mobile-nav-list > li {
    opacity: 0;
    animation: slideIn var(--transition-smooth) forwards;
}
.mobile-menu[data-state="open"] .mobile-nav-list > li:nth-child(1) { animation-delay: 50ms; }
.mobile-menu[data-state="open"] .mobile-nav-list > li:nth-child(2) { animation-delay: 100ms; }
.mobile-menu[data-state="open"] .mobile-nav-list > li:nth-child(3) { animation-delay: 150ms; }
.mobile-menu[data-state="open"] .mobile-nav-list > li:nth-child(4) { animation-delay: 200ms; }
.mobile-menu[data-state="open"] .mobile-nav-list > li:nth-child(5) { animation-delay: 250ms; }

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Mobile CTA & Footer */
.mobile-cta {
    padding: var(--space-6) 0;
    border-top: 2px solid rgba(11, 107, 58, 0.1);
}

.mobile-footer {
    padding-top: var(--space-6);
    border-top: 1px solid var(--color-border-light);
}

.mobile-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    margin: 0;
    padding: var(--space-3);
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
    background: var(--color-bg-subtle);
    border-radius: var(--radius-lg);
}

/* ============================================
   Body state when menu is open
   ============================================ */
body.bt4t-menu-open {
    overflow: hidden;
    position: relative;
}

body.bt4t-menu-open #main-content,
body.bt4t-menu-open .site-main,
body.bt4t-menu-open main {
    position: relative;
    z-index: var(--z-content);
}

/* ============================================
   Desktop override
   ============================================ */
@media (min-width: 1024px) {
    .mobile-menu,
    .menu-backdrop {
        display: none !important;
    }

    body.bt4t-menu-open {
        overflow: auto;
        position: static;
    }
}

/* ============================================
   Reduced motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .mobile-nav-list > li {
        animation: none !important;
        opacity: 1 !important;
    }
}

/* ============================================
   Print
   ============================================ */
@media print {
    .site-header,
    .mobile-menu,
    .menu-backdrop,
    .menu-toggle,
    .skip-link {
        display: none !important;
    }
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1023px) {
    .mobile-nav-list > li > a {
        white-space: normal !important;
        word-break: break-word;
        overflow-wrap: break-word;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .mobile-nav-list > li > a {
        font-size: 1.125rem;
        padding: 1rem 1.5rem;
    }
}

@media (min-width: 1440px) {
    .bt4t-nav-list { gap: clamp(1rem, 1.8vw, 2.5rem); }
    .bt4t-nav-link { padding: 0.875rem 2rem; font-size: 1.125rem; }
}

@media (min-width: 1600px) {
    .header-container { max-width: 1600px; }
}