.gallery-slideshow-container {
    position: relative;
    width: min(80%, 1200px);
    aspect-ratio: 16 / 9;
    margin: 0 auto;
    overflow: hidden;
    background: #111;
}

.gallery-slide {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 1s ease-in-out, visibility 0s linear 1s;
    will-change: opacity;
}

.gallery-slide.active {
    z-index: 1;
    opacity: 1;
    visibility: visible;
    transition: opacity 1s ease-in-out, visibility 0s;
}

.gallery-slide picture,
.gallery-slide img {
    display: block;
    width: 100%;
    height: 100%;
}

.gallery-slide img {
    object-fit: cover;
}

.gallery-caption {
    position: absolute;
    left: 50%;
    bottom: 0.5rem;
    z-index: 2;
    transform: translateX(-50%);
    max-width: calc(100% - 2rem);
    padding: 0.25rem 0.75rem;
    border-radius: 0.25rem;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 0.875rem;
    line-height: 1.25rem;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 640px) {
    .gallery-slideshow-container {
        width: 100%;
    }
}

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