/* =========================================
   MEDIA GALLERY
   ========================================= */

.container-wide {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* === MASONRY-STYLE GRID === */
.gallery-grid {
  columns: 4;
  column-gap: 1rem;
}

.gallery-item {
  display: block;
  break-inside: avoid;
  margin-bottom: 1rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  cursor: pointer;
}
.gallery-item img {
  width: 100%;
  display: block;
  transition: transform 0.4s ease;
}
.gallery-item:hover img {
  transform: scale(1.05);
}
.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s;
  display: flex;
  align-items: flex-end;
  padding: 1.25rem;
}
.gallery-item:hover .gallery-overlay {
  opacity: 1;
}
.gallery-caption {
  color: var(--white);
  font-size: 0.85rem;
  font-weight: 600;
}

/* === LIGHTBOX === */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s;
}
.lightbox.active {
  opacity: 1;
  visibility: visible;
}
.lightbox-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.92);
}
.lightbox-content {
  position: relative;
  z-index: 1;
  max-width: 85vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.lightbox-content img {
  max-width: 85vw;
  max-height: 75vh;
  object-fit: contain;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.lightbox-caption {
  color: var(--white);
  font-size: 0.95rem;
  font-weight: 500;
  margin-top: 1rem;
  text-align: center;
}
.lightbox-counter {
  color: rgba(255,255,255,0.5);
  font-size: 0.78rem;
  margin-top: 0.35rem;
}
.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 2;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: none;
  color: var(--white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.lightbox-close:hover {
  background: rgba(255,255,255,0.25);
}
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: none;
  color: var(--white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.lightbox-nav:hover {
  background: rgba(255,255,255,0.25);
}
.lightbox-prev { left: 1.5rem; }
.lightbox-next { right: 1.5rem; }

/* === RESPONSIVE === */
@media (max-width: 1024px) {
  .gallery-grid { columns: 3; }
}
@media (max-width: 768px) {
  .gallery-grid { columns: 2; }
  .lightbox-nav { width: 38px; height: 38px; }
  .lightbox-prev { left: 0.75rem; }
  .lightbox-next { right: 0.75rem; }
  .lightbox-content img { max-width: 95vw; }
}
@media (max-width: 480px) {
  .gallery-grid { columns: 1; max-width: 400px; margin: 0 auto; }
}
