/* * {
  box-sizing: border-box;
} */

#gal {
  display: grid;
  max-width: 1910px;
  width: 98%;
  margin: auto;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 1rem;
  grid-auto-flow: dense;
  padding: 8rem 0 6rem !important;
}
@media (max-width: 720px) {
  #gal {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
}

#gal .item-galeria {
  display: inline-block;
}

#gal .item-galeria.ancho {
  grid-column: span 2;
}

#gal .item-galeria.alto {
  grid-row: span 2;
}

#gal .item-galeria.grande {
  grid-column: span 2;
  grid-row: span 2;
}

.piedeobraGal {
  text-align: left;
  padding: 0px 10px;
  line-height: 1.2;
  font-size: 0.75rem;
}

.obraTitAut {
  font-style: italic;
  font-size: 1rem;
  color: var(--bs-success);
}

.obraTitGal {
  font-weight: 700;
  font-size: 1rem;
}

.galink {
  color: var(--bs-danger-text-emphasis);
}

/* ═══════════════════════════════════════════════════════════
   Lightbox personalizado  #pue-overlay
   Layout: flexbox column — sin position:fixed en los hijos
   (backdrop-filter crea stacking context y rompe fixed en hijos)
   ═══════════════════════════════════════════════════════════ */

html.pue-open { overflow: hidden; }

/* Overlay: ocupa todo el viewport, columna flex */
#pue-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  flex-direction: column;
  /* sin background propio: el backdrop lo pone */
}
#pue-overlay.active { display: flex; }

/* Fondo oscuro con blur — position:absolute para no afectar fixed de hijos */
#pue-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 0;
}

/* ── Barra superior: contador + botones fullscreen + cerrar ── */
.pue-topbar {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  flex-shrink: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.5), transparent);
}
.pue-counter {
  font-family: 'Raleway', sans-serif;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.7);
  margin-right: auto;
  padding-left: 4px;
}

/* ── Escenario central: imagen/iframe ── */
.pue-stage {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  min-height: 0;
}

/* ── Media (imagen o iframe) ── */
.pue-media {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 0 56px; /* espacio para las flechas */
}
.pue-media img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}
/* Iframe de vimeo: ratio 16:9 */
.pue-media iframe {
  width:  min(92vw, calc(85vh * 16 / 9));
  height: min(calc(92vw * 9 / 16), 85vh);
  border: 0;
}
/* Iframe de página de obra: casi todo el viewport */
.pue-media.is-page {
  padding: 0;
}
.pue-media.is-page iframe {
  width:  92vw;
  height: 88vh;
}

/* ── Caption en la parte inferior — sin fondo, mismos estilos que galería ── */
.pue-footer {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  padding: 10px 20px 16px; /* sin background */
}
.pue-caption {
  /* mismas proporciones que .piedeobraGal en la galería */
  text-align: left;
  padding: 0 10px;
  line-height: 1.2;
  font-size: 0.75rem;
  font-family: 'Raleway', sans-serif;
  color: #ffddae;
  max-width: 800px;
  margin: 0 auto;
}
/* Cada dato en su propia línea — display:block fuerza el salto;
   el <br> que sigue en el HTML queda suprimido con el selector + br */
.pue-caption .obraTitAut {
  font-style: italic;
  font-size: 1rem;
  color: #e79858;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pue-caption .obraTitGal {
  font-weight: 700;
  font-size: 1rem;
  color: #ffddae;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Ocultar el <br> inmediatamente posterior a estos bloques (evita línea en blanco) */
.pue-caption .obraTitAut + br,
.pue-caption .obraTitGal + br { display: none; }
.pue-caption a       { color: #e79858; text-decoration: none; }
.pue-caption a:hover { text-decoration: underline; }

/* ── Botones genéricos ── */
.pue-btn {
  background: rgba(0, 0, 0, 0.35);
  border: none;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: color 0.15s, background 0.15s;
}
.pue-btn:hover {
  color: #fff;
  background: rgba(0, 0, 0, 0.65);
}
/* Cerrar y Fullscreen (en topbar) */
.pue-close,
.pue-fs {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.6rem;
}
/* Flechas prev/next con desplegarC.svg — el SVG ya tiene su propio círculo */
.pue-prev,
.pue-next {
  position: absolute;
  top: 50%;
  z-index: 4;
  width: 44px;
  height: 44px;
  background: none;   /* el SVG trae su propio fondo circular */
  border-radius: 0;
  font-size: 0;
  padding: 2px;
  opacity: 0.85;
  transition: opacity 0.15s;
}
.pue-prev { left: 10px;  transform: translateY(-50%) rotate(90deg);  }
.pue-next { right: 10px; transform: translateY(-50%) rotate(-90deg); }
.pue-prev:hover,
.pue-next:hover { opacity: 1; background: none; }

.pue-prev img,
.pue-next img {
  width: 40px;
  height: 40px;
  display: block;
}
