.gallery-container {
    width: 100%;
    padding: 0;
    margin: 0;
}
.gallery-grid {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    height: 100%;
}

.gallery-item {
    position: relative;
    flex: 1 0 33.33%; /* 3 per row */
    aspect-ratio: 1 / 1; /* makes them perfect squares */
    overflow: hidden;
}
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1s ease;
}


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

/* Overlay heading */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 18px;
    opacity: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
    text-align: center;
    padding: 10px;
}
.gallery-item .overlay {
    pointer-events: none; /* ✅ overlay won't block clicks */
}


.gallery-item:hover .overlay {
    opacity: 1;
}

.overlay h2 {
    font-size: 1.5rem;
    margin: 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .gallery-item {
        flex: 1 0 50%;
        height: 50%;
    }
    .lightbox button {
        display: none;
    }
}

@media (max-width: 480px) {
    .gallery-item {
        flex: 1 0 100%;
        height: 33vh;
    }
}


.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    justify-content: center;
    align-items: center;
    background: rgba(0,0,0,0.9);
    z-index: 9999;
}

.lightbox img {
    max-width: 90%;
    max-height: 90%;
}

.lightbox button {
    position: absolute;
    background: none;
    border: none;
    color: white;
    font-size: 3rem;
    cursor: pointer;
    user-select: none;
}

.lightbox-close {
    top: 20px;
    right: 20px;
}

.lightbox-prev {
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-next {
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}
.lightbox button {
    font-size: 4rem; /* bigger for touch */
    padding: 0.5rem;
}

/* Default for desktop */
.lightbox-prev,
.lightbox-next, .lightbox-close {
    display: block;
}

/* Hide on tablets and phones */
@media (max-width: 1024px) {
    .lightbox-prev,
    .lightbox-next, .lightbox-close{
        display: none;
    }
}

.progressive-img {
    transition: filter 0.5s ease;
    filter: blur(5px);
}

.progressive-img.loaded {
    filter: blur(0);
}
