/* ==========================================================================
   Image Lightbox Modal with Zoom & Pan for Alienrobot Devlog
   ========================================================================== */

/* Cursor hint on clickable blog images */
.article img,
.post-body img {
  cursor: zoom-in;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.article img:hover,
.post-body img:hover {
  border-color: rgba(0, 200, 255, 0.55) !important;
  box-shadow: 0 4px 20px rgba(0, 200, 255, 0.15);
}

/* Lightbox Modal Dialog */
dialog.img-lightbox {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  margin: 0;
  padding: 0;
  border: none;
  background: rgba(6, 8, 12, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: #f0f0f0;
  z-index: 999999;
  display: none;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
}

dialog.img-lightbox[open] {
  display: flex;
}

dialog.img-lightbox::backdrop {
  background: rgba(6, 8, 12, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* Header Toolbar */
.lb-toolbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(180deg, rgba(6, 8, 12, 0.92) 0%, rgba(6, 8, 12, 0) 100%);
  z-index: 100;
  pointer-events: none;
}

.lb-caption {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: #7fdfff;
  letter-spacing: 0.05em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60%;
  pointer-events: auto;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.lb-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  pointer-events: auto;
}

.lb-zoom-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: #94a3b8;
  padding: 0.3rem 0.6rem;
  background: rgba(18, 24, 34, 0.85);
  border: 1px solid rgba(0, 200, 255, 0.25);
  border-radius: 4px;
  min-width: 48px;
  text-align: center;
  pointer-events: none;
}

.lb-btn {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  border: 1px solid rgba(0, 200, 255, 0.3);
  background: rgba(18, 24, 34, 0.85);
  color: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
}

.lb-btn:hover {
  background: #00c8ff;
  color: #04090f;
  border-color: #00c8ff;
  box-shadow: 0 0 12px rgba(0, 200, 255, 0.4);
}

.lb-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.lb-btn.lb-close:hover {
  background: #ff4757;
  border-color: #ff4757;
  color: #fff;
  box-shadow: 0 0 12px rgba(255, 71, 87, 0.5);
}

/* Viewport Area */
.lb-viewport {
  flex: 1;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.lb-viewport.is-dragging {
  cursor: grabbing;
}

/* Image */
.lb-img {
  max-width: 92vw;
  max-height: 86vh;
  object-fit: contain;
  transform-origin: center center;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85);
  border: 1px solid rgba(0, 200, 255, 0.3);
  border-radius: 6px;
  pointer-events: auto;
  will-change: transform;
}

/* Bottom Control Hint */
.lb-hint {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: #94a3b8;
  background: rgba(12, 16, 24, 0.85);
  border: 1px solid rgba(0, 200, 255, 0.22);
  padding: 0.4rem 1rem;
  border-radius: 999px;
  pointer-events: none;
  z-index: 100;
  white-space: nowrap;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
}

@media (max-width: 768px) {
  .lb-hint {
    display: none;
  }
  .lb-caption {
    max-width: 50%;
    font-size: 0.7rem;
  }
}
