/* ============================================================
   _lightbox.css — публичный лайтбокс: оверлей, картинка с zoom+pan,
   prev/next-навигация, тулбар зума, caption, кнопка закрыть.
   Логика в static/js/site_lightbox.js. Разметка — partials/_lightbox.html.

   ⚠️ Дублирует функциональность static/css/lightbox.css (кабинет).
   Унификация — см. plan_lightbox_unification.md.

   Зависит от _base.css (нет конкретных переменных, использует rgba).
   ============================================================ */

.lightbox {
  position: fixed; inset: 0; z-index: 2000;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease;
}
.lightbox.open { opacity: 1; pointer-events: all; }

.lb-backdrop {
  position: absolute; inset: 0;
  background: rgba(10,6,3,0.96);
  backdrop-filter: blur(8px);
}

.lb-stage {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}

.lb-img-wrap {
  transform-origin: center center;
  will-change: transform;
  display: flex; align-items: center; justify-content: center;
}
.lb-img-wrap img {
  display: block;
  border-radius: 10px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.8), 0 0 0 1px rgba(255,255,255,0.05);
  user-select: none; pointer-events: none;
}
/* Мобильный: CSS вписывает картинку, зум поверх */
@media (max-width: 768px) {
  .lb-img-wrap img {
    max-width: 100vw;
    max-height: calc(100vh - 130px);
    width: auto; height: auto;
    object-fit: contain;
  }
}

.lb-nav {
  position: fixed; top: 50%; transform: translateY(-50%);
  z-index: 10;
  width: 52px; height: 52px; border-radius: 50%;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.13);
  color: #fff; font-size: 20px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.18s, transform 0.18s;
}
.lb-nav:hover { background: rgba(255,255,255,0.15); }
.lb-prev { left: 20px; }
.lb-next { right: 20px; }

.lb-toolbar {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
  z-index: 10;
  display: flex; align-items: center; gap: 6px;
  background: rgba(28,18,10,0.8);
  border: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(12px);
  border-radius: 99px; padding: 8px 16px;
}
.lb-btn {
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff; font-size: 18px; font-weight: 600;
  cursor: pointer; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.lb-btn:hover { background: rgba(255,255,255,0.16); }
.lb-zoom-label {
  font-size: 13px; font-weight: 600; color: rgba(255,255,255,0.7);
  min-width: 36px; text-align: center; font-variant-numeric: tabular-nums;
}
.lb-sep { width: 1px; height: 20px; background: rgba(255,255,255,0.12); margin: 0 4px; }

.lb-caption {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
  z-index: 10;
  font-size: 13px; font-weight: 500; letter-spacing: 0.04em;
  color: rgba(255,255,255,0.45);
  white-space: nowrap;
}

.lb-close {
  position: fixed; top: 20px; right: 24px; z-index: 10;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.13);
  color: #fff; font-size: 18px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.18s;
}
.lb-close:hover { background: rgba(255,255,255,0.18); }

.lb-hint {
  position: fixed; top: 24px; left: 50%; transform: translateX(-50%);
  z-index: 10;
  font-size: 12px; font-weight: 500; color: rgba(255,255,255,0.4);
  background: rgba(28,18,10,0.7); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 7px 18px; border-radius: 99px;
  pointer-events: none; white-space: nowrap;
  transition: opacity 0.5s;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .lb-prev { left: 8px; }
  .lb-next { right: 8px; }
}

@media (max-width: 640px) {
  .lb-hint { display: none; }
  .lb-toolbar { padding: 6px 10px; gap: 4px; bottom: 16px; }
  .lb-btn { width: 30px; height: 30px; font-size: 16px; }
  .lb-zoom-label { font-size: 12px; min-width: 30px; }
  .lb-nav { width: 40px; height: 40px; font-size: 16px; }
  .lb-prev { left: 4px; }
  .lb-next { right: 4px; }
  .lb-img-wrap img { border-radius: 6px; }
}
