/* Media gallery — filters, grid, lightbox. */

.filter-bar { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 2rem; }

.filter-btn {
  font-family: var(--font-display);
  font-size: 0.88rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.4rem 1.1rem;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.filter-btn:hover { color: var(--text); border-color: var(--border-gold); background: rgba(111, 147, 189, 0.07); }
.filter-btn.active { color: var(--gold); background: rgba(201, 169, 97, 0.1); border-color: var(--border-gold); }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.gallery-item {
  cursor: pointer;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
  animation: itemIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
@keyframes itemIn {
  from { opacity: 0; transform: scale(0.97); }
  to   { opacity: 1; transform: scale(1); }
}
.gallery-item:hover { border-color: var(--border-gold); box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45); }

.gallery-thumb { position: relative; width: 100%; aspect-ratio: 16 / 9; background: rgba(0, 0, 0, 0.4); overflow: hidden; }
.gallery-thumb img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), filter 0.25s ease;
  filter: brightness(0.9) saturate(0.95);
}
.gallery-item:hover .gallery-thumb img { transform: scale(1.05); filter: brightness(0.75) saturate(1.05); }

.gallery-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(160deg, rgba(16, 35, 63, 0.55) 0%, rgba(0, 0, 0, 0.1) 100%);
  opacity: 0; display: flex; align-items: center; justify-content: center;
  transition: opacity 0.25s ease;
}
.gallery-item:hover .gallery-overlay { opacity: 1; }
.overlay-icon { font-size: 2rem; color: var(--gold); opacity: 0.9; transform: scale(0.8); transition: transform 0.2s ease; }
.gallery-item:hover .overlay-icon { transform: scale(1); }

.lightbox {
  position: fixed; inset: 0;
  background: rgba(4, 8, 16, 0.94);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease;
}
.lightbox.open { opacity: 1; pointer-events: all; }

.lightbox-inner {
  position: relative;
  max-width: min(90vw, 1200px);
  max-height: 85vh;
  display: flex; flex-direction: column; align-items: center; gap: 1rem;
}
.lightbox-inner img {
  max-width: 100%; max-height: 75vh; object-fit: contain;
  border: 1px solid var(--border-gold);
  border-radius: 4px;
  box-shadow: 0 0 70px rgba(0, 0, 0, 0.85);
  transition: opacity 0.12s ease;
}
.lightbox-inner img.lb-fade { opacity: 0; }

.lightbox-caption { font-size: 0.9rem; color: var(--muted); text-align: center; max-width: 600px; line-height: 1.5; }

.lightbox-close {
  position: absolute; top: 1.2rem; right: 1.5rem;
  background: rgba(16, 35, 63, 0.8);
  border: 1px solid var(--border-gold);
  color: var(--gold);
  font-size: 1.1rem;
  width: 2.2rem; height: 2.2rem;
  border-radius: 4px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 10;
  transition: background 0.18s ease;
}
.lightbox-close:hover { background: var(--navy-600); }

.lightbox-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(16, 35, 63, 0.8);
  border: 1px solid var(--border);
  color: var(--gold);
  font-size: 2rem;
  width: 3rem; height: 3rem;
  border-radius: 4px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 10;
  line-height: 1;
  transition: background 0.18s ease, border-color 0.18s ease;
}
.lightbox-nav:hover { background: var(--navy-600); border-color: var(--gold); }

.lb-prev { left: 1.5rem; }
.lb-next { right: 1.5rem; }

@media (max-width: 900px) {
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}
@media (max-width: 540px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 0.6rem; }
  .lb-prev { left: 0.5rem; }
  .lb-next { right: 0.5rem; }
  .lightbox-nav { width: 2.4rem; height: 2.4rem; font-size: 1.6rem; }
}
