
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1em;
  align-items: start;
}

.gallery img {
  width: 100%;
  height: auto;
  display: block;
  cursor: pointer;
  border-radius: 0px;
  transition: transform 0.2s;
}

.gallery img:hover {
  transform: scale(1.00);
}

.gallery .column-page p img {
  width: 100%;
  margin: 0;
  height: auto;
  display: block;
  margin-bottom: 1em; /* vertical spacing between images */
}


/* Lightbox overlay */
.lightbox {
  display: none; 
  position: fixed; 
  top: 0;
  left: 0;
  width: 100%; 
  height: 100%; 
  background-color: rgba(0,0,0,0.8); 
  justify-content: center; 
  align-items: center; /* centers content vertically */
  z-index: 1000;
  flex-direction: column; /* caption below image */
  padding: 20px;
  box-sizing: border-box;
}

/* Lightbox image */
.lightbox-img {
  max-width: 90%;
  max-height: 80%; 
  margin-bottom: 10px;
  object-fit: contain; /* ensures image scales without distortion */
}

/* Caption */
.lightbox .caption {
  color: #fff;
  text-align: center;
  font-size: 1em;
  max-width: 90%;
  word-wrap: break-word;
  line-height: 1.4em;   /* ensures proper spacing between lines */
  white-space: normal;  /* allows <br> and wrapping */
}

/* Close button */
.lightbox .close {
  position: absolute;
  top: 15px;
  right: 25px;
  color: #fff;
  font-size: 2em;
  cursor: pointer;
}
.lightbox-img.zoomed {
  transform: scale(2); /* double size */
  cursor: zoom-out;
  transition: transform 0.3s ease;
}

/* Responsive adjustments for phones */
@media (max-width: 600px) {
  .lightbox-img {
    max-width: 95%;
    max-height: 70%;
  }
  .lightbox .caption {
    font-size: 0.9em;
  }
  .lightbox .close {
    font-size: 1.5em;
    top: 10px;
    right: 15px;
  }
}

