/* ============================================
   Penny's Saloon — Custom Styles
   Classic & Elegant · Forest Green + Off-White
   ============================================ */

/* --- Base & Reset --- */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    margin: 0;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
}

/* --- Navbar Scroll State --- */
#navbar {
    background: transparent;
    transition: background 0.5s ease, box-shadow 0.5s ease;
}

#navbar.scrolled {
    background: rgba(27, 67, 50, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 20px rgba(0, 0, 0, 0.2);
}

.nav-text {
    transition: color 0.3s ease;
}

/* --- Mobile Menu --- */
#mobile-menu {
    z-index: 60;
}

#mobile-menu.open {
    opacity: 1;
    pointer-events: all;
}

#mobile-menu.closed {
    opacity: 0;
    pointer-events: none;
}

.mobile-link {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

#mobile-menu.open .mobile-link {
    opacity: 1;
    transform: translateY(0);
}

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

/* --- Mobile Menu Icon Animation --- */
#menu-toggle.active #bar1 {
    transform: rotate(45deg) translate(5px, 5px);
}

#menu-toggle.active #bar2 {
    opacity: 0;
}

#menu-toggle.active #bar3 {
    transform: rotate(-45deg) translate(5px, -5px);
    width: 1.5rem;
}

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

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

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
    
    html {
        scroll-behavior: auto;
    }
    
    img, .overflow-hidden img {
        transition: none;
    }
    
    .overflow-hidden img:hover {
        transform: none;
    }
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: #2a5c36;
}

/* --- Selection Color --- */
::selection {
    background: rgba(212, 165, 116, 0.3);
    color: #0d221a;
}

/* --- Focus Styles --- */
:focus-visible {
    outline: 2px solid #D4A574;
    outline-offset: 4px;
}

/* --- Input Autofill --- */
input:-webkit-autofill,
textarea:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 30px #0d221a inset !important;
    -webkit-text-fill-color: #FDF8F0 !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* --- Image Hover Container --- */
.overflow-hidden {
    position: relative;
}

.overflow-hidden::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(27, 67, 50, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.overflow-hidden:hover::after {
    opacity: 1;
}

/* --- Decorative Divider --- */
.section-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 0 auto;
}

.section-divider::before,
.section-divider::after {
    content: '';
    flex: 0 0 auto;
    width: 60px;
    height: 1px;
    background: currentColor;
    opacity: 0.3;
}

/* --- Menu Item Hover --- */
.group:hover .group-hover\:text-cream-400 {
    color: #D4A574;
}

/* --- Button Ripple Effect (subtle) --- */
button, a {
    position: relative;
    overflow: visible;
}

/* --- Print Styles --- */
@media print {
    #navbar, #mobile-menu, .reveal {
        display: none !important;
    }
    
    body {
        color: #000;
        background: #fff;
    }
    
    .bg-forest-700, .bg-forest-800, .bg-forest-950 {
        background: #fff !important;
        color: #000 !important;
    }
}
