* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.section {
  padding: 44px 12px;
}
.section--no-space {
  padding-top: 0 !important;
}

.container {
  max-width: 1400px;
  margin: 70px auto 0;
}

.gallery {
  display: grid;
  grid-auto-flow: column;
  grid-template-columns: repeat(3, minmax(200px, 1fr));
  grid-template-rows: repeat(3, 300px);
  columns: 3;
  column-gap: 1.5rem;
  width: 100%;
}

.row-1 { grid-column: 1; }
.row-2 { grid-column: 2; }
.row-3 { grid-column: 3; }

@media (max-width: 768px) {
  .gallery {
      grid-template-columns: repeat(1, minmax(200px, 1fr));
  }
  .row-2, .row-3 {
      grid-column: 1;
  }
}

.gallery-item {
  break-inside: avoid;
  margin-bottom: 1.5rem;
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.8s ease forwards;
  cursor: pointer;
}

.double-row {
  grid-row: span 2;
}

.gallery-item img,
.gallery-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.gallery-item:hover img,
.gallery-item:hover video {
  transform: scale(1.05);
}

@keyframes fadeUp {
  to {
      opacity: 1;
      transform: translateY(0);
  }
}

.overlay-container {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 2rem;
}

.overlay-content {
  position: relative;
  max-width: 90%;
  max-height: 90vh;
  border-radius: 12px;
  overflow: hidden;
}

.overlay-content img,
.overlay-content video {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
}
.close-button {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background-color: rgba(255, 255, 255, 0.8);
  border: none;
  color: #333;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.close-button:hover {
  background-color: rgba(255, 255, 255, 1);
  transform: scale(1.1);
  color: #ff0000;
}

.close-button:focus {
  outline: 2px solid rgba(255, 0, 0, 0.7);
}


.gallery-item {
  opacity: 0;
  animation: fadeUp 0.8s ease forwards;
}

.delay-1 { animation-delay: 0.2s; }
.delay-2 { animation-delay: 0.4s; }
.delay-3 { animation-delay: 0.6s; }
.delay-4 { animation-delay: 0.8s; }
.delay-5 { animation-delay: 1.0s; }
.delay-6 { animation-delay: 1.2s; }
.delay-7 { animation-delay: 1.4s; }
.delay-8 { animation-delay: 1.6s; }