/* ==========================================================================
   Cover Slider Block
   A cover area with cross-fading background images and content on top.
   ========================================================================== */

.acf-cover-slider {
    position: relative;
    width: 100%;
    min-height: 100vh; /* Default, overridden by inline style */
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background-color: #111;
}

/* --- Background image layer ------------------------------------------------ */
.acf-cover-slider-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.acf-cover-slider .cover-slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity var(--cs-fade, 1.5s) ease-in-out;
    will-change: opacity;
}

/* The active image is the one shown; JS toggles this class on a timer.
   Rendered on the first slide server-side so it shows without/before JS. */
.acf-cover-slider .cover-slide.is-active {
    opacity: 1;
}

/* --- Dark overlay ---------------------------------------------------------- */
.acf-cover-slider-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background-color: #000;
    pointer-events: none;
}

/* --- Content layer --------------------------------------------------------- */
.acf-cover-slider-content {
    position: relative;
    z-index: 2;
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* Vertical position of content */
.acf-cover-slider.content-top    .acf-cover-slider-content { justify-content: flex-start; }
.acf-cover-slider.content-center .acf-cover-slider-content { justify-content: center; }
.acf-cover-slider.content-bottom .acf-cover-slider-content { justify-content: flex-end; }

/* Let the inner content span the full width by default */
.acf-cover-slider-content > .block-editor-inner-blocks,
.acf-cover-slider-content > * {
    width: 100%;
}

/* ==========================================================================
   Editor Preview
   JS does not run in the editor, so the first slide is shown via .is-active.
   Give the block a sensible minimum height so it's visible while editing.
   ========================================================================== */
.editor-styles-wrapper .acf-cover-slider,
.wp-admin .acf-cover-slider {
    min-height: 400px;
}

/* Keep the background layer behind the editable content in the editor */
.editor-styles-wrapper .acf-cover-slider-bg,
.wp-admin .acf-cover-slider-bg {
    position: absolute;
    inset: 0;
}

.editor-styles-wrapper .acf-cover-slider-content .wp-block,
.wp-admin .acf-cover-slider-content .wp-block {
    max-width: none;
}
