/* WSU Navigators Mobile-First Framework */

/* ==========================================
   MOBILE-FIRST BASE STYLES
   ========================================== */

/* Reset and base mobile styles */
* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Montserrat', Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ==========================================
   DARK MODE VARIABLES & BASE STYLES
   ========================================== */

:root {
    /* Light theme colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-tertiary: #64748b;
    --border-primary: #e2e8f0;
    --border-secondary: #cbd5e1;
    --shadow-light: rgba(0, 0, 0, 0.1);
    --shadow-medium: rgba(0, 0, 0, 0.15);
    --shadow-heavy: rgba(0, 0, 0, 0.25);
    
    /* Brand colors */
    --color-primary: #0A4C95;
    --color-secondary: #F6C949;
    --color-accent: #10b981;
    --color-success: #059669;
    --color-warning: #d97706;
    --color-error: #dc2626;
}

/* Dark theme colors */
html.dark {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;    
    --bg-tertiary: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;
    --border-primary: #334155;
    --border-secondary: #475569;
    --shadow-light: rgba(0, 0, 0, 0.3);
    --shadow-medium: rgba(0, 0, 0, 0.4);
    --shadow-heavy: rgba(0, 0, 0, 0.6);
    
    /* Adjusted brand colors for dark mode */
    --color-primary: #3b82f6;
    --color-secondary: #fbbf24;
    --color-accent: #34d399;
}

/* Apply theme colors to body */
body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

/* ==========================================
   NAVIGATION STYLES
   ========================================== */

/* Desktop dropdown styles */
.desktop-nav-dropdown {
    position: relative;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    cursor: pointer;
    background: none;
    border: none;
    color: inherit;
    font: inherit;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px var(--shadow-medium);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.desktop-nav-dropdown:hover .dropdown-menu,
.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.dropdown-item:hover {
    background-color: var(--bg-secondary);
    color: var(--color-primary);
}

/* Mobile menu section styles */
.mobile-menu-section-title {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.mobile-menu-sub-item {
    padding-left: 2.5rem !important;
    font-size: 0.9rem;
    opacity: 0.9;
}

.mobile-menu-divider {
    height: 1px;
    background-color: var(--border-primary);
    margin: 0.5rem 0;
}

/* ==========================================
   MOBILE TYPOGRAPHY
   ========================================== */

/* Mobile-first typography scale */
h1 {
    font-size: 1.75rem; /* 28px */
    line-height: 1.2;
    margin-bottom: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

h2 {
    font-size: 1.5rem; /* 24px */
    line-height: 1.3;
    margin-bottom: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

h3 {
    font-size: 1.25rem; /* 20px */
    line-height: 1.4;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

h4 {
    font-size: 1.125rem; /* 18px */
    line-height: 1.4;
    margin-bottom: 0.625rem;
    font-weight: 500;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

p {
    font-size: 1rem; /* 16px */
    line-height: 1.6;
    margin-bottom: 1rem;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

/* Small text for mobile */
.text-small {
    font-size: 0.875rem; /* 14px */
    line-height: 1.5;
}

/* Large text for mobile emphasis */
.text-large {
    font-size: 1.125rem; /* 18px */
    line-height: 1.5;
}

/* ==========================================
   MOBILE SPACING SYSTEM
   ========================================== */

/* Mobile-first spacing utilities */
.mobile-container {
    width: 100%;
    max-width: 100%;
    padding-left: 1rem;
    padding-right: 1rem;
    margin-left: auto;
    margin-right: auto;
}

.mobile-section {
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
}

.mobile-card {
    background: var(--bg-primary);
    border-radius: 0.75rem;
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px var(--shadow-light);
    border: 1px solid var(--border-primary);
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* ==========================================
   MOBILE NAVIGATION
   ========================================== */

.mobile-nav {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    z-index: 1000 !important;
    height: 81px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease-in-out;
    display: block;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    will-change: transform, opacity;
}

/* Compensate for the fixed mobile-nav when the browser hash-scrolls
   (e.g. visiting /#connect directly). Without this, the section lands
   at the top of the viewport behind the nav and reads as "didn't
   scroll" on mobile where the nav takes a larger % of screen height.
   Also fixes the programmatic scrollIntoView({block:'start'}) path. */
html {
    scroll-padding-top: 81px;
}
@media (min-width: 1280px) {
    html { scroll-padding-top: 96px; }
}

/* Home page specific styles - transparent initially */
body.home-page .mobile-nav {
    background: transparent !important;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom: none;
    box-shadow: none;
}

/* When scrolled, show navigation background */
body.home-page .mobile-nav.scrolled {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Dark mode support for transparent navigation */
.dark body.home-page .mobile-nav {
    background: transparent !important;
}

.dark body.home-page .mobile-nav.scrolled {
    background: rgba(17, 24, 39, 0.95) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Hide logo initially, show on scroll */
.mobile-nav .mobile-nav-logo {
    opacity: 0;
    transform: translateX(-20px);
    transition: all 0.3s ease-in-out;
}

.mobile-nav.scrolled .mobile-nav-logo {
    opacity: 1;
    transform: translateX(0);
}

/* Always show hamburger menu (override Tailwind lg:hidden between 1024-1279px) */
.mobile-menu-button {
    opacity: 1 !important;
    display: flex !important;
    visibility: visible !important;
}

/* Override Tailwind lg:hidden - keep hamburger visible until xl breakpoint */
@media (min-width: 1024px) and (max-width: 1279px) {
    .mobile-menu-button {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}

.mobile-main-content {
    padding-top: 70px !important;
    min-height: 100vh;
    transition: padding-top 0.3s ease-in-out;
}

/* Remove padding initially, add when scrolled */
@media (max-width: 1279px) {
    .mobile-main-content {
        padding-top: 70px !important;
    }
}

/* Add padding when navigation logo is visible */
.mobile-main-content.nav-scrolled {
    padding-top: 70px !important;
}

/* Override any conflicting navigation styles */
.universal-nav,
.universal-nav *,
[class*="universal-"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* Hide desktop navigation elements on mobile/tablet */
@media (max-width: 1279px) {
    .desktop-nav-menu,
    .desktop-nav-item,
    .desktop-nav-actions {
        display: none !important;
    }
}

/* Show mobile navigation only on mobile/tablet */
@media (max-width: 1279px) {
    .mobile-nav {
        display: block !important;
    }
}

/* Desktop navigation styles */
@media (min-width: 1280px) {
    .mobile-nav {
        display: flex !important;
        height: auto;
        border-bottom: none;
        box-shadow: none;
    }

    .mobile-nav-content {
        justify-content: space-between;
        width: 100%;
        padding: 0 3rem;
    }
    
    /* Logo section */
    .mobile-nav .mobile-nav-logo {
        opacity: 1 !important;
        transform: none !important;
        height: auto;
        max-height: 55px;
        transition: all 0.2s ease;
    }
    
    /* Hide hamburger menu on desktop */
    .mobile-menu-button {
        display: none !important;
    }
    
    /* Desktop navigation menu */
    .desktop-nav-menu {
        display: flex !important;
        align-items: center;
        gap: 0.25rem;
        visibility: visible !important;
        opacity: 1 !important;
        position: relative !important;
        z-index: 10 !important;
    }
    
    /* Force desktop menu visibility with stronger selectors */
    .mobile-nav .desktop-nav-menu,
    nav .desktop-nav-menu,
    body .desktop-nav-menu {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .desktop-nav-item {
        text-decoration: none;
        color: #ffffff !important;
        font-weight: 500;
        font-size: 0.95rem;
        padding: 0.5rem 1rem;
        border-radius: 8px;
        transition: all 0.2s ease;
        display: flex !important;
        align-items: center;
        gap: 0.4rem;
        white-space: nowrap;
        visibility: visible !important;
        opacity: 1 !important;
        position: relative !important;
        z-index: 10 !important;
    }
    
    /* Force desktop nav items visibility with stronger selectors */
    .mobile-nav .desktop-nav-item,
    nav .desktop-nav-item,
    body .desktop-nav-item,
    .desktop-nav-menu .desktop-nav-item {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        color: #ffffff !important;
    }
    
    .desktop-nav-item:hover {
        background: transparent;
        color: var(--wsu-brand-orange, #e16b2a) !important;
    }
    
    .desktop-nav-item svg {
        width: 16px;
        height: 16px;
    }
    
    /* Right side actions */
    .desktop-nav-actions {
        display: flex !important;
        align-items: center;
        gap: 0.75rem;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* Desktop theme toggle */
    .desktop-theme-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        border: none;
        background: #f3f4f6;
        border-radius: 6px;
        cursor: pointer;
        transition: all 0.2s ease;
    }
    
    .desktop-theme-toggle:hover {
        background: #e5e7eb;
    }
    
    .desktop-theme-toggle svg {
        width: 18px;
        height: 18px;
        color: #6b7280;
    }
    
    /* Hide mobile elements on desktop */
    .floating-theme-toggle {
        display: none !important;
    }
    
    .mobile-main-content {
        padding-top: 70px !important;
    }
    
    /* Desktop dark mode styles */
    .dark .mobile-nav {
        background: rgba(15, 23, 42, 0.98) !important;
        border-bottom-color: rgba(255, 255, 255, 0.1);
    }
    
    .dark .desktop-nav-item {
        color: #ffffff !important;
    }

    .dark .desktop-nav-item:hover {
        background: transparent;
        color: var(--wsu-brand-orange, #e16b2a) !important;
    }
    
    .dark .desktop-theme-toggle {
        background: #334155;
    }
    
    .dark .desktop-theme-toggle:hover {
        background: #475569;
    }
    
    .dark .desktop-theme-toggle svg {
        color: #cbd5e1;
    }
}

.mobile-nav-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
}

.mobile-nav-logo {
    height: auto;
    max-height: 60px;
    width: auto;
}


/* Menu title color */
.mobile-menu-title {
    color: #1f2937;
}

.dark .mobile-menu-title {
    color: #f1f5f9;
}

.mobile-menu-button {
    width: 44px;
    height: 44px;
    border: none;
    background: none !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
    padding: 10px;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    tap-highlight-color: rgba(0, 0, 0, 0.1);
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

.mobile-menu-button:hover {
    background-color: rgba(0, 0, 0, 0.05) !important;
    transform: scale(1.05);
}

/* Dark mode mobile menu button */
html.dark .mobile-menu-button,
.dark .mobile-menu-button {
    color: #f1f5f9 !important;
    background: none !important;
}

html.dark .mobile-menu-button:hover,
.dark .mobile-menu-button:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
    transform: scale(1.05);
}

/* Hamburger icon */
.hamburger {
    width: 24px;
    height: 18px;
    position: relative;
}

.hamburger span {
    display: block;
    height: 2px;
    width: 100%;
    background: #374151 !important;
    border-radius: 1px;
    position: absolute;
    transition: all 0.3s ease;
}

/* Dark mode hamburger */
html.dark .hamburger span,
.dark .hamburger span {
    background: #f1f5f9 !important;
}

.hamburger span:nth-child(1) { top: 0; }
.hamburger span:nth-child(2) { top: 8px; }
.hamburger span:nth-child(3) { top: 16px; }

/* Override brand theme colors for hamburger visibility */
html:not(.dark) .hamburger span,
body:not(.dark) .hamburger span,
.light .hamburger span {
    background: #374151 !important;
}

html.dark .hamburger span,
.dark .hamburger span {
    background: #f1f5f9 !important;
}

/* Mobile menu button overrides for all themes */
html:not(.dark) .mobile-menu-button,
body:not(.dark) .mobile-menu-button,
.light .mobile-menu-button {
    background: none !important;
    color: #374151 !important;
}

/* Desktop navigation overrides for visibility - only on desktop */
@media (min-width: 1280px) {
    html:not(.dark) .desktop-nav-item,
    body:not(.dark) .desktop-nav-item,
    .light .desktop-nav-item {
        color: #ffffff !important;
        visibility: visible !important;
        opacity: 1 !important;
        display: flex !important;
    }

    html:not(.dark) .desktop-nav-item:hover,
    body:not(.dark) .desktop-nav-item:hover,
    .light .desktop-nav-item:hover {
        background: transparent !important;
        color: var(--wsu-brand-orange, #e16b2a) !important;
    }

    html:not(.dark) .desktop-nav-menu,
    body:not(.dark) .desktop-nav-menu,
    .light .desktop-nav-menu {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999;
    display: none;
    touch-action: none;
    -webkit-overflow-scrolling: touch;
    transform: translateZ(0);
    will-change: opacity;
}

.mobile-menu-overlay.active {
    display: block;
}

.mobile-menu-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 320px;
    max-width: 85vw;
    height: 100vh;
    background: #ffffff;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    transition: transform 0.3s ease, background-color 0.3s ease;
    overflow-y: auto;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    -webkit-overflow-scrolling: touch;
    will-change: transform;
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
}

.mobile-menu-overlay.active .mobile-menu-panel {
    transform: translateX(0);
}

.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(248, 250, 252, 0.9);
    transition: background-color 0.3s ease, border-color 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.mobile-menu-close-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
    color: #6b7280;
}

.mobile-menu-close-btn:hover {
    background-color: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    transform: scale(1.05);
}

/* Dark mode close button */
html.dark .mobile-menu-close-btn {
    color: #9ca3af;
}

html.dark .mobile-menu-close-btn:hover {
    background-color: rgba(239, 68, 68, 0.15);
    color: #f87171;
    transform: scale(1.05);
}

.mobile-menu-content {
    padding: 1.5rem 0;
}

.mobile-menu-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 1rem 1.25rem;
    text-decoration: none;
    color: #374151;
    font-weight: 500;
    font-size: 1rem;
    transition: all 0.2s ease;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    border-radius: 8px;
    margin: 0 0.5rem;
    gap: 0.75rem;
}

.mobile-menu-item:hover {
    background-color: rgba(59, 130, 246, 0.1);
    color: #2563eb;
    transform: translateX(4px);
}

/* Dark mode menu items */
html.dark .mobile-menu-item:hover {
    background-color: rgba(96, 165, 250, 0.15);
    color: #60a5fa;
    transform: translateX(4px);
}

.mobile-menu-item svg {
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.mobile-menu-divider {
    height: 1px;
    background: var(--border-primary);
    margin: 0.5rem 1.25rem;
    transition: background-color 0.3s ease;
}

/* ==========================================
   MOBILE BUTTONS & INTERACTIONS
   ========================================== */

/* Mobile-optimized buttons */
.mobile-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 0.75rem;
    text-decoration: none;
    transition: all 0.2s ease;
    min-height: 44px; /* Apple's minimum touch target */
    min-width: 44px;
    border: none;
    cursor: pointer;
}

.mobile-btn-primary {
    background: var(--color-primary);
    color: white;
}

.mobile-btn-primary:hover {
    background: var(--color-primary);
    transform: translateY(-1px);
    opacity: 0.9;
}

.mobile-btn-secondary {
    background: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}

.mobile-btn-secondary:hover {
    background: var(--color-primary);
    color: white;
}

/* Full-width mobile buttons */
.mobile-btn-full {
    width: 100%;
    margin-bottom: 0.75rem;
}

/* ==========================================
   MOBILE CARDS & CONTENT
   ========================================== */

.mobile-hero {
    min-height: calc(100vh - 60px);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem 1rem;
    background: #0A2240;
    transition: background 0.3s ease;
}

.mobile-hero-content {
    max-width: 100%;
}

.mobile-hero h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--color-primary);
    transition: color 0.3s ease;
}

.mobile-hero p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    transition: color 0.3s ease;
}

/* Mobile content sections */
.mobile-content-section {
    padding: 2rem 0;
}

.mobile-feature-card {
    background: var(--bg-primary);
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px var(--shadow-light);
    border: 1px solid var(--border-primary);
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.mobile-feature-icon {
    width: 48px;
    height: 48px;
    background: #e0f2fe;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

/* ==========================================
   MOBILE FORMS
   ========================================== */

.mobile-form-group {
    margin-bottom: 1.25rem;
}

.mobile-form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.mobile-form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    background: white;
    transition: all 0.2s ease;
    min-height: 44px;
}

.mobile-form-input:focus {
    outline: none;
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.mobile-form-textarea {
    resize: vertical;
    min-height: 120px;
}

/* ==========================================
   MOBILE UTILITIES
   ========================================== */

/* Hide on mobile */
.mobile-hidden {
    display: none;
}

/* Show only on mobile */
.mobile-only {
    display: block;
}

/* Mobile spacing utilities */
.mobile-mt-1 { margin-top: 0.5rem; }
.mobile-mt-2 { margin-top: 1rem; }
.mobile-mt-3 { margin-top: 1.5rem; }
.mobile-mt-4 { margin-top: 2rem; }

.mobile-mb-1 { margin-bottom: 0.5rem; }
.mobile-mb-2 { margin-bottom: 1rem; }
.mobile-mb-3 { margin-bottom: 1.5rem; }
.mobile-mb-4 { margin-bottom: 2rem; }

.mobile-px-2 { padding-left: 1rem; padding-right: 1rem; }
.mobile-py-2 { padding-top: 1rem; padding-bottom: 1rem; }

/* Mobile text alignment */
.mobile-text-center { text-align: center; }
.mobile-text-left { text-align: left; }

/* ==========================================
   FLOATING THEME TOGGLE
   ========================================== */

.floating-theme-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    background: #1f2937;
    border: none;
    border-radius: 50%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.floating-theme-toggle:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), 0 4px 12px rgba(0, 0, 0, 0.3);
}

.floating-theme-toggle:active {
    transform: scale(1.05) translateY(-1px);
}

.floating-theme-toggle svg {
    width: 24px;
    height: 24px;
    color: #fbbf24;
    transition: all 0.3s ease;
}

/* Theme toggle icon visibility — CSS handles initial state instantly
   (theme-init.js sets .dark on <html> in <head> before body renders) */
#floating-theme-toggle .sun-icon { display: none; }
#floating-theme-toggle .moon-icon { display: block; }
.dark #floating-theme-toggle .sun-icon { display: block; }
.dark #floating-theme-toggle .moon-icon { display: none; }

/* Light mode styles */
.light .floating-theme-toggle {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(0, 0, 0, 0.1);
}

.light .floating-theme-toggle svg {
    color: #f59e0b;
}

/* Dark mode styles */
.dark .floating-theme-toggle {
    background: #1f2937;
    border-color: rgba(255, 255, 255, 0.2);
}

.dark .floating-theme-toggle svg {
    color: #fbbf24;
}

/* Theme toggle animation */
.theme-toggle-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle-icon svg {
    position: absolute;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-toggle-icon .sun-icon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.theme-toggle-icon .moon-icon {
    opacity: 0;
    transform: rotate(180deg) scale(0.8);
}

.dark .theme-toggle-icon .sun-icon {
    opacity: 0;
    transform: rotate(-180deg) scale(0.8);
}

.dark .theme-toggle-icon .moon-icon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

/* Mobile optimizations */
@media (max-width: 640px) {
    .floating-theme-toggle {
        bottom: 16px;
        right: 16px;
        width: 52px;
        height: 52px;
    }
    
    .floating-theme-toggle svg {
        width: 22px;
        height: 22px;
    }
}

/* ==========================================
   ENHANCED DARK MODE SUPPORT
   ========================================== */

/* Light mode (default) */
body {
    background-color: #ffffff;
    color: #1f2937;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Dark mode */
.dark body {
    background-color: #0f172a;
    color: #f1f5f9;
}

.dark .mobile-nav {
    background: rgba(15, 23, 42, 0.95) !important;
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.dark .mobile-card, 
.dark .mobile-feature-card {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.1);
    color: #f1f5f9;
}

.dark .mobile-hero {
    background: #333333;
}

.dark .mobile-hero h1 {
    color: #60a5fa !important;
}

.dark .mobile-hero p {
    color: #cbd5e1 !important;
}

.dark .hamburger span {
    background: #f1f5f9;
}

.dark .mobile-form-input {
    background: #334155;
    border-color: #475569;
    color: #f1f5f9;
}

.dark .mobile-form-label {
    color: #cbd5e1;
}

.dark .mobile-btn-primary {
    background: #3b82f6;
    color: white;
}

.dark .mobile-btn-primary:hover {
    background: #2563eb;
}

.dark .mobile-btn-secondary {
    background: transparent;
    color: #60a5fa;
    border-color: #3b82f6;
}

.dark .mobile-btn-secondary:hover {
    background: #3b82f6;
    color: white;
}

/* Mobile menu dark mode */
.dark .mobile-menu-panel {
    background: #1e293b !important;
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3) !important;
}

.dark .mobile-menu-header {
    background: rgba(15, 23, 42, 0.95) !important;
    border-color: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.dark .mobile-menu-item {
    color: #cbd5e1;
}

.dark .mobile-menu-item:hover {
    background-color: #334155;
    color: #60a5fa;
}

.dark .mobile-menu-close-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Content sections dark mode */
.dark .mobile-content-section {
    background: #0f172a !important;
}

/* Feature icons dark mode */
.dark .mobile-feature-icon {
    background: rgba(59, 130, 246, 0.2) !important;
}

/* Special background cards in dark mode */
.dark .mobile-feature-card[style*="background: #f0f9ff"],
.dark .mobile-feature-card[style*="background: #fef3c7"],
.dark .mobile-feature-card[style*="background: #dcfce7"],
.dark .mobile-feature-card[style*="background: #f3e8ff"],
.dark .mobile-card[style*="background: white"],
.dark .mobile-content-section[style*="background: white"],
.dark *[style*="background: white"],
.dark *[style*="background: #ffffff"],
.dark *[style*="background:#ffffff"],
.dark *[style*="background: #fff"],
.dark *[style*="background:#fff"] {
    background: #1e293b !important;
    color: #f1f5f9 !important;
}

.dark .mobile-feature-card[style*="background: #f0f9ff"] h3,
.dark .mobile-feature-card[style*="background: #fef3c7"] h3,
.dark .mobile-feature-card[style*="background: #dcfce7"] h3,
.dark .mobile-feature-card[style*="background: #f3e8ff"] h3,
.dark .mobile-card[style*="background: white"] h3,
.dark .mobile-content-section[style*="background: white"] h3,
.dark *[style*="background: white"] h3,
.dark *[style*="background: #ffffff"] h3,
.dark *[style*="background:#ffffff"] h3,
.dark *[style*="background: #fff"] h3,
.dark *[style*="background:#fff"] h3 {
    color: #60a5fa !important;
}

.dark .mobile-feature-card[style*="background: #f0f9ff"] p,
.dark .mobile-feature-card[style*="background: #fef3c7"] p,
.dark .mobile-feature-card[style*="background: #dcfce7"] p,
.dark .mobile-feature-card[style*="background: #f3e8ff"] p,
.dark .mobile-card[style*="background: white"] p,
.dark .mobile-content-section[style*="background: white"] p,
.dark *[style*="background: white"] p,
.dark *[style*="background: #ffffff"] p,
.dark *[style*="background:#ffffff"] p,
.dark *[style*="background: #fff"] p,
.dark *[style*="background:#fff"] p {
    color: #cbd5e1 !important;
}

/* Fix white text on white backgrounds */
.dark *[style*="color: white"],
.dark *[style*="color:#ffffff"],
.dark *[style*="color: #ffffff"],
.dark *[style*="color:#fff"],
.dark *[style*="color: #fff"] {
    color: #f1f5f9 !important;
}

/* System dark mode preference */
@media (prefers-color-scheme: dark) {
    :root:not(.light) body {
        background-color: #0f172a;
        color: #f1f5f9;
    }
}

/* ==========================================
   TABLET STYLES (768px+)
   ========================================== */

@media (min-width: 768px) {
    .mobile-container {
        max-width: 768px;
        padding-left: 2rem;
        padding-right: 2rem;
    }
    
    .mobile-section {
        padding-top: 3.5rem;
        padding-bottom: 3.5rem;
    }
    
    h1 {
        font-size: 2.25rem; /* 36px */
    }
    
    h2 {
        font-size: 1.875rem; /* 30px */
    }
    
    .mobile-hero h1 {
        font-size: 2.5rem;
    }
    
    .mobile-hero p {
        font-size: 1.25rem;
    }
    
    .mobile-nav {
        height: auto;
    }

    .mobile-hero {
        min-height: calc(100vh - 70px);
    }
    
    /* Hide mobile-only elements on tablet+ */
    .mobile-only {
        display: none;
    }
    
    /* Show tablet+ elements */
    .tablet-up {
        display: block;
    }
}

/* ==========================================
   DESKTOP STYLES (1024px+)
   ========================================== */

@media (min-width: 1024px) {
    .mobile-container {
        max-width: 1024px;
        padding-left: 2.5rem;
        padding-right: 2.5rem;
    }
    
    .mobile-section {
        padding-top: 5rem;
        padding-bottom: 5rem;
    }
    
    h1 {
        font-size: 3rem; /* 48px */
    }
    
    h2 {
        font-size: 2.25rem; /* 36px */
    }
    
    .mobile-hero h1 {
        font-size: 3.5rem;
    }
    
    .mobile-nav {
        height: auto;
    }

    .mobile-hero {
        min-height: calc(100vh - 80px);
    }
    
    /* Hide mobile elements on desktop */
    .mobile-hidden {
        display: block;
    }
}

/* ==========================================
   SMALL MOBILE STYLES (480px and below)
   ========================================== */

@media (max-width: 480px) {
    /* Smaller mobile navigation adjustments */
    .mobile-nav {
        height: 60px !important;
        padding: 0;
    }
    
    .mobile-nav-content {
        padding: 0 1rem !important;
        height: 60px;
    }
    
    .mobile-nav .mobile-nav-logo {
        height: 40px !important;
        max-height: 40px !important;
    }
    
    .mobile-menu-button {
        width: 44px !important;
        height: 44px !important;
        padding: 8px !important;
    }
    
    .mobile-menu-panel {
        width: 280px !important;
        max-width: 90vw !important;
    }
    
    .mobile-menu-item {
        padding: 1rem 1rem !important;
        font-size: 1rem !important;
    }
    
    .mobile-menu-header {
        padding: 0.75rem 1rem !important;
    }
    
    .mobile-menu-title {
        font-size: 1rem !important;
    }
    
    /* Ensure main content doesn't get covered */
    .mobile-main-content {
        margin-top: 60px !important;
    }
    
    /* Home page specific adjustments */
    body.home-page .mobile-main-content {
        margin-top: 0 !important;
        padding-top: 80px !important;
    }
    
    body.home-page .mobile-nav.scrolled ~ .mobile-main-content {
        margin-top: 60px !important;
        padding-top: 0 !important;
    }
    
    /* Additional spacing for hero logo */
    body.home-page .mobile-hero-content {
        padding-top: 2rem !important;
    }
    
    /* Better touch targets */
    .floating-theme-toggle {
        width: 52px !important;
        height: 52px !important;
        bottom: 1rem !important;
        right: 1rem !important;
    }
    
    /* Improve hamburger button visibility */
    .mobile-menu-button .hamburger span {
        height: 3px !important;
        margin-bottom: 4px !important;
    }
    
    /* Better menu transitions on mobile */
    .mobile-menu-panel {
        transition: transform 0.25s ease-out !important;
    }
    
    .mobile-menu-overlay {
        transition: opacity 0.25s ease-out !important;
    }
    
    .mobile-menu-overlay.active {
        opacity: 1 !important;
    }
}

/* ==========================================
   VERY SMALL MOBILE STYLES (360px and below)
   ========================================== */

@media (max-width: 360px) {
    .mobile-nav {
        height: 56px !important;
    }
    
    .mobile-nav-content {
        padding: 0 0.75rem !important;
        height: 56px;
    }
    
    .mobile-nav .mobile-nav-logo {
        height: 36px !important;
        max-height: 36px !important;
    }
    
    .mobile-menu-button {
        width: 40px !important;
        height: 40px !important;
    }
    
    .mobile-menu-panel {
        width: 260px !important;
        max-width: 95vw !important;
    }
    
    .mobile-menu-item {
        padding: 0.875rem 0.75rem !important;
        font-size: 0.95rem !important;
    }
    
    .mobile-menu-header {
        padding: 0.625rem 0.75rem !important;
    }
    
    /* Ensure main content doesn't get covered */
    .mobile-main-content {
        margin-top: 56px !important;
    }
    
    /* Home page specific adjustments */
    body.home-page .mobile-main-content {
        margin-top: 0 !important;
        padding-top: 70px !important;
    }
    
    body.home-page .mobile-nav.scrolled ~ .mobile-main-content {
        margin-top: 56px !important;
        padding-top: 0 !important;
    }
    
    /* Additional spacing for hero logo on very small screens */
    body.home-page .mobile-hero-content {
        padding-top: 1.5rem !important;
    }
}

/* ==========================================
   ACCESSIBILITY & PERFORMANCE
   ========================================== */

/* High contrast support */
@media (prefers-contrast: high) {
    .mobile-btn-primary {
        border: 2px solid #000;
    }
    
    .mobile-card, .mobile-feature-card {
        border: 2px solid #000;
    }
}

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

/* Focus styles for keyboard navigation */
.mobile-btn:focus,
.mobile-form-input:focus,
.mobile-menu-button:focus {
    outline: 2px solid #0ea5e9;
    outline-offset: 2px;
}

/* ---------------------------------------------------------------------------
 * CTA widget — background variants
 *
 * Variants are selected via `data-bg-variant` on the root `[data-cta-root]`
 * element emitted by the client renderer and the server generator. Styling
 * MUST live here (not in inline `style=` attrs) so the builder can switch
 * variants without re-rendering the whole component. `!important` preserves
 * the page's color contracts when hand-crafted HTML sets conflicting inline
 * styles on descendants.
 * ------------------------------------------------------------------------ */
[data-cta-root][data-bg-variant="default"] {
    background: #008c95 !important;
    color: #ffffff !important;
}
[data-cta-root][data-bg-variant="solid-dark"] {
    background: #475569 !important;
    color: #ffffff !important;
}
[data-cta-root][data-bg-variant="gradient-teal"] {
    background: linear-gradient(135deg, #008c95 0%, #006b75 100%) !important;
    color: #ffffff !important;
}
[data-cta-root][data-bg-variant="gradient-dark"] {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%) !important;
    color: #ffffff !important;
}
[data-cta-root] h1,
[data-cta-root] h2,
[data-cta-root] h3 {
    color: #ffffff !important;
}
[data-cta-root] p {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* ===== image-text-row widget =====
 *
 * Canonical class is .itr-row. Legacy .ff-row (femme-fideles) and .gi-row
 * (get-involved) are aliased to preserve the !important contract captured
 * in important-contracts.json before those pages were migrated off
 * custom-code (see scripts/inventory/important-contracts.json —
 * `.ff-row__half img` / `.gi-row__half img` height: auto !important).
 *
 * Mobile default: flex column-reverse so the image renders on top and the
 * text below, regardless of DOM order. Desktop switches to row and honors
 * data-image-left="1" (image first) or "0" (image last).
 */
.itr-row, .ff-row, .gi-row {
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    gap: 2rem;
}
.itr-row[data-image-left="1"],
.ff-row[data-image-left="1"],
.gi-row[data-image-left="1"] {
    flex-direction: column;
}
.itr-half, .ff-row__half, .gi-row__half {
    width: 100%;
    min-width: 0;
}
.itr-text, .ff-row__text, .gi-row__text {
    text-align: center;
}
/* On mobile, let images size to their natural aspect ratio instead of
 * being cropped by the inline height:420px set by the renderer. This is
 * the !important contract captured from staging — must apply to all three
 * class names. */
@media (max-width: 1023px) {
    .itr-half img,
    .ff-row__half img,
    .gi-row__half img {
        height: auto !important;
    }
}
@media (min-width: 1024px) {
    .itr-row, .ff-row, .gi-row {
        flex-direction: row;
        gap: 4rem;
    }
    .itr-row[data-image-left="1"],
    .ff-row[data-image-left="1"],
    .gi-row[data-image-left="1"] {
        flex-direction: row;
    }
    .itr-half, .ff-row__half, .gi-row__half {
        flex: 1 1 0%;
    }
    .itr-text, .ff-row__text, .gi-row__text {
        text-align: left;
    }
}

/* ===== step-sticky-header widget =====
 *
 * Thin sticky bar demarcating a process step. Canonical class is
 * `.ssh-sticky`. Legacy `.gi-step-sticky` (get-involved) is aliased so the
 * !important rule captured from staging (58px mobile offset) keeps working
 * after the sections are migrated off custom-code.
 *
 * The inline top offset (from stickyOffset) is applied via `style="top:Npx"`
 * on the section. The mobile !important rule overrides that for viewports
 * under 640px to match the site's mobile fixed-nav height.
 */
.ssh-sticky, .gi-step-sticky { position: sticky; z-index: 30; }
@media (max-width: 639px) {
    .ssh-sticky, .gi-step-sticky { top: 58px !important; }
}