/*
 * The rotating stack: behaviour only, no look.
 *
 * Every slide sits in the same grid cell, so the stack is as tall as its
 * tallest slide and nothing below it moves when the slide changes. An inactive
 * slide is invisible, untouchable and out of the accessibility tree
 * (visibility, not display, so it still takes its cell and can fade). The
 * host theme decides what a slide and its controls look like through the
 * classes it adds beside these; this file never sets a colour, a size or a
 * font.
 *
 * Plain CSS, like group.css: the plugin has no build, and a copy each venue
 * compiled for itself would drift.
 */

.hhl-slides__track {
    display: grid;
}

.hhl-slides__track > .hhl-slide {
    grid-area: 1 / 1;
    min-width: 0;
}

/* visibility waits for the fade to finish; the incoming slide drops the wait. */
.hhl-slide,
.hhl-slides__layer {
    opacity: 0;
    pointer-events: none;
    transition:
        opacity 0.6s ease,
        visibility 0s linear 0.6s;
    visibility: hidden;
}

.hhl-slide.is-active,
.hhl-slides__layer.is-active {
    opacity: 1;
    pointer-events: auto;
    transition-delay: 0s;
    visibility: visible;
}

/* height => 'active': slides.js sizes the track to the shown slide. */
[data-hhl-slides-height="active"] > .hhl-slides__track {
    overflow: hidden;
    transition: height 0.6s ease;
}

[data-hhl-slides-height="active"] > .hhl-slides__track > .hhl-slide {
    align-self: start;
}

@media (prefers-reduced-motion: reduce) {
    [data-hhl-slides-height="active"] > .hhl-slides__track {
        transition: none;
    }
}

/* A layer fills whatever positioned box the theme gives the media. */
.hhl-slides__layer {
    inset: 0;
    position: absolute;
}

/* Controls stay hidden until the script lifts them; a theme's display rule must not undo that. The same for the pause button, which the script hides under reduced motion and a theme's .button rule would re-show. */
.hhl-slides__controls[hidden],
.hhl-slides__control[hidden] {
    display: none !important;
}

/* The pause button comes first in the DOM (rotation control before the slide picker, as the carousel pattern asks) and last on screen, where the themes already place it. */
.hhl-slides__pause {
    order: 1;
}

.hhl-slides__dots {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

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