/* Core Gallery cannot overlay/fade slides or clip a slow image zoom. Its native
   attributes continue to own image crops, spacing and corner radii. */
.ds-place-slideshow[data-enhanced] {
    display: grid;
    aspect-ratio: 5 / 4;
    overflow: hidden;
}
.ds-place-slideshow[data-enhanced] > .wp-block-image {
    grid-area: 1 / 1;
    opacity: 0;
    pointer-events: none;
    transition: opacity 2s ease-in-out;
}
.ds-place-slideshow[data-enhanced] > .wp-block-image.is-current {
    opacity: 1;
    pointer-events: auto;
}
.ds-place-slideshow[data-enhanced] figcaption {
    display: none;
}
.ds-place-slideshow[data-enhanced] .is-zooming img {
    animation: ds-place-drift-in 18s linear forwards;
}
.ds-place-slideshow[data-enhanced] .is-zooming[data-motion="out-left"] img {
    animation-name: ds-place-drift-out;
}
.ds-slideshow[data-paused] .is-zooming img {
    animation-play-state: paused;
}
/* Overscan remains larger than the translation, so slow panning never exposes
   an image edge. Alternate photos drift and zoom in opposite directions. */
@keyframes ds-place-drift-in {
    from { transform: translate(-2.5%, -1.5%) scale(1.06); }
    to { transform: translate(2.5%, 1.5%) scale(1.18); }
}
@keyframes ds-place-drift-out {
    from { transform: translate(2.5%, 1.5%) scale(1.18); }
    to { transform: translate(-2.5%, -1.5%) scale(1.06); }
}

/* Slideshow controls are generated only after enhancement; core Gallery has no
   playback-control attributes. Use the site's tokens and visible focus. */
.ds-slide-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--wp--preset--spacing--20);
    margin-top: var(--wp--preset--spacing--30);
    font-size: var(--wp--preset--font-size--small);
    color: var(--wp--preset--color--secondary);
}
.ds-slide-controls .ds-slide-label {
    flex: 1 1 9rem;
}
.ds-slide-controls button {
    min-height: 44px;
    padding: var(--wp--preset--spacing--20) var(--wp--preset--spacing--30);
    background: var(--wp--preset--color--base);
    color: var(--wp--preset--color--contrast);
    border: 1px solid var(--wp--preset--color--accent-6);
    border-radius: 4px;
    font: inherit;
    cursor: pointer;
}
.ds-slide-controls button:hover {
    background: var(--wp--preset--color--accent-5);
}
.ds-slide-controls button:focus-visible {
    outline: 2px solid var(--wp--preset--color--accent-1);
    outline-offset: 3px;
}
.ds-slide-controls button:disabled {
    cursor: default;
}
@media (prefers-reduced-motion: reduce) {
    .ds-place-slideshow[data-enhanced] > .wp-block-image {
        transition: none;
    }
    .ds-place-slideshow[data-enhanced] .is-zooming[data-motion] img {
        animation: none;
    }
}
