/* Карусель стандартной WordPress-галереи на single portfolio. */
.ehs-portfolio-gallery {
    position: relative;
    margin: 32px 0 10px;
    padding: 0 44px;
}

.ehs-portfolio-gallery__viewport {
    overflow: hidden;
}

.ehs-portfolio-gallery__track {
    display: flex;
    gap: 18px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 3px;
}

.ehs-portfolio-gallery__track::-webkit-scrollbar {
    display: none;
}

.ehs-portfolio-gallery__item {
    flex: 0 0 calc((100% - 36px) / 3);
    min-width: 0;
    margin: 0;
    scroll-snap-align: start;
}

.ehs-portfolio-gallery__link {
    position: relative;
    display: block;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 4px;
    background: #f3f5f7;
}

.ehs-portfolio-gallery__link::after {
    content: "";
    position: absolute;
    inset: 0;
    border: 1px solid rgba(31, 53, 95, 0.08);
    border-radius: inherit;
    pointer-events: none;
}

.ehs-portfolio-gallery__image {
    display: block;
    width: 100%;
    height: 100% !important;
    margin: 0 !important;
    object-fit: cover;
    transition: transform 0.25s ease;
}

.ehs-portfolio-gallery__link:hover .ehs-portfolio-gallery__image,
.ehs-portfolio-gallery__link:focus-visible .ehs-portfolio-gallery__image {
    transform: scale(1.035);
}

.ehs-portfolio-gallery__caption {
    margin-top: 8px;
    font-size: 13px;
    line-height: 1.4;
    color: #6f7887;
}

.ehs-portfolio-gallery__nav {
    position: absolute;
    top: 50%;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid #4fbefd;
    border-radius: 50%;
    background: #fff;
    color: #1f355f;
    font: inherit;
    line-height: 1;
    cursor: pointer;
    transform: translateY(-50%);
    transition: opacity 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.ehs-portfolio-gallery__nav span {
    display: block;
    margin-top: -3px;
    font-size: 28px;
    font-weight: 300;
    line-height: 1;
}

.ehs-portfolio-gallery__nav--prev {
    left: 0;
}

.ehs-portfolio-gallery__nav--next {
    right: 0;
}

.ehs-portfolio-gallery__nav:hover,
.ehs-portfolio-gallery__nav:focus-visible {
    background: #4fbefd;
    color: #fff;
}

.ehs-portfolio-gallery__nav:disabled {
    opacity: 0.25;
    cursor: default;
    pointer-events: none;
}

.ehs-portfolio-gallery.is-static {
    padding-inline: 0;
}

.ehs-portfolio-gallery.is-static .ehs-portfolio-gallery__nav {
    display: none;
}

/* Планшет: две карточки. */
@media (max-width: 1023px) {
    .ehs-portfolio-gallery__item {
        flex-basis: calc((100% - 18px) / 2);
    }
}

/* Телефон: одна крупная карточка, свайп остаётся доступен. */
@media (max-width: 639px) {
    .ehs-portfolio-gallery {
        margin-top: 26px;
        padding: 0 36px;
    }

    .ehs-portfolio-gallery__item {
        flex-basis: 100%;
    }

    .ehs-portfolio-gallery__nav {
        width: 30px;
        height: 30px;
    }

    .ehs-portfolio-gallery__nav span {
        font-size: 24px;
    }
}
