/* Gallery styles */

.gallery-wrapper {
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 16px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  background: #c0c0c0; /* silver background as requested */
  border-radius: 8px;
  display: flex;
  align-items: center; /* vertically center images that are shorter than the container */
  justify-content: center; /* horizontally center images */
}

.gallery-item img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  display: block;
  object-fit: contain; /* preserve aspect ratio and avoid cropping; show transparent areas */
  transition: transform 300ms ease;
  background: transparent; /* ensure any image background is transparent when supported */
}

.gallery-item { min-height: 140px; }

.gallery-item:hover img {
  transform: scale(1.05);
}

.gallery-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 8px 10px;
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.6) 100%);
  color: #fff;
  font-size: 14px;
  display: none; /* hide filename/title caption */
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.85);
  z-index: 9999;
}

.lightbox.open {
  display: flex;
}

.lightbox-content {
  max-width: 95%;
  max-height: 95%;
  position: relative;
}

.lightbox-img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 80vh;
  display: block;
  margin: 0 auto;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 10px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
}

.lightbox-close { right: 10px; }
.lightbox-prev { left: 10px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 10px; top: 50%; transform: translateY(-50%); }

.lightbox-meta {
  color: #fff;
  text-align: center;
  margin-top: 8px;
}

@media (max-width: 600px) {
  .gallery-grid { gap: 8px; grid-template-columns: repeat(auto-fill, minmax(140px,1fr)); }
}
