/* Base Styles - Reset and Foundation */
/* Global resets, scrollbar hiding, and core element styling */

/* Hide scrollbars globally and add smooth scroll with navigation offset */
html {
    overflow-y: auto;
    
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
    scroll-padding-top: var(--nav-height);
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

/* Reset & Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    background: #ffffff !important;
    background-color: #ffffff !important;
}

body {
    font-family: 'Jost', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: #ffffff !important;
    background-color: #ffffff !important;
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Footer protection - prevent body/html white background from overriding footer */
body footer,
body .modern-professional-footer,
body .spa-footer,
body #footer {
    background: #18241c !important;
    background-color: #18241c !important;
    color: #ffffff !important;
}

/* Container System */
.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

/* Body Layout Structure */
.body-inner {
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ========================================================================== 
   GLOBAL NAVIGATION SPACING PROTECTION
   Ensures all content appears below the sticky navigation header
   
   SYSTEM OVERVIEW:
   - Navigation remains sticky at top of viewport
   - ALL content (including heroes) starts below the navigation
   - Main content gets 85px top padding (nav height) automatically
   - All responsive breakpoints maintain consistent nav spacing
   - No page-specific spacing rules needed - everything handled globally
   ========================================================================== */

/* Main content container - no default padding (heroes handle their own spacing) */
#spa-content,
main#spa-content,
.spa-content-wrapper {
    padding-top: 0 !important; /* No default padding - heroes handle navigation spacing */
    opacity: 0; /* Initial hidden state for FOUC protection */
    transition: opacity 0.3s ease;
}

/* Hero system moved to hero.css */

/* Mobile navigation spacing */
@media (max-width: 767px) {
    #spa-content,
    main#spa-content,
    .spa-content-wrapper {
        padding-top: 0 !important; /* No padding for mobile full-screen heroes */
    }
}

/* Simplified mobile viewport handling */
@supports (height: 100svh) {
    :root { --viewport-height: 100svh; }
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-inline { display: inline; }
.d-inline-block { display: inline-block; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

.position-relative { position: relative; }
.position-absolute { position: absolute; }
.position-fixed { position: fixed; }
.position-sticky { position: sticky; }

.overflow-hidden { overflow: hidden; }
.overflow-visible { overflow: visible; }

/* ========================================================================== 
   ⚡ BULLETPROOF INSTANT CONTENT BLANKING SYSTEM
   Zero-FOUC protection with microsecond response time
   ========================================================================== */

/* Content ready state - show content */
#spa-content.spa-ready,
main#spa-content.spa-ready,
.spa-content-wrapper.spa-ready {
    opacity: 1;
}

/* Navigation Always Visible - Exclude from FOUC */
#header,
.spa-header,
.nav-container,
.desktop-nav,
.mobile-nav,
.small-mobile-nav,
.nav-sidebar,
.sidebar-header,
.sidebar-nav {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    z-index: var(--z-header) !important; /* Ensure above loading overlay */
}

/* Layer 1: Instant CSS Blanking (0ms response) */
.spa-content-blanked {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: translateZ(0) !important; /* Force GPU layer */
}

/* Simple Content Loading Indicator */
.content-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    background: #ffffff !important;
    background-color: #ffffff !important;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top: 3px solid #333333;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Layer 3: Ultimate Off-Screen Staging - Bulletproof invisibility */
.spa-ultimate-staging {
    position: fixed !important;
    top: -9999px !important;
    left: -9999px !important;
    width: 100vw !important;
    height: auto !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    z-index: -9999 !important;
    overflow: hidden !important;
    transform: translateZ(0) !important; /* GPU acceleration */
}

/* Legacy support for old staging */
.spa-content-staging {
    position: fixed !important;
    top: -9999px !important;
    left: -9999px !important;
    width: 100vw !important;
    height: auto !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    z-index: -1 !important;
}

/* Layer 4: Content Ready State */
.spa-content-ready {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: none !important;
}

/* Scroll Offset for Anchor Links */
/* Automatic scroll offset for all elements with IDs (anchor targets) */
*[id] {
    scroll-margin-top: var(--nav-height);
}

/* Extra spacing for section headings and major content blocks */
section[id],
.section[id],
.page-section[id],
h1[id], h2[id], h3[id], h4[id], h5[id], h6[id] {
    scroll-margin-top: calc(var(--nav-height) + 20px); /* Extra 20px breathing room */
}
