/* ========================================
   King's Way Cafe — Custom Styles
   ======================================== */

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

body {
    overflow-x: hidden;
}

/* Selection */
::selection {
    background-color: rgba(5, 150, 105, 0.2);
    color: #064e3b;
}

/* ========================================
   Navigation
   ======================================== */
#header {
    background: transparent;
    transition: background-color 0.5s ease, backdrop-filter 0.5s ease, box-shadow 0.5s ease;
}

#header.scrolled {
    background: rgba(253, 251, 247, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(6, 78, 59, 0.06);
}

.nav-link {
    position: relative;
}

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

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

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

.mobile-nav-link {
    position: relative;
}

.mobile-nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 1px;
    background: currentColor;
    transition: width 0.3s ease;
}

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

/* Hamburger */
#menu-toggle[aria-expanded="true"] .menu-line:nth-child(1) {
    transform: translateY(3px) rotate(45deg);
}

#menu-toggle[aria-expanded="true"] .menu-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

#menu-toggle[aria-expanded="true"] .menu-line:nth-child(3) {
    transform: translateY(-3px) rotate(-45deg);
    width: 6px;
}

/* ========================================
   Hero Animations
   ======================================== */
.hero-eyebrow {
    animation: fadeUp 0.8s ease forwards;
    animation-delay: 0.2s;
    opacity: 0;
}

.hero-title {
    animation: fadeUp 0.8s ease forwards;
    animation-delay: 0.4s;
    opacity: 0;
}

.hero-subtitle {
    animation: fadeUp 0.8s ease forwards;
    animation-delay: 0.6s;
    opacity: 0;
}

.hero-cta {
    animation: fadeUp 0.8s ease forwards;
    animation-delay: 0.8s;
    opacity: 0;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   Section Eyebrow
   ======================================== */
.section-eyebrow {
    letter-spacing: 0.25em;
}

/* ========================================
   Menu Items
   ======================================== */
.menu-item {
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(6, 78, 59, 0.06);
}

.menu-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

/* ========================================
   Scroll Reveal
   ======================================== */
.reveal-up,
.reveal-left,
.reveal-right {
    opacity: 1;
    transform: none;
    transition: opacity 0.7s ease, transform 0.7s ease;
}

/* When JS is enabled, set initial hidden state via .js class */
.js .reveal-up {
    opacity: 0;
    transform: translateY(32px);
}

.js .reveal-left {
    opacity: 0;
    transform: translateX(-32px);
}

.js .reveal-right {
    opacity: 0;
    transform: translateX(32px);
}

.js .reveal-up.revealed,
.js .reveal-left.revealed,
.js .reveal-right.revealed {
    opacity: 1;
    transform: none;
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    
    .reveal-up,
    .reveal-left,
    .reveal-right {
        opacity: 1;
        transform: none;
        transition: none;
    }
    
    .hero-eyebrow,
    .hero-title,
    .hero-subtitle,
    .hero-cta {
        animation: none;
        opacity: 1;
    }
    
    .menu-item {
        transition: none;
    }
    
    .menu-item:hover {
        transform: none;
    }
    
    img {
        transition: none;
    }
}

/* ========================================
   Image Hover
   ======================================== */
img {
    transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ========================================
   Focus Styles
   ======================================== */
a:focus-visible,
button:focus-visible {
    outline: 2px solid #059669;
    outline-offset: 4px;
    border-radius: 2px;
}

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

::-webkit-scrollbar-track {
    background: #FDFBF7;
}

::-webkit-scrollbar-thumb {
    background: rgba(6, 78, 59, 0.2);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(6, 78, 59, 0.4);
}

/* ========================================
   Smooth image loading
   ======================================== */
img {
    background-color: rgba(6, 78, 59, 0.04);
}

/* ========================================
   Print
   ======================================== */
@media print {
    #header,
    #menu-toggle,
    .hero-cta,
    img {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .bg-emerald-950,
    footer {
        background: white !important;
        color: black !important;
    }
}
