.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 20px 0;
}

@media screen and (max-width: 1024px) {
  .gallery {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media screen and (max-width: 768px) {
  .gallery {
    grid-template-columns: 1fr;
  }
}

.gallery-item {
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity 0.3s ease;
}

.gallery img:hover {
  opacity: 0.8;
}

/* Enlarged image overlay */
.overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  opacity: 0; /* Ensure it's hidden initially */
  transition: opacity 0.5s ease; /* Changed the transition duration */
}

.overlay.active {
  display: flex;
  opacity: 1;
}

.overlay img {
  max-width: 80%;
  max-height: 80%;
}