/* Cozy Nook - Custom Styles */

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

/* Header Scroll Effect */
#header {
    background: transparent;
}

#header.scrolled {
    background: rgba(247, 244, 238, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

#header.scrolled .font-heading {
    color: #2B2B2B;
}

/* Mobile Menu */
#mobileMenu {
    background: #F7F4EE;
}

/* Masonry Gallery */
.masonry-grid {
    column-count: 1;
    column-gap: 1rem;
}

@media (min-width: 640px) {
    .masonry-grid {
        column-count: 2;
    }
}

@media (min-width: 1024px) {
    .masonry-grid {
        column-count: 3;
    }
}

@media (min-width: 1280px) {
    .masonry-grid {
        column-count: 4;
    }
}

.masonry-item {
    break-inside: avoid;
    margin-bottom: 1rem;
}

.masonry-item img {
    width: 100%;
    display: block;
}

/* Fade In Animation */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stagger animation delays */
.fade-in:nth-child(1) { animation-delay: 0.1s; }
.fade-in:nth-child(2) { animation-delay: 0.2s; }
.fade-in:nth-child(3) { animation-delay: 0.3s; }
.fade-in:nth-child(4) { animation-delay: 0.4s; }
.fade-in:nth-child(5) { animation-delay: 0.5s; }

/* Scroll Reveal Animation */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

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

/* Image Hover Zoom */
.img-zoom {
    overflow: hidden;
}

.img-zoom img {
    transition: transform 0.5s ease;
}

.img-zoom:hover img {
    transform: scale(1.05);
}

/* Soft Parallax Effect */
.parallax {
    will-change: transform;
}

/* Lightbox */
#lightbox {
    opacity: 0;
    transition: opacity 0.3s ease;
}

#lightbox:not(.hidden) {
    display: flex;
    opacity: 1;
}

#lightboxImg {
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

#lightbox:not(.hidden) #lightboxImg {
    transform: scale(1);
}

/* Form Styles */
input:focus,
select:focus,
textarea:focus {
    box-shadow: 0 0 0 3px rgba(214, 185, 140, 0.2);
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: #8A6A4A;
}

/* Button Hover Effects */
a,
button {
    transition: all 0.3s ease;
}

/* Selection Color */
::selection {
    background: #D6B98C;
    color: #2B2B2B;
}

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

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
    
    .fade-in,
    .reveal {
        opacity: 1;
        transform: none;
    }
}

/* Print Styles */
@media print {
    header,
    footer,
    .fixed,
    #lightbox,
    .no-print {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
}

/* Mobile Optimizations */
@media (max-width: 1023px) {
    /* Add padding for sticky bottom bar */
    body {
        padding-bottom: 80px;
    }
    
    /* Ensure touch targets are large enough */
    a,
    button {
        min-height: 44px;
        min-width: 44px;
    }
}

/* High Resolution Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    img {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* Dark Mode Support (if needed in future) */
@media (prefers-color-scheme: dark) {
    /* Currently not implemented - site uses light theme */
}
