/* ===== Custom Styles for Willow Bakery ===== */

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

/* Selection color */
::selection {
    background-color: rgba(95, 184, 147, 0.3);
    color: #0a1638;
}

/* Focus visible styles */
:focus-visible {
    outline: 2px solid #5fb893;
    outline-offset: 2px;
}

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

    .scroll-reveal {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ===== Scroll Reveal (progressive enhancement) ===== */
.scroll-reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

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

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

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

    .scroll-reveal.delay-1 { transition-delay: 0.1s; }
    .scroll-reveal.delay-2 { transition-delay: 0.2s; }
    .scroll-reveal.delay-3 { transition-delay: 0.3s; }
    .scroll-reveal.delay-4 { transition-delay: 0.4s; }
}

/* ===== Header scroll state ===== */
#header.scrolled {
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

/* ===== Hero image composition ===== */
#hero .relative {
    margin-right: -2rem;
}

@media (max-width: 1023px) {
    #hero .relative {
        margin-right: 0;
    }
}

/* ===== Card hover effects ===== */
.group:hover .group-hover\:scale-105 {
    transform: scale(1.05);
}

/* ===== Button micro-interactions ===== */
a, button {
    -webkit-tap-highlight-color: transparent;
}

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

::-webkit-scrollbar-track {
    background: #0a1638;
}

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

::-webkit-scrollbar-thumb:hover {
    background: #3050c4;
}

/* ===== Mobile menu animation ===== */
#mobileMenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.22, 1, 0.36, 1),
                padding 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

#mobileMenu.open {
    max-height: 400px;
    padding-top: 0;
}

/* ===== Image loading placeholder ===== */
img {
    background: linear-gradient(135deg, #eef2ff 0%, #d0d9f7 100%);
}

/* ===== Section dividers ===== */
section + section::before {
    content: '';
    display: block;
}

/* ===== Table of contents for accessibility ===== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ===== Active nav link ===== */
nav a.active {
    color: #95d3b8 !important;
}

/* ===== Subtle pattern overlay ===== */
.pattern-grid {
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
}

/* ===== Focus ring for keyboard nav ===== */
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid #5fb893;
    outline-offset: 2px;
}

/* ===== Print styles ===== */
@media print {
    #header,
    #contact,
    footer {
        display: none;
    }

    body {
        color: #000;
        background: #fff;
    }

    section {
        page-break-inside: avoid;
    }
}
