.mn-gallery-slider {
    --gap: 30px;
    --h: 360px;
    --w: calc((100% - (var(--gap) * 2.5)) / 3.5);

    position: relative;
    overflow: visible;
    display: block !important;
    width: 100%;
    margin: 40px 0;
    padding: 0 0 54px;
}

.mn-gallery-slider-viewport {
    position: relative;
    overflow: hidden;
    width: 100%;
}

.mn-gallery-slider-track {
    display: flex;
    align-items: stretch;
    gap: var(--gap);
    transition: transform .35s ease;
    will-change: transform;
}

.mn-gallery-slider .wp-block-image {
    flex: 0 0 var(--w);
    width: var(--w);
    margin: 0 !important;
}

.mn-gallery-slider-image-link {
    display: block;
    width: 100%;
    height: 100%;
    overflow: hidden;
    cursor: zoom-in;
    box-shadow: 0 14px 24px rgba(0, 0, 0, .08);
}

.mn-gallery-slider img {
    display: block;
    width: 100%;
    height: var(--h);
    object-fit: cover;
}

.mn-gallery-slider-button,
.mn-gallery-modal-close,
.mn-gallery-modal-prev,
.mn-gallery-modal-next {
    position: absolute;
    z-index: 20;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    appearance: none;
    -webkit-appearance: none;
    color: #fff;
    line-height: 1;
}

.mn-gallery-slider-button {
    top: calc(50% - 27px) !important;
    width: 54px;
    height: 54px;
    min-width: 54px;
    min-height: 54px;
    padding: 0;
    margin: 0;
    background: var(--ast-global-color-8);
    font-size: 38px;
    transform: none !important;
}

.mn-gallery-slider-button:hover,
.mn-gallery-slider-button:focus {
    background: rgba(0, 0, 0, .78);
    color: #fff;
}

.mn-gallery-slider-prev {
    left: 24px;
}

.mn-gallery-slider-next {
    right: 24px;
}

.mn-gallery-slider-dots {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 18px;
}

.mn-gallery-slider-dot {
    width: 14px;
    height: 14px;
    padding: 0;
    margin: 0;
    border: 1px solid #111;
    border-radius: 999px;
    background: transparent;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.mn-gallery-slider-dot.is-active {
    background: #333;
    border-color: #333;
}

/* Fullscreen modal */

.mn-gallery-modal {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    margin: 0;
    padding: 0;
    border: 0;
    background: rgba(0, 0, 0, .94);
    overflow: hidden;
}

.mn-gallery-modal::backdrop {
    background: rgba(0, 0, 0, .86);
}

.mn-gallery-modal-inner,
.mn-gallery-modal-slide {
    display: flex;
    align-items: center;
    justify-content: center;
}

.mn-gallery-modal-inner {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    touch-action: pan-y;
}

.mn-gallery-modal-track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform .35s ease;
    will-change: transform;
}

.mn-gallery-modal-slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    padding: 70px 90px;
}

.mn-gallery-modal-slide img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.mn-gallery-modal-close,
.mn-gallery-modal-prev,
.mn-gallery-modal-next {
    background: rgba(255, 255, 255, .18);
    color: #fff;
}

.mn-gallery-modal-close:hover,
.mn-gallery-modal-prev:hover,
.mn-gallery-modal-next:hover,
.mn-gallery-modal-close:focus,
.mn-gallery-modal-prev:focus,
.mn-gallery-modal-next:focus {
    background: rgba(255, 255, 255, .32);
    color: #fff;
}

.mn-gallery-modal-close {
    top: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    font-size: 32px;
}

.mn-gallery-modal-prev,
.mn-gallery-modal-next {
    top: 50%;
    width: 58px;
    height: 58px;
    font-size: 42px;
    transform: translateY(-50%);
}

.mn-gallery-modal-prev {
    left: 24px;
}

.mn-gallery-modal-next {
    right: 24px;
}

.mn-gallery-modal-counter {
    position: absolute;
    left: 50%;
    bottom: 24px;
    z-index: 30;
    transform: translateX(-50%);
    color: #fff;
    font-size: 14px;
    line-height: 1.2;
    background: rgba(0, 0, 0, .42);
    border-radius: 999px;
    padding: 8px 14px;
}

@media (max-width: 1024px) {
    .mn-gallery-slider {
        --gap: 24px;
        --h: 320px;
        --w: calc((100% - (var(--gap) * 1.2)) / 2.2);
    }
}

@media (max-width: 767px) {
    .mn-gallery-slider {
        --gap: 16px;
        --h: 260px;
        --w: calc((100% - (var(--gap) * .15)) / 1.15);
        padding-bottom: 44px;
    }

    .mn-gallery-slider-button {
        top: calc(50% - 21px) !important;
        width: 42px;
        height: 42px;
        min-width: 42px;
        min-height: 42px;
        font-size: 30px;
    }

    .mn-gallery-slider-prev {
        left: 10px;
    }

    .mn-gallery-slider-next {
        right: 10px;
    }

    .mn-gallery-slider-dots {
        gap: 12px;
    }

    .mn-gallery-slider-dot {
        width: 11px;
        height: 11px;
    }

    .mn-gallery-modal-slide {
        padding: 60px 18px;
    }

    .mn-gallery-modal-prev,
    .mn-gallery-modal-next {
        width: 44px;
        height: 44px;
        font-size: 32px;
    }

    .mn-gallery-modal-prev {
        left: 10px;
    }

    .mn-gallery-modal-next {
        right: 10px;
    }

    .mn-gallery-modal-close {
        top: 14px;
        right: 14px;
        width: 42px;
        height: 42px;
        font-size: 28px;
    }
}