/* ==================== GALLERY SWIPER SLIDER ==================== */

.gallery-swiper {
  background: var(--bg);
  /* Más aire en la parte inferior: la paginación vive bajo las cards, así
     que reservamos espacio extra abajo para que el slider no quede pegado a
     la siguiente sección y el efecto de reveal respire. */
  padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(4.5rem, 9vw, 7rem);
  position: relative;
  overflow: hidden;
}

.gallery-swiper .section-title {
  color: var(--ink);
}

.gallery-swiper .section-title em {
  background: linear-gradient( 100deg, var(--imp-champagne) 0%, var(--imp-gold-3) 18%, var(--imp-gold-2) 36%, var(--imp-amber) 54%, var(--imp-flame) 72%, var(--imp-amber) 86%, var(--imp-gold-2) 100% );
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmerSlide 7s var(--ease) infinite;
}

/* ---------- Fondo animado tipo hero ---------- */
.gallery-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.gallery-bg .glow {
  position: absolute;
  width: clamp(280px, 50vw, 620px);
  height: clamp(280px, 50vw, 620px);
  border-radius: 50%;
  filter: blur(70px);
  opacity: .45;
  animation: floatGlow 20s ease-in-out infinite;
}

.gallery-bg .glow.g1 {
  background: radial-gradient(circle at center, var(--imp-flame), transparent 62%);
  top: -140px;
  right: -100px;
}

.gallery-bg .glow.g2 {
  background: radial-gradient(circle at center, var(--imp-gold), transparent 62%);
  bottom: -160px;
  left: -140px;
  animation-delay: -10s;
}

.gallery-bg .glow.g3 {
  background: radial-gradient(circle at center, var(--imp-amber), transparent 60%);
  top: 40%;
  left: 50%;
  transform: translateX(-50%);
  opacity: .25;
  width: clamp(320px, 55vw, 700px);
  height: clamp(320px, 55vw, 700px);
  animation-delay: -5s;
  animation-duration: 24s;
}

.gallery-bg .particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.gallery-bg .particles span {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--imp-gold-2);
  opacity: 0;
  animation: particleFloat 14s linear infinite;
  filter: blur(1px);
}

.gallery-bg .particles span:nth-child(1) { left: 8%; top: 85%; width: 4px; height: 4px; animation-duration: 16s; }
.gallery-bg .particles span:nth-child(2) { left: 25%; top: 65%; width: 7px; height: 7px; animation-duration: 20s; animation-delay: -3s; }
.gallery-bg .particles span:nth-child(3) { left: 55%; top: 92%; width: 3px; height: 3px; animation-duration: 18s; animation-delay: -6s; }
.gallery-bg .particles span:nth-child(4) { left: 78%; top: 72%; width: 5px; height: 5px; animation-duration: 22s; animation-delay: -2s; }
.gallery-bg .particles span:nth-child(5) { left: 42%; top: 88%; width: 6px; height: 6px; animation-duration: 24s; animation-delay: -9s; }
.gallery-bg .particles span:nth-child(6) { left: 18%; top: 55%; width: 4px; height: 4px; animation-duration: 19s; animation-delay: -5s; }
.gallery-bg .particles span:nth-child(7) { left: 88%; top: 45%; width: 6px; height: 6px; animation-duration: 26s; animation-delay: -12s; }
.gallery-bg .particles span:nth-child(8) { left: 65%; top: 20%; width: 3px; height: 3px; animation-duration: 21s; animation-delay: -8s; }

@keyframes floatGlow {
  0%, 100% { transform: translateY(0) scale(1); opacity: .45; }
  50% { transform: translateY(-35px) scale(1.06); opacity: .6; }
}

@keyframes particleFloat {
  0% { transform: translateY(0) translateX(0); opacity: 0; }
  10% { opacity: .35; }
  90% { opacity: .35; }
  100% { transform: translateY(-100vh) translateX(35px); opacity: 0; }
}

.gallery-swiper .container,
.gallery-swiper .gallery-swiper-container {
  position: relative;
  z-index: 1;
}

.gallery-swiper-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 40px;
  position: relative;
  z-index: 1;
}

.gallery-swiper-container .swiper-slide {
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.6s ease;
}


.gallery-swiper-container .swiper-slide-active {
  opacity: 1;
}

.gallery-slide {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 18px;
  overflow: hidden;
  background: var(--surface);
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.28),
    0 0 0 1px rgba(212, 175, 55, 0.15);
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
              border-color 0.5s ease;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(212, 175, 55, 0.18);
  /* Altura fija: desktop */
  height: 470px;
  max-width: 675px;
}

.gallery-slide::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
  background: radial-gradient(
    120% 120% at 50% 0%,
    rgba(255, 235, 59, 0.12) 0%,
    rgba(212, 175, 55, 0.06) 35%,
    transparent 70%
  );
  mix-blend-mode: screen;
  z-index: 2;
}

.gallery-swiper-container .swiper-slide-active .gallery-slide {
  transform: scale(1.04) translateY(-6px);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(212, 175, 55, 0.28),
    0 0 40px rgba(212, 175, 55, 0.12);
  border-color: rgba(212, 175, 55, 0.35);
}

.gallery-slide:hover {
  transform: scale(1.05) translateY(-8px);
  box-shadow:
    0 28px 70px rgba(0, 0, 0, 0.38),
    0 0 0 1px rgba(240, 192, 83, 0.35),
    0 0 48px rgba(240, 192, 83, 0.14);
  border-color: rgba(240, 192, 83, 0.4);
}

.gallery-slide:hover::after {
  opacity: 1;
}

.gallery-swiper-container .swiper-slide-active .gallery-slide:hover {
  transform: scale(1.06) translateY(-10px);
}

.gallery-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.6s ease;
  filter: brightness(1);
  animation: fadeIn 0.8s ease;
}

.gallery-swiper-container .swiper-slide-active .gallery-slide img {
  animation: fadeIn 0.8s ease, zoomIn 0.8s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    filter: brightness(0.8);
  }
  to {
    opacity: 1;
    filter: brightness(1);
  }
}

@keyframes zoomIn {
  from {
    transform: scale(0.95);
  }
  to {
    transform: scale(1);
  }
}



.gallery-slide:hover img {
  transform: scale(1.08);
  filter: brightness(1.1);
}

.gallery-info {
  position: absolute;
  opacity: 1;

  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(180deg, 
    transparent 0%, 
    rgba(12, 19, 32, 0.5) 30%, 
    rgba(12, 19, 32, 0.92) 70%, 
    rgba(12, 19, 32, 1) 100%);
  color: white;
  padding: 40px 20px 20px;
  transform: translateY(15px);
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);

  z-index: 10;
  backdrop-filter: blur(10px);
}

.gallery-swiper-container .swiper-slide-active .gallery-info,
.gallery-slide:hover .gallery-info {
  transform: translateY(0);
  opacity: 1;
}

.gallery-info::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, #f0c053 50%, transparent 100%);
}

.gallery-info h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 8px 0;
  color: #fffdf8;
  font-family: 'Playfair Display', serif;
  letter-spacing: 0.2px;
  line-height: 1.25;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.45);
}

.gallery-info p {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--ff-mono, 'JetBrains Mono', monospace);
  font-size: 0.7rem;
  margin: 0;
  color: #f0c053;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  line-height: 1.4;
}

.gallery-info p::before {
  content: "";
  width: 18px;
  height: 1.5px;
  background: linear-gradient(90deg, #f0c053, rgba(240, 192, 83, 0.1));
  border-radius: 2px;
  flex: none;
}

/* ==================== SWIPER CONTROLS ==================== */

.swiper-pagination {
  bottom: auto !important;
  display: flex;
  justify-content: center;
  gap: 10px;
  position: relative !important;
  margin-top: clamp(28px, 4vw, 44px);
}

.swiper-pagination-bullet {
  background: rgba(212, 175, 55, 0.4) !important;
  opacity: 1 !important;
  width: 8px !important;
  height: 8px !important;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 1px solid rgba(212, 175, 55, 0.6);
}

.swiper-pagination-bullet:hover {
  background: rgba(255, 235, 59, 0.7) !important;
  transform: scale(1.3);
}

.swiper-pagination-bullet-active {
  opacity: 1 !important;
  background: #f0c053 !important;
  width: 32px !important;
  height: 8px !important;
  border-radius: 10px !important;
  border-color: #f0c053;
  box-shadow: 0 0 14px rgba(240, 192, 83, 0.55);
}

.swiper-button-prev,
.swiper-button-next {
  position: absolute !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  z-index: 10 !important;
  width: 40px !important;
  height: 40px !important;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.9) 0%, rgba(255, 235, 59, 0.8) 100%) !important;
  border-radius: 50% !important;
  color: #0c1320 !important;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
  backdrop-filter: blur(10px) !important;
  border: 1.5px solid rgba(255, 235, 59, 0.2) !important;
  box-shadow: 0 4px 16px rgba(212, 175, 55, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.4) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
}

.swiper-button-prev {
  left: 10px !important;
}

.swiper-button-next {
  right: 10px !important;
}

.swiper-button-prev:hover,
.swiper-button-next:hover {
  background: linear-gradient(135deg, #ffeb3b 0%, #ffd700 100%) !important;
  transform: translateY(-50%) scale(1.15) !important;
  box-shadow: 0 15px 40px rgba(255, 235, 59, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.8) !important;
}

.swiper-button-prev::after,
.swiper-button-next::after {
  font-size: 16px !important;
  font-weight: 900 !important;
  color: #0c1320 !important;
}

/* Auto-play indicator */
.swiper-autoplay-indicator {
  position: absolute;
  bottom: 30px;
  right: 100px;
  font-size: 12px;
  color: #d4af37;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 20;
}

.autoplay-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f0c053;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

/* Tablet horizontal / laptop pequeño (4 slides por vista) */
@media (max-width: 1199.98px) {
  .gallery-swiper-container {
    padding: 0 32px;
  }
  .gallery-slide {
    height: 490px;
  }
}

/* Tablet vertical (3 slides por vista) */
@media (max-width: 991.98px) {
  .gallery-swiper-container {
    padding: 0 28px;
  }
  .gallery-slide {
    border-radius: 16px;
    height: 450px;
  }

  .swiper-pagination {
    display: none !important;
  }
}

/* Móvil grande / tablet pequeña (2 slides por vista) */
@media (max-width: 767.98px) {
  .gallery-swiper-container {
    padding: 0 22px;
  }

  .gallery-slide {
    border-radius: 15px;
    height: 400px;
  }

  .gallery-info {
    padding: 34px 16px 18px;
  }

  .gallery-info h3 {
    font-size: 1.05rem;
  }

  .gallery-info p {
    font-size: 0.68rem;
  }

  .swiper-button-prev,
  .swiper-button-next {
    width: 38px !important;
    height: 38px !important;
  }

  .swiper-button-prev::after,
  .swiper-button-next::after {
    font-size: 13px !important;
  }

  .swiper-autoplay-indicator {
    right: 60px;
  }
}

/* Móvil (1 slide centrado · card retrato protagonista) */
@media (max-width: 479.98px) {
  .gallery-swiper-container {
    padding: 0 44px;
  }

  .gallery-slide {
    border-radius: 16px;
    height: 480px;
    max-width: 360px;
  }

  .gallery-info {
    padding: 38px 18px 20px;
  }

  .gallery-info h3 {
    font-size: 1.2rem;
  }

  .gallery-info p {
    font-size: 0.72rem;
  }

  .swiper-button-prev,
  .swiper-button-next {
    width: 36px !important;
    height: 36px !important;
  }

  .swiper-pagination {
    margin-top: 14px;
  }

  .swiper-autoplay-indicator {
    display: none;
  }
}

/* Reduced motion: detener animaciones de fondo */
@media (prefers-reduced-motion: reduce) {
  .gallery-bg .glow,
  .gallery-bg .particles span,
  .gallery-swiper .section-title em {
    animation: none !important;
  }
}

/* Print: ocultar decoraciones de fondo */
@media print {
  .gallery-bg,
  .gallery-swiper::before {
    display: none !important;
  }
}
