#fw-section-custom-html-b869924b-6d54-418d-b18f-8fc0e172303f {

/* --- Gallery Grid Styling (Optimized for all screens) --- */
.gallery {
  /* Use CSS Grid for robust layout handling */
  display: grid;
  /* Default: 3 columns with a 10px gap between them */
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  justify-items: center; /* Center items within their grid cell */
}

.gallery-item {
  width: 100%; /* Items take full width of their grid column */
  cursor: pointer;
  overflow: hidden;
  border-radius: 5px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  /* You may still need to ensure your thumbnails are consistently sized */
}

.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.gallery-item:hover img {
  transform: scale(1.05); /* Slight zoom effect on hover */
}

/* Media Query: Adjust to 2 columns on smaller phones (<600px) */
@media (max-width: 600px) {
  .gallery {
    /* Switch to 2 columns on mobile devices */
    grid-template-columns: repeat(2, 1fr); 
  }
}

/* --- The Modal (Pop-up) Styling (From previous response) --- */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.98);
  padding: 0;
}

.modal-content {
  margin: auto;
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100vh;
  object-fit: contain;
  padding: 40px 0 60px 0;
}

#caption {
  margin: auto;
  display: block;
  width: 90%;
  text-align: center;
  color: #fff;
  padding: 10px 0;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: rgba(0,0,0,0.5);
}

.close {
  position: fixed;
  top: 10px;
  right: 10px;
  color: #fff;
  font-size: 45px;
  font-weight: bold;
  cursor: pointer;
  z-index: 1001;
  text-shadow: 0 0 5px rgba(0,0,0,0.8);
}

}