/*
 * JoomGallery Navigation Prev-Next, version 3.0.0
 * Uses Bootstrap 5 CSS variables with fallbacks, so it works in any template.
 *
 * The size of the thumbnails depends on the width of the block (not of the browser window),
 * so sidebars or narrow columns are taken into account. If the block is narrow, thumbnails
 * far away from the current image are hidden (container queries).
 */
.jg-navigation {
    --jg-nav-size: 100px;

    container-type: inline-size;
    container-name: jg-nav;
}

.jg-nav-strip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: 0;
    margin-bottom: 0.25rem;
}

.jg-nav-thumbs {
    display: flex;
    flex: 0 1 auto;
    justify-content: center;
    gap: 0.5rem;
    min-width: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.jg-nav-thumbs > li {
    flex: 0 1 var(--jg-nav-size);
    min-width: 0;
}

.jg-nav-thumb {
    position: relative;
    display: block;
    box-sizing: border-box;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: var(--bs-border-radius, 0.375rem);
    background: var(--bs-light, #f8f9fa);
    opacity: 0.7;
    transition: opacity 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.jg-nav-thumb.is-current {
    border: 2px solid var(--bs-primary, #0d6efd);
    opacity: 1;
}

.jg-nav-thumb:hover,
.jg-nav-thumb:focus-visible {
    z-index: 1;
    opacity: 1;
    transform: scale(1.02);
    box-shadow: 0 0 0 1px var(--bs-primary, #0d6efd);
}

.jg-nav-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.jg-nav-placeholder {
    display: block;
    width: 100%;
    height: 100%;
}

.jg-nav-edge {
    display: inline-flex;
    flex: 0 0 auto;
    color: inherit;
    font-size: 2rem;
    line-height: 1;
}

.jg-nav-edge.is-disabled {
    opacity: 0.25;
}

.jg-nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.jg-nav-bar-prev,
.jg-nav-bar-next {
    flex: 1 1 0;
}

.jg-nav-bar-prev {
    text-align: start;
}

.jg-nav-bar-next {
    text-align: end;
}

.jg-nav-counter {
    flex: 0 0 auto;
    text-align: center;
}

.jg-nav-chevron {
    width: 1em;
    height: 1em;
    vertical-align: -0.125em;
}

/* Narrow block: show fewer thumbnails (data-distance = distance from the current image). */
@container jg-nav (max-width: 41.99rem) {
    .jg-nav-thumbs > li[data-distance="4"] {
        display: none;
    }
}

@container jg-nav (max-width: 31.99rem) {
    .jg-nav-thumbs > li[data-distance="3"] {
        display: none;
    }
}

@container jg-nav (max-width: 21.99rem) {
    .jg-nav-thumbs > li[data-distance="2"] {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .jg-nav-thumb {
        transition: none;
    }

    .jg-nav-thumb:hover,
    .jg-nav-thumb:focus-visible {
        transform: none;
    }
}
