.work-before-after-grid .item {
    cursor: pointer;
    position: relative;
}

.work-before-after-grid .item-title {
    color: #816a55;
    margin: 0;
    font-size: 18px;
    font-weight: 400;
    line-height: 140%;
    text-shadow: rgba(255, 255, 255, 0.44) 0 1px 0;
    position: absolute;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    transition: 0.3s ease-in-out;
    z-index: 2;
}

.work-before-after-grid .item-image,
.work-before-after-grid .item-image--small {
    width: 350px;
    height: 485px;
    border-radius: 28px;
    overflow: hidden;
    position: relative;
    transition: 0.3s ease-in-out;
}

.work-before-after-grid .item-image>img,
.work-before-after-grid .item-image--small>img {
    width: 100%;
    object-fit: cover;
    position: absolute;
    bottom: 0;
    left: 0;
}

.work-before-after-grid .item-image::before {
    content: '';
    width: 100%;
    height: 100%;
    background-image: url(/wp-content/uploads/2025/06/patern.png);
    background-size: contain;
    background-repeat: repeat;
    opacity: 0.4;
    mix-blend-mode: soft-light;
    position: absolute;
    top: 0;
    left: 0;
}

.work-before-after-grid .item-image>img {
    z-index: 3;
}

.work-before-after-grid .item-image--small {
    width: 125px;
    height: 175px;
    border-radius: 16px;
    opacity: 0;
    position: absolute;
    right: 25px;
    bottom: -10px;
    transform: translateY(50%);
    transform-origin: right;
}

.work-before-after-grid .item-image--small::before {
    content: 'Before';
    position: absolute;
    bottom: 55px;
    left: 0;
    transform: translateX(-100%);
}

.work-before-after-grid .item-image--small>img {
    height: 100%;
}

@media screen and (max-width: 768px) {
    .work-before-after-grid .item {
        display: flex;
        align-items: end;
        justify-content: space-between;
        column-gap: 20px;
    }

    .work-before-after-grid .item-image {
        width: 320px;
        height: 435px;
        border-radius: 20px;
    }

    .work-before-after-grid .item-title {
        text-shadow: none;
    }

    .work-before-after-grid .item-image--small {
        border-radius: 20px;
        opacity: 1;
        position: relative;
        right: 0;
        bottom: 0;
        transform: none;
    }

    .work-before-after-grid .item-image--small::before {
        color: #fff;
        line-height: 1;
        right: 15px;
        bottom: 15px;
        left: initial;
        transform: none;
        text-shadow: rgba(0, 0, 0, 0.44) 0 1px 0;
        z-index: 2;
    }

    .work-before-after-grid .swiper-slide:nth-child(2n) .item {
        flex-direction: row-reverse;
        align-items: start;
    }
}

@media screen and (max-width: 640px) {
    .work-before-after-grid .item-image {
        width: 300px;
        height: 385px;
    }

    .work-before-after-grid .item-title {
        top: 20px;
    }
}

@media screen and (max-width: 480px) {
    .work-before-after-grid .item-image {
        width: 205px;
        height: 285px;
        border-radius: 16px;
    }

    .work-before-after-grid .item-image--small {
        border-radius: 16px;
    }

    .work-before-after-grid .swiper-wrapper {
        row-gap: 20px;
    }
}

/*----- Active item -----*/

.work-before-after-grid .item.active .item-title {
    font-family: var(--font-family-display);
    font-weight: 500;
    font-size: 62px;
    line-height: 100%;
    text-shadow: none;
    top: 55px;
    opacity: 0.4;
    z-index: 2;
}

.work-before-after-grid .item.active .item-image {
    transform: translateY(-25px);
}

.work-before-after-grid .item.active .item-image--small {
    opacity: 1;
    transform: none;
}

/*----- Swiper -----*/

.work-before-after-grid .swiper {
    overflow: visible;
}

.work-before-after-grid .swiper-slide {
    width: 350px;
    margin-right: 45px;
}

@media screen and (max-width: 768px) {
    .work-before-after-grid .swiper-wrapper {
        flex-wrap: wrap;
        row-gap: 30px;
    }

    .work-before-after-grid .swiper-slide {
        width: 100%;
        margin-right: 0;
    }
}