/* ===============================
   PZ Gallery (Grid + Masonry)
   =============================== */

.pz-gallery {
  display: grid;
  gap: 16px;
}

/* Grid template */
.pz-gallery--grid {
  grid-template-columns: repeat(var(--pz-cols-mobile), minmax(0,1fr));
}

@media (min-width: 992px) {
  .pz-gallery--grid {
    grid-template-columns: repeat(var(--pz-cols-desktop), minmax(0,1fr));
  }
}

/* Masonry template (CSS columns) */
.pz-gallery--masonry {
  display: block;
  column-count: var(--pz-cols-mobile);
  column-gap: 16px;
}

@media (min-width: 992px) {
  .pz-gallery--masonry {
    column-count: var(--pz-cols-desktop);
  }
}

.pz-gallery--masonry .pz-gallery__item {
  display: inline-block;
  width: 100%;
  margin: 0 0 16px;
  break-inside: avoid;
}

/* Item with fixed ratio */
.pz-gallery__item {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  display: block;
  background: #f6f6f6;
  transition: transform .2s ease;
}

.pz-gallery__item::before {
  content: "";
  display: block;
  padding-bottom: var(--pz-thumb-ratio, 100%);
}

.pz-gallery__item img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: scale(1);
  transition: transform .25s ease;
}

/* Hover zoom */
@media (hover:hover) {
  .pz-gallery__item:hover img {
    transform: scale(var(--pz-hover-scale));
  }
}

/* ===============================
   Lightbox overlay
   =============================== */

.pz-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10,10,10,.92);
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  --pz-lightbox-ratio: 75%;
}

.pz-lightbox.is-open {
  display: flex;
}

.pz-lightbox__stage {
  position: relative;
  width: min(1100px, 92vw);
  max-width: 100%;
}

/* Рамка с фиксированным соотношением сторон */
.pz-lightbox__frame {
  position: relative;
  width: 100%;
  height: 80vh;           /* максимум 80% высоты экрана под картинку */
  max-height: 80vh;
  overflow: hidden;
}

.pz-lightbox__frame::before {
  content: "";
  display: none;          /* отключаем "растягивающую" заглушку */
}

.pz-lightbox__img {
  position: absolute;
  inset: 0;
  margin: auto;
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.pz-lightbox__close,
.pz-lightbox__prev,
.pz-lightbox__next {
  position: absolute;
  border: 0;
  background: rgba(255,255,255,.08);
  color: #fff;
  padding: 5px 12px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s ease;
  z-index: 5;
}

.pz-lightbox__close:hover,
.pz-lightbox__prev:hover,
.pz-lightbox__next:hover {
  background: rgba(255,255,255,.18);
}

.pz-lightbox__close {
  top: 16px;
  right: 16px;
  font-size: 22px;
  line-height: 1;
}

.pz-lightbox__prev,
.pz-lightbox__next {
  top: 50%;
  transform: translateY(-50%);
  font-size: 26px;
  line-height: 1;
}

.pz-lightbox__prev { left: 16px; }
.pz-lightbox__next { right: 16px; }

/* Подписи */
.pz-lightbox__meta {
  margin-top: 12px;
  color: #eaeaea;
  text-align: center;
  max-width: min(1100px, 92vw);
  display: none;            /* скрываем заголовок и подпись */
}

.pz-lightbox__title {
  font-weight: 600;
  margin-bottom: 4px;
}

.pz-lightbox__caption {
  opacity: .85;
  font-size: 14px;
}

/* На мобиле стрелки чуть крупнее и удобнее */
@media (max-width: 991.98px) {
  .pz-lightbox__prev,
  .pz-lightbox__next {
    padding: 14px 16px;
  }
}
