/* =========================================
   GALLERY PAGE STYLES
   ========================================= */

.gallery-header {
  padding: clamp(var(--space-20), 10vw, var(--space-32)) var(--space-8) clamp(var(--space-12), 6vw, var(--space-20));
  background: var(--color-surface);
  margin-top: var(--header-h);
  text-align: center;
}
.gallery-header-inner { max-width: var(--content-narrow); margin: 0 auto; }
.gallery-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 300;
  color: var(--color-dark);
  margin-bottom: var(--space-3);
}
.gallery-sub {
  font-size: var(--text-xs);
  font-weight: 300;
  letter-spacing: 0.15em;
  color: var(--color-text-muted);
  text-transform: uppercase;
}

/* CATEGORY */
.gallery-category {
  padding: clamp(var(--space-12), 6vw, var(--space-20)) var(--space-8);
  max-width: var(--content-default);
  margin: 0 auto;
}
.gallery-category-label { margin-bottom: var(--space-8); }

/* MASONRY-STYLE GRID */
.gallery-masonry {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 280px;
  gap: 6px;
}
.gallery-item {
  overflow: hidden;
  cursor: pointer;
  position: relative;
  background: var(--color-dark);
}
.gallery-item--tall { grid-row: span 2; }
.gallery-item--wide { grid-column: span 2; }
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 600ms cubic-bezier(0.16, 1, 0.3, 1), opacity 300ms ease;
}
.gallery-item:hover img { transform: scale(1.04); opacity: 0.9; }

/* LIGHTBOX */
.lightbox {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 300ms ease;
}
.lightbox.open { opacity: 1; pointer-events: auto; }
.lightbox-backdrop {
  position: absolute; inset: 0;
  background: rgb(var(--rgb-charcoal) / 0.92);
  backdrop-filter: blur(8px);
}
.lightbox-content {
  position: relative; z-index: 1;
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
}
.lightbox-content img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  display: block;
  box-shadow: 0 30px 80px rgb(var(--rgb-charcoal) / 0.5);
}
.lightbox-caption {
  font-size: var(--text-xs);
  font-weight: 300;
  letter-spacing: 0.12em;
  color: rgb(var(--rgb-linen) / 0.9);
  text-align: center;
  max-width: 60ch;
}
.lightbox-close {
  position: fixed; top: var(--space-6); right: var(--space-6);
  color: rgb(var(--rgb-linen) / 0.9);
  font-size: 2rem;
  line-height: 1;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  z-index: 2;
  transition: color var(--transition);
}
.lightbox-close:hover { color: var(--brand-linen); }
.lightbox-prev, .lightbox-next {
  position: fixed;
  top: 50%; transform: translateY(-50%);
  color: rgb(var(--rgb-linen) / 0.9);
  font-size: 1.5rem;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  z-index: 2;
  transition: color var(--transition);
}
.lightbox-prev { left: var(--space-6); }
.lightbox-next { right: var(--space-6); }
.lightbox-prev:hover, .lightbox-next:hover { color: var(--brand-linen); }

@media (max-width: 800px) {
  .gallery-masonry {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 220px;
  }
  .gallery-item--tall { grid-row: span 1; }
  .gallery-item--wide { grid-column: span 2; }
}
@media (max-width: 500px) {
  .gallery-masonry { grid-template-columns: 1fr; grid-auto-rows: 260px; }
  .gallery-item--wide { grid-column: span 1; }
}
