.gallery-page .main {
  padding-bottom: 0;
}

.gallery-hero {
  background-image: url("../img/backgroundHero.webp");
}

.gallery-section {
  padding: 40px 0 80px;
}

.gallery-masonry {
  --masonry-gap: 1rem;
  --masonry-row: 10px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--masonry-gap);
  grid-auto-rows: var(--masonry-row);
  grid-auto-flow: dense;
}

.gallery-item {
  margin: 0;
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface-color);
  box-shadow: 0 10px 30px color-mix(in srgb, var(--default-color), transparent 88%);
  visibility: hidden;
  align-self: start;
}

.gallery-item.is-ready {
  visibility: visible;
}

.gallery-trigger {
  display: block;
  border: 0;
  width: 100%;
  padding: 0;
  margin: 0;
  background: transparent;
  cursor: pointer;
  line-height: 0;
}

.gallery-item img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.3s ease;
}

.gallery-item:hover img {
  transform: scale(1.02);
}

.gallery-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.88);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1rem;
}

.gallery-lightbox.is-open {
  display: flex;
}

.gallery-lightbox #lightbox-img {
  max-width: min(1200px, 95vw);
  max-height: 90vh;
  object-fit: contain;
  border-radius: 12px;
}

.gallery-lightbox .lightbox-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.gallery-lightbox .lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.gallery-lightbox .lightbox-prev {
  left: 16px;
}

.gallery-lightbox .lightbox-next {
  right: 16px;
}

@media (max-width: 767px) {
  .gallery-lightbox .lightbox-nav {
    width: 42px;
    height: 42px;
    background: rgba(0, 0, 0, 0.35);
  }
}

@media (max-width: 1199px) {
  .gallery-masonry {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .gallery-masonry {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    --masonry-gap: 0.75rem;
  }
}

@media (max-width: 575px) {
  .gallery-masonry {
    grid-template-columns: 1fr;
  }
}
