/* ==========================================================================
   Design System - Variables
   ========================================================================== */
:root {
    /* Colors */
    --color-deep-forest-green: #1a2e1a;
    --color-warm-ivory: #f7f3ed;
    --color-soft-gold: #c9a84c;
    --color-charcoal: #2d2d2d;
    --color-muted-sage: #8fad88;
    --color-pure-white: #ffffff;

    /* Backgrounds & Text */
    --bg-primary: var(--color-warm-ivory);
    --bg-secondary: var(--color-pure-white);
    --bg-accent: var(--color-deep-forest-green);
    --text-primary: var(--color-charcoal);
    --text-secondary: var(--color-deep-forest-green);
    --text-light: var(--color-warm-ivory);

    /* Typography */
    --font-heading: 'Cormorant Garamond', 'Georgia', 'Times New Roman', serif;
    --font-body: 'Inter', sans-serif;

    /* Typography Fluid */
    --text-h1-hero: clamp(2.2rem, 6vw, 5.5rem);
    --text-h1-page: clamp(2rem, 5vw, 4.5rem);
    --text-h2-section: clamp(1.8rem, 4vw, 3.2rem);
    --text-h3-card: clamp(1.4rem, 3vw, 2rem);
    --text-body: clamp(0.95rem, 2vw, 1.125rem);
    --text-small: clamp(0.7rem, 1.5vw, 0.85rem);

    /* Spacing Fluid */
    --section-padding: clamp(60px, 8vw, 120px);
    --container-padding: clamp(20px, 5vw, 80px);
    --card-padding: clamp(20px, 3vw, 40px);
    --grid-gap: clamp(16px, 3vw, 32px);

    /* Spacing Scale */
    --space-xs: 0.5rem;   /* 8px */
    --space-sm: 1rem;     /* 16px */
    --space-md: 1.5rem;   /* 24px */
    --space-lg: 2rem;     /* 32px */
    --space-xl: 3rem;     /* 48px */
    --space-2xl: 4.5rem;  /* 72px */
    --space-3xl: 6rem;    /* 96px */

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    /* Box Shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.05);
    --shadow-xl: 0 20px 25px rgba(0,0,0,0.05);

    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-normal: 300ms ease-in-out;
    --transition-slow: 500ms ease-in-out;
}

/* ==========================================================================
   Global Resets & Base Styles
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

body {
    font-family: var(--font-body);
    font-size: var(--text-body);
    color: var(--text-primary);
    background-color: var(--bg-primary);
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 500;
    color: var(--text-secondary);
    line-height: 1.3;
    margin-bottom: var(--space-sm);
}

.hero h1, h1.hero-title, [class*="hero"] h1 {
    font-size: var(--text-h1-hero);
}

h1 {
    font-size: var(--text-h1-page);
}

h2, .section-title {
    font-size: var(--text-h2-section);
}

h3, .card-title {
    font-size: var(--text-h3-card);
}

.eyebrow, small, .small-text, [class*="eyebrow"] {
    font-size: var(--text-small);
    letter-spacing: 0.15em;
    min-width: 0; /* reset if applied elsewhere */
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-soft-gold);
}

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

/* ==========================================================================
   Utility Classes
   ========================================================================== */
/* Container */
.container {
    width: 100%;
    max-width: 1280px;
    margin-inline: auto;
    padding-inline: var(--container-padding);
}

/* Section Padding */
.section-padding-sm, .section-padding-md, .section-padding-lg { 
    padding-block: var(--section-padding); 
}

/* Card Padding */
.card {
    padding: var(--card-padding);
}

/* Flex Helpers */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-sm, .gap-md, .gap-lg { gap: var(--grid-gap); }

/* Text Alignment */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* Colors */
.text-gold { color: var(--color-soft-gold); }
.text-green { color: var(--color-deep-forest-green); }
.bg-white { background-color: var(--bg-secondary); }
.bg-dark { background-color: var(--bg-accent); color: var(--text-light); }
.text-ivory { color: var(--color-warm-ivory) !important; }

/* ==========================================================================
   Touch Targets & Hover States (Mobile First)
   ========================================================================== */
button, a, .nav-link, input, select, textarea {
    min-height: 44px;
    min-width: 44px;
}

@media (hover: none) {
    a:hover, button:hover, .btn:hover, .nav-link:hover, .CTA-btn:hover, .card:hover {
        transform: none !important;
    }
}

/* ==========================================================================
   Media Queries / Breakpoints
   ========================================================================== */
/* Mobile First implies min-width */

/* Small Devices (375px and up - Mobile Landscape) */
@media (min-width: 375px) {
}

/* Large Phones (480px and up) */
@media (min-width: 480px) {
}

/* Tablets Portrait (768px and up) */
@media (min-width: 768px) {
}

/* Tablets Landscape / Small Laptops (1024px and up) */
@media (min-width: 1024px) {
}

/* Desktop (1280px and up) */
@media (min-width: 1280px) {
}

/* Large Desktops (1440px and up) */
@media (min-width: 1440px) {
}

/* ==========================================================================
   Navigation Responsive System
   ========================================================================== */
:root {
    --nav-height: 80px; /* default desktop */
}

/* Base Navbar (Desktop 1024px+) */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    background-color: var(--color-warm-ivory);
    border-bottom: 1px solid rgba(201, 168, 76, 0.2);
    box-shadow: 0 2px 20px rgba(0,0,0,0.06);
    z-index: 1000;
    display: flex;
    align-items: center;
}

.navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.navbar-logo {
    color: var(--color-soft-gold);
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    z-index: 1001; /* Stay above overlay */
}

.navbar-menu {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: var(--space-md);
    align-items: center;
}

.nav-link {
    color: var(--color-charcoal);
    font-weight: 500;
    position: relative;
}

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

/* Desktop Dropdown */
.has-dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background-color: var(--color-warm-ivory);
    min-width: 220px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(201, 168, 76, 0.2);
    border-radius: var(--radius-sm);
    padding: var(--space-sm) 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-normal), transform var(--transition-normal), visibility var(--transition-normal);
    list-style: none;
}

/* Desktop Hover */
@media (min-width: 1024px) {
    .has-dropdown:hover .dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(0);
    }
}

.dropdown-link {
    display: block;
    padding: var(--space-xs) var(--space-md);
    color: var(--color-charcoal);
}

.dropdown-link:hover {
    background-color: rgba(201, 168, 76, 0.05);
    color: var(--color-soft-gold);
}

/* CTA Buttons */
.CTA-btn-desktop {
    background-color: transparent;
    border: 1px solid var(--color-soft-gold);
    color: var(--color-soft-gold);
    border-radius: var(--radius-sm);
    padding: 0 var(--space-md);
    white-space: nowrap;
}

.CTA-btn-desktop:hover {
    background-color: var(--color-soft-gold);
    color: var(--color-pure-white);
}

.mobile-menu-footer {
    display: none;
}

/* Hamburger (hidden on desktop) */
.hamburger {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1001; /* Above overlay */
    width: 44px;
    height: 44px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
}

.hamburger-line {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--color-charcoal);
    transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1), opacity 300ms ease, background-color 300ms;
    transform-origin: center;
}

/* TABLET (768px - 1023px) */
@media (max-width: 1023px) and (min-width: 768px) {
    :root {
        --nav-height: 70px;
    }
    .hamburger {
        display: flex;
    }
    .CTA-btn-desktop {
        font-size: 0.9rem; /* Shrink text */
        padding: 0 var(--space-sm);
        margin-right: var(--space-sm);
        margin-left: auto;
    }
    
    .navbar-menu {
        position: absolute;
        top: var(--nav-height);
        left: 0;
        width: 100%;
        background-color: var(--color-warm-ivory);
        box-shadow: 0 10px 15px rgba(0,0,0,0.05);
        flex-direction: column;
        align-items: stretch;
        padding: 0;
        /* Slide down animation panel */
        transform-origin: top;
        transform: scaleY(0);
        opacity: 0;
        visibility: hidden;
        transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1), opacity 300ms ease, visibility 300ms;
    }

    .navbar-menu.is-active {
        transform: scaleY(1);
        opacity: 1;
        visibility: visible;
    }

    .nav-links {
        flex-direction: column;
        gap: 0;
        width: 100%;
    }

    .nav-item {
        width: 100%;
        border-bottom: 1px solid rgba(0,0,0,0.05);
    }
    .nav-link {
        display: block;
        padding: var(--space-md) var(--space-lg);
    }

    /* Tablet Dropdown Accordion */
    .dropdown-menu {
        position: static;
        transform: none;
        box-shadow: none;
        border: none;
        background-color: rgba(0,0,0,0.02);
        max-height: 0;
        overflow: hidden;
        transition: max-height 300ms ease;
        opacity: 1;
        visibility: visible;
        padding: 0;
    }
    
    .has-dropdown.mobile-active .dropdown-menu {
        max-height: 400px;
    }
}

/* MOBILE (below 768px) */
@media (max-width: 767px) {
    :root {
        --nav-height: 65px;
    }
    
    .hamburger {
        display: flex;
        margin-left: auto;
    }
    
    .CTA-btn-desktop {
        display: none; /* Hide on mobile navbar */
    }

    /* Full screen overlay */
    .navbar-menu {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background-color: #1a2e1a; /* Deep green */
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: var(--space-2xl) var(--space-lg);
        opacity: 0;
        visibility: hidden;
        transition: opacity 300ms ease, visibility 300ms;
        overflow-y: auto;
    }

    .navbar-menu.is-active {
        opacity: 1;
        visibility: visible;
    }

    .nav-links {
        flex-direction: column;
        gap: var(--space-md);
        align-items: center;
        width: 100%;
        margin-bottom: var(--space-xl);
    }

    .nav-link {
        font-family: var(--font-heading);
        font-size: 2.5rem;
        color: var(--color-warm-ivory);
        opacity: 0;
        transform: translateY(20px);
        transition: opacity 400ms ease, transform 400ms ease;
    }

    .navbar-menu.is-active .nav-link {
        opacity: 1;
        transform: translateY(0);
    }
    
    /* Staggered fade up */
    .nav-item:nth-child(1) .nav-link { transition-delay: 100ms; }
    .nav-item:nth-child(2) .nav-link { transition-delay: 200ms; }
    .nav-item:nth-child(3) .nav-link { transition-delay: 300ms; }
    .nav-item:nth-child(4) .nav-link { transition-delay: 400ms; }

    /* Accordion Dropdown Mobile */
    .dropdown-menu {
        position: static;
        transform: none;
        box-shadow: none;
        border: none;
        background-color: transparent;
        max-height: 0;
        overflow: hidden;
        transition: max-height 300ms ease;
        opacity: 1;
        visibility: visible;
        padding: 0;
        text-align: center;
    }

    .dropdown-link {
        color: rgba(247, 243, 237, 0.7); /* warm ivory with opacity */
        font-size: 1.25rem;
    }
    .dropdown-link:hover {
        color: var(--color-soft-gold);
        background: transparent;
    }

    .has-dropdown.mobile-active .dropdown-menu {
        max-height: 400px;
    }
    
    .dropdown-icon {
        color: var(--color-soft-gold);
    }

    /* Mobile Footer (CTA and Socials) */
    .mobile-menu-footer {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: var(--space-lg);
        width: 100%;
        opacity: 0;
        transform: translateY(20px);
        transition: opacity 400ms ease 500ms, transform 400ms ease 500ms;
    }

    .navbar-menu.is-active .mobile-menu-footer {
        opacity: 1;
        transform: translateY(0);
    }

    .CTA-btn-mobile {
        width: 100%;
        text-align: center;
    }

    .mobile-socials {
        display: flex;
        gap: var(--space-md);
    }
    .mobile-socials a {
        color: var(--color-warm-ivory);
        font-size: 1.25rem;
    }
    
    /* Hamburger styling when overlay open */
    .navbar.menu-open .hamburger-line {
        background-color: var(--color-warm-ivory) !important;
    }
    .navbar.menu-open .navbar-logo {
        color: var(--color-warm-ivory) !important;
    }
}

/* Hamburger Animation (3 lines to X) */
.hamburger.is-active .hamburger-line:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}
.hamburger.is-active .hamburger-line:nth-child(2) {
    opacity: 0;
}
.hamburger.is-active .hamburger-line:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* ==========================================================================
   Hero & Navigation Spacing Fixes
   ========================================================================== */
:root {
    --nav-height: 80px;
}

@media (max-width: 768px) {
    :root {
        --nav-height: 65px;
    }
}

/* Full-height heroes default */
section[class*="hero"], div[class*="hero"], .hero {
    padding-top: var(--nav-height) !important;
}

/* Shorter heroes */
.blog-hero, .experiences-hero {
    padding-top: calc(var(--nav-height) + 60px) !important;
}

@media (max-width: 768px) {
    .blog-hero, .experiences-hero {
        padding-top: calc(var(--nav-height) + 40px) !important;
    }
}

/* Non-hero pages that start with a plain section */
main > section:first-child:not([class*="hero"]) {
    margin-top: var(--nav-height) !important;
}

/* ==========================================================================
   Page-Specific Hero Adjustments (Blog & Experiences)
   ========================================================================== */

/* 1 & 2: Height and calculated padding for breathing room */
body.blog-page .blog-hero,
body.experiences-page .hero {
    min-height: 50vh !important;
    padding-top: calc(var(--nav-height) + 80px) !important;
}

@media (max-width: 768px) {
    body.blog-page .blog-hero,
    body.experiences-page .hero {
        padding-top: calc(var(--nav-height) + 50px) !important;
    }
}

/* 3 & 4: Margin adjustments on the eyebrow element */
body.blog-page .blog-hero-eyebrow,
body.experiences-page .hero-eyebrow {
    margin-top: 0 !important;
    margin-bottom: 20px !important;
    display: inline-block; /* Ensure margins apply properly */
}

/* 5: Wrapping content padding for flex-centered heroes */
body.blog-page .blog-hero-content,
body.experiences-page .hero-content {
    padding-top: 40px !important;
    padding-bottom: 40px !important;
}

/* Prevent horizontal scroll on mobile */
html, body {
    overflow-x: hidden;
}


/* ==========================================================================
   Optimization & Accessibility
   ========================================================================== */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: #c9a84c;
    color: white;
    padding: 8px;
    z-index: 1000000;
    transition: top 0.2s ease;
}
.skip-to-content:focus {
    top: 0;
}

/* Contain layout for heavy grids to prevent repaints */
.journey-grid, .blog-grid, .masonry-grid, .grid {
    contain: layout;
}

/* Content Visibility for off-screen heavy sections */
.site-footer, footer, .related-journeys {
    content-visibility: auto;
    contain-intrinsic-size: 1000px;
}


/* ==========================================================================
   Cross-Browser Compatibility Fixes
   ========================================================================== */

/* 1. Backdrop Filter Fallbacks */
@supports not (backdrop-filter: blur(1px)) {
    .main-header.scrolled, header.scrolled, .header-scrolled,
    .sticky-booking-sidebar, .consultation-sidebar,
    #mobile-book-toggle, .mobile-floating-cta {
        background: rgba(247, 243, 237, 0.98) !important;
    }
}
@supports (-webkit-backdrop-filter: none) or (backdrop-filter: none) {
    .main-header.scrolled, header.scrolled, .header-scrolled,
    .sticky-booking-sidebar, .consultation-sidebar,
    #mobile-book-toggle, .mobile-floating-cta {
        -webkit-backdrop-filter: blur(20px) saturate(180%);
    }
}

/* 4. Smooth Scroll */
html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-height) + 2rem);
}

/* 5. vh units on mobile (address bar issue) */
.hero, .journey-hero, .contact-hero {
    height: 100vh; /* fallback */
    height: 100dvh;
}
@supports (height: 100dvh) {
    .hero, .journey-hero, .contact-hero {
        height: 100dvh;
    }
}

/* 6. Object-fit fallback */
img {
    -o-object-fit: cover;
    object-fit: cover;
    object-position: center;
}

/* 8. Touch Events (removes 300ms delay on mobile) */
a, button, input[type="submit"], input[type="button"], .btn {
    touch-action: manipulation;
}

/* 9. iOS input zoom prevention */
input, textarea, select {
    font-size: 16px !important;
}

/* 10. Overscroll prevention */
body {
    overscroll-behavior: none;
}

/* Note: IE Grid Fallbacks omitted (Not supported for luxury modern baseline) */
