/* ==========================================================================
   ClusterNZS Universal Interactive Image Zoom Lightbox
   High-performance, cinematic, accessible fullscreen viewer
   ========================================================================== */

/* Zoomable Trigger Container */
.zoomable-frame {
  position: relative;
  cursor: zoom-in;
  overflow: hidden;
  border-radius: var(--radius, 16px);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s ease, border-color 0.35s ease;
}

.zoomable-frame:hover {
  transform: translateY(-4px) scale(1.008);
  box-shadow: 0 20px 48px -12px rgba(6, 68, 105, 0.28), 0 0 0 1px rgba(16, 185, 129, 0.4);
}

[data-theme="dark"] .zoomable-frame:hover {
  box-shadow: 0 20px 48px -12px rgba(0, 0, 0, 0.6), 0 0 24px rgba(34, 229, 255, 0.25), 0 0 0 1px rgba(34, 229, 255, 0.45);
}

/* Hover Zoom Pill */
.zoomable-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(6, 68, 105, 0.15) 0%, rgba(0, 0, 0, 0.45) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 5;
}

.zoom-hint-badge {
  position: absolute;
  bottom: 16px;
  right: 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(5, 15, 30, 0.82);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
  font-family: var(--font-display, inherit);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  z-index: 6;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.zoom-hint-badge svg {
  width: 14px;
  height: 14px;
  stroke: #22E5FF;
  fill: none;
  stroke-width: 2.2;
}

.zoomable-frame:hover::after {
  opacity: 1;
}

.zoomable-frame:hover .zoom-hint-badge {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   Fullscreen Lightbox Overlay & Stage
   ========================================================================== */
.lightbox-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 12, 24, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.32s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.32s;
  padding: 24px;
  box-sizing: border-box;
}

.lightbox-modal.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Top Navigation Bar */
.lightbox-header {
  position: absolute;
  top: 18px;
  left: 24px;
  right: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 10;
  pointer-events: none;
}

.lightbox-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: auto;
}

.lightbox-counter {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #22E5FF;
  font-size: 0.78rem;
  font-weight: 700;
  font-family: monospace;
}

.lightbox-title {
  color: #FFFFFF;
  font-family: var(--font-display, inherit);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.lightbox-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
}

.lightbox-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.22s ease;
  backdrop-filter: blur(10px);
}

.lightbox-btn:hover {
  background: rgba(34, 229, 255, 0.22);
  border-color: #22E5FF;
  color: #22E5FF;
  transform: scale(1.08);
}

.lightbox-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Image Stage Container */
.lightbox-viewport {
  position: relative;
  max-width: 92vw;
  max-height: 86vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  border-radius: 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(34, 229, 255, 0.4) transparent;
}

.lightbox-img-wrapper {
  position: relative;
  display: inline-block;
  transform-origin: center center;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.lightbox-img {
  display: block;
  max-width: 90vw;
  max-height: 82vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 28px 80px -16px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.15);
  user-select: none;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

/* Zoom state */
.lightbox-modal.is-zoomed .lightbox-img-wrapper {
  transform: scale(1.5);
  cursor: grab;
}

.lightbox-modal.is-zoomed .lightbox-img-wrapper:active {
  cursor: grabbing;
}

/* Prev / Next Chevrons */
.lightbox-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(10, 25, 45, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s ease;
  backdrop-filter: blur(12px);
  z-index: 10;
}

.lightbox-nav-btn:hover {
  background: rgba(34, 229, 255, 0.25);
  border-color: #22E5FF;
  color: #22E5FF;
  transform: translateY(-50%) scale(1.1);
}

.lightbox-nav-prev { left: 24px; }
.lightbox-nav-next { right: 24px; }

.lightbox-nav-btn svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.2;
}

/* Caption bar */
.lightbox-footer {
  position: absolute;
  bottom: 18px;
  left: 24px;
  right: 24px;
  text-align: center;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
  pointer-events: none;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
}

/* Responsive tweaks */
@media (max-width: 768px) {
  .lightbox-modal { padding: 12px; }
  .lightbox-nav-btn { width: 40px; height: 40px; }
  .lightbox-nav-prev { left: 8px; }
  .lightbox-nav-next { right: 8px; }
  .lightbox-title { font-size: 0.88rem; max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
