/* ==========================================================================
   Galeria
   (usa também home.css p/ revelar ao rolar; lightbox em components.css)
   ========================================================================== */

.gallery {
  background: var(--c-menu-fg);
  padding: var(--section-y) calc(var(--frame) + var(--gutter));
}

/* --------------------------------------------------------------------------
   Filtros: pílulas centralizadas
   -------------------------------------------------------------------------- */

.gallery__filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  max-width: 1600px;
  margin: 0 auto clamp(32px, 3.4vw, 52px);
}

.gallery__filter {
  padding: 12px 22px;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  color: var(--c-menu-bg);
  background: transparent;
  border: 1px solid rgba(159, 55, 39, 0.35);
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.gallery__filter:hover {
  border-color: var(--c-menu-bg);
}

.gallery__filter.is-active {
  color: var(--c-menu-fg);
  background: var(--c-menu-bg);
  border-color: var(--c-menu-bg);
}

/* --------------------------------------------------------------------------
   Grade em colunas (alturas variadas, estilo mural)
   -------------------------------------------------------------------------- */

.gallery__grid {
  max-width: 1600px;
  margin: 0 auto;
  columns: 4 260px;
  column-gap: clamp(10px, 1vw, 16px);
  transition: opacity 0.25s ease;
}

.gallery__grid.is-switching {
  opacity: 0;
}

.gallery__item {
  position: relative;
  display: block;
  margin-bottom: clamp(10px, 1vw, 16px);
  overflow: hidden;
  border-radius: 10px;
  break-inside: avoid;
  cursor: zoom-in;
  animation: gallery-in 0.6s var(--ease) both;
  animation-delay: calc(min(var(--i, 0), 12) * 0.04s);
}

.gallery__item[hidden] {
  display: none;
}

.gallery__item img {
  width: 100%;
  height: auto;
  transition: transform 0.8s var(--ease);
}

/* véu terracota + lupa no hover */
.gallery__item::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fef5d8' stroke-width='1.5'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='M16 16l4.5 4.5M11 8v6M8 11h6'/%3E%3C/svg%3E") center / 40px no-repeat,
    rgba(159, 55, 39, 0.5);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.gallery__item:hover img {
  transform: scale(1.05);
}

.gallery__item:hover::after {
  opacity: 1;
}

@keyframes gallery-in {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .gallery__item { animation: none; }
}
