/* H3X Slide Cover — frontend slideshow styles. */

.h3x-slide-cover {
    position: relative;
    max-width: 100%;
    overflow: hidden;
}

.h3x-slide-cover:not(.is-editor) .h3x-slide-cover__track {
    /* min-width:0 stops a wide Cover from forcing horizontal overflow. */
    min-width: 0;
    max-width: 100%;
}

/* Only the active slide occupies layout — inactive slides are fully
   removed so they can't ghost behind the active one or add height. */
.h3x-slide-cover:not(.is-editor) .h3x-slide-cover__slide {
    display: none;
}

.h3x-slide-cover:not(.is-editor) .h3x-slide-cover__slide.is-active {
    display: block;
    animation: h3x-slide-cover-fade 0.5s ease;
}

@keyframes h3x-slide-cover-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* The nested Cover block fills the slide but never exceeds it. */
.h3x-slide-cover__slide > .wp-block-cover {
    width: 100%;
    max-width: 100%;
}

/* Navigation chevrons. */
.h3x-slide-cover__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    cursor: pointer;
    transition: background 0.2s ease;
}

.h3x-slide-cover__nav:hover,
.h3x-slide-cover__nav:focus-visible {
    background: rgba(0, 0, 0, 0.7);
    outline: none;
}

.h3x-slide-cover__nav--prev {
    left: 16px;
}

.h3x-slide-cover__nav--next {
    right: 16px;
}

.h3x-slide-cover__nav svg {
    width: 24px;
    height: 24px;
    display: block;
}

/* Dot indicators. */
.h3x-slide-cover__dots {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 16px;
    z-index: 2;
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 0;
    padding: 0;
}

.h3x-slide-cover__dot {
    width: 12px;
    height: 12px;
    padding: 0;
    border: 2px solid #fff;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    transition: background 0.2s ease;
}

.h3x-slide-cover__dot.is-active,
.h3x-slide-cover__dot:hover {
    background: #fff;
}

/* Editor — show slides stacked and labelled so each Cover can be edited. */
.h3x-slide-cover.is-editor .h3x-slide-cover__editor-note {
    margin: 0 0 12px;
    padding: 6px 10px;
    font-size: 12px;
    font-style: italic;
    opacity: 0.7;
    border: 1px dashed currentColor;
    border-radius: 4px;
}

.h3x-slide-cover.is-editor .h3x-slide-cover__slide {
    position: relative;
    margin-bottom: 16px;
    outline: 1px dashed rgba(0, 0, 0, 0.2);
    outline-offset: 4px;
}
