.gallery {
  background: var(--cream);
}

/* Masonry via CSS columns: lida bem com fotos retrato + paisagem misturadas */
.gallery-grid {
  column-count: 3;
  column-gap: 1.25rem;
  margin-top: 3rem;
}

.gallery-item {
  display: block;
  width: 100%;
  margin: 0 0 1.25rem;
  padding: 0;
  border: none;
  background: none;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  break-inside: avoid;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  /* botão de abrir o lightbox: duplo clique não deve selecionar a legenda */
  -webkit-user-select: none;
  user-select: none;
}

.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.6s ease;
}

.gallery-item:hover img,
.gallery-item:focus-visible img {
  transform: scale(1.06);
}

.gallery-item:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 3px;
}

.gallery-cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 2rem 1.25rem 1rem;
  background: linear-gradient(180deg, transparent, rgba(28, 28, 28, 0.85));
  color: var(--marble);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-align: left;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.35s ease, transform 0.35s ease;
  /* Uma linha por parte: estoura em reticências, nunca quebra (texto inteiro no lightbox) */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gallery-item:hover .gallery-cap,
.gallery-item:focus-visible .gallery-cap {
  opacity: 1;
  transform: translateY(0);
}

/* Touch (sem hover): nome sempre visível — no tap o lightbox abre antes de ler */
@media (hover: none) {
  .gallery-cap {
    opacity: 1;
    transform: none;
  }
}

.gallery-cap strong {
  display: block;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  background: rgba(15, 15, 15, 0.94);
  backdrop-filter: blur(4px);
}

.lightbox.active {
  display: flex;
  animation: lbFade 0.25s ease;
}

@keyframes lbFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.lightbox-fig {
  margin: 0;
  max-width: min(1100px, 92vw);
  text-align: center;
}

.lightbox-fig img {
  max-width: 100%;
  max-height: 80vh;
  margin: 0 auto;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

.lightbox-fig figcaption {
  margin-top: 1.25rem;
  color: rgba(245, 242, 238, 0.85);
  font-size: 0.95rem;
  letter-spacing: 0.03em;
}

/* Bolinhas de paginação: posição e "há mais fotos". Aparecem em todos os tamanhos. */
.lightbox-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.9rem;
}
.lightbox-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(245, 242, 238, 0.35);
  transition: background 0.25s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.lightbox-dots span.is-active {
  background: var(--red-bright);
  transform: scale(1.6);
}

.lightbox-close,
.lightbox-nav {
  position: absolute;
  background: rgba(245, 242, 238, 0.1);
  color: var(--marble);
  border: 1px solid rgba(245, 242, 238, 0.25);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s, transform 0.25s;
  line-height: 1;
}

.lightbox-close:hover,
.lightbox-nav:hover {
  background: var(--red);
  border-color: var(--red);
}

.lightbox-close {
  top: 1.5rem;
  right: 1.5rem;
  width: 48px;
  height: 48px;
  font-size: 2rem;
}

.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
  font-size: 2.25rem;
}

.lightbox-nav:hover { transform: translateY(-50%) scale(1.05); }

.lightbox-prev { left: 1.5rem; }
.lightbox-next { right: 1.5rem; }

/* Overdrive: a foto morfa da miniatura pra tela cheia (View Transitions).
   object-fit casa o recorte de cada ponta (cover na chapa, contain na tela cheia). */
::view-transition-group(lightbox-zoom) {
  animation-duration: 0.5s;
  animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}
::view-transition-old(lightbox-zoom) { object-fit: cover; }
::view-transition-new(lightbox-zoom) { object-fit: contain; }

/* ---------- Linha completa de produtos: chips acima do grid ---------- */
.products-all {
  margin-top: 2.5rem;
  text-align: center;
}

.products-all-lead {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.35rem;
  color: var(--charcoal);
  margin-bottom: 1.5rem;
}

.products-all-list {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  max-width: 760px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.3rem 0.85rem;
}

/* Texto corrido, não chip: separador em losango dourado entre os itens */
.products-all-list li {
  position: relative;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
  color: var(--slate);
}

.products-all-list li:not(:last-child)::after {
  content: '\25C6';
  margin-left: 0.85rem;
  font-size: 0.4rem;
  vertical-align: middle;
  color: var(--gold);
}
