.yvc-carousel {
    --yvc-gap: 1rem;
    color: inherit;
    margin-block: 1.5rem;
    max-width: 100%;
}

.yvc-controls {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-bottom: 0.75rem;
}

.yvc-controls [hidden] {
    display: none;
}

.yvc-control {
    align-items: center;
    background: transparent;
    border: 1px solid currentColor;
    border-radius: 50%;
    color: var(--yvc-control-color, inherit);
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    height: 2.5rem;
    justify-content: center;
    line-height: 1;
    width: 2.5rem;
}

.yvc-control:disabled {
    color: var(--yvc-control-disabled-color, currentColor);
    cursor: default;
    opacity: var(--yvc-control-disabled-opacity, 0.4);
}

.yvc-control:focus-visible,
.yvc-preview:focus-visible,
.yvc-dialog-close:focus-visible {
    outline: 3px solid currentColor;
    outline-offset: 3px;
}

.yvc-track {
    display: flex;
    gap: var(--yvc-gap);
    list-style: none;
    margin: 0;
    overflow-x: auto;
    padding: 0.25rem 0 0.75rem;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    touch-action: pan-y pinch-zoom;
    user-select: none;
    cursor: grab;
    -webkit-overflow-scrolling: touch;
}

.yvc-track::-webkit-scrollbar {
    display: none;
}

.yvc-track.yvc-dragging {
    cursor: grabbing;
    scroll-behavior: auto;
    scroll-snap-type: none;
}

.yvc-track.yvc-dragging .yvc-preview {
    cursor: grabbing;
}

.yvc-slide {
    flex: 0 0 calc((100% - (var(--yvc-gap) * 2)) / 3);
    min-width: 0;
    scroll-snap-align: start;
}

.yvc-preview {
    aspect-ratio: 16 / 9;
    background: #222;
    border: 0;
    color: #fff;
    cursor: grab;
    display: block;
    overflow: hidden;
    padding: 0;
    position: relative;
    text-decoration: none;
    width: 100%;
}

.yvc-preview img {
    display: block;
    height: 100%;
    object-fit: cover;
    transition: transform 160ms ease;
    user-select: none;
    width: 100%;
    -webkit-user-drag: none;
}

.yvc-preview:hover img {
    transform: scale(1.03);
}

.yvc-play-icon {
    border: 0.7rem solid transparent;
    border-left-color: #fff;
    height: 0;
    left: 50%;
    position: absolute;
    top: 50%;
    transform: translate(-25%, -50%);
    width: 0;
    z-index: 1;
}

.yvc-preview::after {
    background: #ff0000;
    border-radius: 0.55rem;
    content: "";
    height: 2.4rem;
    left: 50%;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 3.6rem;
}

.yvc-preview-unavailable {
    align-items: center;
    background: #222;
    display: flex;
    inset: 0;
    justify-content: center;
    position: absolute;
}

.yvc-title {
    color: var(--yvc-caption-color, inherit);
    margin: 0.5rem 0 0;
    text-align: center;
}

.yvc-dialog {
    background: #000;
    border: 0;
    box-sizing: border-box;
    color: #fff;
    max-height: 90vh;
    max-width: 90vw;
    padding: 0.75rem;
    position: fixed;
    width: min(60rem, 90vw);
}

.yvc-dialog::backdrop {
    background: rgb(0 0 0 / 80%);
}

.yvc-dialog-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.5rem;
}

.yvc-dialog-content {
    aspect-ratio: 16 / 9;
    position: relative;
}

.yvc-video-slot,
.yvc-video-slot iframe {
    border: 0;
    height: 100%;
    width: 100%;
}

.yvc-dialog-close {
    background: #000;
    border: 1px solid #fff;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    font-size: 1.5rem;
    height: 2.5rem;
    line-height: 1;
    width: 2.5rem;
}

.yvc-carousel > dialog.yvc-dialog[open] {
    bottom: auto !important;
    left: 50% !important;
    margin: 0 !important;
    position: fixed !important;
    right: auto !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 100000;
}

@media (max-width: 900px) {
    .yvc-slide {
        flex-basis: calc((100% - var(--yvc-gap)) / 2);
    }
}

@media (max-width: 600px) {
    .yvc-slide {
        flex-basis: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .yvc-track {
        scroll-behavior: auto;
    }

    .yvc-preview img {
        transition: none;
    }
}
