.gallery-container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 110px 12px;
  box-sizing: border-box;
}

.gallery-container h1 {
  text-align: center;
  margin-bottom: 30px;
  font-size: 2.5rem;
  font-weight: 700;
}

.gallery-filters {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 8px 16px;
  background: #f5f5f5;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.3s, color 0.3s;
}

.filter-btn:hover,
.filter-btn.active {
  background: #333;
  color: #fff;
}

.masonry {
  column-count: 1;
  column-gap: 5px;
  width: 100%;
  margin: 0 auto;
}

@media (min-width: 480px) {
  .masonry {
    column-count: 2;
  }
}

@media (min-width: 768px) {
  .masonry {
    column-count: 3;
  }
}

@media (min-width: 992px) {
  .masonry {
    column-count: 3;
  }
}

@media (max-width: 520px) {
  .gallery-container {
    padding-top: 60px;
  }
}

.brick {
  box-sizing: border-box;
  -webkit-column-break-inside: avoid;
  page-break-inside: avoid;
  break-inside: avoid;
  margin-bottom: 5px;
  display: block;
}

.brick img {
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: 4px;
  display: block;
}

/* Стилі для кастомного лайтбоксу */
.custom-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.custom-lightbox.active {
  display: flex;
  opacity: 1;
}

.lightbox-content {
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-content img,
.lightbox-content video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  color: #fff;
  font-size: 30px;
  cursor: pointer;
  padding: 10px;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border: none;
  font-size: 24px;
  padding: 10px 15px;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.3s;
}

.lightbox-nav:hover {
  background: rgba(0, 0, 0, 0.8);
}

.lightbox-prev {
  left: 20px;
}

.lightbox-next {
  right: 20px;
}
