/*
 * K&E legacy gallery compatibility.
 * Keeps the original 50/50 composition, fade main gallery and 4 thumbnails.
 * No project typography or color palette is hard-coded here.
 */
.ke-section-gallery .gallery_wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
}

.ke-section-gallery .gallery_wrapper > .fiftyfifty {
    width: 50%;
    min-width: 0;
}

.ke-section-gallery.gallery-side-default .gallery-copy {
    order: 1;
}

.ke-section-gallery.gallery-side-default .galparent {
    order: 2;
}

.ke-section-gallery.gallery-side-alt .gallery-copy {
    order: 2;
}

.ke-section-gallery.gallery-side-alt .galparent {
    order: 1;
}

.ke-section-gallery .gallery-copy {
    display: flex;
    align-items: center;
}

.ke-section-gallery .galparent,
.ke-section-gallery .news_content.gal,
.ke-section-gallery .ke-gallery,
.ke-section-gallery .ke-gallery-main {
    position: relative;
    min-width: 0;
    width: 100%;
}

.ke-gallery-legacy .mySwiper5 {
    position: relative;
    overflow: hidden;
}

.ke-gallery-legacy .mySwiper5 > .swiper-wrapper {
    position: relative;
    width: 100%;
}

.ke-gallery-legacy .mySwiper5 > .swiper-wrapper > .swiper-slide {
    position: relative;
    width: 100%;
    opacity: 0;
    transition: opacity .35s ease;
}

.ke-gallery-legacy .mySwiper5 > .swiper-wrapper > .swiper-slide.swiper-slide-active {
    opacity: 1;
}

.ke-gallery-legacy .mySwiper5 > .swiper-wrapper > .swiper-slide[hidden] {
    display: none !important;
}

.ke-gallery-legacy .fullheight {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}


/* Standard K&E cut corner: top left, 40px. Main gallery image only. */
.ke-gallery-legacy .ke-gallery-image.ke-cut-top-left {
    --ke-cut-size: 40px;
    clip-path: polygon(
        var(--ke-cut-size) 0,
        100% 0,
        100% 100%,
        0 100%,
        0 var(--ke-cut-size)
    );
}

.ke-gallery-legacy .caption {
    position: relative;
}

.ke-gallery-legacy .caption_p {
    margin-bottom: 0;
}

.ke-gallery-legacy .swiper-button-prev,
.ke-gallery-legacy .swiper-button-next {
    position: absolute;
    top: calc(50% - 46px);
    z-index: 10;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.ke-gallery-legacy .swiper-button-prev {
    left: 12px;
}

.ke-gallery-legacy .swiper-button-next {
    right: 12px;
}

.ke-gallery-legacy .swiper-button-prev::after,
.ke-gallery-legacy .swiper-button-next::after {
    content: none !important;
    display: none !important;
}

.ke-gallery-legacy .swiper-button-prev::before,
.ke-gallery-legacy .swiper-button-next::before {
    content: "";
    display: block;
    width: 15px;
    height: 15px;
    margin: auto;
    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
}

.ke-gallery-legacy .swiper-button-prev::before {
    transform: rotate(-135deg);
}

.ke-gallery-legacy .swiper-button-next::before {
    transform: rotate(45deg);
}

.ke-gallery-legacy .mySwiper6 {
    width: 100%;
    margin-top: 10px;
    overflow: hidden;
    scroll-behavior: smooth;
}

.ke-gallery-legacy .mySwiper6 .swiper-wrapper {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 10px;
    width: 100% !important;
    height: auto !important;
    transform: none !important;
}

.ke-gallery-legacy .mySwiper6 .swiper-slide {
    display: block;
    flex: 0 0 calc((100% - 30px) / 4);
    width: calc((100% - 30px) / 4) !important;
    min-width: 0;
    padding: 0;
    margin: 0 !important;
    border: 0;
    background: transparent;
    cursor: pointer;
    opacity: .55;
    transition: opacity .2s ease;
}

.ke-gallery-legacy .mySwiper6 .swiper-slide.swiper-slide-thumb-active {
    opacity: 1;
}

.ke-gallery-legacy .thumbsSlider {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

@media (max-width: 767px) {
    .ke-section-gallery .gallery_wrapper {
        flex-direction: column;
    }

    .ke-section-gallery .gallery_wrapper > .fiftyfifty {
        width: 100%;
    }

    .ke-section-gallery.gallery-side-default .gallery-copy,
    .ke-section-gallery.gallery-side-alt .gallery-copy {
        order: 1;
    }

    .ke-section-gallery.gallery-side-default .galparent,
    .ke-section-gallery.gallery-side-alt .galparent {
        order: 2;
    }

    .ke-gallery-legacy .mySwiper6 .swiper-wrapper {
        display: flex !important;
        flex-wrap: nowrap !important;
    }

    .ke-gallery-legacy .mySwiper6 .swiper-slide {
        flex-basis: calc((100% - 30px) / 4);
        width: calc((100% - 30px) / 4) !important;
    }
}


/* Smooth crossfade for the main gallery slides. */
.ke-gallery-legacy .ke-gallery-main > .swiper-wrapper {
    position: relative;
}

.ke-gallery-legacy .ke-gallery-main > .swiper-wrapper > [data-ke-gallery-slide] {
    position: absolute;
    inset: 0;
    width: 100%;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
        opacity 450ms ease-in-out,
        visibility 0s linear 450ms;
}

.ke-gallery-legacy .ke-gallery-main > .swiper-wrapper > [data-ke-gallery-slide].swiper-slide-active {
    position: relative;
    inset: auto;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition:
        opacity 450ms ease-in-out,
        visibility 0s linear 0s;
}


/* Keep gallery navigation controls visually neutral on interaction.
 * Prevent global button hover styles from adding red/pink backgrounds.
 */
.ke-gallery-legacy .swiper-button-prev,
.ke-gallery-legacy .swiper-button-next,
.ke-gallery-legacy .swiper-button-prev:hover,
.ke-gallery-legacy .swiper-button-next:hover,
.ke-gallery-legacy .swiper-button-prev:focus,
.ke-gallery-legacy .swiper-button-next:focus,
.ke-gallery-legacy .swiper-button-prev:focus-visible,
.ke-gallery-legacy .swiper-button-next:focus-visible,
.ke-gallery-legacy .swiper-button-prev:active,
.ke-gallery-legacy .swiper-button-next:active {
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
}
