/* ---------- Galeria (galeria.html) ----------
   Página própria: não altera style.css nem o lightbox de main.js,
   que continua a servir as outras páginas. */

.gx-stats{display:flex;gap:10px;flex-wrap:wrap;margin-top:28px}
.gx-stats .chip strong{font-family:var(--font-display);font-weight:700}

/* Filtros por evento */
.gx-filter{display:flex;gap:8px;flex-wrap:wrap;margin:0 0 56px}
.gx-filter button{
  font:600 .86rem/1 var(--font-body);color:var(--ink);
  background:var(--surface);border:1px solid var(--line);border-radius:99px;
  padding:11px 18px;cursor:pointer;
  transition:background .25s,color .25s,border-color .25s,transform .25s;
}
.gx-filter button:hover{border-color:var(--ink);transform:translateY(-1px)}
.gx-filter button[aria-pressed="true"]{background:var(--ink);border-color:var(--ink);color:#fff}
.gx-filter button span{font-weight:500;opacity:.55;margin-left:6px}
.gx-filter button:focus-visible{outline:2px solid var(--ink);outline-offset:3px}

/* Grupos por evento */
.gx-group{margin-bottom:84px}
.gx-group[hidden]{display:none}
.gx-group .event-group-head{margin-bottom:24px}
.gx-count{font-size:.85rem;color:var(--muted);font-weight:500}

/* Mosaico */
.gx-grid{columns:3;column-gap:16px}
.gx-item{
  display:block;position:relative;margin-bottom:16px;break-inside:avoid;
  border-radius:16px;overflow:hidden;background:var(--accent-soft);cursor:zoom-in;
}
.gx-item img{width:100%;height:auto;transition:transform .7s cubic-bezier(.2,.65,.3,1)}
.gx-item::after{
  content:"";position:absolute;inset:0;pointer-events:none;
  background:linear-gradient(180deg,transparent 60%,rgba(16,16,20,.35));
  opacity:0;transition:opacity .4s;
}
.gx-item:hover img{transform:scale(1.04)}
.gx-item:hover::after{opacity:1}
.gx-item:focus-visible{outline:3px solid var(--ink);outline-offset:3px}
.gx-group:not(.expanded) .gx-extra{display:none}

.gx-more{display:flex;justify-content:center;margin-top:12px}
.gx-more .btn{font-family:var(--font-body);cursor:pointer}

/* CTA Instagram */
.gx-cta{margin:24px 0 0}
.gx-cta .btn svg{width:18px;height:18px;fill:currentColor}

/* ---------- Lightbox com navegação ---------- */
.gx-lb{
  position:fixed;inset:0;z-index:300;background:rgba(10,10,12,.97);
  display:flex;align-items:center;justify-content:center;
  opacity:0;pointer-events:none;transition:opacity .3s;
  overscroll-behavior:contain;touch-action:pan-y;
}
.gx-lb.open{opacity:1;pointer-events:auto}
.gx-lb-fig{
  margin:0;display:flex;flex-direction:column;align-items:center;gap:14px;
  max-width:calc(100vw - 180px);max-height:100%;padding:24px 0;
}
.gx-lb-fig img{
  max-width:100%;max-height:calc(100vh - 120px);max-height:calc(100dvh - 120px);
  width:auto;height:auto;border-radius:10px;box-shadow:0 30px 80px rgba(0,0,0,.5);
  transition:opacity .2s;
}
.gx-lb-fig img.loading{opacity:.35}
.gx-lb-fig figcaption{
  display:flex;gap:14px;align-items:baseline;color:rgba(255,255,255,.85);
  font-size:.88rem;text-align:center;
}
.gx-lb-title{font-family:var(--font-display);font-weight:600}
.gx-lb-count{color:rgba(255,255,255,.5);font-variant-numeric:tabular-nums}
.gx-lb button{
  position:absolute;border:0;border-radius:50%;cursor:pointer;
  width:52px;height:52px;display:flex;align-items:center;justify-content:center;
  background:rgba(255,255,255,.08);color:#fff;transition:background .2s;
}
.gx-lb button:hover{background:rgba(255,255,255,.18)}
.gx-lb button:focus-visible{outline:2px solid #fff;outline-offset:2px}
.gx-lb button svg{width:24px;height:24px;stroke:currentColor;fill:none;stroke-width:2}
.gx-lb-close{top:18px;right:18px}
.gx-lb-prev{left:24px;top:50%;transform:translateY(-50%)}
.gx-lb-next{right:24px;top:50%;transform:translateY(-50%)}

/* ---------- Responsivo ---------- */
@media (max-width:960px){
  .gx-grid{columns:2}
}
@media (max-width:640px){
  .gx-filter{margin-bottom:44px;gap:6px}
  .gx-filter button{padding:10px 14px;font-size:.82rem}
  .gx-group{margin-bottom:64px}
  .gx-lb-fig{max-width:100vw;padding:0 12px}
  .gx-lb-fig img{max-height:calc(100vh - 170px);max-height:calc(100dvh - 170px);border-radius:8px}
  .gx-lb-prev,.gx-lb-next{top:auto;bottom:22px;transform:none}
  .gx-lb-prev{left:calc(50% - 64px)}
  .gx-lb-next{right:calc(50% - 64px)}
  .gx-lb-close{top:12px;right:12px;width:46px;height:46px}
  .gx-lb-fig figcaption{position:absolute;top:24px;left:16px;right:72px;justify-content:flex-start;text-align:left;font-size:.82rem}
}
@media (max-width:480px){
  .gx-grid{column-gap:10px}
  .gx-item{margin-bottom:10px;border-radius:12px}
}
@media (prefers-reduced-motion:reduce){
  .gx-item img,.gx-lb,.gx-lb-fig img{transition:none}
}
