/* ═════════════════════════════════════════════════════════════════
   Gallery — masonry grid, filter chips, lightbox
   Loaded alongside styles.css on gallery.html
   ═════════════════════════════════════════════════════════════════ */

/* ───── HERO ───── */
.gal-hero {
  padding: clamp(80px, 12vw, 140px) 0 clamp(48px, 6vw, 72px);
  position: relative;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(255,46,138,0.18), transparent 55%),
    radial-gradient(ellipse at 90% 30%, rgba(180,22,224,0.14), transparent 60%),
    var(--bg-0);
  overflow: hidden;
}
.gal-hero h1 {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(48px, 7vw, 92px); line-height: 0.95;
  letter-spacing: -0.025em;
  margin: 14px 0 24px;
  color: var(--ink-0);
}
.gal-hero-lede {
  font-size: clamp(16px, 1.6vw, 19px); line-height: 1.55;
  color: var(--ink-1); max-width: 640px;
  margin: 0 0 36px;
}
.gal-hero-stats {
  display: flex; gap: 28px; flex-wrap: wrap;
}
.gal-hero-stats > div {
  border-left: 2px solid var(--line);
  padding: 4px 0 4px 16px;
}
.gal-hero-stats .num {
  font-family: var(--font-display); font-weight: 800;
  font-size: 26px; line-height: 1.1; color: var(--ink-0);
  letter-spacing: -0.015em;
}
.gal-hero-stats .lbl {
  font-size: 11.5px; color: var(--ink-3);
  letter-spacing: 0.1em; text-transform: uppercase;
  margin-top: 4px;
}

/* ───── FILTER BAR ───── */
.gal-filters-wrap {
  position: sticky; top: 0; z-index: 30;
  padding: 18px 0 14px;
  background: rgba(8,3,15,0.85);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}
/* Mobile-only "Filters" toggle — hidden on desktop */
.gal-filter-toggle { display: none; }

.gal-filters {
  display: flex; flex-direction: column; gap: 14px;
}
.gal-filter-group {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 14px;
  align-items: center;
}
.gal-filter-label {
  font-size: 11.5px; color: var(--ink-3);
  letter-spacing: 0.1em; text-transform: uppercase;
  font-weight: 600;
}
.gal-filter-pills {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.gal-filter-pills .pill {
  height: 32px; padding: 0 14px;
  font-size: 13px; cursor: pointer;
  transition: transform 120ms, background 160ms, color 160ms;
}
.gal-filter-pills .pill:hover { transform: translateY(-1px); }

.gal-result-bar {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 14px; padding-top: 12px;
  border-top: 1px dashed var(--line);
}
.gal-count {
  font-family: var(--font-mono); font-size: 12px;
  color: var(--ink-2); letter-spacing: 0.06em;
}
.gal-reset {
  background: none; border: 0;
  font-size: 12.5px; color: var(--pink-glow);
  cursor: pointer; padding: 4px 8px;
  text-decoration: underline; text-underline-offset: 3px;
}
.gal-reset:hover { color: var(--ink-0); }

@media (max-width: 720px) {
  .gal-filter-group { grid-template-columns: 1fr; gap: 8px; }

  /* Collapse the (tall) filter panel behind a compact sticky toggle so it
     doesn't pin half the viewport while scrolling the grid. */
  .gal-filter-toggle {
    display: flex; align-items: center; gap: 8px;
    width: 100%; height: 42px; padding: 0 14px;
    background: var(--surface-2); color: var(--ink-0);
    border: 1px solid var(--line); border-radius: 12px;
    font-size: 14px; font-weight: 600; cursor: pointer;
  }
  .gal-filter-toggle > span:first-of-type { flex: 1; text-align: left; }
  .gal-filter-chevron { display: inline-flex; transition: transform 200ms; }
  .gal-filter-chevron.open { transform: rotate(180deg); }

  /* Hidden until the toggle is tapped */
  .gal-filters { display: none; margin-top: 12px; }
  .gal-filters.is-open { display: flex; }
}

/* ───── MASONRY GRID ───── */
.gal-grid-wrap {
  padding: clamp(36px, 5vw, 64px) 0 clamp(64px, 8vw, 100px);
}
.gal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  grid-auto-rows: 240px;
  gap: 12px;
}
.gal-tile {
  position: relative;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  text-align: left;
  transition: transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 260ms, border-color 200ms;
}
.gal-tile img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 600ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.gal-tile:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-card), 0 24px 50px -20px rgba(255,46,138,0.35);
}
.gal-tile:hover img { transform: scale(1.04); }
.gal-tile:focus-visible {
  outline: 2px solid var(--pink-glow);
  outline-offset: 3px;
}

/* Hero tiles span more space */
.gal-tile-hero {
  grid-column: span 2;
  grid-row: span 2;
}
@media (max-width: 600px) {
  .gal-tile-hero { grid-column: span 1; grid-row: span 1; }
  .gal-grid { grid-auto-rows: 200px; }
}

/* Tile caption overlay (always visible, gradient base) */
.gal-tile-overlay {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 14px 16px 12px;
  background: linear-gradient(180deg, rgba(8,3,15,0) 0%, rgba(8,3,15,0.85) 70%);
  color: #fff;
  pointer-events: none;
}
.gal-tile-caption {
  font-family: var(--font-display); font-weight: 700;
  font-size: 14.5px; letter-spacing: -0.01em;
  line-height: 1.25; color: #fff;
  margin-bottom: 2px;
}
.gal-tile-meta {
  font-size: 11.5px; color: rgba(255,255,255,0.7);
  display: flex; gap: 6px; align-items: center;
  font-family: var(--font-mono); letter-spacing: 0.04em;
}
.gal-tile-meta .dot { color: rgba(255,255,255,0.4); }
.gal-tile-hero .gal-tile-caption { font-size: 18px; }

/* Empty state */
.gal-empty {
  text-align: center; padding: 80px 24px;
  border: 1px dashed var(--line);
  border-radius: 20px;
  background: var(--surface);
}
.gal-empty h3 {
  font-family: var(--font-display); font-weight: 700;
  font-size: 22px; letter-spacing: -0.015em;
  margin: 10px 0 8px; color: var(--ink-0);
}
.gal-empty p { color: var(--ink-2); font-size: 14.5px; }

/* ───── FINAL CTA ───── */
.gal-final-cta {
  padding: clamp(72px, 9vw, 110px) 0;
  text-align: center;
  background:
    radial-gradient(ellipse at 50% 100%, rgba(255,46,138,0.18), transparent 60%),
    var(--bg-0);
  border-top: 1px solid var(--line);
}
.gal-final-cta h2 {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(32px, 5vw, 56px); line-height: 1.05;
  letter-spacing: -0.02em; margin: 14px 0 18px;
  color: var(--ink-0);
}
.gal-final-cta p {
  font-size: clamp(15px, 1.4vw, 18px); color: var(--ink-1);
  max-width: 580px; margin: 0 auto;
}

/* ───── LIGHTBOX ───── */
.gal-lightbox {
  position: fixed; inset: 0;
  background: rgba(4, 1, 8, 0.94);
  backdrop-filter: blur(14px);
  z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  padding: 40px 64px;
  animation: galFadeIn 220ms ease-out;
}
@keyframes galFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.gal-lb-stage {
  max-width: min(1200px, 100%);
  max-height: 100%;
  display: flex; flex-direction: column; gap: 16px;
  align-items: center;
}
.gal-lb-stage img {
  max-width: 100%; max-height: 78vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
  display: block;
}
.gal-lb-info {
  width: 100%;
  padding: 4px 8px;
  display: flex; flex-direction: column; gap: 6px;
  align-items: center; text-align: center;
}
.gal-lb-caption {
  font-family: var(--font-display); font-weight: 700;
  font-size: 19px; letter-spacing: -0.015em;
  color: #fff;
}
.gal-lb-meta {
  font-size: 12px; color: rgba(255,255,255,0.65);
  display: flex; gap: 8px; align-items: center;
  font-family: var(--font-mono); letter-spacing: 0.05em;
}
.gal-lb-meta .dot { color: rgba(255,255,255,0.35); }
.gal-lb-actions {
  display: flex; gap: 10px; flex-wrap: wrap;
  justify-content: center; margin-top: 8px;
}
.gal-lb-counter {
  font-family: var(--font-mono); font-size: 11px;
  color: rgba(255,255,255,0.4); letter-spacing: 0.1em;
  margin-top: 6px;
}

.gal-lb-close, .gal-lb-nav {
  position: absolute;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background 160ms, transform 160ms;
}
.gal-lb-close:hover, .gal-lb-nav:hover {
  background: rgba(255,255,255,0.16);
  transform: scale(1.05);
}
.gal-lb-close { top: 18px; right: 18px; }
.gal-lb-prev  { left: 18px; top: 50%; transform: translateY(-50%); }
.gal-lb-next  { right: 18px; top: 50%; transform: translateY(-50%); }
.gal-lb-prev:hover { transform: translateY(-50%) scale(1.05); }
.gal-lb-next:hover { transform: translateY(-50%) scale(1.05); }

@media (max-width: 720px) {
  .gal-lightbox { padding: 20px 12px; }
  .gal-lb-close { top: 12px; right: 12px; }
  .gal-lb-prev  { left: 8px;  width: 38px; height: 38px; }
  .gal-lb-next  { right: 8px; width: 38px; height: 38px; }
  .gal-lb-stage img { max-height: 70vh; }
}
