/*
 * Custom Carousel (biblijatazboruva.mk): the site's own carousel styles. No third-party CSS.
 *
 * Per carousel the shortcode sets --custom-carousel-columns and --custom-carousel-gutter (per screen width).
 * All items sit in one row and stretch to the tallest one, so the carousel's height and its arrows never move.
 * The arrows sit inside 48px of space on each side, vertically centred; their icons are the files arrow-prev.svg
 * and arrow-next.svg, in the site's gold (#b99663, as the site's arrows were), slightly darker on hover.
 */
.custom-carousel {
    --custom-carousel-arrow: #b99663;
    position: relative;
    box-sizing: border-box;
    padding: 0 48px;
}

.custom-carousel__viewport {
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
}

.custom-carousel__viewport::-webkit-scrollbar {
    display: none;
}

.custom-carousel__viewport:focus-visible {
    outline: 2px solid var(--custom-carousel-arrow);
    outline-offset: 4px;
}

.custom-carousel__track {
    display: flex;
    align-items: stretch;
}

/* Once the script runs, it moves the row itself (a slide of the track): the viewport clips instead of scrolling, and
   a touch that moves up or down still scrolls the page. */
.custom-carousel--enhanced .custom-carousel__viewport {
    overflow: hidden;
    overflow: clip;
    scroll-snap-type: none;
    touch-action: pan-y pinch-zoom;
}

.custom-carousel__item {
    box-sizing: border-box;
    flex: 0 0 calc(100% / var(--custom-carousel-columns, 3));
    max-width: calc(100% / var(--custom-carousel-columns, 3));
    min-width: 0;
    padding: var(--custom-carousel-gutter, 10px);
    scroll-snap-align: start;
}

.custom-carousel__item img {
    max-width: 100%;
    height: auto;
}

.custom-carousel__item > :last-child {
    margin-bottom: 0;
}

.custom-carousel__arrow {
    position: absolute;
    top: 50%;
    z-index: 2;
    width: 40px;
    height: 40px;
    margin: -20px 0 0;
    padding: 3px;
    border: 0;
    border-radius: 50%;
    background: none;
    box-shadow: none;
    color: var(--custom-carousel-arrow);
    cursor: pointer;
    line-height: 0;
}

.custom-carousel__arrow[hidden] {
    display: none;
}

/* The site's SiteOrigin CSS paints every button gold ("button { background-color: #b99663 !important }"), so the
   arrow buttons need an !important transparent background of their own. */
.custom-carousel .custom-carousel__arrow,
.custom-carousel .custom-carousel__arrow:hover,
.custom-carousel .custom-carousel__arrow:focus,
.custom-carousel .custom-carousel__arrow:active {
    background-color: transparent !important;
    background-image: none;
}

/* The theme gives content images a vertical margin; the icon sits exactly in its button. */
.custom-carousel .custom-carousel__arrow .custom-carousel__icon {
    margin: 0;
}

.custom-carousel__arrow--prev {
    left: 4px;
}

.custom-carousel__arrow--next {
    right: 4px;
}

.custom-carousel__arrow:focus-visible {
    outline: 2px solid var(--custom-carousel-arrow);
    outline-offset: 2px;
}

.custom-carousel__icon {
    display: block;
    width: 34px;
    max-width: none;
    height: 34px;
    margin: 0;
    border: 0;
    transition: filter 0.2s ease;
}

.custom-carousel__arrow:hover .custom-carousel__icon {
    filter: brightness(0.78);
}

/* Phones (owner 2026-11-26): less room for the arrows, so the card gets more of the narrow screen. */
@media (max-width: 767px) {
    .custom-carousel {
        padding: 0 36px;
    }

    .custom-carousel__arrow {
        width: 32px;
        height: 32px;
        margin-top: -16px;
        padding: 2px;
    }

    .custom-carousel__arrow--prev {
        left: 2px;
    }

    .custom-carousel__arrow--next {
        right: 2px;
    }

    .custom-carousel__icon {
        width: 28px;
        height: 28px;
    }
}

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

    .custom-carousel__icon {
        transition: none;
    }
}
