/* =============================================
   GALERIAS — estilos
   ============================================= */

/* =============================================
   HERO
   ============================================= */

.gal-hero {
  position: relative;
  height: 36vh;
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 40px;
  overflow: hidden;
  margin-top: 96px; /* ← header desktop */
  background: linear-gradient(135deg, rgba(107,33,232,0.2), rgba(6,6,8,1));
}

.gal-hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 100% 100% at 70% 0%, rgba(232,0,122,0.22) 0%, transparent 60%),
    radial-gradient(ellipse 80% 80% at 0% 100%, rgba(107,33,232,0.22) 0%, transparent 55%),
    linear-gradient(to bottom, rgba(6,6,8,0.3), rgba(6,6,8,0.9));
}

.gal-hero-content { position: relative; z-index: 1; }

.gal-hero-content h1 {
  font-family: var(--font-body);
  font-weight: 900;
  font-size: clamp(2.4rem, 7vw, 5.5rem);
  letter-spacing: -2px;
  line-height: 1;
  color: var(--blanco);
  margin: 12px 0 14px;
}

.gal-hero-content p {
  font-size: 15px;
  font-weight: 300;
  color: var(--gris);
  max-width: 400px;
  line-height: 1.7;
  margin: 0 auto;
}

/* =============================================
   TABS
   ============================================= */

.gal-tabs-wrap {
  position: sticky;
  top: 0; /* se queda fijo al hacer scroll */
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 72px;
  border-bottom: 1px solid var(--glass-border);
  background: rgba(6,6,8,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  gap: 20px;
  flex-wrap: wrap;
}

.gal-tabs { display: flex; gap: 0; }

.gal-tab {
  display: flex;
  align-items: center;
  gap: 12px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 24px 40px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gris-oscuro);
  cursor: pointer;
  transition: color 0.3s, border-color 0.3s;
  margin-bottom: -1px;
  min-height: 72px;
  flex-direction: column;
  gap: 8px;
}

.gal-tab svg {
  stroke: currentColor;
  width: 28px;
  height: 28px;
}
.gal-tab:hover { color: var(--gris); }
.gal-tab.active { color: var(--blanco); border-bottom-color: var(--rosa); }

/* Contador en tab */
.gal-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(232,0,122,0.15);
  color: var(--rosa);
  font-size: 9px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  min-width: 20px;
  margin-left: 4px;
  transition: background 0.3s, color 0.3s;
}

.gal-tab.active .gal-tab-count {
  background: var(--rosa);
  color: var(--blanco);
}

.gal-mes-badge {
  font-size: 11px;
  font-weight: 300;
  color: var(--gris-oscuro);
  letter-spacing: 1px;
  white-space: nowrap;
  padding: 8px 0;
}

.gal-mes-badge strong {
  color: var(--rosa);
  font-weight: 700;
  margin-left: 4px;
}

/* =============================================
   SECCIÓN BASE
   ============================================= */

.gal-section {
  position: relative;
  z-index: 1;
  padding: 48px 72px 80px;
}

/* Mensaje vacío */
.gal-empty {
  text-align: center;
  padding: 80px 24px;
  color: var(--gris-oscuro);
  font-size: 14px;
  font-weight: 300;
  letter-spacing: 0.5px;
  line-height: 1.8;
}

.gal-empty strong { color: var(--gris); }

/* =============================================
   GRID FOTOS
   ============================================= */

.gal-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 1400px;
  margin: 0 auto;
}

.gal-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background: var(--negro-card);
  border: 1px solid var(--glass-border);
  transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
  /* Evita que el hover se dispare accidentalmente en touch */
  -webkit-tap-highlight-color: transparent;
}

.gal-item:hover {
  border-color: var(--glass-hover);
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(232,0,122,0.12);
}

.gal-item img {
  display: block;
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  transition: transform 0.5s ease, filter 0.4s;
  filter: brightness(0.85);
}

.gal-item:hover img {
  transform: scale(1.04);
  filter: brightness(0.65);
}

.gal-item-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6,6,8,0.3);
  opacity: 0;
  transition: opacity 0.3s;
}

.gal-item-overlay svg {
  stroke: var(--blanco);
  filter: drop-shadow(0 0 8px rgba(232,0,122,0.6));
  transition: transform 0.3s;
}

.gal-item:hover .gal-item-overlay { opacity: 1; }
.gal-item:hover .gal-item-overlay svg { transform: scale(1.1); }

/* En touch — mostrar overlay siempre levemente */
@media (hover: none) {
  .gal-item-overlay { opacity: 0.7; }
  .gal-item:active .gal-item-overlay { opacity: 1; }
  .gal-item:active img { filter: brightness(0.6); }
}

/* =============================================
   GRID VIDEOS
   ============================================= */

.gal-video-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 1400px;
  margin: 0 auto;
}

.gal-video-item {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  background: #0a0a0e;
  border: 1px solid var(--glass-border);
  aspect-ratio: 9/16;
  transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
  -webkit-tap-highlight-color: transparent;
}

.gal-video-item.horizontal {
  aspect-ratio: 16/9;
  grid-column: span 2;
}

.gal-video-item:hover {
  border-color: var(--glass-hover);
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(232,0,122,0.12);
}

.gal-video-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: brightness(0.6);
  transition: filter 0.4s;
}

.gal-video-item:hover video { filter: brightness(0.4); }

.gal-video-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6,6,8,0.2);
  transition: background 0.3s;
}

.gal-video-item:hover .gal-video-overlay { background: rgba(6,6,8,0.4); }

.gal-play-btn {
  width: 56px; height: 56px;
  background: rgba(232,0,122,0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 24px var(--rosa-glow), 0 0 60px rgba(232,0,122,0.3);
  transition: transform 0.3s, box-shadow 0.3s;
}

.gal-play-btn svg { fill: var(--blanco); margin-left: 3px; }

.gal-video-item:hover .gal-play-btn {
  transform: scale(1.12);
  box-shadow: 0 0 36px var(--rosa-glow), 0 0 80px rgba(232,0,122,0.4);
}

/* =============================================
   LIGHTBOX FOTOS
   ============================================= */

.gal-lightbox {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(4,4,6,0.96);
  backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.gal-lightbox.open { opacity: 1; pointer-events: all; }

.gal-lb-box {
  position: relative;
  max-width: 1000px;
  width: 100%;
  transform: scale(0.94);
  transition: transform 0.3s;
}

.gal-lightbox.open .gal-lb-box { transform: scale(1); }

.gal-lb-img-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

#gal-lb-img {
  display: block;
  max-width: 100%;
  max-height: 86vh;
  width: auto;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 40px 100px rgba(0,0,0,0.8);
  transition: opacity 0.25s;
}

.gal-lb-spinner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}

.gal-lb-spinner.visible { opacity: 1; }

.lb-spinner {
  width: 32px; height: 32px;
  border: 2px solid rgba(232,0,122,0.2);
  border-top-color: var(--rosa);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.gal-lb-close {
  position: absolute;
  top: -14px; right: -14px;
  width: 38px; height: 38px;
  background: var(--rosa);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px var(--rosa-glow);
  transition: transform 0.2s;
  z-index: 10;
}

.gal-lb-close:hover { transform: scale(1.1); }
.gal-lb-close svg { stroke: var(--blanco); fill: none; }

.gal-lb-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 46px; height: 46px;
  background: rgba(10,10,14,0.85);
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s, border-color 0.3s;
  z-index: 10;
}

.gal-lb-nav:hover { background: rgba(232,0,122,0.2); border-color: var(--rosa); }
.gal-lb-nav svg { stroke: var(--blanco); fill: none; }
.gal-lb-prev { left: 16px; }
.gal-lb-next { right: 16px; }

.gal-lb-counter {
  position: absolute;
  bottom: -32px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--gris-oscuro);
  white-space: nowrap;
}

/* =============================================
   LIGHTBOX VIDEO
   ============================================= */

.gal-video-lightbox {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(4,4,6,0.97);
  backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.gal-video-lightbox.open { opacity: 1; pointer-events: all; }

.gal-vlb-box {
  position: relative;
  max-width: 900px;
  width: 100%;
  transform: scale(0.94);
  transition: transform 0.3s;
}

.gal-video-lightbox.open .gal-vlb-box { transform: scale(1); }

#gal-vlb-video {
  display: block;
  width: 100%;
  max-height: 88vh;
  border-radius: 10px;
  box-shadow: 0 40px 100px rgba(0,0,0,0.9);
}

/* =============================================
   RESPONSIVE
   ============================================= */

@media (max-width: 1024px) {
  .gal-grid { grid-template-columns: repeat(2, 1fr); }
  .gal-video-grid { grid-template-columns: repeat(2, 1fr); }
  .gal-tabs-wrap { padding: 0 40px; }
  .gal-section { padding: 40px 40px 64px; }
}

@media (max-width: 768px) {
  /* Hero — margin-top = header móvil */
  .gal-hero {
    margin-top: 72px;
    height: auto;
    min-height: 180px;
    padding: 40px 20px 32px;
  }

  .gal-hero-content h1 { font-size: clamp(2rem, 9vw, 2.8rem); letter-spacing: -1px; }
  .gal-hero-content p { font-size: 13px; }

  /* Tabs — más compactos y táctiles */
  .gal-tabs-wrap {
    padding: 0 16px;
    gap: 0;
    position: sticky;
    top: 0;
  }

  .gal-tab {
    padding: 14px 16px;
    font-size: 10px;
    letter-spacing: 2px;
    gap: 6px;
    flex: 1;
    justify-content: center;
    min-height: 52px;
  }

  .gal-tab svg { width: 14px; height: 14px; }

  .gal-mes-badge {
    width: 100%;
    text-align: center;
    padding: 8px 0;
    font-size: 10px;
    border-top: 1px solid var(--glass-border);
  }

  /* Grid fotos — 2 columnas en móvil */
  .gal-section { padding: 28px 16px 52px; }
  .gal-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }

  /* Grid videos — 1 columna en móvil (más legibles) */
  .gal-video-grid { grid-template-columns: 1fr; gap: 12px; }
  .gal-video-item { aspect-ratio: 16/9; } /* horizontal en móvil por default */
  .gal-video-item.horizontal { grid-column: span 1; }

  /* Botón play más grande en touch */
  .gal-play-btn { width: 52px; height: 52px; }

  /* Lightbox fotos — pantalla completa */
  .gal-lightbox { padding: 0; align-items: center; justify-content: center; }
  .gal-lb-box { 
    max-width: 100%; 
    height: auto;
    display: block;
    padding-top: 56px; /* espacio para el botón cerrar */
    padding-bottom: 40px; /* espacio para el contador */
  }
  #gal-lb-img { 
    max-height: 80svh; 
    border-radius: 0; 
    box-shadow: none; 
  }
  .gal-lb-box { max-width: 100%; height: 100vh; display: flex; flex-direction: column; justify-content: center; }
  #gal-lb-img { max-height: 90vh; border-radius: 0; box-shadow: none; }
   .gal-lb-close {
    position: fixed;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    z-index: 9999;
  }
  .gal-lb-counter { bottom: 20px; background: rgba(6,6,8,0.7); padding: 6px 14px; border-radius: 20px; }
  .gal-lb-nav {
    display: flex;
    width: 40px;
    height: 40px;
  } 
  .gal-lb-prev { left: 8px; }
  .gal-lb-next { right: 8px; }
  /* swipe reemplaza a los botones en móvil */

  /* Lightbox video */
  .gal-vlb-box { max-width: 100%; }
  #gal-vlb-video { border-radius: 0; max-height: 100vh; }
}

@media (max-width: 480px) {
  .gal-hero { margin-top: 64px; padding: 32px 16px 24px; min-height: 160px; }
  .gal-hero-content h1 { font-size: 1.8rem; }
  .gal-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .gal-section { padding: 24px 12px 44px; }
  .gal-tab { font-size: 9px; letter-spacing: 1px; padding: 12px 10px; }
  .gal-tab-count { display: none; } /* sin espacio para el contador en pantallas muy pequeñas */
}

/* =============================================
   GALERÍA — álbumes por evento
   ============================================= */

.gal-albumes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 1400px;
  margin: 0 auto;
}

.gal-album-card {
  position: relative;
  aspect-ratio: 4/3;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--glass-border);
  transition: transform 0.35s ease, border-color 0.35s, box-shadow 0.35s;
}

.gal-album-card:hover {
  transform: translateY(-5px);
  border-color: var(--glass-hover);
  box-shadow: 0 20px 60px rgba(232,0,122,0.15);
}

.gal-album-img {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: brightness(0.55);
  transition: transform 0.5s ease, filter 0.4s;
}

.gal-album-card:hover .gal-album-img {
  transform: scale(1.06);
  filter: brightness(0.38);
}

.gal-album-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 20px;
  background: linear-gradient(to top, rgba(6,6,8,0.95) 0%, transparent 60%);
}

.gal-album-info { display: flex; flex-direction: column; gap: 6px; }

.gal-album-nombre {
  font-family: var(--font-body);
  font-weight: 900;
  font-size: clamp(14px, 1.4vw, 18px);
  color: var(--blanco);
  letter-spacing: -0.3px;
  line-height: 1.2;
  text-shadow: 0 2px 12px rgba(0,0,0,0.8);
}

.gal-album-count {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: rgba(255,255,255,0.6);
}

.gal-album-count svg { stroke: var(--rosa); }

/* Álbum abierto */
.gal-album-open { margin-top: 0; }

.gal-album-open-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding-bottom: 28px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--glass-border);
  margin-bottom: 32px;
}

.gal-album-back {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  padding: 10px 16px;
  color: rgba(255,255,255,0.7);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.25s, color 0.25s;
  white-space: nowrap;
  flex-shrink: 0;
}

.gal-album-back:hover { border-color: var(--rosa); color: var(--rosa); }
.gal-album-back svg { stroke: currentColor; }

.gal-album-titulo {
  font-family: var(--font-body);
  font-weight: 900;
  font-size: clamp(1.4rem, 2.5vw, 2.2rem);
  letter-spacing: -0.5px;
  color: var(--blanco);
  line-height: 1;
}

@media (max-width: 1024px) {
  .gal-albumes-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .gal-albumes-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .gal-album-open-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .gal-album-nombre { font-size: 13px; }
}

@media (max-width: 480px) {
  .gal-albumes-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
}
