/* Custom styles for The Vitis Center of Integrative Medicine */

/* Base smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Prevent FOUC on page load */
html.no-js .scroll-reveal {
    opacity: 1 !important;
}

/* Scroll reveal base state — always visible by default for accessibility */
.scroll-reveal {
    opacity: 1;
    transform: none;
    transition: opacity 0.7s ease, transform 0.7s ease;
}

/* Only apply hidden state when JS is active and motion is preferred */
@media (prefers-reduced-motion: no-preference) {
    .scroll-reveal[data-reveal] {
        opacity: 0;
        transform: translateY(24px);
    }
    
    .scroll-reveal[data-reveal="left"] {
        transform: translateX(-24px);
    }
    
    .scroll-reveal[data-reveal="right"] {
        transform: translateX(24px);
    }
}

/* Navbar transition */
#navbar {
    transition: background-color 0.4s ease, box-shadow 0.4s ease, padding 0.4s ease;
}

#navbar.scrolled {
    background-color: rgba(250, 249, 246, 0.95);
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 20px rgba(38, 64, 38, 0.08);
}

/* Mobile menu transitions */
#mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease;
}

#mobile-menu.open {
    max-height: 500px;
    opacity: 1;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f5f3ed;
}

::-webkit-scrollbar-thumb {
    background: #c6dfc9;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #9dc4a0;
}

/* Selection color */
::selection {
    background-color: #c6dfc9;
    color: #1f341f;
}

/* Reduce motion preference */
@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;
    }
    
    .animate-float,
    .animate-float-delayed,
    .animate-float-slow {
        animation: none;
    }
}

/* Print styles */
@media print {
    #navbar,
    .scroll-reveal,
    .animate-float,
    .animate-float-delayed,
    .animate-float-slow {
        display: block !important;
        opacity: 1 !important;
    }
    
    body {
        color: #000;
        background: #fff;
    }
}

/* Focus visible for accessibility */
:focus-visible {
    outline: 2px solid #528452;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Smooth image loading */
img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}
