.sbu-xibo-slideshow {
    position: relative;
    width: 100%;
    max-width: 100%;
    height: 100%;
    box-sizing: border-box;
    --xibo-image-shadow-x: 0px;
    --xibo-image-shadow-y: 7px;
    --xibo-image-shadow-blur: 16px;
    --xibo-image-shadow-color: rgba(15, 23, 42, 0.15);
    --xibo-image-shadow-clip-margin: 24px;

    /* Keep alignment anchored to the slide bounds, not shadow spread. */
    padding: 0;

    /*
     * Keep slide transitions contained while allowing soft image shadows
     * to render outside the slideshow bounds.
     */
    overflow: hidden;
    overflow: clip;
    overflow-clip-margin: var(--xibo-image-shadow-clip-margin, 24px);

    background: transparent;

    /* Allow page scroll vertically while keeping horizontal swipe gestures responsive. */
    touch-action: pan-y;
}

.sbu-xibo-track {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 120px;
}

.sbu-xibo-slide {
    position: absolute;
    inset: 0;
    margin: 0;

    /*
     * The figure itself no longer clips the image shadow.
     * Rounded clipping belongs to the image.
     */
    overflow: visible;

    opacity: 0;
    transform: translateX(0);

    transition:
        opacity var(--xibo-transition-ms, 500ms) ease-in-out,
        transform var(--xibo-transition-ms, 500ms) ease-in-out;

    pointer-events: none;

    display: flex;
    align-items: center;
    justify-content: center;
}

.sbu-xibo-slide.is-active {
    position: relative;
    inset: auto;
    width: 100%;
    height: 100%;
    z-index: 2;
    opacity: 1;
    pointer-events: auto;
}

.sbu-xibo-slide.was-active {
    z-index: 1;
    opacity: 1;
}

.sbu-xibo-slide.is-slide-in-from-right {
    transform: translateX(100%);
    animation: sbu-xibo-slide-in-from-right
        var(--xibo-transition-ms, 500ms)
        ease-in-out forwards;
}

.sbu-xibo-slide.is-slide-in-from-left {
    transform: translateX(-100%);
    animation: sbu-xibo-slide-in-from-left
        var(--xibo-transition-ms, 500ms)
        ease-in-out forwards;
}

.sbu-xibo-slide.was-active.is-slide-out-to-left {
    animation: sbu-xibo-slide-out-to-left
        var(--xibo-transition-ms, 500ms)
        ease-in-out forwards;
}

.sbu-xibo-slide.was-active.is-slide-out-to-right {
    animation: sbu-xibo-slide-out-to-right
        var(--xibo-transition-ms, 500ms)
        ease-in-out forwards;
}

@keyframes sbu-xibo-slide-in-from-right {
    0% {
        transform: translateX(100%);
        opacity: 1;
    }

    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes sbu-xibo-slide-in-from-left {
    0% {
        transform: translateX(-100%);
        opacity: 1;
    }

    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes sbu-xibo-slide-out-to-left {
    0% {
        transform: translateX(0);
        opacity: 1;
    }

    100% {
        transform: translateX(-100%);
        opacity: 1;
    }
}

@keyframes sbu-xibo-slide-out-to-right {
    0% {
        transform: translateX(0);
        opacity: 1;
    }

    100% {
        transform: translateX(100%);
        opacity: 1;
    }
}

.sbu-xibo-slide img {
    display: block;

    width: auto;
    height: auto;

    /*
     * Constrain both dimensions to the available slide area.
     * Aspect ratio remains intrinsic.
     */
    max-width: 100%;
    max-height: 100%;

    margin: 0 auto;

    border-radius: 20px;

    object-fit: contain;
    object-position: center center;

    /* Decorative offset shadow; does not change alignment box dimensions. */
    filter: drop-shadow(
        var(--xibo-image-shadow-x, 0px)
        var(--xibo-image-shadow-y, 5px)
        var(--xibo-image-shadow-blur, 10px)
        var(--xibo-image-shadow-color, rgba(15, 23, 42, 0.15))
    );
}

.sbu-xibo-slide[data-target-url]:not([data-target-url=""]),
.sbu-xibo-slide[data-target-url]:not([data-target-url=""]) img {
    cursor: pointer;
}

.sbu-xibo-empty {
    min-height: 160px;
    width: 100%;
}

.sbu-xibo-nav-arrows {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    z-index: 3;

    display: flex;
    justify-content: space-between;

    pointer-events: none;
}

.sbu-xibo-arrow {
    pointer-events: auto;

    border: 0;
    width: 40px;
    height: 40px;
    margin: 0 8px;

    border-radius: 999px;

    background: rgba(0, 0, 0, 0.45);
    color: #fff;

    font-size: 22px;
    line-height: 1;

    cursor: pointer;
}

.sbu-xibo-arrow:hover,
.sbu-xibo-arrow:focus-visible {
    background: rgba(0, 0, 0, 0.65);
    outline: none;
}

.sbu-xibo-dots {
    position: absolute;
    left: 50%;
    bottom: 10px;

    transform: translateX(-50%);

    z-index: 3;

    display: flex;
    gap: 8px;
}

.sbu-xibo-controls-hover .sbu-xibo-nav-arrows,
.sbu-xibo-controls-hover .sbu-xibo-dots {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition: opacity 180ms ease-in-out;
}

.sbu-xibo-controls-hover .sbu-xibo-arrow,
.sbu-xibo-controls-hover .sbu-xibo-dot {
    pointer-events: none;
}

.sbu-xibo-controls-hover:hover .sbu-xibo-nav-arrows,
.sbu-xibo-controls-hover:hover .sbu-xibo-dots,
.sbu-xibo-controls-hover.sbu-xibo-controls-visible .sbu-xibo-nav-arrows,
.sbu-xibo-controls-hover.sbu-xibo-controls-visible .sbu-xibo-dots {
    opacity: 1 !important;
    visibility: visible;
}

.sbu-xibo-controls-hover:hover .sbu-xibo-arrow,
.sbu-xibo-controls-hover:hover .sbu-xibo-dot,
.sbu-xibo-controls-hover.sbu-xibo-controls-visible .sbu-xibo-arrow,
.sbu-xibo-controls-hover.sbu-xibo-controls-visible .sbu-xibo-dot {
    pointer-events: auto;
}

.sbu-xibo-dot {
    width: 10px;
    height: 10px;

    border-radius: 999px;
    border: 0;

    background: rgba(255, 255, 255, 0.45);

    cursor: pointer;
}

.sbu-xibo-dot.is-active,
.sbu-xibo-dot:hover,
.sbu-xibo-dot:focus-visible {
    background: rgba(255, 255, 255, 0.95);
    outline: none;
}

@media (max-width: 768px) {
    .sbu-xibo-arrow {
        width: 34px;
        height: 34px;
        font-size: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sbu-xibo-slide {
        transition-duration: 0ms !important;
    }

    .sbu-xibo-slide.is-slide-in-from-right,
    .sbu-xibo-slide.is-slide-in-from-left,
    .sbu-xibo-slide.was-active.is-slide-out-to-left,
    .sbu-xibo-slide.was-active.is-slide-out-to-right {
        animation: none !important;
        transform: translateX(0) !important;
    }

    .sbu-xibo-controls-hover .sbu-xibo-nav-arrows,
    .sbu-xibo-controls-hover .sbu-xibo-dots {
        transition-duration: 0ms !important;
    }
}