/* =========================================================
   Lightbox: foto's vergroot bekijken (over-de-auteur galerijen)
   ========================================================= */

.lightbox-trigger {
  cursor: zoom-in;
  display: block;
  padding: 0;
  margin: 0;
  border: none;
  background: none;
  line-height: 0;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg) var(--space-md);
}

.lightbox[hidden] {
  display: none;
}

.lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 20, 16, 0.86);
  backdrop-filter: blur(2px);
  animation: lightbox-backdrop-in 220ms ease both;
}

.lightbox__dialog {
  position: relative;
  z-index: 1;
  max-width: min(92vw, 1000px);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: lightbox-dialog-in 260ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.lightbox__image {
  display: block;
  max-width: 100%;
  max-height: 76vh;
  width: auto;
  height: auto;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  background: #fff;
}

.lightbox__caption {
  margin-top: var(--space-sm);
  color: #fffdf6;
  font-size: var(--fs-small);
  text-align: center;
  max-width: 60ch;
}

.lightbox__caption[hidden] {
  display: none;
}

.lightbox__close {
  position: absolute;
  top: -16px;
  right: -16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-surface);
  color: var(--color-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-base), background var(--transition-base), color var(--transition-base);
  z-index: 2;
}

.lightbox__close:hover {
  transform: scale(1.08);
  background: var(--color-primary);
  color: var(--color-surface);
}

.lightbox__close svg {
  width: 18px;
  height: 18px;
}

.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 253, 246, 0.92);
  color: var(--color-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-base), background var(--transition-base);
}

.lightbox__nav:hover {
  background: var(--color-surface);
  transform: translateY(-50%) scale(1.08);
}

.lightbox__nav--prev {
  left: -16px;
}

.lightbox__nav--next {
  right: -16px;
}

.lightbox__nav svg {
  width: 20px;
  height: 20px;
}

.lightbox__nav[hidden] {
  display: none;
}

@keyframes lightbox-backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes lightbox-dialog-in {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@media (max-width: 640px) {
  .lightbox {
    padding: var(--space-md) var(--space-sm);
  }

  .lightbox__close {
    top: -8px;
    right: -8px;
  }

  .lightbox__nav--prev {
    left: -8px;
  }

  .lightbox__nav--next {
    right: -8px;
  }
}
