/*!
 * gallery.css — сетки картинок (вставляются из редактора админки через кнопку
 * «Галерея» в RichTextEditor). Inline-style на .img-gallery задаёт grid-layout,
 * этот файл — только hover-эффекты, zoom-кнопка и лайтбокс.
 */

/* Hover: scale картинки */
.img-gallery .img-gallery-item img {
  transition: transform .25s ease;
}
.img-gallery .img-gallery-item:hover img {
  transform: scale(1.05);
}

/* «+» в центре при наведении */
.img-gallery .img-gallery-zoom {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(.8);
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, .65);
  color: #fff;
  border-radius: 50%;
  font-size: 28px; font-weight: 300;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}
.img-gallery .img-gallery-item:hover .img-gallery-zoom {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* Lightbox overlay */
.lightbox-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, .92);
  z-index: 99999;
  display: none;
  align-items: center; justify-content: center;
  padding: 24px;
  animation: lbFadeIn .2s ease;
}
.lightbox-overlay.is-open {
  display: flex;
}
@keyframes lbFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.lightbox-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  box-shadow: 0 8px 40px rgba(0, 0, 0, .5);
  user-select: none;
}
.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  border: 0;
  cursor: pointer;
  border-radius: 50%;
  width: 44px; height: 44px;
  font-size: 24px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s ease;
}
.lightbox-close { top: 16px; right: 16px; font-size: 28px; }
.lightbox-prev  { left: 16px;  top: 50%; transform: translateY(-50%); }
.lightbox-next  { right: 16px; top: 50%; transform: translateY(-50%); }
.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(255, 255, 255, .25);
}
.lightbox-counter {
  position: absolute;
  bottom: 20px; left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, .7);
  font-size: 13px;
  background: rgba(0, 0, 0, .4);
  padding: 4px 12px;
  border-radius: 12px;
}

/* Мобильный адаптив — лайтбокс */
@media (max-width: 600px) {
  .lightbox-overlay { padding: 12px; }
  .lightbox-prev, .lightbox-next { width: 36px; height: 36px; }
}
/* Галерея с фиксированным размером миниатюр (data-thumb) — НЕ растягиваем
   на мобильных, оставляем как задал маркетолог (20-80px). Если data-thumb нет
   (старые галереи с repeat(N, 1fr)) — на мобильных оставляем горизонтальный
   скролл вместо принудительной 2-колоночной верстки, чтобы не ломать дизайн. */
