.rs-gallery {
    padding-top: 20px;
    padding-bottom: 50px;
    text-align: center;
}

.rs-gallery__items {
    margin-top: 51px;
    margin-bottom: 51px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    position: relative;
}

.rs-gallery__items::after,
.rs-gallery__items:before {
    content: "";
    display: block;
    position: absolute;
    width: 100vw;
    background-color: #f9f7f2;
    z-index: -1;
}

.rs-gallery__items::after {
    height: 739px;
    left: 83%;
    top: 245px;
}

.rs-gallery__items::before {
    height: 877px;
    right: 78%;
    bottom: 122px;
}

.rs-gallery__photo {
    display: block;
    position: relative;
    padding-bottom: 83%;
    overflow: hidden;
}

.rs-gallery__photo img {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    -o-object-fit: cover;
    object-fit: cover;
    transition-duration: 1s;
}

.rs-gallery__photo:hover img {
    -webkit-transform: scale(1.2);
    transform: scale(1.2);
    opacity: 0.5;
}

@media (min-width: 1170px) {
    .rs-gallery__items {
        gap: 30px;
    }
}

@media (max-width: 767.98px) {
    .rs-gallery__items {
        grid-template-columns: 290px;
        grid-auto-flow: column;
        grid-auto-columns: 290px;
        overflow-x: auto;
        overflow-y: hidden;
        margin-right: -15px;
    }
}

@media (max-width: 320px) {
    .rs-gallery__items {
        gap: 10px;
    }
}

@media (min-width: 320px) and (max-width: 1170px) {
    .rs-gallery__items {
        gap: clamp( 10px , 2.4705882353px  +  2.3529411765vw , 30px );
    }
}