.gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: center;
}

.gallery-photo {
  flex: 0 0 calc(33.33% - 30px);
  max-width: calc(33.33% - 30px);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.gallery-photo img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
  transition: transform 0.3s ease;
}

.gallery-photo figcaption {
  text-align: center;
  margin-top: 10px;
  font-size: 0.9rem;
  color: #555;
}

.modal-content img {
  max-width: 100%;
  max-height: 80vh; /* Adjust the height as needed */
  width: auto;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 10px;
}

.modal-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 75vh;
  position: relative;
}

.modal-dialog {
  max-width: 90%;
  max-height: 90%;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 24px;
  color: #fff;
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.modal-nav {
  display: flex;
  justify-content: space-between;
  width: 100%;
  margin-top: 10px;
}

.modal-prev,
.modal-next {
  font-size: 2rem;
  color: #fff;
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 10px; /* Added padding */
}

.modal-prev {
  margin-left: 10px; /* Ensure spacing from the edge */
  margin-bottom: 10px;
}

.modal-next {
  margin-right: 10px; /* Ensure spacing from the edge */
  margin-bottom: 10px;
}

@media (max-width: 768px) {
  .gallery-photo {
    flex: 0 0 calc(50% - 30px);
    max-width: calc(50% - 30px);
  }
}
