section .gallery-container {
  display: grid;
  /* Default to a 4-column layout. See below for smaller displays. */
  grid-template-columns: repeat(4, 1fr);
  gap: 1em; /* Space between gallery items */
  padding: 1em;
  width: 90%;
  margin: 0 auto; /* Centers the gallery container on the page */
}

.gallery-item {
  width: 100%; /* Images take the full width of their container */
  height: auto; /* Maintains aspect ratio */
  object-fit: cover; /* Ensures images cover the area without distortion */
  border-radius: 0.5em;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* Adds a subtle shadow */
  transition: transform 0.3s; /* Smooth transition for hover effect */
}

.gallery-item img {
  width: 100%; /* Images take the full width of their container */
  height: auto; /* Maintains aspect ratio */
  object-fit: cover; /* Ensures images cover the area without distortion */
  border-radius: 0.5em;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* Adds a subtle shadow */
  transition: transform 0.3s; /* Smooth transition for hover effect */
}

.gallery-item img:hover {
  transform: scale(1.05); /* Slightly enlarges image on hover */
}

.caption {
  text-align: center;
  padding: 0.5em 0;
  font-size: 0.9em;
  color: #555;
}

/* For tablets */
@media screen and (max-width: 600px) {
  section .gallery-container {
    /* Changes to a 3-column layout */
    grid-template-columns: repeat(3, 1fr);
  }
}

/* For mobile phones */
@media screen and (max-width: 300px) {
  section .gallery-container {
	/* Changes to a 2-column layout */
    grid-template-columns: repeat(2, 1fr);
  }
}
