/* SN Gallery Lite v2 — базовые переменные */
.sn2-gallery-wrap{
  margin: 12px 0;
}

.sn-gallery-lite{
  display: grid;
  gap: var(--sn2-gap, 10px);
  margin: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

/* Колонки управляются классом */
.sn-gallery-lite.sn-gallery-cols-1{ grid-template-columns: repeat(1, minmax(0, 1fr)); }
.sn-gallery-lite.sn-gallery-cols-2{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sn-gallery-lite.sn-gallery-cols-3{ grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sn-gallery-lite.sn-gallery-cols-4{ grid-template-columns: repeat(4, minmax(0, 1fr)); }
.sn-gallery-lite.sn-gallery-cols-5{ grid-template-columns: repeat(5, minmax(0, 1fr)); }
.sn-gallery-lite.sn-gallery-cols-6{ grid-template-columns: repeat(6, minmax(0, 1fr)); }

/* Плитка */
.sn-gallery-item{
  display: block;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.08);
  background: rgba(0,0,0,0.02);
  aspect-ratio: var(--sn2-ratio, 3/4);
}

/* Картинка внутри плитки */
.sn-gallery-item img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* Кнопка "Показать ещё" */
.sn2-gallery-more{
  margin-top: 12px;
  width: 100%;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.08);
  color: inherit;
  padding: 12px 14px;
  border-radius: 12px;
  cursor: pointer;
  user-select: none;
}

.sn2-gallery-more:hover{
  background: rgba(255,255,255,0.12);
}

.sn2-gallery-more:active{
  transform: translateY(1px);
}

/* Lightbox overlay */
.sn2-lightbox{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.88);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.sn2-lightbox-inner{
  position: relative;
  max-width: min(1200px, 96vw);
  max-height: 92vh;
  width: auto;
  height: auto;
}

.sn2-lightbox-img{
  max-width: min(1200px, 96vw);
  max-height: 92vh;
  border-radius: 14px;
  display: block;
  width: auto;
  height: auto;
}

/* Кнопки */
.sn2-lightbox-close,
.sn2-lightbox-prev,
.sn2-lightbox-next{
  position: fixed;
  z-index: 1000000;
  cursor: pointer;
  padding: 10px 12px;
  border-radius: 12px;
  color: #e5e7eb;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.18);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.sn2-lightbox-close{
  top: 16px;
  right: 16px;
}

.sn2-lightbox-prev{
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
}

.sn2-lightbox-next{
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
}

.sn2-lightbox-counter{
  position: fixed;
  left: 16px;
  top: 16px;
  z-index: 1000000;
  padding: 8px 10px;
  border-radius: 12px;
  color: #e5e7eb;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.12);
  user-select: none;
  font-size: 14px;
}

/* ✅ Мобильная адаптация */
@media (max-width: 768px){
  .sn-gallery-lite.sn-gallery-cols-2,
  .sn-gallery-lite.sn-gallery-cols-3,
  .sn-gallery-lite.sn-gallery-cols-4,
  .sn-gallery-lite.sn-gallery-cols-5,
  .sn-gallery-lite.sn-gallery-cols-6{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Очень маленькие экраны */
@media (max-width: 480px){
  .sn-gallery-lite{
    grid-template-columns: 1fr !important;
  }

  .sn2-lightbox-prev,
  .sn2-lightbox-next{
    padding: 10px 10px;
  }
}

.sn2-gallery-sentinel{
  width: 100%;
  height: 1px;
  margin-top: 16px;
}