/* ============================================
   GALERIA-PARTO — grid justificado + lightbox
   Fonte ÚNICA do visual de grid+lightbox.
   Carregado por /portfolio/ e /proposta/p/.
   Depende das vars --fundo-cinza, --transition, --branco (definidas pela página).
   ============================================ */

/* ─── Justified grid ─── */
.jrow {
  display: flex;
  overflow: hidden;
  flex-shrink: 0;
}
.jitem {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  background: var(--fundo-cinza);
  flex-shrink: 0;
}
.jitem img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s ease;
}
.jitem:hover img { transform: scale(1.04); }
.jitem::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  transition: background var(--transition);
  pointer-events: none;
}
.jitem:hover::after { background: rgba(0, 0, 0, 0.12); }

/* ─── Lightbox ─── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(20, 20, 20, 0.93);
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox[hidden] { display: none; }
.lightbox-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: min(90vw, 900px);
  width: 100%;
  gap: 16px;
}
.lightbox-img {
  max-height: 78vh;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  display: block;
  border-radius: 0;
}
.lightbox-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
}
.lightbox-location {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400;
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  text-align: center;
}
.lightbox-cta {
  font-size: 14px;
  padding: 10px 28px;
}
.lightbox-close {
  position: fixed;
  top: 20px;
  right: 24px;
  background: none;
  border: none;
  font-size: 36px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: color var(--transition);
  z-index: 510;
  padding: 4px;
}
.lightbox-close:hover { color: var(--branco); }
.lightbox-prev,
.lightbox-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  width: 52px;
  height: 52px;
  font-size: 22px;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), color var(--transition);
  z-index: 510;
}
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }
.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(255, 255, 255, 0.18);
  color: var(--branco);
}

/* ─── Lightbox mobile (controles menores) ─── */
@media (max-width: 768px) {
  .lightbox-prev,
  .lightbox-next {
    width: 44px;
    height: 44px;
    font-size: 18px;
  }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
  .lightbox-img { max-height: 65vh; }
}
