/* Gallery Carousel Block - Front-end & Editor Styles */

.mjm-gallery-carousel {
    --mjm-gallery-carousel-gap: clamp(1.5rem, 2.4vw, 2.75rem);
    --mjm-gallery-carousel-columns: 3;
    --mjm-gallery-carousel-button-size: 74px;
    --mjm-gallery-carousel-creator-font-family: "KF Zuka Medium", "Helvetica Neue", Helvetica, Arial, sans-serif;
    --mjm-gallery-carousel-creator-font-size: 1.18rem;
    --mjm-gallery-carousel-creator-line-height: 1.05;
    --mjm-gallery-carousel-title-font-family: var(--font-headline);
    --mjm-gallery-carousel-title-font-size: 1.85rem;
    --mjm-gallery-carousel-title-line-height: 1.02;
    --mjm-gallery-carousel-description-font-family: "KF Zuka Medium", "Helvetica Neue", Helvetica, Arial, sans-serif;
    --mjm-gallery-carousel-description-font-size: 1.18rem;
    --mjm-gallery-carousel-description-line-height: 1.16;
    width: 100vw;
    max-width: 100vw;
    position: relative;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    padding: clamp(2rem, 3.5vw, 3rem) var(--mjm-content-gutter);
    box-sizing: border-box;
    color: #000;
    background: #fff;
}

.mjm-gallery-carousel__viewport {
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.mjm-gallery-carousel__viewport::-webkit-scrollbar {
    display: none;
}

.mjm-gallery-carousel__viewport:focus-visible {
    outline: 3px solid #005fcc;
    outline-offset: 5px;
}

.mjm-gallery-carousel__track {
    display: flex;
    align-items: flex-start;
    gap: var(--mjm-gallery-carousel-gap);
    list-style: none;
    margin: 0;
    padding: 0;
}

.mjm-gallery-carousel__item {
    display: flex;
    flex-direction: column;
    align-self: flex-start;
    flex: 0 0 calc((100% - (var(--mjm-gallery-carousel-gap) * (var(--mjm-gallery-carousel-columns) - 1))) / var(--mjm-gallery-carousel-columns));
    min-width: 0;
    scroll-snap-align: start;
}

.mjm-gallery-carousel__item-inner,
.mjm-gallery-carousel__item-link {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
}

.mjm-gallery-carousel__item-link {
    color: inherit;
    text-decoration: none;
}

.mjm-gallery-carousel__item-link:hover,
.mjm-gallery-carousel__item-link:hover .mjm-gallery-carousel__creator,
.mjm-gallery-carousel__item-link:hover .mjm-gallery-carousel__title,
.mjm-gallery-carousel__item-link:hover .mjm-gallery-carousel__description {
    color: inherit;
    text-decoration: none;
}

.mjm-gallery-carousel__item-link:focus-visible {
    outline: 3px solid #005fcc;
    outline-offset: 4px;
}

.mjm-gallery-carousel__image-wrap {
    display: block;
    flex: 0 0 auto;
    width: 100%;
    margin: 0;
    line-height: 0;
    overflow: hidden;
}

.mjm-gallery-carousel__image {
    display: block;
    width: 100%;
    height: auto;
    vertical-align: top;
}

.mjm-gallery-carousel__image-placeholder {
    width: 100%;
    min-height: clamp(14rem, 28vw, 26rem);
    background: #e0e0e0;
}

.mjm-gallery-carousel__content {
    flex: 0 0 auto;
    max-width: 42rem;
    margin-top: 15px;
}

.mjm-gallery-carousel__creator,
.mjm-gallery-carousel__title,
.mjm-gallery-carousel__description {
    color: #000;
    letter-spacing: 0;
}

.mjm-gallery-carousel__creator {
    font-family: var(--mjm-gallery-carousel-creator-font-family);
    font-size: var(--mjm-gallery-carousel-creator-font-size);
    line-height: var(--mjm-gallery-carousel-creator-line-height);
    margin: 0 0 0.38rem;
}

.mjm-gallery-carousel__title {
    font-family: var(--mjm-gallery-carousel-title-font-family);
    font-size: var(--mjm-gallery-carousel-title-font-size);
    line-height: var(--mjm-gallery-carousel-title-line-height);
    font-weight: normal;
    margin: 0 0 0.4rem;
}

.mjm-gallery-carousel__description {
    font-family: var(--mjm-gallery-carousel-description-font-family);
    font-size: var(--mjm-gallery-carousel-description-font-size);
    line-height: var(--mjm-gallery-carousel-description-line-height);
    margin: 0;
}

.mjm-gallery-carousel__nav {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
}

.mjm-gallery-carousel__nav-button {
    appearance: none;
    position: absolute;
    top: 40%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--mjm-gallery-carousel-button-size);
    height: var(--mjm-gallery-carousel-button-size);
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #FFC800;
    color: #000;
    cursor: pointer;
    line-height: 0;
    transform: translateY(-50%);
    transition: opacity 0.2s ease;
    pointer-events: auto;
}

.mjm-gallery-carousel__nav-button[hidden] {
    display: none;
}

.mjm-gallery-carousel__nav-button--prev {
    left: calc(var(--mjm-content-gutter) + 0.6rem);
}

.mjm-gallery-carousel__nav-button--next {
    right: calc(var(--mjm-content-gutter) + 0.6rem);
}

.mjm-gallery-carousel__nav-button:hover {
    opacity: 0.82;
}

.mjm-gallery-carousel__nav-button:focus-visible {
    outline: 3px solid #005fcc;
    outline-offset: 4px;
}

.mjm-gallery-carousel__arrow-icon {
    display: block;
    width: 58px;
    height: 58px;
    mix-blend-mode: multiply;
}

@media (max-width: 1023px) {
    .mjm-gallery-carousel {
        --mjm-gallery-carousel-columns: 2;
    }
}

@media (max-width: 640px) {
    .mjm-gallery-carousel {
        --mjm-gallery-carousel-columns: 1;
        --mjm-gallery-carousel-button-size: 58px;
        --mjm-gallery-carousel-creator-font-size: 1.05rem;
        --mjm-gallery-carousel-title-font-size: 1.55rem;
        --mjm-gallery-carousel-description-font-size: 1.05rem;
        padding-top: 1.5rem;
        padding-bottom: 1.75rem;
    }

    .mjm-gallery-carousel__item {
        flex-basis: 86%;
    }

    .mjm-gallery-carousel__nav-button {
        top: 36%;
    }

    .mjm-gallery-carousel__nav-button--prev {
        left: calc(var(--mjm-content-gutter) * 0.75);
    }

    .mjm-gallery-carousel__nav-button--next {
        right: calc(var(--mjm-content-gutter) * 0.75);
    }

    .mjm-gallery-carousel__arrow-icon {
        width: 46px;
        height: 46px;
    }

}

@media (prefers-reduced-motion: reduce) {
    .mjm-gallery-carousel__viewport {
        scroll-behavior: auto;
    }

    .mjm-gallery-carousel__nav-button {
        transition: none;
    }
}
