#gallery-section {
  padding: 50px;
  text-align: center;
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.gallery-container {
  width: 80vw;
  height: 100vh;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.gallery-container img {
  width: 80%;
  height: 500px;
  object-fit: contain;
  border-radius: 8px;
  transition: transform 0.3s ease;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.gallery-container img:nth-child(4),
.gallery-container img:nth-child(5),
.gallery-container img:nth-child(6) {
  height: 400px;
}

.gallery-container img:hover {
  transform: scale(1.02);
  box-shadow: 0 0 20px #023e8a;
}

@media (max-width: 1440px) {
  .gallery-container img {
    width: 80%;
    height: 400px;
  }
  .gallery-container {
    width: 80vw;
    height: 90vh;
  }
}

@media (max-width: 1000px) {
  .gallery-container img {
    width: 80%;
    height: 300px;
  }
  .gallery-container img:nth-child(4),
  .gallery-container img:nth-child(5),
  .gallery-container img:nth-child(6) {
    height: 280px;
  }
  .gallery-container {
    width: 80vw;
    height: 80vh;
  }
}

@media (max-width: 1000px) {
  .gallery-container img {
    width: 80%;
    height: 300px;
  }
  .gallery-container {
    grid-template-columns: repeat(2, 1fr);
    width: 80vw;
    height: 100vh;
  }
}

@media (max-width: 768px) {
  .gallery-container img {
    width: 90%;
    height: 300px;
  }
  .gallery-container {
    width: 80vw;
    height: 90vh;
  }
}

@media (max-width: 600px) {
  .gallery-container img {
    width: 90%;
    height: 300px;
  }
  .gallery-container {
    width: 80vw;
    height: 90vh;
  }
}

@media (max-width: 550px) {
  .gallery-container img {
    width: 100%;
    height: 300px;
  }
  .gallery-container {
    grid-template-columns: repeat(1, 1fr);
    width: 80vw;
    height: 200vh;
  }
}

@media (max-width: 420px) {
  .gallery-container img {
    width: 100%;
    height: 300px;
  }
  .gallery-container {
    grid-template-columns: repeat(1, 1fr);
    width: 80vw;
    height: 180vh;
  }
}

/* 1. Reset gallery container height for mobile */
.gallery-container {
  height: auto;
  margin-bottom: 3rem; /* Adds space before contact section */
}

/* 2. Use min-height instead of fixed height for images */
.gallery-container img {
  min-height: 300px;
  max-height: 400px;
  height: auto;
  width: 90%;
  margin: 0 auto;
}

/* 4. Fix for mobile viewport height issues */
@media (max-width: 768px) {
  #gallery-section {
    min-height: 0; /* Override any vh units */
    padding-bottom: 3rem; /* Extra space */
  }
}
