/* ==========================================================
   AirScout Lightbox — uniforme site-brede lightbox
   Tokens uit de brandguide, hex enkel als fallback.
   ========================================================== */

.aslb-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(9, 16, 36, 0.90);
  background: color-mix(in srgb, color-mix(in srgb, var(--brand-deep, #16244c) 88%, black 12%) 90%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.aslb-overlay.aslb-open { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .aslb-overlay { transition: none; }
}

/* ── Kern ── */
.aslb-inner {
  width: min(92vw, 1100px);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.aslb-media {
  position: relative;
  max-width: 100%;
  line-height: 0;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
}

/* ── Slide-overgang bij navigeren ── */
.aslb-media > * {
  animation: aslb-slide-in 0.32s cubic-bezier(.25,.7,.4,1);
}
.aslb-media.aslb-dir-prev > * {
  animation-name: aslb-slide-in-rev;
}
@keyframes aslb-slide-in {
  from { opacity: 0; transform: translateX(28px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes aslb-slide-in-rev {
  from { opacity: 0; transform: translateX(-28px); }
  to   { opacity: 1; transform: translateX(0); }
}
@media (prefers-reduced-motion: reduce) {
  .aslb-media > * { animation: none; }
}
.aslb-media img,
.aslb-media video,
.aslb-media iframe {
  display: block;
  max-width: min(92vw, 1100px);
  max-height: 76vh;
  width: auto;
  height: auto;
  border: 0;
}
.aslb-media iframe {
  width: min(92vw, 1100px);
  aspect-ratio: 16 / 9;
  max-height: 76vh;
}
.aslb-media.aslb-pdf iframe {
  width: min(92vw, 900px);
  aspect-ratio: auto;
  height: 82vh;
  max-height: 82vh;
  background: #fff;
}

/* ── Play-overlay bij mp4's in de lightbox: zichtbaar zolang de video
   gepauzeerd staat (o.a. na een geblokkeerde autoplay-poging zonder
   gebruikersklik, bv. via #media=-deeplinks). Verdwijnt automatisch bij
   play, ook als de gebruiker later zelf pauzeert verschijnt hij opnieuw. */
.aslb-video-wrap {
  position: relative;
  display: inline-block;
  line-height: 0;
}
.aslb-play-overlay {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border: 0;
  background: rgba(10, 14, 26, 0.32);
  cursor: pointer;
  padding: 0;
}
.aslb-video-wrap.aslb-paused .aslb-play-overlay {
  display: flex;
}
.aslb-play-overlay::before {
  content: '';
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background-color: rgba(53, 88, 168, 0.85);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 24 24' fill='white'%3E%3Cpolygon points='6 3 20 12 6 21'/%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: background-color 0.15s ease, transform 0.15s ease;
}
.aslb-play-overlay:hover::before {
  background-color: rgba(53, 88, 168, 1);
  transform: translate(-50%, -50%) scale(1.06);
}

/* ── Caption + acties ── */
.aslb-bar {
  position: relative;
  width: 100%;
  max-width: min(92vw, 1100px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  margin-top: 14px;
}
.aslb-caption {
  flex: 1;
  margin: 0;
  padding: 0 54px;
  font-size: 14px;
  line-height: 1.6;
  color: #fff;
  text-align: center;
}
.aslb-caption:empty { display: none; }

.aslb-download {
  position: absolute;
  top: 0;
  right: 0;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s ease;
}
.aslb-download:hover { background: rgba(255, 255, 255, 0.22); }
.aslb-download svg { width: 18px; height: 18px; }

/* ── Sluitknop: vierkant met scherpe afgeronde hoeken ── */
.aslb-close {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 8px;
  background: var(--brand, #3558A8);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
  z-index: 2;
}
.aslb-close:hover {
  background: var(--brand-dark, #2a4787);
  transform: scale(1.05);
}
.aslb-close svg { width: 16px; height: 16px; }

/* ── Teller ── */
.aslb-counter {
  position: fixed;
  top: 30px;
  left: 22px;
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.75);
  z-index: 2;
}

/* ── Navigatie ── */
.aslb-prev,
.aslb-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(53, 88, 168, 0.55);
  background: color-mix(in srgb, var(--brand, #3558A8) 55%, transparent);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s ease;
  z-index: 2;
}
.aslb-prev { left: 18px; }
.aslb-next { right: 18px; }
.aslb-prev:hover,
.aslb-next:hover { background: var(--brand, #3558A8); }
.aslb-prev svg,
.aslb-next svg { width: 22px; height: 22px; }

/* ── Thumbnails (opt-in via data-lb-thumbs) ── */
.aslb-thumbs {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 14px;
  max-width: min(92vw, 1100px);
}
.aslb-thumb {
  width: 56px;
  height: 40px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 6px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  line-height: 0;
}
.aslb-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.aslb-thumb.aslb-active { border-color: rgba(255, 255, 255, 0.85); }

/* ── Spinner ── */
.aslb-spinner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.aslb-spinner::after {
  content: '';
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  animation: aslb-spin 0.8s linear infinite;
}
@keyframes aslb-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .aslb-spinner::after { animation-duration: 2s; }
}

/* ── Body-lock ── */
body.aslb-noscroll { overflow: hidden; }

/* ── Logo (linksonder) ── */
.aslb-logo {
  position: fixed;
  bottom: 20px;
  left: 22px;
  height: 32px;
  width: auto;
  opacity: 0.55;
  z-index: 1;
  pointer-events: none;
  user-select: none;
}

/* ── Mobiel: pijlen weg, swipe neemt over ── */
@media (max-width: 720px) {
  .aslb-prev, .aslb-next { display: none; }
  .aslb-close { top: 12px; right: 12px; }
  .aslb-counter { top: 24px; left: 14px; }
  .aslb-logo { display: none; }
}

/* ── Hover-affordance: loepje bij foto's met lightbox ──
   ÉÉN centrale definitie voor de hele site — geen pagina/template mag dit
   lokaal herbouwen (voorheen dubbel in project.template.php en team/index.php).
   Automatisch op elk [data-lightbox]-element met een directe <img>-kind,
   behalve video-thumbnails (die krijgen een play-badge via [data-badge="video"],
   zie hieronder). Let op: [data-badge] is puur voor de CSS-badge en staat los
   van [data-type], dat het afspeelmechanisme in lightbox.js bepaalt (video vs
   embed) — nooit deze twee door elkaar gebruiken. */
[data-lightbox]:not([data-badge="video"]):has(> img) {
  position: relative;
  cursor: zoom-in;
}
[data-lightbox]:not([data-badge="video"]):has(> img)::after {
  content: '';
  position: absolute;
  inset: 0;
  background-color: rgba(10, 14, 26, 0);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3Cline x1='11' y1='8' x2='11' y2='14'/%3E%3Cline x1='8' y1='11' x2='14' y2='11'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 30px 30px;
  opacity: 0;
  transition: opacity 0.2s ease, background-color 0.2s ease;
  pointer-events: none;
}
[data-lightbox]:not([data-badge="video"]):has(> img):hover::after {
  opacity: 1;
  background-color: rgba(10, 14, 26, 0.28);
}
@media (hover: none) {
  [data-lightbox]:not([data-badge="video"]):has(> img)::after { display: none; }
}

/* ── Play-badge: video-thumbnail met [data-badge="video"] + <img> ──
   Persistent zichtbaar (geen hover nodig) zodat direct duidelijk is dat
   het om een video gaat, i.p.v. het foto-loepje. Geldt voor alle
   videoplatformen (mp4, Vimeo, YouTube) — [data-badge] wordt altijd gezet
   zodra er een video gekoppeld is, ongeacht welk [data-type] de speler
   uiteindelijk gebruikt. */
[data-lightbox][data-badge="video"]:has(> img) {
  position: relative;
  cursor: pointer;
}
[data-lightbox][data-badge="video"]:has(> img)::before {
  content: '';
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.55);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='white'%3E%3Cpolygon points='5 3 19 12 5 21 5 3'/%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
  z-index: 2;
  pointer-events: none;
  transition: background-color 0.15s ease;
}
[data-lightbox][data-badge="video"]:has(> img):hover::before {
  background-color: rgba(53, 88, 168, 0.85);
}

/* ── Gedeelde expand-knop: voor rauwe <video>-elementen zonder
   thumbnail-afbeelding (bv. inline hero-video's). Plaats de omhullende
   wrapper met position:relative, en deze knop erin als sibling van
   <video>. Nooit een lokale kopie hiervan bouwen per pagina/template. ── */
.aslb-expand-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.35);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  color: var(--brand, #3558A8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease;
}
.aslb-expand-btn:hover { background: rgba(255, 255, 255, 0.55); }
.aslb-expand-btn svg { width: 17px; height: 17px; stroke-width: 2.4; }
