/* Карусель фото в тексте контента, разметка: ImageService::buildCarouselHtml()
 * content-carousel--strip - лента: фото одной высоты вплотную на всю ширину
 * content-carousel--1..4 - фото в ряд одинакового размера, заполняют слайд (object-fit: cover) */
.content-carousel {
    position: relative;
    margin: 20px 0;
}

.content-carousel__track {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    outline: none;
}

.content-carousel__track::-webkit-scrollbar {
    display: none;
}

.content-carousel__slide {
    flex: 0 0 100%;
    min-width: 0;
    scroll-snap-align: start;
}

.content-carousel--2 .content-carousel__slide {
    flex-basis: calc((100% - 16px) / 2);
}

.content-carousel--3 .content-carousel__slide {
    flex-basis: calc((100% - 32px) / 3);
}

.content-carousel--4 .content-carousel__slide {
    flex-basis: calc((100% - 48px) / 4);
}

.content-carousel__slide a {
    display: block;
    height: 100%;
    text-decoration: none !important;
}

.content-carousel__slide img {
    display: block;
    width: 100%;
    max-width: none;
    height: auto;
    margin: 0;
    object-fit: cover;
}

/* лента */
.content-carousel--strip .content-carousel__track {
    gap: 8px;
}

.content-carousel--strip .content-carousel__slide {
    flex: 0 0 auto;
    height: 360px;
}

.content-carousel--strip .content-carousel__slide img {
    width: auto;
    height: 100%;
}

.content-carousel__arrow {
    position: absolute;
    top: 50%;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-top: -20px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .9);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
    color: #01253D;
    cursor: pointer;
    transition: opacity .2s;
}

.content-carousel__arrow::before {
    content: "";
    width: 10px;
    height: 10px;
    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
}

.content-carousel__arrow--prev {
    left: 8px;
}

.content-carousel__arrow--prev::before {
    margin-left: 4px;
    transform: rotate(-135deg);
}

.content-carousel__arrow--next {
    right: 8px;
}

.content-carousel__arrow--next::before {
    margin-right: 4px;
    transform: rotate(45deg);
}

.content-carousel__arrow[disabled] {
    opacity: 0;
    pointer-events: none;
}

.content-carousel__dots {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
}

.content-carousel__dot {
    width: 8px;
    height: 8px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #c7d0d8;
    cursor: pointer;
}

.content-carousel__dot.is-active {
    background: #01253D;
}

.content-carousel.is-static .content-carousel__arrow,
.content-carousel.is-static .content-carousel__dots {
    display: none;
}

@media (max-width: 767px) {
    .content-carousel--3 .content-carousel__slide,
    .content-carousel--4 .content-carousel__slide {
        flex-basis: calc((100% - 16px) / 2);
    }

    .content-carousel--strip .content-carousel__slide {
        height: 280px;
    }
}

@media (max-width: 479px) {
    .content-carousel:not(.content-carousel--strip) .content-carousel__slide {
        flex-basis: 100%;
    }

    .content-carousel--strip .content-carousel__slide {
        height: 220px;
    }

    .content-carousel__arrow {
        width: 32px;
        height: 32px;
        margin-top: -16px;
    }
}
