/* ============================================
   GALLERY PAGE STYLES
   Sawdust, Inc. - Masonry Gallery
   ============================================ */

.gallery-page {
    background: #1a1510;
}

/* Sound Control Button */
.sound-control {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--color-cream);
    background: rgba(45, 31, 20, 0.9);
    color: var(--color-cream);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.sound-control:hover {
    background: var(--color-brown);
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.sound-control i {
    transition: transform 0.2s ease;
}

.sound-control:active i {
    transform: scale(0.9);
}


.gallery-content {
    position: relative;
    min-height: 100vh;
}

/* Gallery Background */
.gallery-background {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    bottom: 0;
    z-index: -1;
    background: linear-gradient(
        180deg,
        #c4a97a 0%,
        #b89b6a 20%,
        #9a8055 50%,
        #1a1510 85%,
        #0d0a07 100%
    );
}

.gallery-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('../assets/images/bg.png');
    background-size: cover;
    opacity: 0.3;
}

/* Masonry Gallery */
.gallery-masonry {
    padding: 4px;
    min-height: 100vh;
}

/* CSS Grid Masonry */
.masonry-auto {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 4px;
    gap: 4px;
}

/* Gallery Items */
.gallery-item {
    position: relative;
    overflow: hidden;
    background: #2d1f14;
    cursor: pointer;
    grid-row-end: span 50;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.03);
}

/* Hover Overlay */
.gallery-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(45, 31, 20, 0);
    transition: background 0.3s ease;
    pointer-events: none;
}

.gallery-item:hover::after {
    background: rgba(45, 31, 20, 0.2);
}

/* Lightbox Popup */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.lightbox.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lightbox-content {
    max-width: 90%;
    max-height: 90vh;
    text-align: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

#lightbox-caption {
    color: var(--color-cream);
    font-family: var(--font-sans);
    font-size: 1rem;
    margin-top: 15px;
    letter-spacing: 1px;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 3rem;
    color: var(--color-cream);
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.3s ease;
    z-index: 10001;
}

.lightbox-close:hover {
    color: var(--color-gold);
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2.5rem;
    color: var(--color-cream);
    background: rgba(45, 31, 20, 0.5);
    border: none;
    cursor: pointer;
    padding: 15px 20px;
    transition: all 0.3s ease;
    z-index: 10001;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: var(--color-brown);
    color: var(--color-cream);
}

/* Dark Footer Area */
.gallery-footer {
    height: 100px;
    background: linear-gradient(180deg, transparent 0%, #1a1510 100%);
}

/* Responsive Styles */
@media (max-width: 1200px) {
    .masonry-auto {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 991.98px) {
    .gallery-background {
        left: 0;
    }
    
    .masonry-auto {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .lightbox-prev,
    .lightbox-next {
        padding: 10px 15px;
        font-size: 2rem;
    }
}

@media (max-width: 767.98px) {
    .gallery-masonry {
        padding: 2px;
    }
    
    .masonry-auto {
        grid-template-columns: repeat(2, 1fr);
        gap: 2px;
    }
    
    .lightbox-prev {
        left: 10px;
    }
    
    .lightbox-next {
        right: 10px;
    }
}

@media (max-width: 480px) {
    .masonry-auto {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Lightbox placeholder - if needed */
.gallery-item {
    cursor: pointer;
}

/* Loading state */
.gallery-item.loading {
    background: linear-gradient(
        90deg,
        #2d1f14 0%,
        #4a3728 50%,
        #2d1f14 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}
