.hero-carousel {
    position: relative;
    width: 100%;
    height: 100vh;
    height: 100svh;
    min-height: 420px;
    overflow: hidden;
    background: #18231a;
}

.hero-carousel__viewport,
.hero-carousel__slides {
    position: absolute;
    inset: 0;
}

.hero-carousel__slides {
    margin: 0;
    padding: 0;
    list-style: none;
}

.hero-carousel__slide {
    position: absolute;
    top: 0;
    right: auto;
    bottom: 0;
    left: 50%;
    width: 64%;
    z-index: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateX(-50%);
    transition: opacity .6s ease, transform .8s ease;
    pointer-events: none;
    will-change: transform, opacity;
}

.hero-carousel__slide[data-position="previous"] {
    left: 18%;
    z-index: 1;
    opacity: .48;
    transform: translateX(-50%);
}

.hero-carousel__slide[data-position="active"] {
    left: 50%;
    width: 64%;
    z-index: 2;
    opacity: 1;
    transform: translateX(-50%) scale(1);
    pointer-events: auto;
}

.hero-carousel__slide[data-position="next"] {
    left: 82%;
    z-index: 1;
    opacity: .48;
    transform: translateX(-50%);
}

.hero-carousel__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.hero-carousel__slide::after {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: rgba(0, 0, 0, .4);
    content: "";
}

.hero-carousel__content {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 1;
    display: flex;
    width: min(760px, calc(100% - 48px));
    flex-direction: column;
    align-items: center;
    color: #fff;
    text-align: center;
    transform: translate(-50%, -50%);
}

.hero-carousel__slide:not([data-position="active"]) .hero-carousel__content {
    visibility: hidden;
}

.hero-carousel__content h2 {
    margin: 0 0 28px;
    color: #fff;
    font-size: 38px;
    font-weight: 600;
    line-height: 1.35;
}

.hero-carousel__content p {
    margin: 0 0 48px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.8;
}

.hero-carousel__content .slider-button {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.hero-carousel__arrow {
    position: absolute;
    top: 50%;
    z-index: 10;
    display: grid;
    width: 68px;
    height: 68px;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, .36);
    color: #fff;
    cursor: pointer;
    transform: translateY(-50%);
}

.hero-carousel__arrow span {
    font-size: 24px;
    line-height: 1;
}

.hero-carousel__arrow--previous {
    left: 30px;
}

.hero-carousel__arrow--next {
    right: 30px;
}

.hero-carousel__arrow:hover,
.hero-carousel__arrow:focus-visible {
    background: rgba(0, 0, 0, .64);
}

.hero-carousel__selectors {
    position: absolute;
    bottom: 28px;
    left: 50%;
    z-index: 3;
    display: flex;
    gap: 9px;
    transform: translateX(-50%);
}

.hero-carousel__selector {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    padding: 0;
    overflow: hidden;
    border: 2px solid transparent;
    border-radius: 50%;
    background: #fff center / cover no-repeat;
    cursor: pointer;
}

.hero-carousel__selector:nth-child(1) {
    background-image: url("../picture/carousel-classic1-thumb.webp");
}

.hero-carousel__selector:nth-child(2) {
    background-image: url("../picture/carousel-classic2-thumb.webp");
}

.hero-carousel__selector:nth-child(3) {
    background-image: url("../picture/carousel-classic3-thumb.webp");
}

.hero-carousel__selector:nth-child(4) {
    background-image: url("../picture/carousel-classic4-thumb.webp");
}

.hero-carousel__selector[aria-pressed="true"] {
    border-color: #fff;
}

.hero-carousel__arrow:focus-visible,
.hero-carousel__selector:focus-visible {
    outline: 3px solid #eb5c20;
    outline-offset: 3px;
}

@media (max-width: 767px) {
    .hero-carousel {
        min-height: 540px;
    }

    .hero-carousel__slide[data-position="previous"],
    .hero-carousel__slide[data-position="next"] {
        opacity: 0;
        visibility: hidden;
    }

    .hero-carousel__slide[data-position="active"] {
        left: 50%;
        width: 100%;
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%);
    }

    .hero-carousel__content {
        width: calc(100% - 36px);
    }

    .hero-carousel__content h2 {
        margin-bottom: 22px;
        font-size: 32px;
    }

    .hero-carousel__content p {
        margin-bottom: 36px;
    }

    .hero-carousel__arrow {
        display: none;
    }

    .hero-carousel__selectors {
        bottom: 20px;
        gap: 7px;
    }

    .hero-carousel__selector {
        width: 38px;
        height: 38px;
        flex-basis: 38px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-carousel__slide {
        transition: none;
    }
}
