/* =====================================================================
   Exxlilly · Galería del inicio
   - Telón de terciopelo que se abre al entrar
   - Carrusel inclinado clicable
   - Galería en mosaico: cada dibujo se descubre con un mini telón
   - Visor (lightbox) que cierra y abre el telón entre dibujos
   Contraste verificado (WCAG AA): ver comentarios junto a cada par.
   ===================================================================== */

:root {
  /* terciopelo rosa (tono de la marca, claro) */
  --velvet-deep: #a8285f;
  --velvet-dark: #c43c76;
  --velvet-mid: #db5a8f;
  --velvet-light: #ec7ea8;
  --velvet-shine: #fbb0cb;
  --lace: #ffe3ee;
  --ink-rose: #8a1c48; /* sobre #fff y #fff0f5: 8.1:1 */
  --curtain-ease: cubic-bezier(0.77, 0, 0.18, 1);
  /* grano de terciopelo (ruido SVG muy suave) */
  --velvet-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .12 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Terciopelo: pliegues suaves de ancho irregular (dos ritmos superpuestos),
   luz difusa arriba, sombra pesada abajo y grano para que no parezca satén */
.curtain-panel,
.curtain-valance,
.gallery-veil {
  background-color: var(--velvet-mid);
  background-image:
    var(--velvet-grain),
    linear-gradient(180deg, rgba(255, 235, 244, 0.22) 0%, rgba(255, 235, 244, 0) 30%,
      rgba(110, 10, 50, 0) 60%, rgba(110, 10, 50, 0.3) 100%),
    repeating-linear-gradient(90deg,
      rgba(120, 10, 55, 0.14) 0, rgba(120, 10, 55, 0) 2.6em, rgba(255, 235, 244, 0.12) 4.1em,
      rgba(120, 10, 55, 0) 5.4em, rgba(120, 10, 55, 0.14) 11.3em),
    repeating-linear-gradient(90deg,
      var(--velvet-deep) 0,
      var(--velvet-dark) 1.3em,
      var(--velvet-mid) 2.6em,
      var(--velvet-light) 3.5em,
      var(--velvet-shine) 3.9em,
      var(--velvet-light) 4.4em,
      var(--velvet-mid) 5.4em,
      var(--velvet-dark) 6.5em,
      var(--velvet-deep) 7.3em);
}

/* ---------------------------------------------------------------------
   1. Telón de entrada
   --------------------------------------------------------------------- */
.curtain {
  display: none;
}

html.js:not(.no-curtain) .curtain {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 10000;
  overflow: hidden;
  pointer-events: auto;
  cursor: pointer;
  font-size: clamp(14px, 1.6vw, 22px); /* escala el ancho de los pliegues */
}

/* Sin barra de scroll mientras el telón está cerrado */
html.js:not(.no-curtain):not(.curtain-done):not(.curtain-failsafe) {
  overflow: hidden;
}

html.curtain-done .curtain,
html.curtain-failsafe .curtain {
  display: none !important;
}

.curtain-panel {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 51%;
  will-change: transform;
  box-shadow: inset 0 -40px 60px rgba(120, 10, 55, 0.18);
}

.curtain-left {
  left: 0;
  transform-origin: 0 0;
  animation: curtainBreathL 3.2s ease-in-out infinite;
}

.curtain-right {
  right: 0;
  transform-origin: 100% 0;
  animation: curtainBreathR 3.2s ease-in-out infinite;
}

/* Sombra donde se juntan las dos hojas */
.curtain-panel::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 40px;
  pointer-events: none;
}
.curtain-left::before {
  right: 0;
  background: linear-gradient(90deg, transparent, rgba(120, 10, 55, 0.3));
}
.curtain-right::before {
  left: 0;
  background: linear-gradient(270deg, transparent, rgba(120, 10, 55, 0.3));
}

.curtain-tie {
  display: none;
}

/* Bambalina: tela más oscura, festones con sombra y cordón de perlas */
.curtain-valance {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: clamp(48px, 8vh, 84px);
  z-index: 3;
  background-size: auto, auto, 9em 100%, 4.6em 100%;
  box-shadow: inset 0 -10px 18px rgba(120, 10, 55, 0.25);
  will-change: transform;
  filter: drop-shadow(0 8px 12px rgba(120, 10, 55, 0.3));
}
.curtain-valance::after {
  /* festones (misma tela, más oscuros abajo) */
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% - 1px);
  height: 2.6em;
  background:
    radial-gradient(ellipse 50% 100% at 50% 0, rgba(120, 10, 55, 0) 0 55%, rgba(120, 10, 55, 0.25) 92%, transparent 93%) 0 0 / 6em 2.6em repeat-x,
    radial-gradient(ellipse 50% 100% at 50% 0, var(--velvet-dark) 0 92%, transparent 93%) 0 0 / 6em 2.6em repeat-x;
}
.curtain-valance::before {
  /* cordón de perlas en el borde de cada festón */
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 2.6em - 7px);
  height: 8px;
  background: radial-gradient(circle, #fff 0 2.5px, transparent 3px) 1.5em 0 / 6em 8px repeat-x,
    radial-gradient(circle, rgba(255, 227, 238, 0.85) 0 2px, transparent 2.5px) 4.5em -3px / 6em 8px repeat-x;
  z-index: 1;
}

/* Cartel central claro: nombre #b8005c sobre #fff7fa = 6.2:1, texto #48152f = 14:1 */
.curtain-title {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: 52%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 1.6rem 2.6rem 1.4rem;
  border-radius: 999px / 70%;
  background: radial-gradient(ellipse at 50% 30%, #ffffff 0%, #fff7fa 60%, #ffe8f0 100%);
  border: 3px solid #fff;
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.45), 0 0 0 8px rgba(184, 0, 92, 0.35),
    0 22px 50px rgba(120, 10, 55, 0.35);
  color: #48152f;
  text-align: center;
  animation: titleIn 0.9s cubic-bezier(0.2, 0.9, 0.3, 1.15) 0.1s both;
}

.curtain-kicker {
  font-size: clamp(0.8rem, 1.2vw, 1rem);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  font-weight: 600;
}

.curtain-name {
  font-family: "Dancing Script", "Segoe Script", cursive;
  font-weight: 700;
  font-size: clamp(3rem, 8vw, 6.2rem);
  line-height: 1;
  color: var(--dark-pink, #b8005c);
  text-shadow: 0 2px 0 rgba(255, 182, 210, 0.9);
}

/* Botón: blanco sobre #b8005c = 6.6:1. Late suave para invitar al clic */
.curtain-skip {
  margin-top: 0.7rem;
  border: 2px solid #fff;
  border-radius: 999px;
  padding: 0.6rem 1.6rem;
  background: var(--dark-pink, #b8005c);
  color: #fff;
  font: 700 1.05rem "Outfit", sans-serif;
  cursor: pointer;
  box-shadow: 3px 3px 0 #ffc0cb, 0 8px 18px rgba(184, 0, 92, 0.3);
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  animation: skipPulse 1.8s ease-in-out 1.2s infinite;
}
.curtain-skip:hover,
.curtain-skip:focus-visible {
  animation: none;
  transform: translateY(-2px) scale(1.05);
  outline: 3px solid var(--dark-pink, #b8005c);
  outline-offset: 3px;
}
/* #6b2a47 sobre #fff7fa = 9.7:1 */
.curtain-hint {
  font-size: 0.85rem;
  color: #6b2a47;
  margin-top: 0.15rem;
}
@keyframes skipPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

/* --- Apertura --- */
.curtain.is-opening {
  pointer-events: none;
}
.curtain.is-opening .curtain-left {
  animation: curtainOpenL 1.6s var(--curtain-ease) forwards;
}
.curtain.is-opening .curtain-right {
  animation: curtainOpenR 1.6s var(--curtain-ease) forwards;
}
.curtain.is-opening .curtain-title {
  animation: titleOut 0.55s ease-in forwards;
}
.curtain.is-opening .curtain-valance {
  animation: valanceUp 0.9s var(--curtain-ease) 0.85s forwards;
}
.curtain.is-fast .curtain-left,
.curtain.is-fast .curtain-right {
  animation-duration: 1.1s;
}
.curtain.is-fast .curtain-valance {
  animation-delay: 0.5s;
}

@keyframes curtainBreathL {
  0%, 100% { transform: skewX(0deg); }
  50% { transform: skewX(0.6deg); }
}
@keyframes curtainBreathR {
  0%, 100% { transform: skewX(0deg); }
  50% { transform: skewX(-0.6deg); }
}

/* La parte de abajo se queda atrás (inclinación) y las hojas se fruncen (scaleX) */
@keyframes curtainOpenL {
  0% { transform: translateX(0) scaleX(1) skewX(0deg); }
  12% { transform: translateX(1.5%) scaleX(1) skewX(-1deg); }
  45% { transform: translateX(-28%) scaleX(0.86) skewX(7deg); }
  100% { transform: translateX(-102%) scaleX(0.5) skewX(0deg); }
}
@keyframes curtainOpenR {
  0% { transform: translateX(0) scaleX(1) skewX(0deg); }
  12% { transform: translateX(-1.5%) scaleX(1) skewX(1deg); }
  45% { transform: translateX(28%) scaleX(0.86) skewX(-7deg); }
  100% { transform: translateX(102%) scaleX(0.5) skewX(0deg); }
}
@keyframes valanceUp {
  to { transform: translateY(calc(-100% - 4em)); }
}
@keyframes titleIn {
  from { opacity: 0; transform: translate(-50%, -44%) scale(0.88); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes titleOut {
  to { opacity: 0; transform: translate(-50%, -62%) scale(1.08); }
}

/* Entrada del contenido cuando el telón termina */
html.js:not(.no-curtain):not(.curtain-done):not(.curtain-revealing):not(.curtain-failsafe) .home-hero .hero-cta-overlay {
  opacity: 0;
  transform: translateY(18px) scale(0.94);
}
.home-hero .hero-cta-overlay {
  transition: opacity 0.7s ease, transform 0.8s cubic-bezier(0.2, 0.9, 0.3, 1.25);
}

/* ---------------------------------------------------------------------
   2. Hero inclinado (ajustes sobre style.css)
   --------------------------------------------------------------------- */
.home-hero {
  flex: none;
  height: clamp(440px, 80vh, 920px);
}

.home-hero .hero-item {
  pointer-events: auto;
  padding: 0;
  border: 0;
  background: #fff;
  cursor: zoom-in;
  transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.2), box-shadow 0.35s ease;
}
.home-hero .hero-item:hover,
.home-hero .hero-item:focus-visible {
  transform: scale(1.05);
  box-shadow: 0 0 0 4px #fff0f5, 0 0 0 7px var(--dark-pink), 0 16px 40px rgba(94, 10, 46, 0.45);
  outline: none;
  position: relative;
  z-index: 2;
}

/* Título: #c2185b sobre blanco 75% (≈#fffbfc) = 5.8:1 */
.home-hero .hero-title {
  color: var(--dark-pink);
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
/* #a3134a sobre #fff = 7.6:1 */
.hero-btn-ghost {
  background: #fff;
  color: var(--velvet-mid);
  border: 2px solid var(--velvet-mid);
}
.hero-btn-ghost:hover {
  background: #fff0f5;
  color: var(--velvet-dark);
}

/* ---------------------------------------------------------------------
   3. Galería en mosaico
   --------------------------------------------------------------------- */
.gallery-section {
  width: min(1500px, 94%);
  margin: 0 auto;
  padding: 56px 0 70px;
  scroll-margin-top: 10px;
}

.gallery-head {
  text-align: center;
  margin-bottom: 30px;
}

/* #8a1c48 sobre #fff0f5 = 8.1:1 */
.gallery-title {
  font-family: "Dancing Script", "Segoe Script", cursive;
  font-size: clamp(2.6rem, 5vw, 3.8rem);
  color: var(--ink-rose);
  line-height: 1.1;
  margin: 0;
}
.gallery-title::after {
  content: "";
  display: block;
  width: 140px;
  height: 10px;
  margin: 8px auto 0;
  background: radial-gradient(circle, var(--hot-pink) 0 3px, transparent 3.5px) 0 0 / 14px 10px repeat-x;
}

/* #6b4a57 sobre #fff0f5 = 6.9:1 */
.gallery-count {
  color: #6b4a57;
  font-weight: 500;
  margin: 6px 0 0;
}

.gallery-grid {
  columns: 4 250px;
  column-gap: 18px;
}

.gallery-card {
  break-inside: avoid;
  margin: 0 0 18px;
  background: #fff;
  border-radius: 18px;
  padding: 8px 8px 10px;
  box-shadow: 0 6px 20px rgba(194, 24, 91, 0.12);
  border: 1px solid #ffd6e6;
  transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.2), box-shadow 0.35s ease;
}
.gallery-card:hover {
  transform: translateY(-4px) rotate(-0.4deg);
  box-shadow: 0 16px 34px rgba(194, 24, 91, 0.22);
}

.gallery-open {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: #ffe6ef;
  border-radius: 12px;
  overflow: hidden;
  cursor: zoom-in;
  min-height: 120px;
}
.gallery-open:focus-visible {
  outline: 3px solid var(--dark-pink);
  outline-offset: 3px;
}
.gallery-open img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.6s ease;
}
.gallery-card:hover .gallery-open img {
  transform: scale(1.04);
}

/* #8a1c48 sobre #fff = 8.1:1 */
.gallery-card figcaption {
  margin-top: 8px;
  padding: 0 4px;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink-rose);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Mini telón de cada dibujo */
.gallery-veil {
  display: none;
  font-size: 9px;
}
html.js:not(.no-curtain) .gallery-veil {
  display: block;
  position: absolute;
  top: 0;
  bottom: 0;
  width: 51%;
  transition: transform 0.95s var(--curtain-ease) var(--d, 0s);
  will-change: transform;
}
.gallery-veil-l {
  left: 0;
  transform-origin: 0 0;
}
.gallery-veil-r {
  right: 0;
  transform-origin: 100% 0;
}
.gallery-card.is-revealed .gallery-veil-l {
  transform: translateX(-102%) scaleX(0.5);
}
.gallery-card.is-revealed .gallery-veil-r {
  transform: translateX(102%) scaleX(0.5);
}

/* ---------------------------------------------------------------------
   4. Visor con telón
   --------------------------------------------------------------------- */
.lightbox[hidden] {
  display: none;
}
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px 70px;
}
/* Mismo estilo que los modales del catálogo: velo con blur + pop-in */
.lb-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(72, 21, 47, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.lightbox.is-open .lb-backdrop {
  animation: fadeIn 0.3s ease both;
}
.lb-stage {
  position: relative;
  border-radius: 18px;
  border: 5px solid #fff;
  box-shadow: 0 0 0 3px var(--hot-pink, #ff69b4), 0 18px 60px rgba(72, 21, 47, 0.45);
  background: #fff0f5;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: transform 0.17s ease, opacity 0.17s ease;
}
.lightbox.is-open .lb-stage {
  animation: modalPopIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}
/* Al cambiar de dibujo: se encoge y se desvanece, y el nuevo vuelve con el pop-in */
.lightbox.is-open.is-swapping .lb-stage {
  animation: lbSwapOut 0.17s ease-in forwards;
}
@keyframes lbSwapOut {
  to { opacity: 0; transform: scale(0.9); }
}
.lb-image {
  display: block;
  max-width: calc(100vw - 160px);
  max-height: calc(100vh - 140px);
  width: auto;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}

/* Pie: #48152f sobre blanco = 14.5:1; contador #b8005c sobre blanco = 6.5:1 */
.lb-caption {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 0.35rem 1.1rem;
  border-radius: 999px;
  background: #fff;
  border: 2px solid #ffc0cb;
  color: #48152f;
  font-weight: 700;
  text-align: center;
  max-width: 80vw;
  box-shadow: 0 6px 18px rgba(72, 21, 47, 0.25);
}
.lightbox.is-open .lb-caption {
  animation: floatIn 0.5s ease-out both;
}
.lb-count {
  color: #b8005c;
  font-weight: 600;
  margin-left: 10px;
  font-size: 0.9em;
}

/* Botones: #b8005c sobre blanco = 6.5:1 (hover: blanco sobre #b8005c = 6.6:1) */
.lb-btn {
  position: absolute;
  z-index: 3;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 3px solid #fff;
  background: #fff;
  color: #b8005c;
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 0 0 2px #ff69b4, 0 6px 16px rgba(72, 21, 47, 0.3);
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), background 0.2s ease, color 0.2s ease;
}
.lb-btn:hover,
.lb-btn:focus-visible {
  background: #b8005c;
  color: #fff;
  transform: scale(1.12);
  outline: 3px solid #fff;
  outline-offset: 3px;
}
.lb-close {
  top: 18px;
  right: 18px;
  font-size: 1.2rem;
}
.lb-prev {
  left: 12px;
  top: 50%;
  margin-top: -26px;
}
.lb-next {
  right: 12px;
  top: 50%;
  margin-top: -26px;
}


body.lb-open {
  overflow: hidden;
}

@media (max-width: 640px) {
  .lightbox {
    padding: 16px 10px 80px;
  }
  .lb-image {
    max-width: calc(100vw - 30px);
    max-height: calc(100vh - 170px);
  }
  .lb-prev,
  .lb-next {
    top: auto;
    bottom: 18px;
    margin-top: 0;
  }
  .lb-prev {
    left: calc(50% - 64px);
  }
  .lb-next {
    right: calc(50% - 64px);
  }
  .gallery-grid {
    columns: 2 150px;
    column-gap: 12px;
  }
  .gallery-card {
    margin-bottom: 12px;
    padding: 6px 6px 8px;
  }
  .home-hero {
    height: 62vh;
  }
}

/* ---------------------------------------------------------------------
   5. Movimiento: lo controla el botón "Pausar animaciones"
   --------------------------------------------------------------------- */
/* Con "Pausar animaciones" activo el telón no aparece (ver index.html) */
