.gallery {
  position: relative; 
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(35vh, 1fr));
  margin-top: 52vh; 
}

.gallery-item {
  position: relative;
  width: 100%;
  padding-bottom: 100%;
  background-size: cover;
  background-position: center;
  cursor: pointer;
  overflow: hidden;
  font-family: 'Poppins';
  opacity: 0;
  transform: scale(0.9);
}

.gallery-item.visible {
  animation: fadeIn 0.8s ease forwards;
}

.gallery-item:nth-child(odd).visible {
  animation-delay: 0.2s;
}

.gallery-item:nth-child(even).visible {
  animation-delay: 0.4s;
}

.gallery-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 0.5s, backdrop-filter 0.5s;
  backdrop-filter: blur(0);
}

.overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  text-align: center;
  font-size: 1.5em;
  opacity: 0;
  transition: opacity 0.5s;
  z-index: 1;
}

.gallery-item.active::before, .gallery-item:hover::before {
  opacity: 1;
  backdrop-filter: blur(5px);
}

.gallery-item.active .overlay, .gallery-item:hover .overlay {
  opacity: 1;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

#loadMore {
  display: block;
  margin: 20px auto;
  padding: 1.5vh 3vh;
  font-size: 1.5vh;
  background-color: #212121;
  color: #fff;
  border: none;
  cursor: pointer;
  font-family: 'Poppins';
  transition: background-color 0.3s;
}

#loadMore:hover {
  background-color: #333;
}

footer {
  margin-top: 5vh;
  padding-bottom: 2vh;
  text-align: center;
  color: #9e9e9e;
  font-family: 'Corbel';
}


@media (max-width: 1000px) {

  .gallery {
    grid-template-columns: repeat(auto-fill, minmax(20vh, 1fr));
    margin-top: 52vh;
  }
  
}