/* ==== Карусель галереи ==== */
.carousel {
  position: relative;
  padding: 0 48px; /* место под стрелки */
}

.gallery {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;       /* прячем полосу прокрутки в Firefox */
}
.gallery::-webkit-scrollbar { display: none; } /* Chrome/Safari */

.gallery-item {
  flex: 0 0 calc((100% - 32px) / 3); /* ровно 3 в ряд, 32px = 2 промежутка */
  scroll-snap-align: start;
  margin: 0;
  cursor: zoom-in;
}

.gallery-item img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  transition: transform .25s ease, box-shadow .25s ease;
}

.gallery-item a:hover img {
  transform: scale(1.02);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
}

.gallery-item figcaption {
  margin-top: 8px;
  font-size: .9rem;
  color: #666;
  line-height: 1.4;
}

/* ==== Стрелки карусели ==== */
.carousel-btn {
  position: absolute;
  top: 110px;                  /* середина картинки высотой 220px */
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: #1a1a1a;
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, opacity .2s;
}

.carousel-btn:hover { background: #e6a817; }
.carousel-btn:disabled { opacity: .3; cursor: default; }
.carousel-btn:disabled:hover { background: #1a1a1a; }

.carousel-prev { left: 0; }
.carousel-next { right: 0; }

/* адаптив: 2 фото на планшете, 1 на телефоне */
@media (max-width: 900px) {
  .gallery-item { flex: 0 0 calc((100% - 16px) / 2); }
}
@media (max-width: 560px) {
  .carousel { padding: 0 40px; }
  .gallery-item { flex: 0 0 100%; }
}

/* ==== Лайтбокс ==== */
.gl-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(10, 10, 12, .92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility .25s;
}

.gl-lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.gl-stage {
  max-width: min(92vw, 1400px);
  max-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: pan-y; /* вертикальный скролл не перехватываем */
}

.gl-stage img {
  max-width: 100%;
  max-height: 80vh;
  border-radius: 6px;
  user-select: none;
  -webkit-user-drag: none;
}

.gl-caption {
  color: #ddd;
  font-size: .95rem;
  margin-top: 14px;
  max-width: 80vw;
  text-align: center;
}

.gl-counter {
  color: #888;
  font-size: .8rem;
  margin-top: 6px;
}

.gl-btn {
  position: absolute;
  background: rgba(255, 255, 255, .08);
  border: none;
  color: #fff;
  font-size: 26px;
  line-height: 1;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
}

.gl-btn:hover {
  background: rgba(255, 255, 255, .2);
}

.gl-close { top: 20px; right: 20px; }
.gl-prev  { left: 16px;  top: 50%; transform: translateY(-50%); }
.gl-next  { right: 16px; top: 50%; transform: translateY(-50%); }

@media (max-width: 600px) {
  .gl-prev, .gl-next {
    top: auto;
    bottom: 18px;
    transform: none;
  }
  .gl-prev { left: 24px; }
  .gl-next { right: 24px; }
}

/* Блокируем прокрутку страницы под лайтбоксом */
body.gl-no-scroll {
  overflow: hidden;
}