/* ============================================================
   SG Lightbox
   ============================================================ */

/* Cursor-Hinweis auf klickbare Bilder */
.sg-lightbox-trigger {
  cursor: zoom-in;
}

/* Body-Lock wenn Overlay offen */
body.sg-lightbox-active {
  overflow: hidden;
}

/* ── Overlay ── */
#sg-lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0, 0, 0, 0.92);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 24px;
  box-sizing: border-box;
}

#sg-lightbox-overlay.sg-lightbox-open {
  display: flex;
  animation: sg-lb-fadein 0.18s ease;
}

@keyframes sg-lb-fadein {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Bild ── */
#sg-lightbox-img {
  max-width: 100%;
  max-height: calc(100dvh - 100px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  opacity: 0;
  transition: opacity 0.2s ease;
  box-shadow: 0 8px 48px rgba(0, 0, 0, 0.6);
}

#sg-lightbox-img.sg-lightbox-img-loaded {
  opacity: 1;
}

/* ── Caption ── */
#sg-lightbox-caption {
  margin: 12px 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.85rem;
  text-align: center;
  max-width: 640px;
}

/* ── Schließen-Button ── */
#sg-lightbox-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: color-mix(in srgb, var(--accent-color, #ff4499) 22%, transparent);
  color: #fff;
  border: 1px solid color-mix(in srgb, var(--accent-color, #ff4499) 45%, transparent);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
  padding: 0;
}

#sg-lightbox-close:hover,
#sg-lightbox-close:focus {
  background: color-mix(in srgb, var(--accent-color, #ff4499) 55%, transparent);
  outline: none;
}

/* ── Mobil ── */
@media (max-width: 600px) {
  #sg-lightbox-overlay {
    padding: 16px;
  }

  #sg-lightbox-img {
    max-height: calc(100dvh - 80px);
    border-radius: 4px;
  }

  #sg-lightbox-close {
    top: 10px;
    right: 12px;
    width: 36px;
    height: 36px;
    font-size: 20px;
  }
}
