/**
 * Gallery Styles - Masonry Grid with Featured Image
 * Responsive layout for mobile/desktop/ultrawide
 */

/* --- Gallery Section Container --- */
.gallery-container {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* --- Featured Image --- */
.gallery-featured {
    width: 100%;
    margin-bottom: 1.5rem;
}

.gallery-featured img {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    object-position: center;
    display: block;
    border: 8px solid var(--pop-black);
    box-shadow: 0 6px 20px var(--black-15);
}

/* --- Masonry Grid Wrapper (handles clipping) --- */
.gallery-masonry-wrapper {
    position: relative;
    height: 1200px;
    overflow: hidden;
}

/* Fade-out overlay at bottom */
.gallery-masonry-wrapper::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        var(--gallery-bg-color) 100%
    );
    pointer-events: none;
    z-index: 10;
}

/* --- Masonry Grid --- */
.gallery-masonry {
    column-count: 3;
    column-gap: 1rem;
}

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

.gallery-masonry-item img {
    width: 100%;
    height: auto;
    display: block;
    border: 6px solid var(--pop-black);
    box-shadow: 0 4px 12px var(--black-15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-masonry-item img:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 24px var(--black-40);
}

/* --- Loading placeholder --- */
.gallery-masonry-item img {
    background-color: var(--light-gray);
    min-height: 150px;
}

/* --- Responsive Breakpoints --- */

/* Ultrawide monitors (1600px+) */
@media (min-width: 1600px) {
    .gallery-masonry {
        column-count: 4;
    }
    
    .gallery-featured img {
        max-height: 600px;
    }
}

/* Desktop (1024px - 1599px) */
@media (min-width: 1024px) and (max-width: 1599px) {
    .gallery-masonry {
        column-count: 3;
    }
}

/* Tablet (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .gallery-masonry-wrapper {
        height: 1000px;
    }
    
    .gallery-masonry {
        column-count: 2;
    }
    
    .gallery-featured img {
        max-height: 400px;
    }
    
    .gallery-masonry-item img {
        border-width: 5px;
    }
}

/* Mobile (< 768px) */
@media (max-width: 767px) {
    .gallery-container {
        padding: 0 0.75rem;
    }
    
    .gallery-masonry-wrapper {
        height: 800px;
    }
    
    .gallery-masonry-wrapper::after {
        height: 150px;
    }
    
    .gallery-masonry {
        column-count: 2;
        column-gap: 0.75rem;
    }
    
    .gallery-masonry-item {
        margin-bottom: 0.75rem;
    }
    
    .gallery-featured img {
        max-height: 300px;
        border-width: 5px;
    }
    
    .gallery-masonry-item img {
        border-width: 4px;
        min-height: 100px;
    }
}

/* Small mobile (< 400px) */
@media (max-width: 399px) {
    .gallery-masonry-wrapper {
        height: 900px;
    }
    
    .gallery-masonry {
        column-count: 1;
    }
    
    .gallery-featured img {
        max-height: 250px;
    }
}
