/* ============================================
   Sache International Language — Custom Styles
   ============================================ */

/* --- Base & Typography --- */
html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow-x: hidden;
}

/* --- Selection Color --- */
::selection {
    background-color: rgba(251, 191, 36, 0.3);
    color: #fce7eb;
}

::-moz-selection {
    background-color: rgba(251, 191, 36, 0.3);
    color: #fce7eb;
}

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

::-webkit-scrollbar-track {
    background: #3d0515;
}

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

::-webkit-scrollbar-thumb:hover {
    background: #c22050;
}

/* --- Navbar --- */
#navbar.scrolled {
    background: rgba(61, 5, 21, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

#navbar.scrolled .menu-line {
    background: #fde68a;
}

/* --- Mobile Menu --- */
#mobile-menu.open {
    opacity: 1;
    pointer-events: all;
}

#mobile-menu.open .mobile-link {
    animation: fadeDown 0.4s ease forwards;
    opacity: 1;
}

#mobile-menu.open .mobile-link:nth-child(1) { animation-delay: 0.1s; }
#mobile-menu.open .mobile-link:nth-child(2) { animation-delay: 0.15s; }
#mobile-menu.open .mobile-link:nth-child(3) { animation-delay: 0.2s; }
#mobile-menu.open .mobile-link:nth-child(4) { animation-delay: 0.25s; }
#mobile-menu.open .mobile-link:nth-child(5) { animation-delay: 0.3s; }

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

/* --- Mobile Menu Button States --- */
.menu-toggle.active .menu-line:nth-child(1) {
    transform: translateY(3px) rotate(45deg);
}

.menu-toggle.active .menu-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.menu-toggle.active .menu-line:nth-child(3) {
    transform: translateY(-3px) rotate(-45deg);
}

/* --- Scroll Reveal Animations --- */
.reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* These are progressive enhancement — content is visible by default.
   JS adds the 'revealed' class for the animation on scroll. */
.reveal {
    transform: translateY(30px);
}

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

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
    
    .animate-bounce {
        animation: none;
    }
    
    img, .group:hover img {
        transition: none;
        transform: none;
    }
}

/* --- Card Image Hover --- */
.group:hover img {
    will-change: transform;
}

/* --- Form Focus States --- */
input:focus, select:focus, textarea:focus {
    outline: none;
}

/* --- Button Ripple Effect --- */
button, a {
    will-change: transform;
}

/* --- Image Aspect Ratios --- */
img {
    max-width: 100%;
    height: auto;
}

/* --- Print Styles --- */
@media print {
    #navbar, .animate-bounce, #mobile-menu {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .bg-plum-950, .bg-plum-900 {
        background: white !important;
    }
    
    .text-white, .text-plum-200, .text-plum-300 {
        color: black !important;
    }
}

/* --- Responsive Adjustments --- */
@media (max-width: 767px) {
    .font-serif {
        line-height: 1.15;
    }
    
    /* Ensure touch targets are large enough */
    a, button {
        min-height: 44px;
    }
    
    /* Adjust card stacking on mobile */
    .md\:col-span-2 {
        grid-column: span 2;
    }
    
    @media (max-width: 639px) {
        .md\:col-span-2 {
            grid-column: span 1;
        }
    }
}

/* --- Focus Visible for Accessibility --- */
:focus-visible {
    outline: 2px solid #fbbf24;
    outline-offset: 2px;
}

/* --- Selection for select dropdown --- */
select option {
    background-color: #3d0515;
    color: #fce7eb;
    padding: 8px;
}
