/* Gallery tour full page */
.gallery-tour__back {
  color: #fff;
  text-decoration: none;
  opacity: 0.9;
}

.gallery-tour__back:hover {
  opacity: 1;
}

.gallery-full {
  background-color: #fff;
  padding-bottom: 2rem;
}

.gallery-full__container {
  max-width: 72.624rem;
  margin: 0 auto;
  padding: 0 0.938rem;
}

/* Masonry layout — колонки, плотная укладка без пустого пространства снизу */
.gallery-full__grid {
  column-count: 4;
  column-gap: 0.375rem;
}

.gallery-full__grid img {
  width: 100%;
  height: auto;
  vertical-align: middle;
  border-radius: 4px;
  cursor: pointer;
  display: block;
  break-inside: avoid;
  margin-bottom: 0.375rem;
  content-visibility: auto;
}

.gallery-full__grid img:hover {
  opacity: 0.9;
}

@media (max-width: 900px) {
  .gallery-full__grid {
    column-count: 3;
  }
}

@media (max-width: 600px) {
  .gallery-full__grid {
    column-count: 2;
  }
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 10000;
  align-items: center;
  justify-content: center;
}

.lightbox.active {
  display: flex;
}

.lightbox__img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
}

.lightbox__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 2.5rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.5rem;
}

.lightbox__close:hover {
  opacity: 0.8;
}

.lightbox__prev,
.lightbox__next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #fff;
  font-size: 2rem;
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 4px;
}

.lightbox__prev:hover,
.lightbox__next:hover {
  background: rgba(255, 255, 255, 0.3);
}

.lightbox__prev {
  left: 1rem;
}

.lightbox__next {
  right: 1rem;
}

.lightbox__prev.disabled,
.lightbox__next.disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}
