.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 2rem;
}

@media screen and (min-width:801px) and (max-width: 950px) {
  .gallery {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media screen and (max-width:801px) {
  .gallery {
    grid-template-columns: repeat(2, 1fr);
  }
}

.gallery-item {
  aspect-ratio: 1/1;
  position: relative;
  overflow: hidden;
  border-radius: 5px;
  border: 1px solid #B1A7A6;
  transition: transform 0.3s ease-in-out;
}
.gallery-item:hover {
  transform: scale(1.1);
}

.gallery img {
  width: 100%;
  object-fit: cover;
}


.caption {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  opacity: 0;
  padding: 0.5rem 0;
  transition: opacity 0.3s ease-in-out;
  color: white; /* Adjust text color for better visibility */
  background-color: rgba(0, 0, 0, 0.5);
}
.caption p {
  margin: 0;
  text-align: center;
}

.gallery-item:hover .caption {
  opacity: 1;
}


.img1{
  margin-top: -15%;

}
.img2 {
  margin-top: -5%;
}

.img3 {
  margin-top: -4%;
}

.img4 {
  margin-top: -3%;
}