/* Gallery page only */
.gallery-page .gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  grid-auto-rows: 250px;
  gap: 18px;
}

.gallery-page .gallery-card {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  box-shadow: var(--soft-shadow);
  grid-row-end: span 1;
  grid-column-end: span 1;
}

.gallery-page .gallery-card:nth-child(5n+2) {
  grid-row-end: span 2;
}

.gallery-page .gallery-card:nth-child(7n+4) {
  grid-column-end: span 2;
}

.gallery-page .gallery-image-wrapper {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.gallery-page .gallery-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease, filter .5s ease;
}

.gallery-page .gallery-card:hover img {
  transform: scale(1.08);
  filter: brightness(.6);
}

.gallery-page .gallery-card figcaption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px;
  color: #fff;
  background: linear-gradient(0deg, rgba(0,0,0,.7), transparent);
  transform: translateY(100%);
  transition: transform .4s ease, opacity .4s ease;
  opacity: 0;
}

.gallery-page .gallery-card:hover figcaption {
  transform: translateY(0);
  opacity: 1;
}

/* Lightbox styles */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(10, 20, 18, .92);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity .4s ease, visibility .4s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.lightbox-overlay.show {
  opacity: 1;
  visibility: visible;
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 85vh;
  animation: lightboxIn .4s cubic-bezier(.22,1,.36,1);
}

.lightbox-content img {
  max-width: 100%;
  max-height: 85vh;
  border-radius: 12px;
  box-shadow: 0 24px 70px rgba(0,0,0,.5);
}

.lightbox-caption {
  margin-top: 12px;
  color: #fff;
  text-align: center;
  font-weight: 800;
}

.lightbox-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 50%;
  background: rgba(0,0,0,.3);
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  transition: background .3s ease, transform .3s ease;
}
.lightbox-btn:hover { background: rgba(0,0,0,.5); transform: translateY(-50%) scale(1.05); }
.lightbox-prev { left: -64px; }
.lightbox-next { right: -64px; }
.lightbox-close { top: -44px; right: -44px; font-size: 24px; }

@keyframes lightboxIn { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: scale(1); } }
@media (max-width: 768px) { .lightbox-prev { left: 8px; } .lightbox-next { right: 8px; } .lightbox-close { top: 8px; right: 8px; background: rgba(0,0,0,.5); } }
