/* Gallery Section */
.gallery-section {
    padding: 50px;
    text-align: center;
    background-color: #f9f9f9;
}

.gallery-section h2 {
    font-size: 36px;
    color: #333;
    margin-bottom: 30px;
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    padding: 0 20px;
}

/* General styling for gallery */
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Hover effect */
.gallery-item img:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
    cursor: pointer;
}

/* Zoomed in state */
.gallery-item img.zoomed {
    transform: scale(1.6); /* Zoom in on click */
    box-shadow: none;   
    z-index: 10; /* Bring the image to the front */
    position: relative; /* Keep it above the backdrop */
    object-fit: contain;
    max-width: 100vw;
    max-height: 50vh;
}

/* Backdrop for zoomed-in image */
.backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* Semi-transparent black */
    z-index: 5; /* Behind the zoomed image */
    opacity: 0;
    transition: opacity 0.3s ease; /* Smooth fade-in */
}

/* Active backdrop */
.backdrop.active {
    opacity: 1;
}
/* Responsive Styles */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .gallery-section h2 {
        font-size: 28px;
    }
}
