/* ============================================
   Double B RV Park — Custom Styles
   ============================================ */

/* Base */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow-x: hidden;
}

/* Selection */
::selection {
    background: #065f46;
    color: #fff9f0;
}

/* ============================================
   Hero Animations
   ============================================ */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-down {
    animation: fadeInDown 0.8s ease forwards;
    animation-delay: 0.2s;
}

.animate-fade-up {
    animation: fadeInUp 0.8s ease forwards;
    animation-delay: 0.5s;
}

.animate-fade-up-delay {
    animation: fadeInUp 0.8s ease forwards;
    animation-delay: 0.7s;
}

.animate-fade-up-delay-2 {
    animation: fadeInUp 0.8s ease forwards;
    animation-delay: 0.9s;
}

/* ============================================
   Scroll Reveal (progressive enhancement)
   ============================================ */
.reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(30px);
    }

    .reveal.revealed {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   Navbar
   ============================================ */
#navbar {
    background: transparent;
}

#navbar.scrolled {
    background: rgba(255, 253, 247, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(6, 78, 59, 0.08);
}

#navbar.scrolled .font-serif,
#navbar.scrolled span {
    color: #064e3b !important;
}

#navbar.scrolled .text-emerald-700 {
    color: #047857 !important;
}

#navbar.scrolled .menu-line {
    background: #064e3b !important;
}

#navbar.scrolled a:not(.bg-emerald-800) {
    color: #064e3b !important;
}

/* ============================================
   Mobile Menu
   ============================================ */
#mobileMenu.open {
    opacity: 1;
    pointer-events: all;
}

#mobileMenu.closed {
    opacity: 0;
    pointer-events: none;
}

.mobile-link {
    opacity: 1;
}

/* Menu button animation */
.menu-line:nth-child(1) {
    transform-origin: center;
}
.menu-line:nth-child(2) {
    transform-origin: center;
}
.menu-line:nth-child(3) {
    transform-origin: center;
}

#menuBtn.active .menu-line:nth-child(1) {
    transform: translateY(4px) rotate(45deg);
}
#menuBtn.active .menu-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
#menuBtn.active .menu-line:nth-child(3) {
    transform: translateY(-4px) rotate(-45deg);
    width: 1.25rem;
}

/* ============================================
   Typography refinements
   ============================================ */
h1, h2, h3, h4 {
    text-wrap: pretty;
}

p {
    text-wrap: pretty;
}

/* ============================================
   Image lazy-load fallback
   ============================================ */
img[loading="lazy"] {
    transition: opacity 0.3s ease;
}

img[loading="lazy"]:not(.loaded) {
    opacity: 0;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* ============================================
   Focus styles
   ============================================ */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid #10b981;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ============================================
   Smooth scroll offset for fixed nav
   ============================================ */
section[id] {
    scroll-margin-top: 80px;
}

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

    html {
        scroll-behavior: auto;
    }
}

/* ============================================
   Print styles
   ============================================ */
@media print {
    #navbar, #mobileMenu, .reveal {
        display: none !important;
    }

    body {
        background: white !important;
        color: black !important;
    }

    a {
        color: black !important;
    }
}
