/* Grade de projetos (página inicial e página Projetos) e cards com nome no hover. */

.bonsa-proj-grid { width: 100%; max-width: 1140px; margin: 0 auto; }
.bonsa-proj-row {
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 20px;
  margin: 0 0 20px;
}
.bonsa-proj-row > .bonsa-proj-card { flex: 1 1 0; min-width: 0; }
.bonsa-proj-row > .bonsa-proj-card:only-child { flex: 0 1 calc(50% - 10px); }

.bonsa-proj-card {
  position: relative;
  display: block;
  aspect-ratio: 4/3;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid var(--bonsa-stroke);
  background: var(--bonsa-bg);
  isolation: isolate;
  cursor: pointer;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: border-color .4s ease, background .4s ease;
}
/* ".bonsa-proj-card" duas vezes: ganha da regra ".elementor img { height: auto }" do Elementor,
   que deixava a foto com a altura natural e sobrando uma faixa vazia no card. */
.bonsa-proj-card.bonsa-proj-card img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  border-radius: inherit;
  transform: scale(var(--z, 1));
  will-change: transform;
  transition: transform 1.1s cubic-bezier(.2,.7,.2,1), filter .6s ease;
}
.bonsa-proj-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(to top, rgba(20,29,31,.45), rgba(20,29,31,0) 55%);
  transition: opacity .5s ease;
}
.bonsa-proj-pill {
  position: absolute;
  z-index: 2;
  left: 14px; right: 14px; bottom: 14px;
  padding: 14px 18px;
  box-sizing: border-box;
  text-align: center;
  font-family: 'Borna', 'Poppins', Arial, sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  line-height: 1.3;
  color: var(--bonsa-text);
  background: rgba(var(--bonsa-bg-rgb), .72);
  -webkit-backdrop-filter: blur(15px) saturate(140%);
  backdrop-filter: blur(15px) saturate(140%);
  border: 1px solid var(--bonsa-stroke);
  border-radius: 50px;
  opacity: 0;
  transform: translateY(160%);
  pointer-events: none;
  transition: transform .55s cubic-bezier(.34,1.2,.64,1), opacity .4s ease, background .4s ease, color .4s ease, border-color .4s ease;
}
.bonsa-proj-empty {
  margin: 0 auto;
  max-width: 1140px;
  padding: 40px 20px;
  text-align: center;
  color: var(--text-sub);
  font-family: 'Borna', 'Poppins', Arial, sans-serif;
}

/* Computador: aparece ao passar o mouse */
@media (hover: hover) and (pointer: fine) {
  .bonsa-proj-card:hover img { transform: scale(calc(var(--z, 1) * 1.08)); filter: saturate(1.05); }
  .bonsa-proj-card:hover::before { opacity: 1; }
  .bonsa-proj-card:hover .bonsa-proj-pill { opacity: 1; transform: translateY(0); }
}
.bonsa-proj-card:focus-visible { outline: 2px solid var(--bonsa-gold); outline-offset: 3px; }
.bonsa-proj-card:focus-visible .bonsa-proj-pill { opacity: 1; transform: translateY(0); }

/* Celular: aparece quando o card passa pelo centro da tela */
.bonsa-proj-card.bonsa-inview img { transform: scale(calc(var(--z, 1) * 1.05)); filter: saturate(1.05); }
.bonsa-proj-card.bonsa-inview::before { opacity: 1; }
.bonsa-proj-card.bonsa-inview .bonsa-proj-pill { opacity: 1; transform: translateY(0); }

@media (max-width: 1000px) {
  .bonsa-proj-card { aspect-ratio: 3/2; }
  .bonsa-proj-pill { font-size: 12px; padding: 12px 14px; left: 10px; right: 10px; bottom: 10px; }
}
@media (max-width: 767px) {
  .bonsa-proj-row { flex-wrap: wrap; gap: 0; }
  .bonsa-proj-row > .bonsa-proj-card,
  .bonsa-proj-row > .bonsa-proj-card:only-child { flex: 0 0 auto; width: calc(100% - 40px); margin: 0 20px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .bonsa-proj-card img, .bonsa-proj-card::before, .bonsa-proj-pill { transition: none !important; }
  .bonsa-proj-pill { opacity: 1; transform: translateY(0); }
}
