.gallery {
    padding: var(--block-padding) 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 48px;
}

    .gallery__inner {
        width: var(--inner-width);
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(2, 1fr);
        gap: 24px;
    }

        .gallery__item {
            width: 100%;
            border-radius: 8px 50px 8px 8px;
            box-shadow: 0 4px 25px 0 rgba(188, 22, 22, 0.24);
            overflow: hidden;
        }

        .gallery__item:nth-child(1) {
            height: 464px;
            grid-area: 1 / 1 / 3 / 2;
        }

        .gallery__item:nth-child(2) {
            grid-area: 1 / 2 / 2 / 3;
        }

        .gallery__item:nth-child(3) {
            grid-area: 1 / 3 / 2 / 4;
        }

        .gallery__item:nth-child(4) {
            grid-area: 2 / 2 / 3 / 3;
        }

        .gallery__item:nth-child(5) {
            grid-area: 2 / 3 / 3 / 4;
        }

        .gallery__item:nth-child(6) {
            display: none;
        }

        .gallery__item:not(:first-child):not(:last-child) {
            height: 220px;
        }

            .gallery__item > img {
                width: 100%;
                height: 100%;
                object-fit: cover;
                transition: var(--transition);
            }

            .gallery__item:hover > img {
                transform: scale(1.1);
            }

@media screen and (max-width: 1023px) {
    .gallery__inner {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(4, 1fr);
        gap: 8px;
    }

        .gallery__item:nth-child(1) {
            height: 228px;
            grid-area: 1 / 1 / 3 / 2;
        }

        .gallery__item:nth-child(2) {
            grid-area: 1 / 2 / 2 / 3;
        }

        .gallery__item:nth-child(3) {
            grid-area: 2 / 2 / 3 / 3;
        }

        .gallery__item:nth-child(4) {
            grid-area: 3 / 1 / 4 / 2;
        }

        .gallery__item:nth-child(5) {
            grid-area: 4 / 1 / 5 / 2;
        }

        .gallery__item:nth-child(6) {
            height: 228px;
            display: block;
            grid-area: 3 / 2 / 5 / 3;
        }

        .gallery__item:not(:first-child):not(:last-child) {
            height: 110px;
        }
}