.na-image-preview-gallery {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    max-width: 100%;
}

.na-image-preview-gallery-right {
    flex-direction: row;
}

.na-image-preview-gallery-bottom {
    flex-direction: column;
}

.na-image-preview-gallery-main {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    max-width: 100%;
}

.na-image-preview-gallery-main img {
    display: block;
    width: 100%;
    max-width: 100%;
}

.na-image-preview-gallery-thumbnails {
    display: flex;
    flex: 0 0 auto;
    width: 100%;
    max-width: 100%;
    gap: 8px;
    padding: 8px;
    overflow: auto;
}

.na-image-preview-gallery-right .na-image-preview-gallery-thumbnails {
    flex-direction: column;
    width: auto;
    max-height: 100%;
}

.na-image-preview-gallery-bottom .na-image-preview-gallery-thumbnails {
    flex-direction: row;
}

.na-image-preview-gallery-thumb {
    flex: 0 0 auto;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 6px;
    background: transparent;
    overflow: hidden;
    cursor: pointer;
    opacity: 0.72;
}

.na-image-preview-gallery-thumb:hover,
.na-image-preview-gallery-thumb.active {
    opacity: 1;
    border-color: var(--bs-primary, #0d6efd);
}

.na-image-preview-gallery-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
}
/* Compact controls (ImagePreviewGalleryWidget.CompactControls): arrows at the sides, a counter and a
   full-screen button in the corner, all over the picture and all small. Icons are the app's own svgs
   as masks, so they take the button's colour. */
.na-image-preview-gallery-nav,
.na-image-preview-gallery-fullscreen {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, .82);
    color: rgba(33, 38, 49, .75);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .12);
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease, opacity .15s ease;
}

.na-image-preview-gallery-nav:hover,
.na-image-preview-gallery-fullscreen:hover {
    background: #fff;
    color: rgba(33, 38, 49, 1);
}

.na-image-preview-gallery-nav {
    position: absolute;
    top: 50%;
    z-index: 3;
    width: 2rem;
    height: 2rem;
    transform: translateY(-50%);
    opacity: .7;
}

.na-image-preview-gallery-main:hover .na-image-preview-gallery-nav {
    opacity: 1;
}

.na-image-preview-gallery-nav-prev {
    left: .6rem;
}

.na-image-preview-gallery-nav-next {
    right: .6rem;
}

.na-image-preview-gallery-controls {
    position: absolute;
    right: .75rem;
    bottom: .75rem;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: .75rem;
}

.na-image-preview-gallery-counter {
    font-size: .8125rem;
    font-variant-numeric: tabular-nums;
    color: rgba(33, 38, 49, .62);
    text-shadow: 0 0 6px rgba(255, 255, 255, .9);
}

.na-image-preview-gallery-fullscreen {
    width: 1.75rem;
    height: 1.75rem;
    background: transparent;
    box-shadow: none;
}

.na-image-preview-gallery-glyph {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    background-color: currentColor;
    -webkit-mask: var(--na-gallery-icon-url) center / contain no-repeat;
    mask: var(--na-gallery-icon-url) center / contain no-repeat;
}
