/* ============================================================
   ПЕРЕГЛЯД КАРТИНОК (lightbox.css)
   ------------------------------------------------------------
   Вікно, яке відкриває assets/js/lightbox.js. Підключається лише
   разом зі скриптом - на сторінках, де є картинки .iep-zoom
   (inc/media.php). Тло завжди темне - у світлій і темній темі
   однаково; кнопки - напівпрозорі світлі на темному.
   ============================================================ */

.iep-lb {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: rgba(8, 12, 20, .94);
  color: #f1f5f9;
  opacity: 0;
  transition: opacity .18s ease;
  touch-action: pan-y pinch-zoom;
}
.iep-lb[hidden] { display: none; }
.iep-lb.is-open { opacity: 1; }

.iep-lb__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px 0 18px;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.iep-lb__counter { opacity: .85; }

.iep-lb__stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 8px 64px;
}
.iep-lb__img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .5);
  background: rgba(255, 255, 255, .04);
  user-select: none;
  -webkit-user-drag: none;
}
.iep-lb.is-loading .iep-lb__img { opacity: .35; }

.iep-lb__caption {
  margin: 0;
  padding: 8px 18px 16px;
  text-align: center;
  font-size: 14.5px;
  line-height: 1.45;
  color: #e2e8f0;
  max-height: 22vh;
  overflow-y: auto;
}
.iep-lb__caption:empty { padding-bottom: 8px; }

.iep-lb__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  cursor: pointer;
  transition: background .15s ease;
}
.iep-lb__btn:hover { background: rgba(255, 255, 255, .26); }
.iep-lb__btn:focus-visible { outline: 3px solid #93c5fd; outline-offset: 2px; }
.iep-lb__btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

.iep-lb__prev,
.iep-lb__next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}
.iep-lb__prev { left: 10px; }
.iep-lb__next { right: 10px; }
.iep-lb__prev[hidden],
.iep-lb__next[hidden] { display: none; }

@media (max-width: 600px) {
  .iep-lb__stage { padding: 4px 0; }
  .iep-lb__prev,
  .iep-lb__next { top: auto; bottom: 8px; transform: none; background: rgba(0, 0, 0, .55); }
  .iep-lb__img { border-radius: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .iep-lb { transition: none; }
}
