#gallery {
  background: var(--navy);
  padding: var(--section-pad) 0;
}

.gallery-header {
  text-align: center;
  margin-bottom: 3rem;
}

.gallery-header .section-h2 { color: var(--white); }
.gallery-header .eyebrow { color: var(--gold); }

.gallery-intro {
  color: rgba(255,255,255,0.55);
  font-size: 0.95rem;
  margin-top: 0.75rem;
  line-height: 1.65;
}

/* Masonry-like grid using CSS */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: auto;
  gap: 0.75rem;
  grid-auto-flow: dense;
}

.gallery-item {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  background: var(--navy-mid);
  aspect-ratio: 4/3;
}

.gallery-item.tall { aspect-ratio: 3/4; grid-row: span 2; }

.gallery-grid > .gallery-item:last-child { grid-column: 2; }

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

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

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(13,27,62,0.9) 0%, transparent 50%);
  display: flex;
  align-items: flex-end;
  padding: 1.25rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-overlay,
.gallery-item:focus .gallery-overlay { opacity: 1; }

.gallery-caption {
  color: white;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.01em;
}

/* Lightbox */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1rem;
  padding: 2rem;
}

.lightbox-overlay.active { display: flex; }

.lightbox-img {
  max-height: 80vh;
  max-width: 90vw;
  object-fit: contain;
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
}

.lightbox-caption {
  color: rgba(255,255,255,0.65);
  font-size: 0.85rem;
  text-align: center;
  max-width: 600px;
}

.lightbox-close {
  position: fixed;
  top: 1.25rem; right: 1.25rem;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: white;
  transition: background 0.2s;
}

.lightbox-close:hover { background: rgba(255,255,255,0.2); }
.lightbox-close svg { width: 20px; height: 20px; }

@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .gallery-item.tall { aspect-ratio: 4/3; grid-row: span 1; }
}

@media (max-width: 480px) {
  .gallery-grid { grid-template-columns: 1fr; }
}
