/* =========================================================
   LKC Divi Lightbox
   Für Divi 5 Module, Bildlinks, Buttons, Icon-Listen etc.

   Nutzung:
   - CSS-Klasse am Divi-Modul:
     lkc-lightbox-img

   - Standard:
     Im Divi-Linkfeld direkte Bild-URL eintragen

   - Divi-5-Fallback:
     Benutzerdefiniertes Attribut setzen:
     data-lkc-lightbox-url="https://domain.de/bild.jpg"
   ========================================================= */


/* Klickbares Element: Hand-Cursor */
.lkc-lightbox-img,
.lkc-lightbox-img *,
.lkc-lightbox-img.et_clickable,
.lkc-lightbox-img.et_clickable * {
  cursor: pointer !important;
}


/* Overlay / Hintergrund */
.lkc-lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background: rgba(0, 0, 0, 0);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  cursor: pointer;
  transition:
    opacity 500ms ease,
    background-color 500ms ease,
    visibility 0s linear 500ms;
}

.lkc-lightbox-overlay.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  background: rgba(0, 0, 0, 0.84);
  transition:
    opacity 500ms ease,
    background-color 500ms ease,
    visibility 0s linear 0s;
}


/* Innerer Lightbox-Container */
.lkc-lightbox-inner {
  position: relative;
  max-width: min(1100px, 92vw);
  max-height: 88vh;
  cursor: default;
  opacity: 1;
  transform: none;
}


/* Während der Zoom-Animation wird das echte Lightbox-Bild versteckt */
.lkc-lightbox-overlay.is-zooming .lkc-lightbox-inner {
  visibility: hidden;
}


/* Finales Lightbox-Bild */
.lkc-lightbox-overlay img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 88vh;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
}


/* Animiertes Kopierbild während des Zoom-Effekts */
.lkc-lightbox-zoom-image {
  position: fixed;
  z-index: 1000000;
  object-fit: contain;
  border-radius: 4px;
  pointer-events: none;
  background: #fff;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
  will-change: left, top, width, height, opacity;
  transition:
    left 500ms cubic-bezier(0.22, 1, 0.36, 1),
    top 500ms cubic-bezier(0.22, 1, 0.36, 1),
    width 500ms cubic-bezier(0.22, 1, 0.36, 1),
    height 500ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 180ms ease;
}


/* Schließen-Button */
.lkc-lightbox-close {
  position: absolute;
  top: -18px;
  right: -18px;
  z-index: 2;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #003271;
  color: #fff;
  font-size: 28px;
  font-weight: 400;
  line-height: 42px;
  text-align: center;
  cursor: pointer !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.lkc-lightbox-close:hover,
.lkc-lightbox-close:focus {
  background: #004699;
  outline: none;
}


/* Bildunterschrift */
.lkc-lightbox-caption {
  margin-top: 10px;
  color: #fff;
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
}


/* Mobile Optimierung */
@media (max-width: 767px) {
  .lkc-lightbox-overlay {
    padding: 24px 14px;
  }

  .lkc-lightbox-inner {
    max-width: 94vw;
  }

  .lkc-lightbox-close {
    top: -14px;
    right: -10px;
    width: 38px;
    height: 38px;
    font-size: 26px;
    line-height: 38px;
  }
}