/* =========================================================
   HIGHWAY 91 KICKIN' CONCRETE - GLOBAL THEME (style.css)
   Theme: Forest & Stone (Professional Nonprofit)
   ========================================================= */

/* --- 1. VARIABLES & RESET --- */
:root {
    /* PRIMARY BRAND COLORS */
    --brand-dark: #142721;    /* Deep Forest Green (Primary Brand) */
    --brand-light: #f4f7f6;   /* "Mint-White" (Backgrounds) */
    --brand-slate: #cfd8d4;   /* Light Slate (Footer Text) */
    --brand-gold: #edcf79;    /* Mustard Gold (Accents/Hovers) */
    
    /* FUNCTIONAL COLORS */
    --text-main: #2c3330;     /* Almost Black (Body Text) */
    --text-muted: #667770;    /* Muted Green-Grey (Subtitles) */
    --white: #ffffff;
    --border-color: #e0e6e4;
    
    --container-width: 1200px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { 
    width: 100%; 
    overflow-x: hidden; /* Fixes mobile white space issues */
}

body {
    font-family: 'Open Sans', sans-serif;
    line-height: 1.6;
    color: var(--text-main);
    background-color: var(--white);
}

h1, h2, h3, h4 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    color: var(--brand-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

a { text-decoration: none; transition: 0.3s; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* Accessibility */
.skip-link {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 3000;
    padding: 10px 14px;
    background: var(--brand-gold);
    color: var(--brand-dark);
    font-weight: 800;
    border-radius: 4px;
    transform: translateY(-180%);
    transition: transform 0.2s ease;
}
.skip-link:focus { transform: translateY(0); }

/* --- 2. LAYOUT UTILITIES --- */
.section { padding: 90px 0; }
.bg-light { background: var(--brand-light); }
.section-header { text-align: center; margin-bottom: 60px; max-width: 800px; margin: 0 auto 60px; }

/* Subtle divider line */
.divider { height: 3px; width: 60px; background: var(--brand-dark); margin: 20px auto; opacity: 0.3; }

/* --- 3. BUTTONS (Global Styles) --- */
.btn { 
    display: inline-block; 
    padding: 15px 35px; 
    border-radius: 4px; 
    font-weight: 700; 
    text-transform: uppercase; 
    border: 2px solid transparent; 
    cursor: pointer;
    margin: 10px; /* Standard spacing around buttons */
    font-size: 0.9rem;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

/* Primary Action: Dark Green on White */
.btn-primary { 
    background: var(--brand-dark); 
    color: var(--white); 
}
.btn-primary:hover { 
    background: #1f3a32; /* Lighter Green */
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* Secondary Action: White on Dark (Hero) */
.btn-white { 
    background: var(--white); 
    color: var(--brand-dark); 
}
.btn-white:hover { 
    background: var(--brand-gold); 
    color: var(--brand-dark);
    border-color: var(--brand-gold);
}

/* Outline Button */
.btn-outline { 
    border: 2px solid var(--white); 
    color: var(--white); 
    background: transparent;
}
.btn-outline:hover { 
    background: var(--white); 
    color: var(--brand-dark); 
    transform: translateY(-2px);
}

/* Social Button (Mobile Menu) */
.btn-social {
    display: flex; 
    align-items: center; 
    justify-content: center;
    gap: 10px; 
    
    /* Matches Global Button Size */
    padding: 15px 35px; 
    font-size: 0.9rem;
    font-weight: 700; 
    text-transform: uppercase;
    letter-spacing: 1px;
    
    border-radius: 50px; 
    color: var(--white); 
    margin: 10px auto; 
    width: 100%; 
    max-width: 300px;
    transition: 0.3s;
    border: none;
}

.btn-facebook { 
    background-color: #1877F2; /* Official FB Blue */
    color: #ffffff !important;
}

.btn-facebook:hover { 
    background-color: #145dbf; 
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(24, 119, 242, 0.3);
}
/* Gold Action Button (High Visibility for Registration) */
.btn-gold {
    background: var(--brand-gold);
    color: var(--brand-dark);
    border: 2px solid var(--brand-gold);
}

.btn-gold:hover {
    background: #deb64b; /* Slightly darker gold */
    border-color: #deb64b;
    color: var(--brand-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(237, 207, 121, 0.4);
}
/* --- 4. NAVIGATION --- */
.navbar {
    background-color: var(--white);
    position: sticky; top: 0; z-index: 1000; padding: 15px 0;
    box-shadow: 0 2px 20px rgba(0,0,0,0.05);
}
.nav-container { display: flex; justify-content: space-between; align-items: center; }
.nav-logo { height: 60px; width: auto; display: block; }

.nav-menu { display: flex; align-items: center; gap: 30px; }
/* Navigation Links */
.nav-menu a { 
    color: var(--brand-dark); 
    font-weight: 700; 
    font-size: 0.85rem; 
    text-transform: uppercase; 
    letter-spacing: 0.5px;
    transition: 0.3s;
}

/* Hover Effect: Turns Gold (Matches Footer Links) */
.nav-menu a:hover
 { 
    color: var(--brand-gold); /* Solid Gold */
    opacity: 1; /* Ensures text stays sharp and doesn't fade to gray */
}
.nav-menu a.active {
    color: var(--text-muted); /* Muted Gray (#667770) */
    opacity: 1;
}
/* --- Navigation Buttons (Donate & Register) --- */

/* 1. Donate Button (Standard Dark Green) */
.nav-btn {
    background-color: var(--brand-dark);
    color: var(--white) !important;
    padding: 10px 24px; 
    border-radius: 4px;
    transition: all 0.3s ease;
    opacity: 1;
}

.nav-btn:hover { 
    background-color: #1f3a32; /* Lighter Green */
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.nav-btn.active {
    background-color: var(--brand-gold);
    color: var(--brand-dark) !important;
}

/* Hamburger Menu (Hidden on Desktop) */
.menu-toggle { display: none; cursor: pointer; z-index: 2000; }
.bar { display: block; width: 28px; height: 3px; background: var(--brand-dark); margin: 6px auto; transition: 0.3s; }

/* Mobile Extras (Hidden on Desktop) */
.mobile-extras { display: none; }

/* --- 5. GLOBAL NEWSLETTER SECTION (Pre-Footer) --- */
.newsletter-section { 
    background-color: #e8eceb; /* Light Silver */
    color: var(--brand-dark); 
    text-align: center;
    padding: 60px 0; 
    border-top: 1px solid #d0d6d4;
}

.newsletter-section h2 { 
    color: var(--brand-dark);
    font-size: 1.8rem; 
    margin-bottom: 10px;
}

.newsletter-section p {
    color: var(--text-muted);
    margin-bottom: 25px;
}

/* Form Layout */
.newsletter-form { 
    display: flex; 
    justify-content: center; 
    gap: 10px; 
    flex-wrap: wrap; 
    align-items: center;
    max-width: 600px;
    margin: 0 auto;
}

/* Input Field */
.newsletter-form input[type="email"] { 
    padding: 12px 20px; 
    flex: 1; 
    min-width: 250px;
    border-radius: 4px; 
    border: 1px solid #ccc; 
    font-size: 1rem; 
    background: var(--white);
    color: var(--text-main);
}

/* Specific Button Style (Dark on Light, No Margin) */
.newsletter-form .btn {
    margin: 0; /* Overrides global margin to touch input */
    padding: 12px 25px;
    background-color: var(--brand-dark);
    color: var(--white);
    border: none;
    font-size: 0.95rem;
}

.newsletter-form .btn:hover {
    background-color: var(--brand-gold);
    color: var(--brand-dark);
}

/* --- 6. FOOTER (Professional) --- */
.footer {
    background-color: var(--brand-dark);
    color: var(--brand-slate);
    font-size: 0.95rem;
    padding-top: 0;
}

/* Monochromatic Ribbons (Watermark Style) */
.footer-ribbons {
    background: #0f1f1a; /* Subtle shade difference */
    padding: 15px 0;
    display: flex;
    justify-content: center;
    gap: 30px;
    overflow: hidden;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    user-select: none;
}

.footer-ribbons i {
    font-size: 1.2rem;
    color: var(--white);
    opacity: 0.15;
}

.footer-main { padding: 80px 0 50px; }

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 50px;
    text-align: left;
}

/* Brand Column */
.footer-brand p { margin-top: 20px; line-height: 1.6; opacity: 0.8; max-width: 300px; }
.footer-logo-img { height: 70px; width: auto; opacity: 1; }

.footer h4 {
    color: var(--white);
    font-size: 1rem;
    margin-bottom: 25px;
    letter-spacing: 1.5px;
    opacity: 0.9;
}

/* Unified Footer Text Links (Global Hover) */
/* Target all anchors in footer that are NOT the donate button */
.footer a:not(.footer-donate-btn) {
    color: var(--brand-slate);
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 400;
    display: inline-block;
}

/* Global Hover: Turn Gold */
.footer a:not(.footer-donate-btn):hover {
    color: var(--brand-gold);
}

/* List Layouts */
.footer-links li { margin-bottom: 12px; }
.footer-links a { padding: 2px 0; }

.footer-contact li {
    display: flex; align-items: flex-start; justify-content: flex-start; gap: 15px; margin-bottom: 20px;
}
.footer-contact i { color: var(--white); opacity: 0.6; font-size: 1.1rem; margin-top: 3px; min-width: 20px; }

/* Support/Donate Column Text */
.footer-support-text {
    font-size: 0.9rem;
    margin-bottom: 30px; /* Spacing above button */
    line-height: 1.5;
    opacity: 0.8;
    display: block;
}

/* Donate Button in Footer (High Contrast) */
.footer-donate-btn {
    display: block;
    width: 100%;
    text-align: center;
    background: var(--white);
    color: var(--brand-dark);
    padding: 15px;
    font-weight: 800;
    text-transform: uppercase;
    border-radius: 4px;
    letter-spacing: 1px;
    transition: 0.3s;
}
.footer-donate-btn:hover { 
    background: var(--brand-gold); 
    color: var(--brand-dark); 
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

/* Bottom Bar */
.footer-bottom {
    background-color: #0b1613;
    padding: 30px 0;
    border-top: 1px solid rgba(255,255,255,0.05);
    font-size: 0.85rem;
    color: #5d6d66;
}
.footer-bottom-flex { display: flex; justify-content: space-between; align-items: center; }
.footer-legal a { color: #5d6d66; margin-left: 20px; padding: 10px; }
.footer-legal a:hover { color: var(--white); text-decoration: underline; }

/* --- 7. RESPONSIVE MEDIA QUERIES --- */
@media(max-width: 900px) { 
    .footer-grid { grid-template-columns: 1fr 1fr; } 
}

@media(max-width: 768px) {
    /* 1. Show the Hamburger */
    .menu-toggle { display: block; }

    /* 2. Full Screen Menu Panel */
    .nav-menu {
        position: fixed; 
        top: 0; 
        right: -100%; 
        width: 100%; 
        height: 100vh; 
        flex-direction: column; 
        justify-content: center; 
        align-items: center;
        background: var(--white);
        padding: 40px 20px; 
        transition: 0.4s ease-in-out; 
        z-index: 1500;
    }

    /* 3. Active State */
    .nav-menu.active { right: 0; }
    
    /* 4. BALANCED Menu Links */
    .nav-menu li { 
        margin: 15px 0; 
        width: 100%;
        text-align: center;
    }

    .nav-menu a {
        font-size: 1.25rem; 
        font-weight: 700;
    }
    
    /* 5. Donate Button Size */
    /* 5. Mobile Action Buttons (Donate & Register) */
    .nav-btn, .nav-btn-register {
        display: inline-block;
        width: auto; 
        min-width: 200px; 
        padding: 15px 30px; 
        font-size: 1rem; 
        margin-top: 10px;
        text-align: center; /* Ensure text is centered */
    }
    /* 6. Mobile Extras */
    .mobile-extras { 
        display: block; 
        text-align: center; 
        margin-top: 30px; 
        border-top: 2px solid var(--border-color); 
        padding-top: 30px; 
        width: 100%; 
    }
    
    /* FACEBOOK BUTTON SPECIFIC FIX */
    .btn-social {
        display: inline-flex; 
        align-items: center;
        justify-content: center;
        gap: 10px;
        white-space: nowrap; /* Forces one line */
        width: auto;
        min-width: 200px;
        padding: 15px 20px; 
        font-size: 0.75rem !important; /* Forces text smaller (12px) */
    }
    
    /* Icon size adjustment to match smaller text */
    .btn-social i {
        font-size: 1rem; 
    }

    /* 7. Hamburger Animation */
    .menu-toggle.is-active .bar:nth-child(2) { opacity: 0; }
    .menu-toggle.is-active .bar:nth-child(1) { transform: translateY(9px) rotate(45deg); }
    .menu-toggle.is-active .bar:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

    /* Footer Fixes */
    .footer-main { padding: 50px 0 30px; }
    .footer-grid { grid-template-columns: 1fr; text-align: left; gap: 40px; }
    .footer-brand p { max-width: 100%; }
    .footer-bottom-flex { flex-direction: column; gap: 15px; text-align: center; }
    
    /* Newsletter Mobile */
    .newsletter-form { flex-direction: column; gap: 15px; }
    .newsletter-form input[type="email"] { width: 100%; }
    .newsletter-form .btn { width: 100%; }
}
/* Shared section label */
.section-kicker {
    display: inline-block;
    margin-bottom: 10px;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 1.4px;
    text-transform: uppercase;
}

/* --- SHARED UTILITIES & LEGAL PAGE HEADER --- */
.text-center { text-align: center !important; }
.text-muted { color: var(--text-muted) !important; }

.page-header {
    padding: 70px 0;
    background: var(--brand-dark);
    border-bottom: 6px solid var(--brand-gold);
    text-align: center;
}
.page-header h1 {
    margin: 0;
    color: var(--white);
}

.quote-box {
    margin: 25px 0;
    padding: 18px 20px;
    border-left: 4px solid var(--brand-gold);
    background: var(--brand-light);
    color: #44514c;
    font-size: 1.05rem;
    font-style: italic;
    line-height: 1.7;
}

/* Keep anchored sections visible below the sticky navigation. */
section[id] { scroll-margin-top: 100px; }

/* Avoid layout shifts when local images load. */
img { height: auto; }

.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}



/* =========================================================
   COMPACT MOBILE NAVIGATION
   ========================================================= */
.nav-overlay {
    display: none;
}

@media (max-width: 768px) {
    .navbar {
        padding: 10px 0;
    }

    .nav-logo {
        height: 48px;
    }

    .menu-toggle {
        display: inline-flex;
        width: 44px;
        height: 44px;
        padding: 8px;
        margin: 0;
        border: 0;
        border-radius: 6px;
        background: transparent;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        position: relative;
        z-index: 2001;
        -webkit-tap-highlight-color: transparent;
    }

    .menu-toggle:focus-visible {
        outline: 2px solid var(--brand-dark);
        outline-offset: 2px;
    }

    .bar {
        width: 24px;
        height: 2px;
        margin: 3px auto;
    }

    .menu-toggle.is-active {
        position: fixed;
        top: 12px;
        right: 16px;
        background: var(--white);
        box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    }

    .menu-toggle.is-active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .menu-toggle.is-active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .nav-overlay {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1490;
        background: rgba(7, 18, 15, 0.48);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.25s ease, visibility 0.25s ease;
    }

    .nav-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    .nav-menu,
    .nav-menu::before,
    .nav-menu::after {
        border: 0 !important;
        border-top: 0 !important;
        box-shadow: none;
    }

    .nav-menu::before,
    .nav-menu::after {
        content: none !important;
        display: none !important;
    }

    .nav-menu {
        top: 0;
        right: -390px;
        width: min(88vw, 370px);
        height: 100dvh;
        min-height: 100vh;
        padding: 72px 24px 26px;
        background: var(--white);
        align-items: stretch;
        justify-content: flex-start;
        gap: 0;
        overflow-y: auto;
        overscroll-behavior: contain;
        box-shadow: -18px 0 45px rgba(10, 29, 23, 0.18);
        transition: right 0.28s ease;
        z-index: 1500;
    }

    .nav-menu.active {
        right: 0;
    }

    .nav-menu > li {
        width: 100%;
        margin: 0;
        text-align: left;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-menu > li > a:not(.btn-social) {
        display: flex;
        align-items: center;
        min-height: 48px;
        padding: 11px 4px;
        font-size: 0.95rem;
        line-height: 1.2;
        letter-spacing: 0.7px;
        color: var(--brand-dark);
    }

    .nav-menu > li > a.active:not(.nav-btn) {
        color: var(--text-muted);
    }

    .nav-menu > li > a:hover:not(.nav-btn):not(.btn-social) {
        color: var(--brand-dark);
        background: var(--brand-light);
        padding-left: 10px;
    }

    .nav-menu > .nav-donate-item {
        border-bottom: 0;
        padding-top: 14px;
    }

    .nav-btn,
    .nav-btn-register {
        display: flex !important;
        width: 100%;
        min-width: 0;
        min-height: 48px;
        margin: 0;
        padding: 12px 18px !important;
        justify-content: center;
        font-size: 0.9rem !important;
        border-radius: 4px;
    }

    .mobile-extras {
        display: block;
        width: 100%;
        margin: 18px 0 0 !important;
        padding: 18px 0 0 !important;
        border-top: 1px solid var(--border-color) !important;
        border-bottom: 0 !important;
        text-align: left;
    }

    .mobile-extras > p:first-child {
        margin: 0 0 10px !important;
        color: var(--text-muted) !important;
        font-size: 0.75rem !important;
        font-weight: 700;
        letter-spacing: 1px;
        text-transform: uppercase;
    }

    .btn-social {
        width: 100%;
        min-width: 0;
        max-width: none;
        margin: 0;
        padding: 11px 16px;
        border-radius: 5px;
        font-size: 0.78rem !important;
    }

    .mobile-extras > p:last-child {
        display: flex;
        align-items: flex-start;
        gap: 9px;
        margin: 14px 0 0 !important;
        font-size: 0.78rem !important;
        line-height: 1.45;
        overflow-wrap: anywhere;
    }

    .mobile-extras > p:last-child a {
        display: inline;
        min-height: 0;
        padding: 0;
        font-size: inherit;
        text-transform: none;
        letter-spacing: 0;
    }

    body.menu-open {
        overflow: hidden;
        touch-action: none;
    }
}

@media (max-width: 420px) {
    .nav-menu {
        width: min(88vw, 340px);
        padding-left: 20px;
        padding-right: 20px;
    }
}

/* =========================================================
   MOBILE SCROLL NAVIGATION + BACK TO TOP
   ========================================================= */
.navbar {
    transition: transform 0.28s ease, box-shadow 0.25s ease;
    will-change: transform;
}

.back-to-top {
    position: fixed;
    right: max(18px, env(safe-area-inset-right));
    bottom: max(18px, env(safe-area-inset-bottom));
    z-index: 1200;
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 50%;
    background: var(--brand-dark);
    color: var(--white);
    box-shadow: 0 8px 24px rgba(8, 28, 21, 0.24);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(14px);
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease, background 0.22s ease;
    -webkit-tap-highlight-color: transparent;
}

.back-to-top:hover,
.back-to-top:focus-visible {
    background: #1f3a32;
    color: var(--brand-gold);
    transform: translateY(-2px);
}

.back-to-top:focus-visible {
    outline: 3px solid var(--brand-gold);
    outline-offset: 3px;
}

.back-to-top.is-visible:not(.near-footer) {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

@media (max-width: 768px) {
    .navbar.nav-hidden {
        transform: translateY(calc(-100% - 4px));
    }

    /* More comfortable touch targets without returning to an oversized menu. */
    .nav-menu > li > a:not(.btn-social) {
        min-height: 56px;
        padding: 16px 6px;
    }

    .nav-menu > .nav-donate-item {
        padding-top: 16px;
    }

    .nav-btn,
    .nav-btn-register {
        min-height: 54px;
        padding-top: 15px !important;
        padding-bottom: 15px !important;
    }

    .back-to-top {
        width: 46px;
        height: 46px;
        right: max(14px, env(safe-area-inset-right));
        bottom: max(14px, env(safe-area-inset-bottom));
    }
}

@media (prefers-reduced-motion: reduce) {
    .navbar,
    .back-to-top {
        transition: none;
    }
}

/* =========================================================
   DESKTOP STICKY NAVIGATION
   ========================================================= */
@media (min-width: 769px) {
    .navbar {
        position: sticky;
        top: 0;
        z-index: 2000;
        transition: padding 0.22s ease, box-shadow 0.22s ease, background-color 0.22s ease;
    }

    .navbar .nav-logo {
        transition: height 0.22s ease;
    }

    .navbar.is-scrolled {
        padding-top: 8px;
        padding-bottom: 8px;
        background-color: rgba(255,255,255,0.97);
        box-shadow: 0 8px 26px rgba(20,39,33,0.12);
        backdrop-filter: blur(10px);
    }

    .navbar.is-scrolled .nav-logo {
        height: 48px;
    }
}

/* =========================================================
   ROBUST DESKTOP PERSISTENT NAVIGATION
   Keeps the full navigation visible while scrolling without
   changing the mobile hide-and-return behavior.
   ========================================================= */
@media (min-width: 769px) {
    html {
        scroll-padding-top: 96px;
    }

    body {
        padding-top: 90px;
    }

    .navbar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        z-index: 3000;
        transform: none !important;
    }

    .navbar.is-scrolled {
        padding-top: 8px;
        padding-bottom: 8px;
    }

    /* Ensure in-page anchors are not covered by the fixed header. */
    [id] {
        scroll-margin-top: 96px;
    }
}
