/* ==========================================================================
   VFW POST 1298 - BOWLING GREEN, KY
   Core Architecture Stylesheet (style.css)
   Optimized for: Performance, WCAG AA Accessibility, and Cross-Browser Fluidity
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design Tokens & Variables
   -------------------------------------------------------------------------- */
:root {
    /* Color Palette */
    --color-navy: #12355B;
    --color-navy-light: #1A477A;
    --color-navy-dark: #0A223B;
    --color-red: #A62828;
    --color-red-light: #C43232;
    --color-gold: #C9A227;
    --color-gold-dark: #A3811D;
    
    /* Neutrals */
    --color-bg: #F7F8FA;
    --color-surface: #FFFFFF;
    --color-text: #2D3748;
    --color-text-muted: #5A6A85;
    --color-border: #E2E8F0;
    
    /* System & States */
    --color-focus: #2B6CB0;
    --color-overlay: rgba(18, 53, 91, 0.85);
    
    /* Typography */
    --font-headings: 'Merriweather', Georgia, serif;
    --font-body: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    
    /* Layout Constants */
    --max-width: 1200px;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;
    
    /* Transitions & Shadows */
    --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}

/* --------------------------------------------------------------------------
   2. Modern Reset & Accessibility Resets
   -------------------------------------------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-body);
    line-height: 1.6;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* --------------------------------------------------------------------------
   3. Typography & Global Focus
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-headings);
    color: var(--color-navy-dark);
    font-weight: 700;
    line-height: 1.25;
}

p {
    margin-bottom: 1.25rem;
}

a {
    color: var(--color-navy);
    text-decoration: none;
    transition: color 0.2s var(--transition-smooth);
}

a:hover {
    color: var(--color-red);
}

/* Strict Keyboard Focus Indicators (WCAG AA Compliance) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 3px solid var(--color-focus);
    outline-offset: 3px;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* --------------------------------------------------------------------------
   4. Skip to Content (A11y Critical)
   -------------------------------------------------------------------------- */
.skip-link {
    position: absolute;
    top: -100px;
    left: 1rem;
    background: var(--color-gold);
    color: var(--color-navy-dark);
    font-weight: 700;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-sm);
    z-index: 9999;
    box-shadow: var(--shadow-lg);
    transition: top 0.2s ease;
}

.skip-link:focus-visible {
    top: 1rem;
}

/* --------------------------------------------------------------------------
   5. Structural Layout Elements
   -------------------------------------------------------------------------- */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

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

/* --------------------------------------------------------------------------
   6. Global Sticky Header & Navigation Base
   -------------------------------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: var(--color-surface);
    box-shadow: var(--shadow-sm);
    transition: padding 0.3s var(--transition-smooth), background-color 0.3s ease;
}

.site-header--scrolled {
    padding: 0.25rem 0;
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(8px);
    box-shadow: var(--shadow-md);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-family: var(--font-headings);
    font-weight: 700;
    color: var(--color-navy-dark);
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.logo-title {
    font-size: 1.25rem;
    letter-spacing: -0.5px;
}

.logo-subtitle {
    font-size: 0.8rem;
    font-family: var(--font-body);
    color: var(--color-text-muted);
    font-weight: 500;
}

/* Main Nav Navigation list items */
.main-nav {
    display: flex;
    align-items: center;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 1.75rem;
    align-items: center;
}

.nav-link {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--color-text);
    padding: 0.5rem 0;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--color-navy);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--color-red);
    transition: width 0.25s var(--transition-smooth);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Mobile Toggle Button */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    aria-label: "Toggle Menu";
}

.nav-toggle-box {
    display: inline-block;
    width: 24px;
    height: 24px;
    position: relative;
}

.nav-toggle-inner {
    display: block;
    top: 50%;
    margin-top: -2px;
}

.nav-toggle-inner,
.nav-toggle-inner::before,
.nav-toggle-inner::after {
    width: 24px;
    height: 4px;
    background-color: var(--color-navy);
    position: absolute;
    transition: transform 0.15s ease, opacity 0.15s ease;
    border-radius: 2px;
}

.nav-toggle-inner::before,
.nav-toggle-inner::after {
    content: "";
    display: block;
}

.nav-toggle-inner::before { top: -8px; }
.nav-toggle-inner::after { bottom: -8px; }

/* --------------------------------------------------------------------------
   7. Base Components: Reusable Global Buttons
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.85rem 1.75rem;
    font-weight: 600;
    font-size: 1rem;
    border-radius: var(--radius-md);
    transition: all 0.2s var(--transition-smooth);
    cursor: pointer;
    border: 2px solid transparent;
    text-align: center;
}

.btn--primary {
    background-color: var(--color-red);
    color: var(--color-surface);
}

.btn--primary:hover {
    background-color: var(--color-red-light);
    color: var(--color-surface);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn--secondary {
    background-color: var(--color-navy);
    color: var(--color-surface);
}

.btn--secondary:hover {
    background-color: var(--color-navy-light);
    color: var(--color-surface);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn--accent {
    background-color: var(--color-gold);
    color: var(--color-navy-dark);
}

.btn--accent:hover {
    background-color: var(--color-gold-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn--outline {
    background-color: transparent;
    border-color: var(--color-navy);
    color: var(--color-navy);
}

.btn--outline:hover {
    background-color: var(--color-navy);
    color: var(--color-surface);
}

/* --------------------------------------------------------------------------
   8. Global Footer System
   -------------------------------------------------------------------------- */
.site-footer {
    background-color: var(--color-navy-dark);
    color: rgba(255, 255, 255, 0.85);
    padding: 4rem 0 2rem 0;
    margin-top: auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-brand h2 {
    color: var(--color-surface);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.footer-brand p {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.footer-heading {
    color: var(--color-gold);
    font-family: var(--font-body);
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1.25rem;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.95rem;
    transition: color 0.2s ease, padding-left 0.2s ease;
}

.footer-links a:hover {
    color: var(--color-surface);
    padding-left: 4px;
}

.footer-contact-info {
    font-style: normal;
    font-size: 0.95rem;
}

.footer-contact-info p {
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
}

.footer-socials {
    display: flex;
    gap: 1rem;
    align-items: center;
}
/* Admin link lives in the footer now rather than the main nav — keep it
   visually quieter than the social buttons but still clearly a link. */
.footer-admin-link {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.875rem;
    text-decoration: none;
    padding: 0.3rem 0.6rem;
    border-radius: 3px;
    transition: color 0.2s, background 0.2s;
}
.footer-admin-link:hover,
.footer-admin-link:focus-visible {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--color-surface);
    transition: background-color 0.2s ease;
}

.social-icon:hover {
    background-color: var(--color-gold);
    color: var(--color-navy-dark);
}