/* ============================================
   Stone Manor Bed and Breakfast
   Custom Styles & Animations
   ============================================ */

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

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

body {
    overflow-x: hidden;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #FFFCFA;
}
::-webkit-scrollbar-thumb {
    background: #D4A0A0;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #781F37;
}

/* --- Selection --- */
::selection {
    background: rgba(120, 31, 55, 0.15);
    color: #781F37;
}

/* --- Scroll Indicator Animation --- */
@keyframes scrollIndicator {
    0% {
        top: 0;
        opacity: 1;
    }
    100% {
        top: 100%;
        opacity: 0;
    }
}

.animate-scroll-indicator {
    animation: scrollIndicator 1.5s ease-in-out infinite;
}

/* --- Hero Content Animation --- */
@keyframes heroFadeUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-content {
    animation: heroFadeUp 1s ease-out forwards;
}

/* --- Mobile Menu --- */
.mobile-link {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s ease;
}

body.menu-open .mobile-link {
    opacity: 1;
    transform: translateY(0);
}

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

/* --- Mobile Menu Icon Animation --- */
body.menu-open #bar1 {
    transform: rotate(45deg) translate(5px, 5px);
}
body.menu-open #bar2 {
    opacity: 0;
}
body.menu-open #bar3 {
    transform: rotate(-45deg) translate(5px, -5px);
    width: 1.5rem;
}

/* --- Scroll Reveal Animations --- */
/* These are progressive enhancement — content is visible by default */
@media (prefers-reduced-motion: no-preference) {
    .room-reveal,
    .experience-reveal,
    .location-reveal,
    .gallery-reveal,
    .contact-info,
    .contact-form-wrap {
        opacity: 1;
        transform: none;
    }
}

/* JS-enhanced reveal (applied via script) */
.revealed {
    opacity: 1 !important;
    transform: none !important;
    transition: opacity 0.8s ease, transform 0.8s ease;
}

/* --- Room Cards --- */
.room-card {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.room-card.revealed {
    opacity: 1;
    transform: translateY(0);
}

.room-card:nth-child(2) { transition-delay: 0.1s; }
.room-card:nth-child(3) { transition-delay: 0.2s; }
.room-card:nth-child(4) { transition-delay: 0.3s; }

/* --- Experience Cards --- */
.experience-card {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.experience-card.revealed {
    opacity: 1;
    transform: translateY(0);
}

.experience-card:nth-child(1) { transition-delay: 0.05s; }
.experience-card:nth-child(2) { transition-delay: 0.1s; }
.experience-card:nth-child(3) { transition-delay: 0.15s; }
.experience-card:nth-child(4) { transition-delay: 0.2s; }
.experience-card:nth-child(5) { transition-delay: 0.25s; }
.experience-card:nth-child(6) { transition-delay: 0.3s; }

/* --- Gallery Items --- */
.gallery-item {
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.gallery-item.revealed {
    opacity: 1;
    transform: scale(1);
}

/* --- Navbar Transition --- */
.nav-scrolled {
    background: rgba(255, 252, 250, 0.95) !important;
    backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(120, 31, 55, 0.08);
}

/* --- Form Focus Styles --- */
input:focus,
textarea:focus {
    outline: none;
}

/* --- Button Hover Glow --- */
button:hover {
    transform: translateY(-1px);
}

button:active {
    transform: translateY(0);
}

/* --- Image Placeholder Fallback --- */
img {
    background: linear-gradient(135deg, #f5f0ec 0%, #ede4de 100%);
}

/* --- Smooth Image Loading --- */
img {
    transition: opacity 0.3s ease;
}

img[loading="lazy"] {
    opacity: 0;
}

img.loaded {
    opacity: 1;
}

/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
    html {
        scroll-behavior: smooth;
    }
    
    .font-serif {
        line-height: 1.2;
    }
}

/* --- Print Styles --- */
@media print {
    nav, .animate-scroll-indicator, #contactForm {
        display: none;
    }
    
    body {
        color: #1C1917;
        background: white;
    }
}
