.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  padding: 1rem;
  background-color: #adc3dc;
}

.gallery img {
  width: 100%;
  max-width: 400px;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.gallery img:hover {
  transform: scale(1.05);
  opacity: 0.85;
}

.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  justify-content: center;
  align-items: center;
}

.modal img {
  max-width: 90%;
  max-height: 90%;
  background-color: #d2b48c;
  padding: 10px;
  border-radius: 10px;
}

/* GALLERY CONTAINER */
.gallery {
  display: grid;
  grid-template-columns: 1fr; /* Mobile first */
  gap: 15px;
  padding: 1rem;
  background-color: #adc3dc;
}

/* TABLET */
@media (min-width: 600px) {
  .gallery {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* DESKTOP */
@media (min-width: 900px) {
  .gallery {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* IMAGES */
.gallery img {
  width: 100%;
  max-width: 400px;
  height: auto;
  border-radius: 10px;
  transition: transform 0.4s ease, box-shadow 0.4s ease, filter 0.4s ease;
  animation: fadeIn 0.8s ease forwards;
  opacity: 0;
}

/* HOVER EFFECT */
.gallery img:hover {
  transform: scale(1.08);
  box-shadow: 0 15px 25px rgba(0,0,0,0.4);
  filter: brightness(1.1);
}

/* FADE IN KEYFRAME */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}