.lorentz-image-carousel {
    display: block;
    min-width: 0;
}

.lorentz-image-carousel [hidden] {
    display: none;
}

.lorentz-carousel-stage {
    position: relative;
    width: 100%;
    aspect-ratio: var(--lorentz-carousel-ratio);
    overflow: hidden;
    touch-action: pan-y;
}

.lorentz-carousel-framed {
    --lorentz-carousel-frame-colour: #242424;
}

.lorentz-carousel-frame-phone6-2,
.lorentz-carousel-frame-phone6-4 {
    --lorentz-carousel-frame-colour: #f5f5f5;
}

.lorentz-carousel-framed:not(:fullscreen) .lorentz-carousel-stage {
    box-sizing: border-box;
    border: solid var(--lorentz-carousel-frame-colour);
    border-width: 1.5rem 0.45rem;
    border-radius: 1.25rem;
}

.lorentz-carousel-frame-phone6-1:not(:fullscreen) .lorentz-carousel-stage,
.lorentz-carousel-frame-phone6-2:not(:fullscreen) .lorentz-carousel-stage {
    box-shadow: inset 0 0 0 1px #999, 0 0 0 1px #777, 0 3px 8px rgb(0 0 0 / 30%);
}

.lorentz-carousel-slide {
    position: absolute;
    inset: 0;
}

.lorentz-carousel-incoming {
    z-index: 1;
}

.lorentz-carousel-slide > img {
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    object-fit: scale-down;
}

.lorentz-image-carousel.fit-contain .lorentz-carousel-slide > img,
.lorentz-image-carousel:fullscreen .lorentz-carousel-slide > img {
    object-fit: contain;
}

.lorentz-image-carousel.fit-cover:not(:fullscreen) .lorentz-carousel-slide > img,
.lorentz-carousel-hero:not(:fullscreen) .lorentz-carousel-slide > img {
    object-fit: cover;
}

.lorentz-carousel-hero .lorentz-carousel-stage {
    height: 375px;
    aspect-ratio: auto;
}

.lorentz-carousel-caption {
    position: absolute;
    inset: auto 0 0;
    padding: 1rem;
    background: rgb(0 0 0 / 65%);
    color: #fff;
}

.lorentz-carousel-title {
    font-weight: 700;
}

.lorentz-image-carousel button {
    display: grid;
    place-items: center;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    line-height: 1;
    box-shadow: none;
}

.lorentz-image-carousel button:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.lorentz-image-carousel .lorentz-carousel-arrow,
.lorentz-image-carousel .lorentz-carousel-fullscreen {
    position: absolute;
    z-index: 2;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    background: rgb(0 0 0 / 64%);
    color: #fff;
    font-size: 1.75rem;
}

.lorentz-carousel-arrow {
    top: 50%;
    transform: translateY(-50%);
}

.lorentz-carousel-arrow.previous {
    inset-inline-start: 0.5rem;
}

.lorentz-carousel-arrow.next,
.lorentz-carousel-fullscreen {
    inset-inline-end: 0.5rem;
}

.lorentz-image-carousel .lorentz-carousel-arrow::before {
    width: 0.5rem;
    height: 0.75rem;
    background: currentColor;
    clip-path: polygon(0 10%, 25% 0, 100% 50%, 25% 100%, 0 90%, 60% 50%);
    content: '';
}

.lorentz-carousel-arrow.previous::before,
.lorentz-image-carousel:dir(rtl) .lorentz-carousel-arrow.next::before {
    transform: scaleX(-1);
}

.lorentz-image-carousel:dir(rtl) .lorentz-carousel-arrow.previous::before {
    transform: none;
}

.lorentz-carousel-fullscreen {
    top: 0.5rem;
}

@media (hover: hover) {
    .lorentz-image-carousel.arrows-hover:not(:hover):not(:focus-within) .lorentz-carousel-arrow {
        opacity: 0;
    }
}

.lorentz-carousel-nav {
    display: flex;
    justify-content: safe center;
    gap: 0.25rem;
    overflow-x: auto;
    padding: 0.3rem;
}

.lorentz-carousel-nav button {
    flex: 0 0 auto;
    min-width: 24px;
    min-height: 24px;
    border-radius: 50%;
}

.lorentz-carousel-nav:not([data-nav='thumbs']) button::before {
    width: 10px;
    height: 10px;
    box-sizing: border-box;
    border: 2px solid currentColor;
    border-radius: 50%;
    background: currentColor;
    content: '';
}

.lorentz-carousel-nav:not([data-nav='thumbs']) button[aria-current]::before {
    background: transparent;
}

.lorentz-carousel-nav[data-nav='thumbs'] button {
    border: 2px solid transparent;
    border-radius: 3px;
}

.lorentz-carousel-nav[data-nav='thumbs'] button[aria-current] {
    border-color: currentColor;
}

.lorentz-carousel-nav img {
    display: block;
    width: 64px;
    height: 44px;
    object-fit: cover;
}

.lorentz-carousel-nav[data-nav='hero'] {
    position: absolute;
    z-index: 2;
    bottom: 10px;
    left: 50%;
    max-width: calc(100% - 16px);
    gap: 0;
    padding: 0 2px;
    transform: translateX(-50%);
    border-radius: 24px;
    background: rgb(0 0 0 / 32%);
    color: #fff;
}

.lorentz-carousel-nav[data-nav='hero'] button {
    opacity: 0.8;
}

.lorentz-carousel-nav[data-nav='hero'] button:focus-visible {
    outline-offset: -3px;
}

@media (prefers-reduced-motion: no-preference) {
    .lorentz-carousel-nav[data-nav='hero'] button::before {
        transition: background-color 220ms ease;
    }
}

.lorentz-image-carousel:fullscreen {
    display: flex;
    flex-direction: column;
    background: #111;
    color: #fff;
}

.lorentz-image-carousel:fullscreen .lorentz-carousel-stage {
    flex: 1;
    min-height: 0;
    height: auto;
    aspect-ratio: auto;
}
