/* Custom styles for B & B Machine Quilting */

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

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #fdfcfa;
}
::-webkit-scrollbar-thumb {
    background: #a12f2f;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #822626;
}

/* Scroll reveal base - always visible by default for progressive enhancement */
.scroll-reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

/* Only animate when JS is enabled and user prefers motion */
@media (prefers-reduced-motion: no-preference) {
    .scroll-reveal {
        opacity: 0;
        transform: translateY(30px);
    }
    .scroll-reveal.revealed {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Staggered animation delays */
.scroll-reveal:nth-child(1) { transition-delay: 0.05s; }
.scroll-reveal:nth-child(2) { transition-delay: 0.1s; }
.scroll-reveal:nth-child(3) { transition-delay: 0.15s; }
.scroll-reveal:nth-child(4) { transition-delay: 0.2s; }
.scroll-reveal:nth-child(5) { transition-delay: 0.25s; }
.scroll-reveal:nth-child(6) { transition-delay: 0.3s; }

/* Navbar scroll state */
.nav-scrolled {
    background: rgba(253, 252, 250, 0.97) !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 1px 20px rgba(108, 32, 32, 0.08);
}

.nav-scrolled .nav-link {
    color: #6c2020 !important;
}

.nav-scrolled .font-serif {
    color: #3b0e0e !important;
}

/* Mobile menu animation */
#mobileMenu {
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hero decorative elements */
.hero-pattern {
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.08'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* Button hover effects */
a:hover {
    transition: all 0.3s ease;
}

/* Focus styles for accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid #a12f2f;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Print styles */
@media print {
    #navbar,
    #backToTop,
    #contactForm,
    .scroll-reveal {
        display: none !important;
    }
    body {
        color: #000;
        background: #fff;
    }
}

/* 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;
    }
}

/* Mobile menu active state */
.mobile-link {
    transition: color 0.3s ease, padding-left 0.3s ease;
}
.mobile-link:hover {
    padding-left: 8px;
}

/* Gallery image hover */
.group:hover .group-hover\:scale-105 {
    transform: scale(1.05);
}

/* Card hover lift */
.shadow-sm:hover {
    transform: translateY(-4px);
}

/* Back to top button */
#backToTop.show {
    opacity: 1;
    pointer-events: all;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#backToTop.hide {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}
