/* Speakers Carousel block.
   Loaded alongside swiper-bundle.min.css; only the deltas live here. */

.speakers-carousel {
    /* --sigil-primary-color comes from the theme; the fallback keeps the block
       usable if this plugin is ever run under a different theme. */
    --swiper-theme-color: var(--sigil-primary-color, #38bdf8);
    --swiper-navigation-color: var(--sigil-primary-color, #38bdf8);
    --swiper-navigation-size: 28px;
    --swiper-pagination-color: var(--sigil-primary-color, #38bdf8);
    --swiper-pagination-bullet-size: 10px;
    --swiper-pagination-bullet-inactive-color: #9ca3af;
    --swiper-pagination-bullet-inactive-opacity: 0.5;
}

/* The card's ring-offset draws ~8px outside the headshot; without this the
   track's overflow:hidden shaves the top and bottom of that ring. */
.speakers-carousel__swiper {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

/* Slides are flex children and default to equal height only if they may grow;
   the card markup already relies on h-full to fill whatever it is given. */
.speakers-carousel .swiper-slide {
    height: auto;
}

/* Leave room for the arrows, which sit outside the track. */
@media (min-width: 1024px) {
    .speakers-carousel {
        padding-left: 2.5rem;
        padding-right: 2.5rem;
    }
}

/* Swiper positions arrows against .swiper; ours are siblings of it, inside the
   relatively-positioned .speakers-carousel, so nudge them back to centre and
   discount the pagination row below. */
.speakers-carousel .swiper-button-prev,
.speakers-carousel .swiper-button-next {
    top: 50%;
    margin-top: -1.5rem;
}

.speakers-carousel .swiper-button-prev {
    left: 0;
}

.speakers-carousel .swiper-button-next {
    right: 0;
}

.speakers-carousel .swiper-button-prev:focus-visible,
.speakers-carousel .swiper-button-next:focus-visible {
    outline: 2px solid var(--sigil-primary-color, #38bdf8);
    outline-offset: 4px;
    border-radius: 0.25rem;
}

/* Swiper only applies its bottom offset to a .swiper-pagination that is a direct
   child of the track. Ours is not, so take it out of absolute flow entirely and
   let it sit under the carousel. */
.speakers-carousel .swiper-pagination {
    position: relative;
    margin-top: 1.5rem;
    bottom: auto;
    left: auto;
}

.speakers-carousel .swiper-pagination-bullet {
    transition: opacity 200ms ease, background-color 200ms ease;
}

/* Hide arrows and dots when there is nothing to page to. */
.speakers-carousel .swiper-button-lock,
.speakers-carousel .swiper-pagination-lock {
    display: none;
}
