/* BVP Content Carousel — frontend + Visual Builder static preview */

/*
 * All selectors are scoped under `.et-db #et-boc` to win against Divi's global
 * reset `#et-boc .et-l div { margin:0; padding:0; background:transparent;
 * box-shadow:none; border-radius:0; transition:none; ... }` (specificity 1,1,1).
 * Prefixing with `.et-db #et-boc` raises every rule to >= 1,2,0, so the module
 * keeps its own backgrounds, spacing, radii and transitions. Mirrors the
 * convention used by ET_Builder_Element dynamic styles.
 */

.et-db #et-boc .bvpcc {
    position: relative;
    width: 100%;
}

.et-db #et-boc .bvpcc__carousel {
    position: relative;
}

.et-db #et-boc .bvpcc__swiper {
    overflow: hidden;
    width: 100%;
    /* Keep slider content below the carousel controls. */
    z-index: 1;
}

/*
 * Overflow-visible mode: let the previous/next slides spill outside the
 * carousel width so several are visible at once. The frontend clones enough
 * slides to fill the viewport on both sides (see cloneSlidesToFill). A parent
 * Divi section/row set to "hidden" overflow can still clip these — that is a
 * layout-level setting outside this module.
 */
.et-db #et-boc .bvpcc--overflow-visible,
.et-db #et-boc .bvpcc--overflow-visible .bvpcc__carousel,
.et-db #et-boc .bvpcc--overflow-visible .bvpcc__swiper {
    overflow: visible;
}

/*
 * Divi's reset (`#et-boc .et-l div { transition: none }`) strips the
 * transition-property from the Swiper wrapper, so its `transitionend` event
 * never fires. That leaves Swiper stuck in `animating: true` after the first
 * move and silently blocks arrows/pagination. Restore the transform transition
 * so Swiper can detect the end of each slide animation.
 */
.et-db #et-boc .bvpcc .swiper-wrapper {
    transition-property: transform !important;
}

/*
 * Non-px slide spacing (vw, rem, %, …): Swiper spaceBetween is px-only, so we
 * apply the author unit via margin and keep spaceBetween at 0.
 */
.et-db #et-boc .bvpcc--css-slide-spacing .swiper-slide {
    margin-right: var(--bvpcc-slide-spacing, 24px) !important;
}

.et-db #et-boc .bvpcc--css-slide-spacing[dir='rtl'] .swiper-slide {
    margin-right: 0 !important;
    margin-left: var(--bvpcc-slide-spacing, 24px) !important;
}

.et-db #et-boc .bvpcc__slide {
    height: auto;
    box-sizing: border-box;
}

.et-db #et-boc .bvpcc--equal-height .swiper-wrapper {
    align-items: stretch;
}

.et-db #et-boc .bvpcc--equal-height .bvpcc__slide-inner {
    height: 100%;
}

.et-db #et-boc .bvpcc__slide-inner {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
    transition: transform 0.45s ease, opacity 0.45s ease, filter 0.45s ease;
    text-decoration: none;
    color: inherit; 
    height: 100%;
    width: 100%;
    align-items: center;
    justify-content: center;
}

.et-db #et-boc .bvpcc__slide-inner--linked {
    cursor: pointer;
}

.et-db #et-boc .bvpcc--modal-enabled .bvpcc__slide-inner:not(.bvpcc__slide-inner--linked) {
    cursor: zoom-in;
}

.et-db #et-boc .bvpcc__figure {
    margin: 0;
    line-height: 0;
}

.et-db #et-boc .bvpcc__figure img {
    display: block;
    width: 100%;
    height: auto;
}

.et-db #et-boc .bvpcc__content {
    flex: 1 1 auto;
}

.et-db #et-boc .bvpcc__slide-inner--overlay {
    position: relative;
}

/* Library layout slide: let the layout provide its own background/spacing. */
.et-db #et-boc .bvpcc__slide-inner--library {
    padding: 0;
    overflow: hidden;
    background: transparent;
    box-shadow: none;
}

.et-db #et-boc .bvpcc__library-content {
    width: 100%;
}

/*
 * Neutralize full-page Divi spacing/min-height that bloats slide height.
 * Library layouts are often built as hero/fullscreen sections (min-height:100vh,
 * large vertical padding), which makes a single slide thousands of px tall.
 */
.et-db #et-boc .bvpcc__library-content .et_pb_section {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    min-height: 0 !important;
    height: auto !important;
}

.et-db #et-boc .bvpcc__library-content .et_pb_row,
.et-db #et-boc .bvpcc__library-content .et_pb_row_inner {
    width: 100% !important;
    max-width: 100% !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    min-height: 0 !important;
    height: auto !important;
}

.et-db #et-boc .bvpcc__library-content .et_pb_column {
    margin-bottom: 0 !important;
    min-height: 0 !important;
}

.et-db #et-boc .bvpcc__library-content img {
    max-width: 100%;
    height: auto;
}

/* Optional hard cap via parent --bvpcc-slide-max-height (unset by default). */
.et-db #et-boc .bvpcc--has-max-height .bvpcc__library-content {
    max-height: var(--bvpcc-slide-max-height, none);
    overflow: hidden;
}

/*
 * Uniform media height: every slide image is forced to the same height and
 * cropped (object-fit: cover) so differently proportioned images no longer make
 * the carousel jump, and each image fills the full slide width. Applies to both
 * built-in figures and Divi Library image modules.
 */
.et-db #et-boc .bvpcc--media-fixed .bvpcc__figure,
.et-db #et-boc .bvpcc--media-fixed .bvpcc__library-content .et_pb_image,
.et-db #et-boc .bvpcc--media-fixed .bvpcc__library-content .et_pb_image_wrap {
    display: block;
    width: 100%;
    height: var(--bvpcc-media-height, 240px);
    margin: 0;
}

.et-db #et-boc .bvpcc--media-fixed .bvpcc__figure img,
.et-db #et-boc .bvpcc--media-fixed .bvpcc__library-content img {
    display: block;
    width: 100%;
    height: var(--bvpcc-media-height, 240px);
    object-fit: cover;
}

/*
 * Auto mode: a single aspect ratio (derived from the first image at runtime,
 * see equalizeMediaRatio) is applied to every slide image. Height is computed
 * from the slide width, so it stays uniform AND responsive without a hard-coded
 * pixel value. Falls back to 16/9 until the ratio is measured.
 */
.et-db #et-boc .bvpcc--media-auto .bvpcc__figure,
.et-db #et-boc .bvpcc--media-auto .bvpcc__library-content .et_pb_image,
.et-db #et-boc .bvpcc--media-auto .bvpcc__library-content .et_pb_image_wrap {
    display: block;
    width: 100%;
    margin: 0;
}

.et-db #et-boc .bvpcc--media-auto .bvpcc__figure img,
.et-db #et-boc .bvpcc--media-auto .bvpcc__library-content img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: var(--bvpcc-media-ratio, 16 / 9);
    object-fit: cover;
}

.et-db #et-boc .bvpcc__library-placeholder {
    margin: 0;
    padding: 32px 24px;
    text-align: center;
    color: #666;
    font-size: 14px;
}

.et-db #et-boc .bvpcc__content--overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    pointer-events: none;
}

.et-db #et-boc .bvpcc__content--overlay .bvpcc__content-inner {
    width: 100%;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.65));
    color: #fff;
}

.et-db #et-boc .bvpcc__slide-inner.bvpcc__content--overlay-parent {
    position: relative;
}

.et-db #et-boc .bvpcc__content--overlay.bvpcc__content {
    pointer-events: none;
}

.et-db #et-boc .bvpcc__title {
    margin: 0 0 0.35em;
}

.et-db #et-boc .bvpcc__subtitle {
    margin: 0 0 0.5em;
    font-weight: 500;
}

.et-db #et-boc .bvpcc__body {
    margin: 0;
}

.et-db #et-boc .bvpcc__body p:last-child {
    margin-bottom: 0;
}

/*
 * Center mode peek.
 * A uniform slide width narrower than the track leaves a symmetric peek of the
 * previous and next slides on BOTH sides. Combined with `slidesPerView: 'auto'`
 * + `centeredSlides` (set for the "Coverflow / Drum" effect) the active slide is
 * always centred while neighbours shrink + blur to the sides.
 */
.et-db #et-boc .bvpcc--center .swiper-slide {
    width: calc(100% - (var(--bvpcc-center-padding, 70px) * 2));
    max-width: 100%;
    box-sizing: border-box;
}

/*
 * Animate scale / opacity / blur in lock-step with Swiper's movement speed so a
 * neighbour never fades or shrinks faster than it slides (which looked like the
 * slide "disappearing" before the transition finished).
 */
.et-db #et-boc .bvpcc--center .swiper-slide {
    transition:
        transform var(--bvpcc-anim-speed, 450ms) var(--bvpcc-anim-ease, ease),
        opacity var(--bvpcc-anim-speed, 450ms) var(--bvpcc-anim-ease, ease),
        filter var(--bvpcc-anim-speed, 450ms) var(--bvpcc-anim-ease, ease);
    will-change: transform, opacity, filter;
}

/* Beside variants (classic / highlighted): neighbours shrink + blur to the sides. */
.et-db #et-boc .bvpcc--center-highlighted .swiper-slide:not(.swiper-slide-active),
.et-db #et-boc .bvpcc--center-classic .swiper-slide:not(.swiper-slide-active) {
    opacity: var(--bvpcc-inactive-opacity, 0.45);
    transform: scale(var(--bvpcc-inactive-scale, 0.88));
    filter: blur(var(--bvpcc-inactive-blur, 4px));
}

/*
 * The active slide can scale ABOVE its neighbours (--bvpcc-active-scale > 1).
 * The size contrast is what produces the coverflow "zoom" feel: navigating next
 * grows the incoming slide from the side scale up to the active scale (and the
 * outgoing one shrinks back down), while the newly revealed slide zooms in from
 * the side scale. z-index keeps the enlarged active above its neighbours.
 */
.et-db #et-boc .bvpcc--center-highlighted .swiper-slide-active,
.et-db #et-boc .bvpcc--center-classic .swiper-slide-active {
    opacity: 1;
    transform: scale(var(--bvpcc-active-scale, 1));
    filter: none;
    z-index: 2;
}

/*
 * Highlighted (BESIDE): the neighbours stay alongside the active on both sides
 * (shrunk + blurred + dimmed via the rule above) and are pushed slightly OUTWARD
 * so the enlarged active is the clear focal point in the middle. They are never
 * pulled behind the active — that is the Stacked variant's job.
 */
.et-db #et-boc .bvpcc--center-highlighted .swiper-slide.swiper-slide-prev {
    transform: translateX(calc(-1 * var(--bvpcc-side-overlap, 18%))) scale(var(--bvpcc-inactive-scale, 0.88));
    z-index: 1;
}

.et-db #et-boc .bvpcc--center-highlighted .swiper-slide.swiper-slide-next {
    transform: translateX(var(--bvpcc-side-overlap, 18%)) scale(var(--bvpcc-inactive-scale, 0.88));
    z-index: 1;
}

/*
 * Stacked (BEHIND ACTIVE): the previous/next slides are pulled toward the centre
 * so their inner edge tucks behind the enlarged active slide (a card-stack look).
 * The active (z-index 3) always covers them; non-adjacent slides stay dimmed.
 */
.et-db #et-boc .bvpcc--center-stacked .swiper-slide:not(.swiper-slide-active) {
    opacity: var(--bvpcc-inactive-opacity, 0.45);
    transform: scale(var(--bvpcc-inactive-scale, 0.88));
    filter: blur(var(--bvpcc-inactive-blur, 4px));
    z-index: 1;
}

.et-db #et-boc .bvpcc--center-stacked .swiper-slide.swiper-slide-prev {
    transform: translateX(var(--bvpcc-side-overlap, 18%)) scale(var(--bvpcc-inactive-scale, 0.88));
    z-index: 2;
}

.et-db #et-boc .bvpcc--center-stacked .swiper-slide.swiper-slide-next {
    transform: translateX(calc(-1 * var(--bvpcc-side-overlap, 18%))) scale(var(--bvpcc-inactive-scale, 0.88));
    z-index: 2;
}

.et-db #et-boc .bvpcc--center-stacked .swiper-slide-active {
    opacity: 1;
    transform: scale(var(--bvpcc-active-scale, 1));
    filter: none;
    z-index: 3;
}

/* Arrows */
.et-db #et-boc .bvpcc__arrow {
    position: absolute;
    z-index: 20;
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    padding: 0;
    font-family: ETmodules, sans-serif;
    line-height: 1;
    transition: opacity 0.2s ease, background 0.2s ease;
}

.et-db #et-boc .bvpcc__arrow:before {
    content: attr(data-icon);
    speak: never;
    font-style: normal;
    font-weight: 400;
    font-variant: normal;
    text-transform: none;
    line-height: 1;
    -webkit-font-smoothing: antialiased;
}

.et-db #et-boc .bvpcc__arrow--prev {
    left: 0;
}

.et-db #et-boc .bvpcc__arrow--next {
    right: 0;
}

.et-db #et-boc .bvpcc__arrow.swiper-button-disabled {
    opacity: 0.35;
    pointer-events: none;
}

/* Pagination */
.et-db #et-boc .bvpcc__pagination {
    position: relative;
    width: 100%;
    z-index: 20;
    pointer-events: auto;
}

.et-db #et-boc .bvpcc__pagination.swiper-pagination-bullets {
    bottom: auto;
}

/* Visual Builder: static horizontal stack */
.et-db #et-boc .bvpcc--vb-preview .swiper-wrapper {
    display: flex;
    flex-wrap: nowrap;
    gap: 16px;
    transform: none !important;
    overflow-x: auto;
    padding-bottom: 8px;
}

.et-db #et-boc .bvpcc--vb-preview .swiper-slide {
    flex: 0 0 min(85%, 520px);
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
}

.et-db #et-boc .bvpcc--vb-preview .bvpcc__arrow,
.et-db #et-boc .bvpcc--vb-preview .bvpcc__pagination {
    display: none;
}

/*
 * Modal — also match .bvpcc-modal--portaled (moved to body in JS) so rules
 * apply above Divi fixed header (~99999) outside #et-boc stacking contexts.
 */
.et-db #et-boc .bvpcc-modal,
.bvpcc-modal.bvpcc-modal--portaled {
    position: fixed;
    inset: 0;
    z-index: 1000000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
}

.et-db #et-boc .bvpcc-modal[hidden],
.bvpcc-modal.bvpcc-modal--portaled[hidden] {
    display: none !important;
}

.et-db #et-boc .bvpcc-modal__backdrop,
.bvpcc-modal.bvpcc-modal--portaled .bvpcc-modal__backdrop {
    position: absolute;
    inset: 0;
    background: var(--bvpcc-modal-overlay, rgba(0, 0, 0, 0.82));
    -webkit-backdrop-filter: blur(var(--bvpcc-modal-overlay-blur, 0px));
    backdrop-filter: blur(var(--bvpcc-modal-overlay-blur, 0px));
}

.et-db #et-boc .bvpcc-modal__dialog,
.bvpcc-modal.bvpcc-modal--portaled .bvpcc-modal__dialog {
    position: relative;
    z-index: 1;
    width: var(--bvpcc-modal-max-width, min(96vw, 1200px));
    max-width: 96vw;
    max-height: 92vh;
    margin: 0;
    background: var(--bvpcc-modal-bg, #111);
    border-radius: 8px;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

/* Image-only dialogs shrink to the image instead of filling max width. */
.et-db #et-boc .bvpcc-modal__dialog:not(.bvpcc-modal__dialog--slide),
.bvpcc-modal.bvpcc-modal--portaled .bvpcc-modal__dialog:not(.bvpcc-modal__dialog--slide) {
    width: auto;
}

.et-db #et-boc .bvpcc-modal__body,
.bvpcc-modal.bvpcc-modal--portaled .bvpcc-modal__body {
    width: 100%;
    /* Center both the enlarged image and the cloned slide content. */
    text-align: center;
}

/* Whole-slide modal: show the cloned slide centered, never exceeding the dialog. */
.et-db #et-boc .bvpcc-modal__slide,
.bvpcc-modal.bvpcc-modal--portaled .bvpcc-modal__slide {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    /* Clear the close button (top-right) and give breathing room. */
    padding: 48px 32px 32px;
    text-align: center;
}

.et-db #et-boc .bvpcc-modal__slide .bvpcc__slide-inner,
.bvpcc-modal.bvpcc-modal--portaled .bvpcc-modal__slide .bvpcc__slide-inner {
    transform: none !important;
    filter: none !important;
    opacity: 1 !important;
    /* Card chrome is not needed inside the modal; content provides its own. */
    box-shadow: none;
    background: transparent;
}

.et-db #et-boc .bvpcc-modal__slide .bvpcc__library-content,
.bvpcc-modal.bvpcc-modal--portaled .bvpcc-modal__slide .bvpcc__library-content {
    max-height: none !important;
    overflow: visible !important;
}

/* Hard cap: nothing inside the modal may grow beyond the dialog bounds. */
.et-db #et-boc .bvpcc-modal__slide,
.et-db #et-boc .bvpcc-modal__slide *,
.bvpcc-modal.bvpcc-modal--portaled .bvpcc-modal__slide,
.bvpcc-modal.bvpcc-modal--portaled .bvpcc-modal__slide * {
    max-width: 100% !important;
}

/* Center images/media and keep them within the dialog (width + height). */
.et-db #et-boc .bvpcc-modal__body img,
.et-db #et-boc .bvpcc-modal__slide img,
.bvpcc-modal.bvpcc-modal--portaled .bvpcc-modal__body img,
.bvpcc-modal.bvpcc-modal--portaled .bvpcc-modal__slide img {
    max-width: 100% !important;
    max-height: 80vh;
    height: auto;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Center Divi modules cloned into the slide (text, image, etc.). */
.et-db #et-boc .bvpcc-modal__slide .et_pb_text,
.et-db #et-boc .bvpcc-modal__slide .et_pb_image,
.et-db #et-boc .bvpcc-modal__slide .et_pb_module,
.et-db #et-boc .bvpcc-modal__slide .et_pb_text_inner,
.bvpcc-modal.bvpcc-modal--portaled .bvpcc-modal__slide .et_pb_text,
.bvpcc-modal.bvpcc-modal--portaled .bvpcc-modal__slide .et_pb_image,
.bvpcc-modal.bvpcc-modal--portaled .bvpcc-modal__slide .et_pb_module,
.bvpcc-modal.bvpcc-modal--portaled .bvpcc-modal__slide .et_pb_text_inner {
    text-align: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
    float: none !important;
}

.et-db #et-boc .bvpcc-modal__slide .et_pb_image .et_pb_image_wrap,
.et-db #et-boc .bvpcc-modal__slide .et_pb_image span,
.bvpcc-modal.bvpcc-modal--portaled .bvpcc-modal__slide .et_pb_image .et_pb_image_wrap,
.bvpcc-modal.bvpcc-modal--portaled .bvpcc-modal__slide .et_pb_image span {
    display: inline-block;
    max-width: 100%;
}

.et-db #et-boc .bvpcc-modal__close,
.bvpcc-modal.bvpcc-modal--portaled .bvpcc-modal__close {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.et-db #et-boc .bvpcc-modal__figure,
.bvpcc-modal.bvpcc-modal--portaled .bvpcc-modal__figure {
    margin: 0;
}

.et-db #et-boc .bvpcc-modal__image,
.bvpcc-modal.bvpcc-modal--portaled .bvpcc-modal__image {
    display: block;
    max-width: 100%;
    max-height: 85vh;
    width: auto;
    height: auto;
    margin: 0 auto;
}

.et-db #et-boc .bvpcc-modal__caption,
.bvpcc-modal.bvpcc-modal--portaled .bvpcc-modal__caption {
    padding: 12px 16px 16px;
    color: #f5f5f5;
    font-size: 14px;
    text-align: center;
}

.et-db #et-boc .bvpcc-modal__caption[hidden],
.bvpcc-modal.bvpcc-modal--portaled .bvpcc-modal__caption[hidden] {
    display: none;
}

.et-db #et-boc .bvpcc-modal.is-open .bvpcc-modal__dialog,
.bvpcc-modal.bvpcc-modal--portaled.is-open .bvpcc-modal__dialog {
    animation: bvpcc-modal-in 0.28s ease;
}

body.bvpcc-modal-open {
    overflow: hidden;
}

@keyframes bvpcc-modal-in {
    from {
        opacity: 0;
        transform: scale(0.94);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    .et-db #et-boc .bvpcc__slide-inner,
    .et-db #et-boc .bvpcc--center .swiper-slide,
    .et-db #et-boc .bvpcc-modal.is-open .bvpcc-modal__dialog,
    .bvpcc-modal.bvpcc-modal--portaled.is-open .bvpcc-modal__dialog {
        transition: none;
        animation: none;
    }
}
