.image-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.image-gallery a {
    display: block;
    overflow: hidden;
}

.image-gallery img {
    display: block;
    width: 100%;
    height: 300px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

/* Gallery */
.image-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.image-gallery img {
    width: 100%;
    display: block;
    cursor: pointer;
    transition: opacity 0.2s;
}

.image-gallery img:hover {
    opacity: 0.8;
}

/* Image loading spinner */
.image-gallery a {
    position: relative;
}

.image-gallery img {
    transition: opacity 0.4s ease, transform 0.3s ease;
}

.image-gallery a.is-loading {
    background: rgba(0, 0, 0, 0.03);
}

.image-gallery a.is-loading img {
    opacity: 0;
}

.gallery-spinner {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 34px;
    height: 34px;
    margin: -17px 0 0 -17px;
    border: 2px solid rgba(255, 179, 198, 0.35);
    border-top-color: #FF8FAB;
    border-radius: 50%;
    animation: gallery-spin 0.8s linear infinite;
    pointer-events: none;
}

.image-gallery a.is-loading .gallery-spinner {
    display: block;
}

@keyframes gallery-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Lightbox background */
.lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    align-items: center;
    justify-content: center;
}

.lightbox.active {
    display: flex;
}

/* Large image */
#lightbox-image {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
}

/* Buttons */
.lightbox button {
    position: absolute;
    border: none;
    background: none;
    color: white;
    font-size: 50px;
    cursor: pointer;
    padding: 10px 20px;
    line-height: 1;
}

.lightbox button:hover {
    color: #ccc;
}

.lightbox-close {
    top: 20px;
    right: 25px;
    font-size: 45px !important;
}

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

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

/* Mobile */
@media (max-width: 600px) {
    .image-gallery {
        grid-template-columns: repeat(2, 1fr);
    }

    .lightbox button {
        font-size: 35px;
    }

    #lightbox-image {
        max-width: 95%;
        max-height: 85vh;
    }
}
