/* ========================================
   Railroad Air Bed & Breakfast Inn
   Custom Styles
======================================== */

/* Base & Typography */
html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow-x: hidden;
}

/* Selection Color */
::selection {
    background-color: rgba(143, 179, 150, 0.3);
    color: #1f3729;
}

/* ========================================
   Scroll Reveal Animations
   Progressive enhancement: content visible
   by default, animated via JS only when
   prefers-reduced-motion is not set.
======================================== */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(30px);
        transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                    transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }
    
    .reveal.revealed {
        opacity: 1;
        transform: translateY(0);
    }
    
    /* Stagger delays */
    .reveal[data-delay="100"] { transition-delay: 0.1s; }
    .reveal[data-delay="200"] { transition-delay: 0.2s; }
    .reveal[data-delay="300"] { transition-delay: 0.3s; }
}

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

#navbar.scrolled {
    background: rgba(12, 23, 16, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05);
}

.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: currentColor;
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

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

#mobile-menu.open .mobile-link {
    animation: slideIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    opacity: 0;
}

#mobile-menu.open .mobile-link:nth-child(1) { animation-delay: 0.05s; }
#mobile-menu.open .mobile-link:nth-child(2) { animation-delay: 0.1s; }
#mobile-menu.open .mobile-link:nth-child(3) { animation-delay: 0.15s; }
#mobile-menu.open .mobile-link:nth-child(4) { animation-delay: 0.2s; }
#mobile-menu.open .mobile-link:nth-child(5) { animation-delay: 0.25s; }

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

/* Menu Toggle Animation */
.menu-toggle.active .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(3px, 3px);
}

.menu-toggle.active .menu-line:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active .menu-line:nth-child(3) {
    transform: rotate(-45deg) translate(3px, -3px);
    width: 1.5rem;
}

/* ========================================
   Gallery Scroll Animation
======================================== */
@keyframes scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.animate-scroll {
    display: flex;
    gap: 1rem;
    animation: scroll 40s linear infinite;
    width: max-content;
}

.animate-scroll:hover {
    animation-play-state: paused;
}

/* ========================================
   Form Styles
======================================== */
input:focus,
textarea:focus {
    box-shadow: 0 0 0 3px rgba(68, 114, 82, 0.1);
}

/* ========================================
   Responsive Adjustments
======================================== */
@media (max-width: 768px) {
    .font-serif {
        line-height: 1.1;
    }
}

/* ========================================
   Focus Visible for Accessibility
======================================== */
:focus-visible {
    outline: 2px solid #8fb396;
    outline-offset: 2px;
}

/* ========================================
   Print Styles
======================================== */
@media print {
    nav, .animate-scroll, #contact-form button {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
}
