/* ============================================
   The Farmer's Daughters' Country Market
   Custom Styles
   ============================================ */

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

/* Base styles */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Selection color */
::selection {
    background-color: #7fb87f;
    color: #0b170b;
}

/* Focus visible styles */
:focus-visible {
    outline: 2px solid #529452;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #faf8f2;
}
::-webkit-scrollbar-thumb {
    background: #b5d4b5;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #7fb87f;
}

/* ============================================
   Scroll Reveal Animations
   Progressive enhancement — only active when
   JS runs and user prefers motion
   ============================================ */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(24px);
        transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
                    transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
    }

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

    /* Stagger children */
    .reveal.stagger > * {
        opacity: 0;
        transform: translateY(16px);
        transition: opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1),
                    transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
    }

    .reveal.stagger.revealed > *:nth-child(1) { transition-delay: 0.05s; }
    .reveal.stagger.revealed > *:nth-child(2) { transition-delay: 0.1s; }
    .reveal.stagger.revealed > *:nth-child(3) { transition-delay: 0.15s; }
    .reveal.stagger.revealed > *:nth-child(4) { transition-delay: 0.2s; }
    .reveal.stagger.revealed > *:nth-child(5) { transition-delay: 0.25s; }
    .reveal.stagger.revealed > *:nth-child(6) { transition-delay: 0.3s; }

    .reveal.revealed > * {
        opacity: 1;
        transform: translateY(0);
    }
}

/* For users who prefer reduced motion, ensure content is always visible */
@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
    }
}

/* ============================================
   Navbar scroll state
   ============================================ */
#site-header {
    background: transparent;
}

#site-header.scrolled {
    background: rgba(253, 252, 248, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 20px rgba(26, 55, 28, 0.08);
}

#site-header.scrolled .font-serif {
    color: #1c371c !important;
}

#site-header.scrolled .menu-line {
    background: #1c371c !important;
}

/* ============================================
   Mobile menu animations
   ============================================ */
#mobile-menu.open .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
#mobile-menu.open .menu-line:nth-child(2) {
    opacity: 0;
}
#mobile-menu.open .menu-line:nth-child(3) {
    width: 1.5rem;
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ============================================
   Hero section
   ============================================ */
#hero {
    background: linear-gradient(135deg, #0b170b 0%, #172c17 40%, #1c371c 100%);
}

/* ============================================
   Button & link hover micro-interactions
   ============================================ */
a {
    text-decoration: none;
}

/* ============================================
   Image shimmer loading placeholder
   ============================================ */
img {
    background: linear-gradient(110deg, #ece4d0 8%, #f5f0e6 18%, #ece4d0 33%);
    background-size: 200% 100%;
    animation: shimmer 1.5s linear infinite;
}

img[loading="lazy"] {
    opacity: 1;
    animation: none;
}

img[src]:not([loading="lazy"]) {
    opacity: 1;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* ============================================
   Product card hover glow
   ============================================ */
.group:hover .bg-forest-500 {
    box-shadow: 0 0 20px rgba(127, 184, 127, 0.4);
}

/* ============================================
   Form input focus glow
   ============================================ */
input:focus,
textarea:focus {
    box-shadow: 0 0 0 3px rgba(82, 148, 82, 0.15);
}

/* ============================================
   Map container responsive
   ============================================ */
iframe {
    border-radius: 1.5rem;
}

/* ============================================
   Print styles
   ============================================ */
@media print {
    #site-header,
    #mobile-menu,
    button,
    .reveal {
        display: none !important;
    }

    body {
        color: #1c371c;
        background: white;
    }

    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.75rem;
        color: #7fb87f;
    }
}
