/* ============================================
   TRAVESSIGA — GALERIA
   Depende de styles.css (variáveis :root, header, footer, .btn).
   ============================================ */

.gal-main { background: var(--quase-branco); }

/* --- Cabeçalho da galeria --- */
.gal-hero {
  background: var(--azul);
  color: var(--branco);
  padding: 120px 0 56px;
  text-align: center;
}
.gal-hero .label-tag { color: var(--azul-aqua); }
.gal-hero .heading-xl { color: var(--branco); margin-bottom: 12px; }
.gal-hero__lead {
  font-size: 1.0625rem;
  color: var(--azul-claro);
  max-width: 560px;
  margin: 0 auto;
}

/* --- Grid masonry (2 → 3 → 4 colunas) --- */
.gal-grid {
  column-count: 2;
  column-gap: 12px;
  padding: 40px 0 80px;
}
.gal-grid > * { break-inside: avoid; margin-bottom: 12px; }

.gal-item {
  display: block;
  width: 100%;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--azul-claro);
  cursor: zoom-in;
  position: relative;
}
.gal-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.5s ease;
}
/* Antes da imagem carregar: reserva uma caixa (senão todos os itens
   colapsam no topo e o lazy load carrega tudo de uma vez). */
.gal-item:not(.loaded) { aspect-ratio: 3 / 4; }
.gal-item:not(.loaded) img { height: 100%; object-fit: cover; font-size: 0; color: transparent; }
.gal-item.loaded { aspect-ratio: auto; }
.gal-item:hover img { transform: scale(1.05); }
.gal-item:focus-visible {
  outline: 3px solid var(--amarelo);
  outline-offset: 2px;
}

/* --- Estado vazio (enquanto as fotos não sobem) --- */
.gal-empty {
  text-align: center;
  padding: 80px 24px 100px;
  color: var(--texto-light);
}
.gal-empty strong {
  display: block;
  font-family: var(--font-condensed);
  font-style: italic;
  text-transform: uppercase;
  font-size: 1.5rem;
  color: var(--texto);
  margin-bottom: 8px;
}

/* ============================================
   PAGINAÇÃO
   ============================================ */
.gal-pager__info {
  text-align: center;
  font-family: var(--font-condensed);
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--texto-light);
  font-size: 0.875rem;
  margin: 28px 0 12px;
}

.gal-pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
}
.gal-pager:first-of-type { margin-bottom: 8px; }
.gal-grid + .gal-pager { padding: 32px 0 80px; }

.gal-pager__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--azul);
  background: var(--branco);
  border: 1px solid var(--borda);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
a.gal-pager__btn:hover {
  background: var(--azul);
  color: var(--branco);
  border-color: var(--azul);
}
.gal-pager__btn.is-current {
  background: var(--amarelo);
  color: var(--preto);
  border-color: var(--amarelo);
  cursor: default;
}
.gal-pager__btn.is-disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.gal-pager__btn--nav { font-weight: 800; }
.gal-pager__btn:focus-visible {
  outline: 3px solid var(--amarelo);
  outline-offset: 2px;
}
.gal-pager__dots {
  display: inline-flex;
  align-items: flex-end;
  padding: 0 4px;
  color: var(--texto-light);
  font-weight: 700;
}

@media (max-width: 600px) {
  .gal-pager__btn--nav {
    flex-basis: 100%;
    order: 2;
  }
  .gal-pager__btn--nav:first-child { order: 0; margin-bottom: 4px; }
}

/* ============================================
   LIGHTBOX
   ============================================ */
.glb {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(11, 16, 32, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  align-items: center;
  justify-content: center;
}
.glb.open { display: flex; }

.glb__stage {
  max-width: 92vw;
  max-height: 82vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.glb__img {
  max-width: 92vw;
  max-height: 82vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  user-select: none;
}

.glb__btn {
  position: absolute;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--branco);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background var(--transition), opacity var(--transition);
}
.glb__btn:hover { background: rgba(255, 255, 255, 0.2); }
.glb__btn:focus-visible {
  outline: 3px solid var(--amarelo);
  outline-offset: 2px;
}

.glb__close {
  top: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  font-size: 1.75rem;
  line-height: 1;
}
.glb__nav {
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
  font-size: 2rem;
  line-height: 1;
}
.glb__prev { left: 20px; }
.glb__next { right: 20px; }

.glb__counter {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--branco);
  font-family: var(--font-condensed);
  font-style: italic;
  font-weight: 700;
  letter-spacing: 0.06em;
  font-size: 0.9375rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 6px 18px;
  border-radius: 999px;
}

/* ============================================
   TABLET (768px+)
   ============================================ */
@media (min-width: 768px) {
  .gal-hero { padding: 140px 0 64px; }
  .gal-grid { column-count: 3; column-gap: 16px; }
  .gal-grid > * { margin-bottom: 16px; }
}

/* ============================================
   DESKTOP (1024px+)
   ============================================ */
@media (min-width: 1024px) {
  .gal-grid { column-count: 4; }
}

/* --- Toque: navegação maior, sem hover-zoom preso --- */
@media (hover: none) {
  .gal-item:hover img { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .gal-item img { transition: none; }
}
