html.slideshow-active,
body.slideshow-active {
    width: 100%;
    height: 100%;
    min-height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
}

body.slideshow-active {
    display: block;
    touch-action: pan-y;
}

#content.slideshow-content {
    position: fixed;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100dvh;
    padding: 0 !important;
    overflow: hidden;
}

#image-container.slideshow-stage {
    position: relative;
    display: block;
    width: 100%;
    max-width: none;
    height: 100%;
    padding: 0 !important;
    overflow: hidden;
    isolation: isolate;
    touch-action: pan-y;
    --slide-duration: 600ms;
    --slide-padding-v: 0px;
    --slide-padding-h: 0px;
}

.slideshow-layer {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    padding: var(--slide-padding-v) var(--slide-padding-h);
    border: 0 !important;
    border-radius: 0 !important;
    opacity: 0;
    object-fit: contain;
    object-position: center;
    user-select: none;
    -webkit-user-drag: none;
    will-change: opacity, filter, transform;
}

.slideshow-layer.is-current {
    z-index: 2;
    opacity: 1;
}

.slideshow-stage[data-effect="blur"] .slideshow-layer.is-entering {
    animation: slideshow-blur-in var(--slide-duration) cubic-bezier(.22, .72, .26, 1) both;
}

.slideshow-stage[data-effect="blur"] .slideshow-layer.is-leaving {
    z-index: 1;
    animation: slideshow-blur-out var(--slide-duration) ease-out both;
}

.slideshow-stage[data-effect="fade"] .slideshow-layer.is-entering {
    animation: slideshow-fade-in var(--slide-duration) ease both;
}

.slideshow-stage[data-effect="fade"] .slideshow-layer.is-leaving {
    z-index: 1;
    animation: slideshow-fade-out var(--slide-duration) ease both;
}

.slideshow-stage[data-effect="zoom"] .slideshow-layer.is-entering {
    animation: slideshow-zoom-in var(--slide-duration) cubic-bezier(.2, .75, .25, 1) both;
}

.slideshow-stage[data-effect="zoom"] .slideshow-layer.is-leaving {
    z-index: 1;
    animation: slideshow-zoom-out var(--slide-duration) ease both;
}

.slideshow-stage[data-effect="slide"][data-direction="forward"] .slideshow-layer.is-entering {
    animation: slideshow-next-in var(--slide-duration) cubic-bezier(.22, .72, .26, 1) both;
}

.slideshow-stage[data-effect="slide"][data-direction="forward"] .slideshow-layer.is-leaving {
    z-index: 1;
    animation: slideshow-next-out var(--slide-duration) cubic-bezier(.22, .72, .26, 1) both;
}

.slideshow-stage[data-effect="slide"][data-direction="backward"] .slideshow-layer.is-entering {
    animation: slideshow-prev-in var(--slide-duration) cubic-bezier(.22, .72, .26, 1) both;
}

.slideshow-stage[data-effect="slide"][data-direction="backward"] .slideshow-layer.is-leaving {
    z-index: 1;
    animation: slideshow-prev-out var(--slide-duration) cubic-bezier(.22, .72, .26, 1) both;
}

@keyframes slideshow-blur-in {
    from { opacity: 0; filter: blur(10px); transform: scale(1.012); }
    to { opacity: 1; filter: blur(0); transform: scale(1); }
}

@keyframes slideshow-blur-out {
    from { opacity: 1; filter: blur(0); transform: scale(1); }
    to { opacity: 0; filter: blur(3px); transform: scale(.994); }
}

@keyframes slideshow-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideshow-fade-out {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes slideshow-zoom-in {
    from { opacity: 0; transform: scale(.92); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes slideshow-zoom-out {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0; transform: scale(1.04); }
}

@keyframes slideshow-next-in {
    from { opacity: 0; transform: translate3d(10%, 0, 0); }
    to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes slideshow-next-out {
    from { opacity: 1; transform: translate3d(0, 0, 0); }
    to { opacity: 0; transform: translate3d(-8%, 0, 0); }
}

@keyframes slideshow-prev-in {
    from { opacity: 0; transform: translate3d(-10%, 0, 0); }
    to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes slideshow-prev-out {
    from { opacity: 1; transform: translate3d(0, 0, 0); }
    to { opacity: 0; transform: translate3d(8%, 0, 0); }
}

.slideshow-progress,
.slideshow-hint,
.slideshow-navigation {
    position: absolute;
    z-index: 5;
    color: #fff;
    background: rgba(17, 24, 39, .64);
    border: 1px solid rgba(255, 255, 255, .22);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .16);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.slideshow-progress {
    top: max(14px, env(safe-area-inset-top));
    right: max(14px, env(safe-area-inset-right));
    min-width: 56px;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    letter-spacing: .04em;
}

.slideshow-navigation {
    inset: 0;
    border: 0;
    background: none;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    pointer-events: none;
}

.slideshow-navigation button {
    position: absolute;
    top: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 72px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: rgba(255, 255, 255, .78);
    font-size: 22px;
    opacity: .5;
    filter: drop-shadow(0 1px 4px rgba(0, 0, 0, .62));
    transform: translateY(-50%);
    transition: opacity 160ms ease, transform 160ms ease;
    pointer-events: auto;
}

.slideshow-navigation button:first-child {
    left: max(8px, env(safe-area-inset-left));
}

.slideshow-navigation button:last-child {
    right: max(8px, env(safe-area-inset-right));
}

.slideshow-navigation button:focus-visible {
    outline: none;
    opacity: .82;
    filter: drop-shadow(0 1px 6px rgba(0, 0, 0, .72));
}

.slideshow-navigation button:disabled {
    opacity: 0;
    pointer-events: none;
}

@media (hover: hover) {
    .slideshow-navigation button:hover:not(:disabled) {
        opacity: .9;
        transform: translateY(-50%) scale(1.06);
    }
}

.slideshow-hint {
    left: 50%;
    bottom: max(18px, env(safe-area-inset-bottom));
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 12px;
    transform: translateX(-50%);
    transition: opacity 400ms ease, transform 400ms ease;
    white-space: nowrap;
}

.slideshow-hint.is-hidden {
    opacity: 0;
    transform: translate(-50%, 8px);
    pointer-events: none;
}

.slideshow-status {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    color: #4b5563;
    text-align: center;
    pointer-events: none;
}

.slideshow-status.is-visible {
    display: flex;
}

.slideshow-status-card {
    max-width: 320px;
    padding: 18px 20px;
    border: 1px solid rgba(0, 0, 0, .08);
    border-radius: 14px;
    background: rgba(255, 255, 255, .9);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .1);
}

.slideshow-status-card i {
    display: block;
    margin-bottom: 8px;
    color: #02a568;
    font-size: 24px;
}

.slideshow-status-card strong,
.slideshow-status-card span {
    display: block;
}

.slideshow-status-card span {
    margin-top: 4px;
    color: #6b7280;
    font-size: 12px;
}

body.slideshow-active #footer {
    display: none !important;
}

@media (max-width: 600px) {
    .slideshow-navigation button {
        width: 40px;
        height: 64px;
        font-size: 19px;
    }

    .slideshow-navigation button:first-child {
        left: max(2px, env(safe-area-inset-left));
    }

    .slideshow-navigation button:last-child {
        right: max(2px, env(safe-area-inset-right));
    }
}

@media (prefers-reduced-motion: reduce) {
    .slideshow-layer,
    .slideshow-hint {
        animation: none !important;
        transition-duration: 0ms !important;
    }
}
