.gallery_animation_container {
    width: 100%;
}

.gallery_wrapper {
    --base-size: 100px;
    --img-size: 100px;
    display: grid;
    gap: 0.5rem;
    grid-template-columns: repeat(6, var(--img-size));
    grid-template-rows: repeat(4, var(--img-size));
}

.gallery_wrapper img {
    aspect-ratio: 1;
    object-fit: cover;
    grid-column: span 2;
    grid-row: span 2;
    border-radius: 0.5rem;
    transition: filter 500ms, clip-path 500ms;
}

.gallery_wrapper img:nth-of-type(4),
.gallery_wrapper img:nth-of-type(9) {
    grid-column: 2 / span 2;
}

.gallery_wrapper img:hover {
    z-index: 100;
}

.gallery_wrapper img:not(:hover) {
    animation: zIndexFix 500ms;
}

.gallery_wrapper:hover>img {
    filter: brightness(0.5) saturate(0.5);
}

.gallery_wrapper>img:hover {
    filter: brightness(1) saturate(1.5);
}

@keyframes zIndexFix {

    0%,
    100% {
        z-index: 10;
    }
}

/* Lightbox Styles */
.wml-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(5px);
}

.wml-lightbox-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.wml-lightbox-image {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.wml-lightbox-overlay.active .wml-lightbox-image {
    transform: scale(1);
}

.wml-lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    background: none;
    border: none;
    color: white;
    font-size: 40px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.wml-lightbox-close:hover {
    opacity: 1;
}