/* ---------------------------------------------------------------------------
   NovoGallery — vanilla JS image lightbox with thumbnail strip
   Geen externe dependencies, ~3KB minified
   --------------------------------------------------------------------------- */

/* Container voor klikbare thumbnails (in de pagina zelf) */
.ns-gallery .ns-gallery-item {
    display: inline-block;
}
.ns-gallery .ns-gallery-item img {
    cursor: pointer;
    transition: opacity 0.15s;
}
.ns-gallery .ns-gallery-item:hover img {
    opacity: 0.85;
}

/* ---- Overlay ---- */
.ns-lb {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    flex-direction: column;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0s linear 0.25s;
}
.ns-lb.is-open {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.25s ease, visibility 0s;
}

/* Sluit-knop rechtsboven */
.ns-lb__close {
    position: absolute;
    top: 8px;
    right: 12px;
    width: 44px;
    height: 44px;
    background: transparent;
    border: 0;
    color: #fff;
    font-size: 36px;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    padding: 0;
}
.ns-lb__close:hover,
.ns-lb__close:focus { opacity: 0.7; outline: none; }

/* Stage = klikbare achtergrond, foto er bovenop gecentreerd */
.ns-lb__stage {
    flex: 1 1 auto;
    position: relative;
    overflow: hidden;
    cursor: zoom-out;
    user-select: none;
    min-height: 0;
}

/* Twee gestackte foto-elementen voor crossfade.
   De inactieve laadt de nieuwe foto in de achtergrond; pas als de decode
   klaar is wisselen we welke laag actief is. Voorkomt half-rendering. */
.ns-lb__image {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 92vw;
    max-height: 100%;
    opacity: 0;
    transition: opacity 0.18s ease;
    cursor: grab;
    user-select: none;
    -webkit-user-drag: none;
}
.ns-lb__image.is-active { opacity: 1; }
.ns-lb__image:active    { cursor: grabbing; }

/* Bijschrift onder de foto */
.ns-lb__caption {
    flex: 0 0 auto;
    text-align: center;
    color: #fff;
    padding: 10px 16px 4px;
    font: 14px/1.4 system-ui, -apple-system, sans-serif;
    min-height: 22px;
}
.ns-lb__caption:empty { padding: 0; min-height: 0; }

/* Onderbalk: prev-knop, thumbnails, next-knop */
.ns-lb__controls {
    flex: 0 0 auto;
    display: flex;
    align-items: stretch;
    gap: 8px;
    padding: 8px 12px 14px;
    background: rgba(0, 0, 0, 0.35);
}

.ns-lb__nav {
    flex: 0 0 auto;
    width: 44px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 0;
    border-radius: 4px;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s;
}
.ns-lb__nav:hover,
.ns-lb__nav:focus {
    background: rgba(255, 255, 255, 0.22);
    outline: none;
}

.ns-lb__thumbs {
    flex: 1 1 auto;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.4) transparent;
    align-items: center;
}
.ns-lb__thumbs::-webkit-scrollbar { height: 6px; }
.ns-lb__thumbs::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.4);
    border-radius: 3px;
}

.ns-lb__thumb {
    flex: 0 0 auto;
    width: 80px;
    height: 60px;
    background-size: cover;
    background-position: center;
    background-color: #222;
    border: 2px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.55;
    transition: opacity 0.15s, border-color 0.15s, transform 0.15s;
    padding: 0;
}
.ns-lb__thumb:hover  { opacity: 0.85; }
.ns-lb__thumb:focus  { outline: none; opacity: 0.95; }
.ns-lb__thumb.is-active {
    opacity: 1;
    border-color: #fff;
    transform: scale(1.05);
}

/* Mobiele aanpassingen */
@media (max-width: 600px) {
    .ns-lb__image     { max-width: 100vw; }
    .ns-lb__nav       { width: 36px; font-size: 22px; }
    .ns-lb__thumb     { width: 60px; height: 45px; }
    .ns-lb__close     { font-size: 30px; }
    .ns-lb__caption   { font-size: 13px; padding: 8px 12px 2px; }
    .ns-lb__controls  { padding: 6px 8px 10px; gap: 6px; }
}
