/* ==========================================================
   PROJETOS / GALERIA
========================================================== */

.page-hero-projects {
  background:
    linear-gradient(rgba(15,12,10,.66), rgba(15,12,10,.72)),
    url("../assets/images/projetos/hero-projetos.webp")
    center center / cover no-repeat;
}

.gallery-section {
  background: var(--color-bg);
}

.gallery-toolbar {
  position: sticky;
  top: calc(var(--header-height) + 12px);
  z-index: 20;
  margin-bottom: 40px;
  padding: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border: 1px solid var(--color-line);
  border-radius: 999px;
  background: rgba(245, 242, 237, 0.90);
  backdrop-filter: blur(12px);
}

.filter-btn {
  min-height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--color-text-soft);
  font-size: .86rem;
  transition: var(--transition);
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--color-dark);
  color: white;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.gallery-card {
  position: relative;
  min-height: 360px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius-md);
  background: #d6cec4;
  text-align: left;
}

.gallery-card.hidden-card {
  display: none;
}

.gallery-card img {
  width: 100%;
  height: 100%;
  min-height: 360px;
  object-fit: cover;
  transition: transform 500ms ease;
}

.gallery-card:hover img {
  transform: scale(1.04);
}

.gallery-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0,0,0,.62), transparent 58%);
}

.gallery-card span {
  position: absolute;
  z-index: 2;
  left: 22px;
  bottom: 20px;
  color: white;
  font-size: 1.1rem;
}

/* MODAL */
.image-modal {
  position: fixed;
  z-index: 2000;
  inset: 0;
  padding: 40px;
  display: none;
  place-items: center;
  background: rgba(8, 7, 6, 0.95);
}

.image-modal.open {
  display: grid;
}

.image-modal img {
  max-width: min(92vw, 1500px);
  max-height: 82vh;
  object-fit: contain;
}

.image-modal p {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,.78);
  text-align: center;
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 28px;
  width: 52px;
  height: 52px;
  border: 0;
  background: transparent;
  color: white;
  font-size: 2.6rem;
}

@media (max-width: 900px) {
  .gallery-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  .gallery-toolbar {
    position: static;
    border-radius: var(--radius-md);
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .gallery-card,
  .gallery-card img {
    min-height: 320px;
  }
}

.gallery-card span small { display:block; margin-bottom:6px; font-size:.68rem; letter-spacing:.08em; text-transform:uppercase; opacity:.72; }
.gallery-more { display:flex; justify-content:center; margin-top:34px; }
.gallery-more [hidden] { display:none; }
