/* ==========================================================================
   THE EXPAT CHIRO - CENTRAL STYLESHEET
   Shared styles across all pages
   ========================================================================== */

/* ==========================================================================
   DESIGN SYSTEM DOCUMENTATION
   ==========================================================================

   SPACING SCALE:
   --space-xs (2rem):   Minimal spacing, tight sections
   --space-sm (3rem):   Small padding for compact elements
   --space-md (5rem):   Medium padding for standard sections
   --space-lg (6rem):   Large padding for prominent sections
   --space-xl (7rem):   Extra large padding
   --space-xxl (8rem):  Maximum padding for hero sections

   GAP SCALE (Grid/Flex):
   --gap-sm (1rem):     Tight element spacing (buttons, small grids)
   --gap-md (2rem):     Standard grid gaps (mobile)
   --gap-lg (2.5rem):   Medium grid gaps (tablet)
   --gap-xl (3rem):     Large grid gaps (desktop)
   --gap-xxl (4rem):    Extra large gaps (hero elements)

   TYPOGRAPHY SCALE:
   --heading-hero:      Full-screen hero h1 (2.5rem - 5rem responsive)
   --heading-compact:   Compact hero h1 (2.5rem - 4rem responsive)
   --heading-xl:        Major section h2 (2rem - 3.5rem responsive)
   --heading-lg:        Large section h2 (2rem - 3rem responsive)
   --heading-md:        Medium section h2 (1.8rem - 2.8rem responsive)
   --heading-sm:        Small section h2 (1.8rem - 2.5rem responsive)

   --body-lg (1.15rem): Large body text (emphasis paragraphs)
   --body-md (1.05rem): Medium body text (standard content)
   --body-base (1rem):  Base body text (cards, descriptions)
   --body-sm (0.95rem): Small body text (card content, fine print)

   RESPONSIVE BREAKPOINTS:
   768px:  Primary breakpoint (mobile → tablet/desktop)
   1024px: Secondary breakpoint (tablet → desktop, specific layouts only)

   MODIFIER CLASSES:
   .hero--compact:           50vh hero for FAQ/Privacy pages
   .cta-section--compact:    5rem padding CTA
   .cta-section--spacious:   8rem padding CTA

   ========================================================================== */

/* 1. CSS VARIABLES
   ========================================================================== */
:root {
    /* Base Colors */
    --stormy-teal: #006466;
    --dark-teal: #065a60;
    --deep-teal: #0b525b;
    --ocean-teal: #144552;
    --charcoal-blue: #1b3a4b;
    --space-blue: #212f45;
    --space-indigo: #272640;
    --midnight-violet: #312244;
    --deep-violet: #3e1f47;
    --deep-purple: #4d194d;
    --off-white: #f8f9fa;
    --light-grey: #e0e5e8;
    --text-light: rgba(255, 255, 255, 0.95);
    --text-muted: rgba(255, 255, 255, 0.7);

    /* Accent Colors */
    --accent-coral: #D97567;
    --accent-coral-muted: #C17A70;
    --accent-teal-bright: #4ECDC4;

    /* Spacing Scale (padding/margin) */
    --space-xs: 2rem;
    --space-sm: 3rem;
    --space-md: 5rem;
    --space-lg: 6rem;
    --space-xl: 7rem;
    --space-xxl: 8rem;

    /* Gap Scale (grid/flex gaps) */
    --gap-sm: 1rem;
    --gap-md: 2rem;
    --gap-lg: 2.5rem;
    --gap-xl: 3rem;
    --gap-xxl: 4rem;

    /* Typography Scale */
    --heading-hero: clamp(2.5rem, 8vw, 5rem);
    --heading-xl: clamp(2rem, 5vw, 3.5rem);
    --heading-lg: clamp(2rem, 4vw, 3rem);
    --heading-md: clamp(1.8rem, 4vw, 2.8rem);
    --heading-sm: clamp(1.8rem, 4vw, 2.5rem);
    --heading-compact: clamp(2.5rem, 6vw, 4rem);

    --body-lg: 1.15rem;
    --body-md: 1.05rem;
    --body-base: 1rem;
    --body-sm: 0.95rem;
}

/* 1A. ACCESSIBILITY
   ========================================================================== */

/* Skip to Content Link - Hidden until focused via keyboard */
.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    background-color: var(--stormy-teal);
    color: var(--text-light);
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    font-weight: 600;
    z-index: 10000;
    border-radius: 0 0 4px 0;
    transition: top 0.2s ease;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    height: 1px;
    overflow: hidden;
    white-space: nowrap;
    width: 1px;
}

.skip-link:focus {
    top: 0;
    outline: 3px solid var(--accent-teal-bright);
    outline-offset: 2px;
    clip: auto;
    clip-path: none;
    height: auto;
    overflow: visible;
    white-space: normal;
    width: auto;
}

/* Focus Indicators - Visible keyboard navigation */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus,
.nav-links a:focus,
.cta-btn:focus,
.service-link:focus,
.social-links a:focus {
    outline: 3px solid var(--accent-teal-bright);
    outline-offset: 2px;
    border-radius: 2px;
}

/* Remove default focus for mouse users (keeps keyboard focus) */
a:focus:not(:focus-visible),
button:focus:not(:focus-visible),
input:focus:not(:focus-visible),
textarea:focus:not(:focus-visible),
select:focus:not(:focus-visible) {
    outline: none;
}

/* Ensure focus-visible works for keyboard users */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 3px solid var(--accent-teal-bright);
    outline-offset: 2px;
    border-radius: 2px;
}

/* 2. RESET & BASE STYLES
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'Inter', sans-serif;
    background-color: var(--charcoal-blue);
    color: var(--text-light);
    line-height: 1.6;
    overflow-x: hidden;
}

h1,
h2,
h3 {
    font-weight: 300;
    letter-spacing: -1px;
}

a {
    text-decoration: none;
    color: inherit;
}

/* 3. NAVIGATION
   ========================================================================== */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 1.5rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0) 100%);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.logo {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

.nav-links a {
    opacity: 0.8;
    transition: opacity 0.3s;
    font-size: 1rem;
}

.nav-links a:hover {
    opacity: 1;
}

.book-btn {
    background-color: var(--stormy-teal);
    padding: 0.6rem 1.5rem;
    border-radius: 2px;
    font-weight: 500;
    opacity: 1 !important;
}

/* 4. CALL-TO-ACTION BUTTONS
   ========================================================================== */
.cta-btn {
    padding: 1rem 2.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 2px;
    transition: all 0.3s;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.cta-primary {
    background-color: var(--stormy-teal);
    color: var(--text-light);
}

.cta-primary:hover {
    background-color: var(--dark-teal);
    transform: translateY(-2px);
}

.cta-secondary {
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--text-light);
}

.cta-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.cta-buttons {
    display: inline-flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* 5. FOOTER
   ========================================================================== */
footer {
    background-color: var(--space-indigo);
    padding: 4rem 5% 2rem 5%;
    text-align: center;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.footer-links a {
    font-size: 0.85rem;
    opacity: 0.7;
    transition: opacity 0.3s;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.footer-links a:hover {
    opacity: 1;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 3rem;
}

.social-links a {
    opacity: 0.7;
    transition: opacity 0.3s, transform 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.social-links a:hover {
    opacity: 1;
    transform: translateY(-2px);
}

.social-links svg {
    width: 24px;
    height: 24px;
    fill: white;
}

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.75rem;
    opacity: 0.5;
    letter-spacing: 1px;
}

.footer-bottom p {
    margin-bottom: 0.5rem;
}

/* 6. SHARED UTILITIES
   ========================================================================== */
.profile-quote-attribution sup,
.credential-card h3 sup,
.faq-answer sup {
    font-size: 0.75em;
    opacity: 0.9;
    vertical-align: super;
    line-height: 0;
}

/* 7. SCROLL INDICATOR (Full-screen hero pages)
   ========================================================================== */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    opacity: 0.5;
    letter-spacing: 2px;
    text-transform: uppercase;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%,
    100% {
        opacity: 0.3;
    }
    50% {
        opacity: 0.7;
    }
}

/* 8. HERO SECTIONS
   ========================================================================== */
.hero {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--charcoal-blue) 0%, var(--midnight-violet) 100%);
    background-size: cover;
    background-position: center;
    z-index: 0;
}

.hero-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--charcoal-blue) 0%, var(--space-indigo) 100%);
    background-size: cover;
    background-position: center;
    opacity: 0.12;
    mix-blend-mode: overlay;
    background-attachment: fixed;
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 0 5%;
    max-width: 1000px;
}

.hero-content h1 {
    font-size: clamp(2.5rem, 8vw, 5rem);
    margin-bottom: 1.5rem;
    font-weight: 200;
    line-height: 1.2;
}

.hero-content p {
    font-size: clamp(1rem, 2vw, 1.3rem);
    opacity: 0.85;
    margin-bottom: 2rem;
    font-weight: 300;
}

.hero-cta {
    display: inline-flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* Hero Modifier: Compact (50vh) for FAQ/Privacy pages */
.hero--compact {
    height: 50vh;
    min-height: 400px;
    overflow: visible;
}

.hero--compact .hero-bg::after {
    display: none;
}

.hero--compact .hero-content {
    max-width: 900px;
    padding: 6rem 8% 3rem;
}

.hero--compact .hero-content h1 {
    font-size: clamp(2.5rem, 6vw, 4rem);
    margin-bottom: 0.5rem;
}

.hero--compact .hero-content h2 {
    font-size: clamp(1.3rem, 3vw, 1.8rem);
    font-weight: 300;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.9;
    letter-spacing: -0.5px;
    line-height: 1.3;
}

.hero--compact .hero-content p {
    font-size: clamp(1rem, 2vw, 1.15rem);
    opacity: 0.8;
    margin-top: 0.5rem;
    font-weight: 300;
    line-height: 1.6;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.hero--compact .hero-content .hero-dates {
    font-size: 1.1rem;
    opacity: 0.7;
    margin-top: 2.5rem;
    font-weight: 300;
    line-height: 1.6;
}

/* 9. IMAGE-BREAK SECTIONS
   ========================================================================== */
.image-break {
    height: 50vh;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-break h2 {
    position: relative;
    z-index: 1;
    font-size: clamp(2rem, 4vw, 3rem);
    text-align: center;
    padding: 0 5%;
}

/* 10. CARD COMPONENTS
   ========================================================================== */
.card {
    background-color: rgba(255, 255, 255, 0.03);
    padding: 3rem 2.5rem;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s;
}

.card:hover {
    background-color: rgba(255, 255, 255, 0.05);
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.2);
}

.card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--stormy-teal);
}

.card p {
    opacity: 0.8;
    line-height: 1.8;
}

/* 11. CTA SECTIONS
   ========================================================================== */
.cta-section {
    padding: 6rem 5%;
    background: linear-gradient(135deg, var(--deep-violet), var(--deep-purple));
    text-align: center;
}

.cta-section--compact {
    padding: 5rem 5%;
}

.cta-section--spacious {
    padding: 8rem 5%;
}

.cta-section h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 1.5rem;
}

.cta-section p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* 12. ACCORDION COMPONENTS
   ========================================================================== */
.accordion-item {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    margin-bottom: 1rem;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.2);
}

.accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.3s ease;
}

.accordion-header:hover {
    background-color: rgba(0, 100, 102, 0.15);
}

.accordion-header h2,
.accordion-header h3 {
    margin: 0 !important;
    font-size: 1.5rem;
    font-weight: 300;
    letter-spacing: -1px;
}

.accordion-icon {
    font-size: 1.5rem;
    font-weight: 300;
    transition: transform 0.3s ease;
    flex-shrink: 0;
    margin-left: 1rem;
    color: var(--stormy-teal);
}

.accordion-header.active .accordion-icon {
    transform: rotate(45deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out, padding 0.4s ease-out;
    padding: 0 1.5rem;
}

.accordion-content.active {
    max-height: 5000px;
    padding: 0 1.5rem 1.5rem 1.5rem;
    transition: max-height 0.5s ease-in, padding 0.4s ease-in;
}

.accordion-content > *:first-child {
    margin-top: 0;
}

/* Responsive adjustments for accordion */
@media (max-width: 768px) {
    .accordion-header h2,
    .accordion-header h3 {
        font-size: 1.2rem;
    }

    .accordion-header {
        padding: 1rem;
    }

    .accordion-content.active {
        padding: 0 1rem 1rem 1rem;
    }
}

/* 13. RESPONSIVE MEDIA QUERIES
   ========================================================================== */

/* MOBILE NAVIGATION - Hide Checkbox at All Sizes */
.nav-toggle {
    display: none;
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
}

/* Mobile-First: Spacing Optimizations for Small Screens */
@media (max-width: 767px) {
    :root {
        /* Mobile Spacing Scale - Reduced for smaller screens */
        --space-xxl: 4rem;     /* was 8rem - halved for mobile */
        --space-xl: 3.5rem;    /* was 7rem */
        --space-lg: 3rem;      /* was 6rem - halved for mobile */
        --space-md: 2.5rem;    /* was 5rem - halved for mobile */
        --space-sm: 2rem;      /* was 3rem */
        --space-xs: 1.5rem;    /* was 2rem */

        /* Mobile Gap Scale - Tighter spacing for grids */
        --gap-xl: 2rem;        /* was 3rem */
        --gap-lg: 1.5rem;      /* was 2.5rem */
        --gap-md: 1.5rem;      /* was 2rem */
    }
}

/* MOBILE NAVIGATION - Hamburger Menu (under 1024px) */
@media (max-width: 1023px) {

    /* Hamburger Icon - Only visible on mobile */
    .hamburger {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 28px;
        height: 21px;
        cursor: pointer;
        z-index: 2000;
        position: relative;
    }

    .hamburger span {
        display: block;
        height: 3px;
        width: 100%;
        background-color: white;
        border-radius: 2px;
        transition: all 0.3s ease;
    }

    /* Transform hamburger to X when checked */
    .nav-toggle:checked ~ .hamburger span:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }

    .nav-toggle:checked ~ .hamburger span:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle:checked ~ .hamburger span:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }

    /* Mobile Navigation Links */
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 75%;
        max-width: 300px;
        height: 100vh;
        background: linear-gradient(180deg, var(--charcoal-blue) 0%, var(--space-indigo) 100%);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 1.75rem;
        transition: right 0.4s ease;
        z-index: 1500;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
        padding: 2rem 0;
    }

    /* Show menu when checkbox is checked */
    .nav-toggle:checked ~ .nav-links {
        right: 0;
    }

    /* Mobile nav link styling */
    .nav-links a {
        font-size: 1.05rem;
        font-weight: 400;
        opacity: 0.9;
        padding: 0.875rem 1.5rem;
        width: 75%;
        text-align: center;
        letter-spacing: 1px;
        transition: all 0.3s;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .nav-links a:hover {
        opacity: 1;
        background-color: rgba(255, 255, 255, 0.05);
        border-radius: 4px;
    }

    /* Book button - full width on mobile */
    .book-btn {
        width: 75% !important;
        padding: 0.875rem 1.5rem !important;
        text-align: center;
        background-color: var(--stormy-teal) !important;
        border-radius: 4px;
        font-weight: 500 !important;
    }

    /* Backdrop overlay when menu is open */
    .nav-toggle:checked ~ .nav-links::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: -1;
    }
}

/* Landscape Phone Fix: Optimize for short, wide screens */
@media (max-width: 1023px) and (max-height: 500px) {
    /* Compact navigation - preserves gradient opacity */
    nav {
        padding: 0.5rem 4%;
        position: fixed;
        background: linear-gradient(180deg, rgba(27, 58, 75, 0.95) 0%, rgba(27, 58, 75, 0) 100%);
        -webkit-backdrop-filter: blur(10px);
        backdrop-filter: blur(10px);
    }

    .logo {
        font-size: 0.95rem;
        letter-spacing: 1.5px;
    }

    .hamburger {
        width: 20px;
        height: 15px;
    }

    .hamburger span {
        height: 2px;
    }

    .nav-toggle:checked ~ .hamburger span:nth-child(1) {
        transform: translateY(6.5px) rotate(45deg);
    }

    .nav-toggle:checked ~ .hamburger span:nth-child(3) {
        transform: translateY(-6.5px) rotate(-45deg);
    }

    .nav-links {
        width: 90%;
        max-width: 380px;
    }

    /* Compact hero sections - account for fixed nav */
    .hero {
        height: 100vh;
        min-height: 100vh;
        padding-top: 5rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .hero-content {
        padding: 0 5%;
        max-width: 100%;
    }

    .hero-content h1 {
        font-size: clamp(1.8rem, 5vw, 2.5rem);
        margin-bottom: 0.75rem;
        line-height: 1.1;
    }

    .hero-content p {
        font-size: clamp(0.85rem, 1.8vw, 1rem);
        margin-bottom: 1rem;
    }

    .cta-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.75rem;
    }

    .cta-buttons {
        gap: 0.5rem;
    }

    .scroll-indicator {
        bottom: 0.75rem;
        font-size: 0.65rem;
    }

    /* Compact hero modifier */
    .hero--compact {
        min-height: 70vh;
        height: auto;
        padding-top: 4rem;
    }
}

/* Desktop: Hide Hamburger, Show Desktop Nav - ONLY at 1024px+ */
@media (min-width: 1024px) {
    /* Hide hamburger menu elements on desktop */
    .hamburger,
    .nav-toggle {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        position: absolute !important;
        pointer-events: none !important;
    }

    /* Ensure desktop nav is visible */
    .nav-links {
        display: flex !important;
        position: static !important;
        flex-direction: row !important;
        width: auto !important;
        height: auto !important;
        background: none !important;
        box-shadow: none !important;
    }
}

/* Desktop: Enhanced Spacing */
@media (min-width: 1024px) {
    nav {
        padding: 2rem 8%;
    }

    .hero-content {
        padding: 0 8%;
    }
}

/* iOS Safari Fix: Disable fixed background on mobile/touch devices
   iOS Safari does not properly support background-attachment: fixed,
   causing zoomed/cropped images when combined with background-size: cover */
@media (max-width: 1023px), (hover: none) {
    .hero-bg::after {
        background-attachment: scroll;
    }

    .image-break {
        background-attachment: scroll;
    }
}
