/* ============================================================
   LIGHTBOX v2 — Unified Image Viewer
   Shared across all portfolio pages
   Design principle: controls are subtle by default,
   highlight only on hover. Image is the sole focus.
   ============================================================ */

/* --- Overlay --- */
.lb-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--bg, #080c14);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}
.lb-overlay.active { display: flex; }

/* --- Controls: shared hidden-then-reveal behavior --- */
.lb-controls-visible .lb-btn,
.lb-controls-visible .lb-dots,
.lb-controls-visible .lb-info,
.lb-controls-visible .lb-hint,
.lb-controls-visible .lb-tabs {
  opacity: 1;
  pointer-events: auto;
}
.lb-btn, .lb-dots, .lb-info, .lb-hint, .lb-tabs {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.lb-overlay:hover .lb-btn,
.lb-overlay:hover .lb-dots,
.lb-overlay:hover .lb-info,
.lb-overlay:hover .lb-hint,
.lb-overlay:hover .lb-tabs {
  opacity: 1;
  pointer-events: auto;
}

/* --- Close button --- */
.lb-close {
  position: fixed;
  top: 80px;
  right: 28px;
  background: none;
  border: none;
  color: var(--muted, #6b7d9a);
  font-size: 1.5rem;
  font-weight: 400;
  cursor: pointer;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10002;
  transition: color 0.2s, transform 0.2s, text-shadow 0.2s;
  line-height: 1;
  border-radius: 50%;
}
.lb-close:hover {
  color: var(--accent, #00e5ff);
  transform: scale(1.15);
  text-shadow: 0 0 12px var(--accent-glow, rgba(0,229,255,0.4));
}

/* --- Navigation arrows --- */
.lb-arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--muted, #6b7d9a);
  font-size: 1.4rem;
  cursor: pointer;
  width: 48px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  transition: color 0.2s, text-shadow 0.2s, transform 0.2s;
  border-radius: var(--radius, 6px);
  line-height: 1;
}
.lb-arrow.lb-prev { left: 20px; }
.lb-arrow.lb-next { right: 20px; }
.lb-arrow:hover {
  color: var(--accent, #00e5ff);
  text-shadow: 0 0 12px var(--accent-glow, rgba(0,229,255,0.4));
  transform: translateY(-50%) scale(1.12);
}

/* --- Image stage --- */
.lb-stage {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.lb-img-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  padding: 120px 80px 100px;
}
.lb-img-wrap.grabbing { cursor: grabbing; }
.lb-img-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  transition: none;
  will-change: transform;
  border-radius: 4px;
}

/* --- Bottom info bar (title + counter) --- */
.lb-info {
  position: fixed;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  font-family: var(--font-mono, 'JetBrainsMono', monospace);
  font-size: 0.72rem;
  color: var(--muted, #6b7d9a);
  z-index: 10001;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.lb-counter { color: var(--accent, #00e5ff); margin-left: 0.6rem; }
.lb-title { color: var(--ink2, #c8d2e0); }

/* --- Dots (page indicators) --- */
.lb-dots {
  position: fixed;
  bottom: 64px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 70vw;
  z-index: 10001;
}
.lb-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--rule, #1e3050);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  flex-shrink: 0;
}
.lb-dot.active { background: var(--accent, #00e5ff); transform: scale(1.3); }
.lb-dot:hover { background: var(--accent2, #f0a030); }

/* --- Year/Group tabs (optional, for multi-group viewers like MC gallery) --- */
.lb-tabs {
  position: fixed;
  top: 88px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.4rem;
  z-index: 10001;
  flex-wrap: wrap;
  justify-content: center;
  max-width: calc(100vw - 180px);
}
.lb-tab {
  font-family: var(--font-mono, 'JetBrainsMono', monospace);
  font-size: 0.62rem;
  color: var(--muted, #6b7d9a);
  background: none;
  border: none;
  padding: 0.3rem 0.7rem;
  cursor: pointer;
  transition: color 0.2s, text-shadow 0.2s;
  letter-spacing: 0.06em;
  border-radius: 3px;
}
.lb-tab:hover { color: var(--ink, #dfe6f0); }
.lb-tab.active {
  color: var(--accent, #00e5ff);
  text-shadow: 0 0 8px var(--accent-glow, rgba(0,229,255,0.3));
}

/* --- Zoom hint (fades out) --- */
.lb-hint {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono, 'JetBrainsMono', monospace);
  font-size: 0.58rem;
  color: var(--muted, #6b7d9a);
  opacity: 0.5;
  z-index: 10001;
  letter-spacing: 0.06em;
  pointer-events: none;
  white-space: nowrap;
}
.lb-hint.fade-out { opacity: 0; transition: opacity 0.8s ease 1s; }

/* --- Body scroll lock --- */
body.lb-open { overflow: hidden; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .lb-close { top: 72px; right: 16px; width: 40px; height: 40px; font-size: 1.3rem; }
  .lb-arrow { width: 40px; height: 60px; font-size: 1.1rem; }
  .lb-arrow.lb-prev { left: 8px; }
  .lb-arrow.lb-next { right: 8px; }
  .lb-img-wrap { padding: 110px 56px 90px; }
  .lb-tabs { top: 80px; }
}
@media (max-width: 600px) {
  .lb-close { top: 64px; right: 10px; width: 36px; height: 36px; font-size: 1.15rem; }
  .lb-arrow { width: 32px; height: 52px; font-size: 0.95rem; }
  .lb-arrow.lb-prev { left: 4px; }
  .lb-arrow.lb-next { right: 4px; }
  .lb-img-wrap { padding: 100px 40px 80px; }
  .lb-info { font-size: 0.65rem; bottom: 28px; }
  .lb-dots { bottom: 56px; gap: 5px; }
  .lb-dot { width: 4px; height: 4px; }
  .lb-hint { display: none; }
  .lb-tabs { top: 72px; max-width: calc(100vw - 100px); }
  .lb-tab { font-size: 0.58rem; padding: 0.25rem 0.5rem; }
}
