/* GALLERY */
@media all {
    .gallery-grid {
        display: grid;
        width: 100%;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 0;
    }

    .gallery-item {
        position: relative;
        display: block;
        overflow: hidden;
        aspect-ratio: 1 / 1;
        background: #000;
    }

    .gallery-item img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 350ms ease, opacity 350ms ease;
    }

    .gallery-item:hover img,
    .gallery-item:focus-visible img {
        opacity: 0.9;
        transform: scale(1.05);
    }

    .gallery-lightbox {
        position: fixed;
        inset: 0;
        z-index: 4000;
        background: rgba(0, 0, 0, 0.9);
    }

    .gallery-lightbox[hidden] {
        display: none;
    }

    .gallery-lightbox-inner {
        position: absolute;
        top: 50%;
        left: 50%;
        width: min(90%, 1100px);
        max-height: 88vh;
        transform: translate(-50%, -50%);
    }

    .gallery-lightbox-inner img {
        display: block;
        max-width: 100%;
        max-height: 88vh;
        margin: 0 auto;
        box-shadow: 0 0 30px rgba(0, 0, 0, 0.35);
    }

    .gallery-close,
    .gallery-nav {
        position: absolute;
        z-index: 2;
        border: 0;
        color: #fff;
        background: rgba(0, 0, 0, 0.5);
        cursor: pointer;
    }

    .gallery-close {
        top: 20px;
        right: 25px;
        width: 54px;
        height: 54px;
        font-size: 42px;
        line-height: 1;
    }

    .gallery-nav {
        top: 50%;
        width: 54px;
        height: 84px;
        font-size: 48px;
        transform: translateY(-50%);
    }

    .gallery-prev {
        left: 15px;
    }

    .gallery-next {
        right: 15px;
    }

    .gallery-close:hover,
    .gallery-nav:hover {
        background: rgba(161, 40, 48, 0.92);
    }

    body.gallery-open {
        overflow: hidden;
    }
}

/* RESPONSIVE */
@media all and (max-width: 1160px) {
    .gallery-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media all and (max-width: 760px) {
    .gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .gallery-close {
        top: 10px;
        right: 10px;
        width: 44px;
        height: 44px;
        font-size: 34px;
    }

    .gallery-nav {
        width: 44px;
        height: 64px;
        font-size: 34px;
    }

    .gallery-prev {
        left: 8px;
    }

    .gallery-next {
        right: 8px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .gallery-item img {
        transition: none;
    }
}
