/*
 * NENI - Foto-lightbox
 * Modal-slideshow voor de inhoudsfoto's van een pagina.
 * Kleuren en lettertype komen uit het NENI-designsysteem (var(--na-*)), met
 * fallbacks zodat het ook klopt als die variabelen ooit niet geladen zijn.
 */

/* De aanklikbare foto's op de pagina zelf */
.na-zoomable {
  cursor: zoom-in;
}

/* ---------- Overlay ---------- */

.na-lb {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Dekkend: de gele header is fixed en zou anders door de overlay heen schijnen. */
  background: #141313;
  opacity: 0;
  /* Verbergen doen we met het hidden-attribuut hieronder; opacity verzorgt alleen
     de fade. Géén visibility hier: een element met visibility:hidden kan geen
     focus krijgen, en de sluitknop moet die bij openen juist meteen krijgen. */
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.na-lb[data-open="true"] {
  opacity: 1;
  pointer-events: auto;
}

.na-lb[hidden] {
  display: none;
}

/* ---------- Voortgangsbalk van de automatische slideshow ---------- */

.na-lb__progress {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(248, 243, 233, 0.14);
}

.na-lb__progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--na-yellow, #ffce2e);
}

.na-lb__progress[data-running="true"] span {
  animation: na-lb-progress var(--na-lb-interval, 4000ms) linear forwards;
}

@keyframes na-lb-progress {
  from { width: 0; }
  to   { width: 100%; }
}

/* ---------- Bovenbalk ---------- */

.na-lb__bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 26px;
  pointer-events: none;
}

.na-lb__count {
  font-family: var(--na-font, 'Josefin Sans', sans-serif);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.14em;
  color: rgba(248, 243, 233, 0.72);
  font-variant-numeric: tabular-nums;
}

.na-lb__tools {
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
}

/* ---------- Knoppen ---------- */

.na-lb__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(248, 243, 233, 0.1);
  color: var(--na-cream, #f8f3e9);
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease;
}

.na-lb__btn:hover,
.na-lb__btn:focus-visible {
  background: var(--na-yellow, #ffce2e);
  color: var(--na-ink, #222121);
  outline: none;
}

.na-lb__btn svg {
  width: 19px;
  height: 19px;
}

/* De play-knop wisselt van icoon; het niet-actieve icoon wordt verborgen */
.na-lb__play .na-lb__icon-play {
  display: none;
}

.na-lb[data-playing="false"] .na-lb__play .na-lb__icon-play {
  display: block;
}

.na-lb[data-playing="false"] .na-lb__play .na-lb__icon-pause {
  display: none;
}

/* ---------- Vorige / volgende ---------- */

.na-lb__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(248, 243, 233, 0.1);
  color: var(--na-cream, #f8f3e9);
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease;
}

.na-lb__nav:hover,
.na-lb__nav:focus-visible {
  background: var(--na-yellow, #ffce2e);
  color: var(--na-ink, #222121);
  outline: none;
}

.na-lb__nav svg {
  width: 22px;
  height: 22px;
}

.na-lb__prev {
  left: 26px;
}

.na-lb__next {
  right: 26px;
}

/* Bij één foto is navigeren zinloos */
.na-lb[data-single="true"] .na-lb__nav,
.na-lb[data-single="true"] .na-lb__play,
.na-lb[data-single="true"] .na-lb__progress {
  display: none;
}

/* ---------- Beeld ---------- */

.na-lb__stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin: 0;
  padding: 88px 104px;
  width: 100%;
  height: 100%;
  justify-content: center;
}

.na-lb__img {
  max-width: 100%;
  max-height: calc(100vh - 200px);
  width: auto;
  height: auto;
  object-fit: contain;
  opacity: 1;
  transition: opacity 0.35s ease;
}

.na-lb[data-fading="true"] .na-lb__img {
  opacity: 0;
}

.na-lb__caption {
  max-width: 720px;
  font-family: var(--na-font, 'Josefin Sans', sans-serif);
  font-size: 15px;
  line-height: 1.5;
  text-align: center;
  color: rgba(248, 243, 233, 0.78);
}

.na-lb__caption:empty {
  display: none;
}

/* ---------- Responsive ---------- */

@media (max-width: 1023px) {
  .na-lb__stage {
    padding: 80px 24px;
  }
  .na-lb__nav {
    width: 48px;
    height: 48px;
  }
  .na-lb__prev {
    left: 12px;
  }
  .na-lb__next {
    right: 12px;
  }
}

@media (max-width: 767px) {
  .na-lb__bar {
    padding: 16px 18px;
  }
  .na-lb__stage {
    padding: 74px 16px 96px;
    gap: 16px;
  }
  .na-lb__img {
    max-height: calc(100vh - 190px);
  }
  /* Op smalle schermen staan de pijlen onderin, buiten het beeld */
  .na-lb__nav {
    top: auto;
    bottom: 20px;
    transform: none;
    width: 46px;
    height: 46px;
  }
  .na-lb__prev {
    left: calc(50% - 58px);
  }
  .na-lb__next {
    right: calc(50% - 58px);
  }
  .na-lb__caption {
    font-size: 14px;
  }
}

/* ---------- Bewegingsvoorkeur ---------- */

@media (prefers-reduced-motion: reduce) {
  .na-lb,
  .na-lb__img {
    transition: none;
  }
  .na-lb__progress[data-running="true"] span {
    animation: none;
  }
}
