/* Galería con lightbox para las webs de boda (autocontenido, CSP-safe). Prefijo .bb-gallery */
.bb-gallery { padding: 72px 20px; }
.bb-gallery-inner { max-width: 1140px; margin: 0 auto; }
/* El título hereda el estilo de cada plantilla (section-head/-heading); para el
   caso de h2 plano centramos sin imponer tipografía. */
.bb-gallery .bb-gallery-title { text-align: center; margin: 0 auto 32px; }

.bb-gallery-grid {
  margin-top: 30px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.bb-gallery-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.bb-gallery-item {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 16px;
  cursor: pointer;
  background: rgba(0,0,0,.04);
  border: 0;
  padding: 0;
}
.bb-gallery-item img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  transition: transform .5s ease;
}
.bb-gallery-item:hover img { transform: scale(1.07); }
.bb-gallery-item::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.18), transparent 45%);
  opacity: 0; transition: opacity .3s ease;
}
.bb-gallery-item:hover::after { opacity: 1; }

/* Encabezado "Nuestros vídeos": separa la zona de vídeos de las fotos */
.bb-gallery-videos-head { margin-top: 64px; text-align: center; }

/* Vídeos debajo de la galería: 2 columnas, último centrado si es impar */
.bb-gallery-videos {
  margin-top: 30px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px 24px;
}
.bb-gallery-video { margin: 0; }
.bb-gallery-video-frame {
  position: relative; width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 18px; overflow: hidden;
  background: #000;
  box-shadow: 0 14px 38px rgba(0,0,0,.22);
}
.bb-gallery-video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.bb-gallery-video figcaption {
  margin-top: 14px;
  text-align: center;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: .01em;
  opacity: .9;
}
/* Si el número de vídeos es impar, el último ocupa el ancho y se centra a la mitad */
.bb-gallery-video:last-child:nth-child(odd) {
  grid-column: 1 / -1;
  max-width: calc(50% - 12px);
  margin-inline: auto;
}
@media (max-width: 760px) {
  .bb-gallery-videos { grid-template-columns: 1fr; gap: 24px; }
  .bb-gallery-video:last-child:nth-child(odd) { max-width: 100%; }
}

/* Lightbox */
.bb-lightbox {
  position: fixed; inset: 0;
  z-index: 9999;
  display: none;
  align-items: center; justify-content: center;
  background: rgba(15, 8, 10, .94);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.bb-lightbox.is-open { display: flex; }
.bb-lightbox img {
  max-width: 90vw; max-height: 84vh;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
  -webkit-user-select: none; user-select: none;
}
.bb-lb-btn {
  position: absolute;
  display: flex; align-items: center; justify-content: center;
  width: 54px; height: 54px;
  border: 0; border-radius: 999px;
  background: rgba(255,255,255,.14);
  color: #fff; font-size: 30px; line-height: 1;
  cursor: pointer;
  transition: background .2s ease, transform .2s ease;
}
.bb-lb-btn:hover { background: rgba(255,255,255,.28); transform: scale(1.06); }
.bb-lb-prev { left: 4vw; }
.bb-lb-next { right: 4vw; }
.bb-lb-close { top: 22px; right: 22px; width: 46px; height: 46px; font-size: 24px; }
.bb-lb-counter {
  position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,.8); font-size: 14px; letter-spacing: .04em;
}

@media (max-width: 760px) {
  .bb-gallery-grid, .bb-gallery-grid.cols-3 { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .bb-lb-prev { left: 10px; }
  .bb-lb-next { right: 10px; }
  .bb-lb-btn { width: 46px; height: 46px; font-size: 26px; }
}
