.gallery-section {
  padding: 40px;
  text-align: center;
}

.gallery-title {
  font-size: 24px;
  margin-bottom: 20px;
  color: #004080;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
}

.gallery-item {
  text-align: center;
  cursor: pointer;
}

.gallery-item img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 8px;
  transition: transform 0.3s;
}

.gallery-item img:hover {
  transform: scale(1.05);
}

.gallery-item p {
  margin-top: 8px;
  font-size: 14px;
  color: #333;
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  overflow: auto;
  text-align: center;
  padding: 0;
}

/* Контейнер изображения центрирован */
.lightbox-content {
  margin: 50px auto;
  max-width: 90%;
  max-height: 80vh;
  border-radius: 8px;
  display: block;
  object-fit: contain;
  transition: transform 0.3s;
}

/* Подпись */
.caption {
  margin: 15px auto;
  text-align: center;
  font-size: 18px;
  color: #fff;
  max-width: 90%;
}

/* Кнопка закрытия */
.close {
  position: absolute;
  top: 15px;
  right: 35px;
  color: #fff;
  font-size: 40px;
  cursor: pointer;
}

/* Стрелки навигации */
.prev, .next {
  cursor: pointer;
  position: absolute;
  top: 50%;
  font-size: 40px;
  padding: 10px;
  color: white;
  user-select: none;
  transform: translateY(-50%);
}

.prev { left: 10px; }
.next { right: 10px; }

.prev:hover, .next:hover, .close:hover {
  color: #f1c40f;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
  .gallery-item img {
    height: 120px;
  }
  .lightbox-content {
    max-width: 95%;
    max-height: 70vh;
    margin: 20px auto;
  }
  .caption {
    font-size: 16px;
  }
}
