/* ===== Custom Styles for Seymour Flour Mill ===== */

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

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== 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(24px);
    }
    .scroll-reveal.revealed {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Staggered delays for grid items */
.scroll-reveal:nth-child(1) { transition-delay: 0ms; }
.scroll-reveal:nth-child(2) { transition-delay: 80ms; }
.scroll-reveal:nth-child(3) { transition-delay: 160ms; }
.scroll-reveal:nth-child(4) { transition-delay: 240ms; }
.scroll-reveal:nth-child(5) { transition-delay: 320ms; }
.scroll-reveal:nth-child(6) { transition-delay: 400ms; }

/* ===== Navbar scroll state ===== */
#navbar.scrolled {
    box-shadow: 0 1px 20px rgba(0,0,0,0.08);
}

/* ===== Nav link underline animation ===== */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: #B85446;
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

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

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

.mobile-link {
    position: relative;
}

.mobile-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: #B85446;
    transition: width 0.3s ease;
}

.mobile-link:hover::after {
    width: 100%;
}

/* ===== Custom scrollbar ===== */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #F9F1E8;
}
::-webkit-scrollbar-thumb {
    background: #D3C8BA;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #9E8B6E;
}

/* ===== Selection color ===== */
::selection {
    background: #FBC8BB;
    color: #5E261F;
}

/* ===== Input autofill style ===== */
input:-webkit-autofill,
textarea:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 30px #FDF8F3 inset !important;
    -webkit-text-fill-color: #4D4033 !important;
}

/* ===== Button focus states ===== */
button:focus-visible,
a:focus-visible {
    outline: 2px solid #B85446;
    outline-offset: 2px;
}

/* ===== Image optimization ===== */
img {
    max-width: 100%;
    height: auto;
}

/* ===== Print styles ===== */
@media print {
    #navbar, #mobile-menu-btn {
        display: none !important;
    }
    body {
        color: #000;
        background: #fff;
    }
}

/* ===== Accessibility ===== */
@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;
        transform: translateY(0);
    }
}

/* ===== Tablet adjustments ===== */
@media (max-width: 768px) {
    .font-serif {
        line-height: 1.15;
    }
}

/* ===== Large screen adjustments ===== */
@media (min-width: 1400px) {
    .max-w-7xl {
        max-width: 80rem;
    }
}
