/**
 * HoloLayerGallery – Stylesheet
 * Lightbox · Container · UI-Elemente
 */

/* =====================================================================
   CONTAINER
===================================================================== */
.hlg-container {
  position: relative;
  width: 100%;
  overflow: hidden;
  display: block;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  border-radius: 4px;
  /* Dezente Außen-Glow-Reflexion */
  box-shadow:
    0 0 0 1px rgba(61, 127, 255, 0.08),
    0 8px 48px rgba(0, 0, 0, 0.55),
    0 0 80px rgba(13, 43, 94, 0.18) inset;
}

.hlg-container:active {
  cursor: grabbing;
}

.hlg-container canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  outline: none;
}

/* =====================================================================
   EDITOR-PLACEHOLDER
===================================================================== */
.hlg-editor-placeholder {
  box-sizing: border-box;
}

/* =====================================================================
   LIGHTBOX – OVERLAY
===================================================================== */
.hlg-lightbox {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--hlg-lb-bg, rgba(1, 8, 18, 0.96));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0.38s;

  /* Glassmorphism-Hintergrund-Blur */
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
}

.hlg-lightbox::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 50% 0%,   rgba(30, 80, 200, 0.12) 0%, transparent 70%),
    radial-gradient(ellipse 50% 40% at 80% 100%,  rgba(0, 150, 255, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hlg-lightbox--open {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

/* =====================================================================
   LIGHTBOX – BILD
===================================================================== */
.hlg-lb-img {
  display: block;
  max-width: min(90vw, 1200px);
  max-height: 80vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  box-shadow:
    0 0 0 1px rgba(77, 140, 255, 0.20),
    0 0 40px rgba(20, 60, 160, 0.50),
    0 30px 80px rgba(0, 0, 0, 0.70);
  transform: scale(0.88) translateY(18px);
  transition:
    transform 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    opacity   0.38s ease;
  opacity: 0;
  position: relative;
  z-index: 2;
}

.hlg-lightbox--open .hlg-lb-img {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* =====================================================================
   LIGHTBOX – SCHLIESSEN-BUTTON
===================================================================== */
.hlg-lb-close {
  position: absolute;
  top: 22px;
  right: 26px;
  z-index: 10;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(77, 140, 255, 0.30);
  border-radius: 50%;
  background: rgba(10, 25, 60, 0.70);
  color: #a0c0ff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background   0.22s,
    border-color 0.22s,
    color        0.22s,
    transform    0.22s;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transform: scale(0.9);
  opacity: 0;
}

.hlg-lightbox--open .hlg-lb-close {
  transform: scale(1);
  opacity: 1;
  transition-delay: 0.15s;
}

.hlg-lb-close:hover {
  background: rgba(30, 70, 180, 0.80);
  border-color: rgba(77, 140, 255, 0.65);
  color: #ffffff;
  transform: scale(1.08) rotate(90deg);
}

.hlg-lb-close:focus-visible {
  outline: 2px solid #4d8cff;
  outline-offset: 3px;
}

/* =====================================================================
   LIGHTBOX – NAVIGATIONS-BUTTONS
===================================================================== */
.hlg-lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 52px;
  height: 52px;
  border: 1px solid rgba(77, 140, 255, 0.25);
  border-radius: 50%;
  background: rgba(10, 25, 60, 0.65);
  color: #7eb3ff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background   0.20s,
    border-color 0.20s,
    color        0.20s,
    transform    0.20s;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.hlg-lb-prev { left:  20px; }
.hlg-lb-next { right: 20px; }

.hlg-lb-nav:hover {
  background: rgba(25, 65, 170, 0.80);
  border-color: rgba(77, 140, 255, 0.60);
  color: #ffffff;
}

.hlg-lb-prev:hover { transform: translateY(-50%) scale(1.08) translateX(-2px); }
.hlg-lb-next:hover { transform: translateY(-50%) scale(1.08) translateX( 2px); }

.hlg-lb-nav:focus-visible {
  outline: 2px solid #4d8cff;
  outline-offset: 3px;
}

/* =====================================================================
   LIGHTBOX – CAPTION
===================================================================== */
.hlg-lb-caption {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(160, 192, 255, 0.75);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 13px;
  letter-spacing: 0.04em;
  white-space: nowrap;
  max-width: 80vw;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  transition: opacity 0.30s ease 0.25s;
  z-index: 5;
}

.hlg-lightbox--open .hlg-lb-caption {
  opacity: 1;
}

/* =====================================================================
   LOADING-INDIKATOR (wird von JS dynamisch hinzugefügt)
===================================================================== */
.hlg-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  pointer-events: none;
  z-index: 5;
}

.hlg-loading::after {
  content: '';
  width: 36px;
  height: 36px;
  border: 2px solid rgba(77, 140, 255, 0.20);
  border-top-color: #4d8cff;
  border-radius: 50%;
  animation: hlg-spin 0.8s linear infinite;
}

@keyframes hlg-spin {
  to { transform: rotate(360deg); }
}

/* =====================================================================
   RESPONSIVE
===================================================================== */
@media (max-width: 768px) {
  .hlg-lb-close {
    top: 14px;
    right: 14px;
    width: 40px;
    height: 40px;
    font-size: 16px;
  }

  .hlg-lb-nav {
    width: 44px;
    height: 44px;
    font-size: 24px;
  }

  .hlg-lb-prev { left:  10px; }
  .hlg-lb-next { right: 10px; }

  .hlg-lb-img {
    max-width: 95vw;
    max-height: 75vh;
  }

  .hlg-lb-caption {
    bottom: 16px;
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .hlg-lb-nav {
    display: none;
  }
}

/* =====================================================================
   FOKUS-HIGHLIGHTS (Accessibility)
===================================================================== */
.hlg-container:focus-visible {
  outline: 2px solid #4d8cff;
  outline-offset: 2px;
}

/* =====================================================================
   PRINT
===================================================================== */
@media print {
  .hlg-container,
  .hlg-lightbox {
    display: none !important;
  }
}
