/* =============================================================
   galeria.css — Estilos de la página pública de Galería
   ============================================================= */

/* ─── PAGE HEADER ─── */
.page-header {
  background: linear-gradient(100deg, var(--azul) 60%, #0d1f3c 100%);
  padding: 64px 0 56px;
  position: relative;
  overflow: hidden;
}
.page-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 30px,
    rgba(255, 255, 255, 0.018) 30px,
    rgba(255, 255, 255, 0.018) 31px
  );
}
.page-header::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--oro), var(--rojo), var(--oro));
}
.page-header-content {
  position: relative;
  z-index: 1;
}
.page-eyebrow {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--oro);
  border-left: 3px solid var(--oro);
  padding-left: 0.6rem;
  margin-bottom: 0.8rem;
}
.page-header h1 {
  font-family: var(--fuente-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 900;
  color: #fff;
  margin: 0;
}
.page-header p {
  color: rgba(255, 255, 255, 0.65);
  font-size: 1rem;
  margin: 0.8rem 0 0;
}

/* ─── FILTER BAR ─── */
.filter-bar {
  background: #fff;
  border-bottom: 1px solid #e8e4dd;
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}
.filter-btn {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.4rem 1.1rem;
  border-radius: 0;
  border: 1.5px solid #ddd;
  background: transparent;
  color: var(--gris-medio);
  cursor: pointer;
  transition: all 0.2s;
}
.filter-btn:hover,
.filter-btn.active {
  background: var(--azul);
  border-color: var(--azul);
  color: #fff;
}
.search-input {
  font-size: 0.85rem;
  border: 1.5px solid #ddd;
  border-radius: 0;
  padding: 0.4rem 1rem;
  outline: none;
  transition: border-color 0.2s;
  width: 220px;
}
.search-input:focus {
  border-color: var(--azul);
}

/* ─── GALLERY SECTION ─── */
.gallery-section {
  background: var(--gris-claro);
  padding: 60px 0 80px;
}

/* ─── COUNTER BADGE ─── */
.results-count {
  font-size: 0.78rem;
  color: var(--gris-medio);
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* ─── GALLERY GRID (masonry) ─── */
.gallery-grid {
  columns: 4;
  column-gap: 16px;
}
@media (max-width: 1200px) {
  .gallery-grid { columns: 3; }
}
@media (max-width: 768px) {
  .gallery-grid { columns: 2; }
}
@media (max-width: 480px) {
  .gallery-grid { columns: 1; }
}

.gallery-item {
  break-inside: avoid;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  background: var(--azul);
}
.gallery-item img {
  width: 100%;
  display: block;
  transition: transform 0.4s ease, opacity 0.3s;
  opacity: 1;
}
.gallery-item:hover img {
  transform: scale(1.06);
  opacity: 0.75;
}

/* ─── OVERLAY ─── */
.gallery-item-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(26, 58, 92, 0.85) 0%, transparent 55%);
  opacity: 0;
  transition: opacity 0.3s;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1rem;
}
.gallery-item:hover .gallery-item-overlay {
  opacity: 1;
}
.gallery-item-overlay .item-tag {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--oro);
  margin-bottom: 0.3rem;
}
.gallery-item-overlay .item-title {
  font-family: var(--fuente-display);
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  margin: 0;
}
.gallery-item-overlay .item-zoom {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1rem;
  backdrop-filter: blur(4px);
}

/* ─── PLACEHOLDER (sin foto) ─── */
.gallery-placeholder {
  width: 100%;
  background: linear-gradient(135deg, var(--azul) 0%, #0d1f3c 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1rem;
  min-height: 160px;
  gap: 0.5rem;
}
.gallery-placeholder i {
  font-size: 2.2rem;
  color: rgba(212, 160, 23, 0.35);
}
.gallery-placeholder span {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.3);
}

/* ─── SIN RESULTADOS ─── */
#noResults {
  padding: 4rem 0;
  text-align: center;
}
#noResults i {
  font-size: 2.5rem;
  color: var(--gris-medio);
}
#noResults p {
  color: var(--gris-medio);
  margin-top: 0.8rem;
}

/* ─── LIGHTBOX ─── */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.lightbox-overlay.active {
  opacity: 1;
  pointer-events: all;
}
.lightbox-inner {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.lightbox-inner img {
  max-width: 90vw;
  max-height: 78vh;
  object-fit: contain;
  display: block;
  border: 2px solid rgba(212, 160, 23, 0.3);
}
.lightbox-caption {
  margin-top: 0.8rem;
  text-align: center;
}
.lightbox-caption .lb-tag {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--oro);
  margin-bottom: 0.2rem;
}
.lightbox-caption .lb-title {
  font-family: var(--fuente-display);
  font-size: 1.05rem;
  color: #fff;
  font-weight: 700;
}
.lightbox-counter {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 0.3rem;
}
.lb-close {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 2001;
}
.lb-close:hover {
  background: var(--rojo);
}
.lb-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  border-radius: 0;
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s;
  z-index: 2001;
}
.lb-nav:hover {
  background: var(--azul);
  border-color: var(--oro);
}
.lb-prev { left: 1.5rem; }
.lb-next { right: 1.5rem; }

@media (max-width: 576px) {
  .lb-prev { left: 0.5rem; }
  .lb-next { right: 0.5rem; }
}