/* ── css/gallery.css ──────────────────────────────────────
   Gallery page styles + lightbox
   ─────────────────────────────────────────────────────── */

/* Hero */
.gallery-hero {
  background:
    linear-gradient(150deg, rgba(17,8,8,.72) 0%, rgba(140,48,48,.50) 100%),
    url('https://images.unsplash.com/photo-1517248135467-4c7edcad34c4?w=1600&q=80') center/cover no-repeat;
  min-height: 42vh;
  display: flex;
  align-items: center;
}

/* Filter bar */
.gallery-filters {
  background: var(--c-cream);
  border-bottom: 1px solid rgba(107,63,37,.12);
  padding: .85rem 0;
  position: sticky;
  top: 70px;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(26,14,6,.06);
}
.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  justify-content: center;
}
.filter-tab {
  padding: .4rem 1.1rem;
  border: 1.5px solid rgba(107,63,37,.2);
  border-radius: 999px;
  background: transparent;
  font-size: .84rem;
  font-weight: 500;
  color: var(--c-text-muted);
  cursor: pointer;
  transition: all var(--t-base);
}
.filter-tab:hover { border-color: var(--c-amber); color: var(--c-amber); }
.filter-tab.active { background: var(--c-amber); border-color: var(--c-amber); color: #fff; }

/* Gallery section */
.gallery-section { background: var(--c-bg); }

/* Masonry columns */
.gallery-grid {
  columns: 3;
  column-gap: 1rem;
  padding: 1.5rem 0 3rem;
}
.gallery-item {
  break-inside: avoid;
  margin-bottom: 1rem;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform var(--t-base), box-shadow var(--t-base);
}
.gallery-item:hover { transform: scale(1.02); box-shadow: var(--shadow-md); z-index: 1; }

.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform .5s ease;
}
.gallery-item:hover img { transform: scale(1.05); }

/* Overlay on hover */
.gallery-item-overlay {
  position: absolute;
  inset: 0;
  background: rgba(26,14,6,.45);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 1rem;
  opacity: 0;
  transition: opacity var(--t-base);
}
.gallery-item:hover .gallery-item-overlay { opacity: 1; }
.gallery-item-overlay .overlay-icon { font-size: 1.6rem; color: #fff; margin-bottom: .4rem; }
.gallery-item-overlay .overlay-caption { color: #fff; font-size: .82rem; font-weight: 500; text-align: center; }

/* Category badge */
.gallery-cat-badge {
  position: absolute;
  top: .6rem;
  left: .6rem;
  background: rgba(232,151,62,.9);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  padding: .2rem .55rem;
  border-radius: 999px;
  text-transform: capitalize;
  letter-spacing: .03em;
  backdrop-filter: blur(3px);
}

/* Reveal */
.js-reveal .gallery-item.reveal { opacity: 0; transform: translateY(16px); transition: opacity .45s ease, transform .45s ease; }
.js-reveal .gallery-item.reveal.visible { opacity: 1; transform: none; }

/* ── Lightbox ──────────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(10,6,3,.9);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  animation: lbIn .25s ease;
}
.lightbox[hidden] { display: none; }
@keyframes lbIn { from { opacity: 0; } to { opacity: 1; } }

.lb-img-wrap {
  max-width: 90vw;
  max-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
#lb-img {
  max-width: 90vw;
  max-height: 78vh;
  border-radius: var(--radius-md);
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
  object-fit: contain;
  transition: opacity .2s ease;
}

.lb-close {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
  opacity: .8;
  transition: opacity var(--t-fast), transform var(--t-fast);
  padding: .25rem .5rem;
}
.lb-close:hover { opacity: 1; transform: scale(1.15); }

.lb-prev,
.lb-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,.12);
  border: 1.5px solid rgba(255,255,255,.2);
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  border-radius: 50%;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background var(--t-base), transform var(--t-base);
}
.lb-prev { left: 1.25rem; }
.lb-next { right: 1.25rem; }
.lb-prev:hover,
.lb-next:hover { background: rgba(232,151,62,.7); transform: translateY(-50%) scale(1.1); }

.lb-caption {
  color: rgba(255,255,255,.85);
  font-size: .88rem;
  margin-top: .9rem;
  text-align: center;
  max-width: 600px;
  padding: 0 1rem;
}
.lb-counter {
  color: rgba(255,255,255,.45);
  font-size: .78rem;
  margin-top: .3rem;
}

/* ── Responsive ─────────────────────────────────────────── */
/* TV / Large screen (1400px+) */
@media (min-width: 1400px) { .gallery-grid { columns: 4; } }

/* Laptop (1024px–1399px) */
@media (max-width: 1024px) { .gallery-grid { columns: 2; } }

/* Tablet (768px) */
@media (max-width: 768px) {
  .filter-tabs { flex-wrap: wrap; gap: 0.5rem; }
  .filter-tab { flex: 1 0 auto; text-align: center; }
}

/* Mobile (≤480px) */
@media (max-width: 480px) {
  .gallery-grid { columns: 1; }
  .lb-prev { left: .5rem; }
  .lb-next { right: .5rem; }
  .lb-prev, .lb-next { width: 40px; height: 40px; font-size: 1.5rem; }
  .lb-img-wrap { max-height: 60vh; }
}
