/* ==========================================================================
   GALLERY GRID + LIGHTBOX
   Used on the gallery page and (lightbox only) the homepage polaroids.
   ========================================================================== */
.galleryGrid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.9rem;
  margin: 0 0 2.5rem;
}

.galleryItem{
  display: block;
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 3px solid #000;
  background: rgba(0,0,0,0.04);
  box-shadow: 5px 5px 0 rgba(0,0,0,0.85);
}

.galleryItem img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 400ms ease;
}

@media (hover: hover) and (pointer: fine){
  .galleryItem:hover img{ transform: scale(1.06); }
}

@media (max-width: 540px){
  .galleryGrid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
  }
}

/* ---- Lightbox dialog ---- */
.lightboxDialog{
  border: 0;
  padding: 0;
  background: transparent;
  max-width: min(96vw, 1100px);
  max-height: 92vh;
}

.lightboxDialog::backdrop{
  background: rgba(0, 0, 0, 0.85);
}

.lightboxFigure{
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}

.lightboxImg{
  max-width: min(94vw, 1100px);
  max-height: 82vh;
  width: auto;
  height: auto;
  border: 4px solid #fff;
  background: #000;
}

.lightboxCaption{
  color: #fff;
  font-size: 1rem;
  text-align: center;
  min-height: 1.4em;
}

.lightboxBtn{
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: #000;
  color: hsl(var(--primary, 48 100% 50%));
  border: 2px solid #fff;
  font-size: 1.6rem;
  line-height: 1;
  padding: 0.6rem 0.85rem;
  cursor: pointer;
  z-index: 2;
}
.lightboxPrev{ left: 1rem; }
.lightboxNext{ right: 1rem; }

.lightboxClose{
  position: fixed;
  top: 1rem;
  right: 1rem;
  transform: none;
}

@media (max-width: 540px){
  .lightboxBtn{ font-size: 1.3rem; padding: 0.5rem 0.7rem; }
  .lightboxPrev{ left: 0.4rem; }
  .lightboxNext{ right: 0.4rem; }
}
