/* =================================================================
   SEMANA DE LA DULZURA - Estilo DULCE Y COLORIDA 🍬
   Todo pastel, redondeado y bubbly. Mobile-first + responsive.
   ================================================================= */

/* ---------- VARIABLES DE COLOR Y ESTILO ---------- */
:root {
  /* Paleta pastel vibrante */
  --rosa:        #ff8fb1;
  --rosa-claro:  #ffb3c6;
  --coral:       #ff9a76;
  --lavanda:     #c8a2ff;
  --menta:       #9be7c4;
  --crema:       #fff5f7;
  --amarillo:    #ffe08a;

  /* Texto */
  --texto:       #6b3a4e;   /* ciruela suave, buen contraste sobre crema */
  --texto-suave: #9b6b7d;
  --blanco:      #ffffff;

  /* Gradientes alegres */
  --grad-hero:    linear-gradient(135deg, #ffb3c6 0%, #c8a2ff 55%, #9be7c4 100%);
  --grad-boton:   linear-gradient(135deg, #ff8fb1 0%, #ff9a76 100%);
  --grad-menta:   linear-gradient(160deg, #fff5f7 0%, #eafff4 100%);
  --grad-lavanda: linear-gradient(160deg, #fff5f7 0%, #f3ecff 100%);

  /* Tipografias (con fallback a system-ui) */
  --f-titulo:  "Baloo 2", "Fredoka", system-ui, -apple-system, sans-serif;
  --f-cuerpo:  "Nunito", system-ui, -apple-system, sans-serif;
  --f-mano:    "Caveat", "Segoe Script", cursive;

  /* Sombras y radios bubbly */
  --sombra:       0 14px 34px rgba(255, 143, 177, 0.28);
  --sombra-suave: 0 8px 20px rgba(200, 162, 255, 0.22);
  --radio:        26px;
  --radio-chico:  16px;

  --ancho-max: 1180px;
}

/* ---------- RESET LIGERO ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  /* Compensa el header fijo al saltar con anclas (no hay header fijo, pero da aire) */
  scroll-padding-top: 1rem;
}

body {
  font-family: var(--f-cuerpo);
  color: var(--texto);
  background: var(--crema);
  line-height: 1.65;
  overflow-x: hidden;             /* NUNCA scroll horizontal */
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
}

/* ---------- CONTENEDORES ---------- */
.contenedor {
  width: 100%;
  max-width: var(--ancho-max);
  margin: 0 auto;
  padding: 0 clamp(1.1rem, 5vw, 3rem);
  text-align: center;
}

.contenedor--angosto {
  max-width: 720px;
}

/* ---------- SECCIONES ---------- */
.seccion {
  position: relative;
  padding: clamp(3.5rem, 9vw, 6.5rem) 0;
}

.seccion__titulo {
  font-family: var(--f-titulo);
  font-weight: 800;
  font-size: clamp(1.9rem, 6vw, 3.1rem);
  line-height: 1.1;
  color: var(--rosa);
  margin-bottom: 0.6rem;
  letter-spacing: -0.01em;
}

.seccion__bajada {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: var(--texto-suave);
  margin-bottom: 2.2rem;
}

.emoji-titulo {
  display: inline-block;
  font-size: clamp(2.2rem, 7vw, 3rem);
  margin-bottom: 0.4rem;
  animation: latido 2.6s ease-in-out infinite;
}

/* ===================================================================
   FONDO FLOTANTE (corazones y dulces)
   =================================================================== */
.fondo-flotante {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.fondo-flotante .flota {
  position: absolute;
  bottom: -60px;
  font-size: 1.6rem;
  opacity: 0;
  will-change: transform, opacity;
  animation: subir linear infinite;
}

@keyframes subir {
  0%   { transform: translateY(0) rotate(0deg);      opacity: 0; }
  10%  { opacity: 0.85; }
  90%  { opacity: 0.85; }
  100% { transform: translateY(-108vh) rotate(220deg); opacity: 0; }
}

/* Todo el contenido va por encima del fondo */
.hero,
main,
.footer {
  position: relative;
  z-index: 1;
}

/* ===================================================================
   1) HERO
   =================================================================== */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1.2rem 5rem;
  overflow: hidden;
  background: var(--grad-hero);
}

/* Foto horizontal (#2) como fondo sutil, con velo para legibilidad */
.hero__fondo {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(135deg, rgba(255,179,198,0.82), rgba(200,162,255,0.78) 55%, rgba(155,231,196,0.8)),
    url("imagenes/IMG-20250919-WA0000.jpg");
  background-size: cover;
  background-position: center;
  z-index: 0;
}

.hero__contenido {
  position: relative;
  z-index: 2;
  max-width: 760px;
  animation: aparecer-arriba 1s ease both;
}

.hero__kicker {
  font-family: var(--f-mano);
  font-size: clamp(1.3rem, 4vw, 1.9rem);
  color: var(--blanco);
  font-weight: 700;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 10px rgba(107, 58, 78, 0.25);
}

.hero__titulo {
  font-family: var(--f-titulo);
  font-weight: 800;
  font-size: clamp(2.6rem, 11vw, 6rem);
  line-height: 1.02;
  color: var(--blanco);
  text-shadow: 0 6px 24px rgba(107, 58, 78, 0.28);
  margin-bottom: 0.7rem;
}

.hero__nombre {
  font-family: var(--f-mano);
  font-size: clamp(2rem, 8vw, 3.6rem);
  font-weight: 700;
  color: var(--amarillo);
  text-shadow: 0 3px 14px rgba(107, 58, 78, 0.3);
  margin-bottom: 0.9rem;
}

.hero__subtitulo {
  font-size: clamp(1.05rem, 3vw, 1.4rem);
  color: var(--blanco);
  font-weight: 600;
  max-width: 40ch;
  margin: 0 auto 2.4rem;
  text-shadow: 0 2px 10px rgba(107, 58, 78, 0.22);
}

/* Indicador de scroll animado */
.hero__scroll {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  text-decoration: none;
  color: var(--blanco);
  font-weight: 700;
  font-size: 0.95rem;
  animation: rebote 1.8s ease-in-out infinite;
}

.hero__scroll-flecha {
  font-size: 1.6rem;
  line-height: 1;
}

/* ===================================================================
   ONDAS DECORATIVAS entre secciones
   =================================================================== */
.onda {
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 100%;
  line-height: 0;
  z-index: 3;
}

.onda svg {
  width: 100%;
  height: clamp(50px, 8vw, 100px);
  display: block;
}

.onda--hero svg path     { fill: var(--crema); }
.onda--carta svg path    { fill: var(--grad-menta); fill: #eafff4; }
.onda--contador svg path { fill: var(--crema); }
.onda--galeria svg path  { fill: #f3ecff; }
.onda--timeline svg path { fill: var(--crema); }
.onda--dulce svg path    { fill: #6b3a4e; }

/* ===================================================================
   2) CARTA
   =================================================================== */
.carta {
  background: var(--grad-menta);
}

.carta__papel {
  background: var(--blanco);
  border-radius: var(--radio);
  padding: clamp(1.8rem, 5vw, 3rem);
  box-shadow: var(--sombra-suave);
  border: 3px dashed var(--rosa-claro);
  text-align: left;
}

.carta__texto {
  font-size: clamp(1.05rem, 2.5vw, 1.25rem);
  margin-bottom: 1.1rem;
  color: var(--texto);
}

.carta__firma {
  font-family: var(--f-mano);
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  color: var(--rosa);
  text-align: right;
  font-weight: 700;
  margin-top: 0.5rem;
}

/* ===================================================================
   3) CONTADOR
   =================================================================== */
.contador {
  background: var(--crema);
}

.contador__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(0.9rem, 3vw, 1.4rem);
  max-width: 720px;
  margin: 0 auto;
}

.contador__tarjeta {
  background: var(--blanco);
  border-radius: var(--radio);
  padding: clamp(1.3rem, 4vw, 2rem) 1rem;
  box-shadow: var(--sombra-suave);
  border: 3px solid var(--rosa-claro);
  transition: transform 0.3s ease;
}

.contador__tarjeta:hover {
  transform: translateY(-6px) scale(1.02);
}

.contador__numero {
  font-family: var(--f-titulo);
  font-weight: 800;
  font-size: clamp(2.2rem, 9vw, 3.6rem);
  line-height: 1;
  background: var(--grad-boton);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--rosa);
}

.contador__etiqueta {
  display: block;
  margin-top: 0.35rem;
  font-weight: 700;
  color: var(--texto-suave);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.85rem;
}

.contador__pie {
  font-family: var(--f-mano);
  font-size: clamp(1.5rem, 5vw, 2rem);
  color: var(--lavanda);
  font-weight: 700;
  margin-top: 1.8rem;
}

/* ===================================================================
   4) GALERIA (columnas tipo masonry con CSS columns)
   =================================================================== */
.galeria {
  background: var(--grad-lavanda);
}

.galeria__grid {
  column-count: 2;
  column-gap: clamp(0.7rem, 2.5vw, 1.1rem);
  max-width: 1000px;
  margin: 0 auto;
}

.galeria__item {
  position: relative;
  break-inside: avoid;
  margin-bottom: clamp(0.7rem, 2.5vw, 1.1rem);
  border-radius: var(--radio-chico);
  overflow: hidden;
  box-shadow: var(--sombra-suave);
  cursor: pointer;
  border: 4px solid var(--blanco);
  background: var(--blanco);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.galeria__item:hover,
.galeria__item:focus-visible {
  transform: translateY(-5px) rotate(-1deg);
  box-shadow: var(--sombra);
  outline: none;
}

.galeria__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.galeria__item:hover img {
  transform: scale(1.06);
}

/* Corazoncito que aparece al pasar el mouse */
.galeria__item::after {
  content: "💗";
  position: absolute;
  right: 10px;
  bottom: 8px;
  font-size: 1.5rem;
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.galeria__item:hover::after {
  opacity: 1;
  transform: scale(1);
}

/* ===================================================================
   5) TIMELINE
   =================================================================== */
.timeline {
  background: var(--crema);
}

.timeline__linea {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem 0;
}

/* Linea vertical central/lateral */
.timeline__linea::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 22px;
  width: 4px;
  background: repeating-linear-gradient(
    to bottom,
    var(--rosa-claro) 0 12px,
    transparent 12px 24px
  );
  border-radius: 4px;
}

.timeline__item {
  position: relative;
  padding-left: 62px;
  margin-bottom: 2.4rem;
  text-align: left;
}

/* Puntito/dulce sobre la linea */
.timeline__punto {
  position: absolute;
  left: 3px;
  top: 4px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: var(--blanco);
  border: 3px solid var(--rosa);
  border-radius: 50%;
  font-size: 1.2rem;
  box-shadow: var(--sombra-suave);
  z-index: 1;
}

.timeline__tarjeta {
  background: var(--blanco);
  border-radius: var(--radio-chico);
  overflow: hidden;
  box-shadow: var(--sombra-suave);
  border: 3px solid var(--menta);
  transition: transform 0.3s ease;
}

.timeline__tarjeta:hover {
  transform: translateY(-4px);
}

.timeline__foto {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  cursor: pointer;
}

.timeline__cuerpo {
  padding: 1rem 1.2rem 1.3rem;
}

.timeline__fecha {
  display: inline-block;
  font-family: var(--f-mano);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--lavanda);
  margin-bottom: 0.2rem;
}

.timeline__titulo {
  font-family: var(--f-titulo);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--rosa);
  margin-bottom: 0.3rem;
}

/* ===================================================================
   6) INTERACTIVO "Un dulce por un besito"
   =================================================================== */
.dulce {
  background: var(--grad-lavanda);
}

.dulce__boton {
  font-family: var(--f-titulo);
  font-weight: 700;
  font-size: clamp(1.1rem, 3.5vw, 1.5rem);
  color: var(--blanco);
  background: var(--grad-boton);
  border: none;
  border-radius: 999px;
  padding: 1rem 2.4rem;
  cursor: pointer;
  box-shadow: var(--sombra);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  margin-top: 0.6rem;
}

.dulce__boton:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 18px 40px rgba(255, 143, 177, 0.4);
}

.dulce__boton:active {
  transform: translateY(0) scale(0.98);
}

.dulce__mensaje {
  margin-top: 1.8rem;
  background: var(--blanco);
  border-radius: var(--radio);
  padding: clamp(1.4rem, 4vw, 2.2rem);
  box-shadow: var(--sombra-suave);
  border: 3px dashed var(--lavanda);
  font-family: var(--f-mano);
  font-size: clamp(1.4rem, 4.5vw, 2rem);
  font-weight: 700;
  color: var(--rosa);
  line-height: 1.4;
  animation: aparecer-pop 0.5s ease both;
}

/* ===================================================================
   7) FOOTER
   =================================================================== */
.footer {
  background: #6b3a4e;
  color: var(--crema);
  text-align: center;
  padding: clamp(2.6rem, 7vw, 4rem) 1.2rem;
}

.footer__corazon {
  font-size: 2.6rem;
  animation: latido 2.4s ease-in-out infinite;
}

.footer__texto {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 0.6rem;
}

.footer__firma {
  font-family: var(--f-mano);
  font-size: 1.5rem;
  color: var(--rosa-claro);
  margin-top: 0.4rem;
}

.footer__mini {
  margin-top: 1rem;
  opacity: 0.7;
  font-size: 0.9rem;
}

/* ===================================================================
   LIGHTBOX
   =================================================================== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: clamp(0.8rem, 3vw, 2rem);
  background: rgba(107, 58, 78, 0.85);
  backdrop-filter: blur(6px);
  animation: aparecer 0.25s ease both;
}

.lightbox[hidden] {
  display: none;
}

.lightbox__figura {
  max-width: min(92vw, 720px);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0;
}

.lightbox__img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: var(--radio-chico);
  border: 5px solid var(--blanco);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  animation: aparecer-pop 0.3s ease both;
}

.lightbox__caption {
  margin-top: 0.8rem;
  color: var(--blanco);
  font-family: var(--f-mano);
  font-size: clamp(1.2rem, 4vw, 1.6rem);
  font-weight: 700;
  text-align: center;
  max-width: 40ch;
}

.lightbox__cerrar {
  position: absolute;
  top: clamp(0.6rem, 3vw, 1.4rem);
  right: clamp(0.6rem, 3vw, 1.4rem);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: none;
  background: var(--blanco);
  color: var(--rosa);
  font-size: 1.3rem;
  cursor: pointer;
  box-shadow: var(--sombra-suave);
  transition: transform 0.2s ease;
  z-index: 2;
}

.lightbox__cerrar:hover {
  transform: rotate(90deg) scale(1.1);
}

.lightbox__nav {
  flex-shrink: 0;
  width: clamp(42px, 10vw, 58px);
  height: clamp(42px, 10vw, 58px);
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  color: var(--rosa);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--sombra-suave);
  transition: transform 0.2s ease, background 0.2s ease;
  display: grid;
  place-items: center;
}

.lightbox__nav:hover {
  transform: scale(1.12);
  background: var(--blanco);
}

/* ===================================================================
   SCROLL REVEAL (IntersectionObserver agrega .visible)
   =================================================================== */
.reveal {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===================================================================
   ANIMACIONES (keyframes)
   =================================================================== */
@keyframes latido {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.15); }
}

@keyframes rebote {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(10px); }
}

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

@keyframes aparecer {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes aparecer-arriba {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes aparecer-pop {
  0%   { opacity: 0; transform: scale(0.85); }
  100% { opacity: 1; transform: scale(1); }
}

/* Confeti / lluvia de dulces del boton */
@keyframes caer {
  0%   { transform: translateY(-10vh) rotate(0deg);   opacity: 1; }
  100% { transform: translateY(110vh) rotate(540deg); opacity: 0; }
}

.confeti {
  position: fixed;
  top: -5vh;
  z-index: 40;
  font-size: 1.8rem;
  pointer-events: none;
  will-change: transform, opacity;
  animation: caer linear forwards;
}

/* ===================================================================
   RESPONSIVE >= 720px (tablet)
   =================================================================== */
@media (min-width: 720px) {
  .contador__grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .galeria__grid {
    column-count: 3;
  }

  /* Timeline alternado a los costados en pantallas grandes */
  .timeline__linea::before {
    left: 50%;
    transform: translateX(-50%);
  }

  .timeline__item {
    width: 50%;
    padding-left: 0;
    padding-right: 48px;
    margin-left: 0;
  }

  .timeline__item:nth-child(even) {
    margin-left: 50%;
    padding-right: 0;
    padding-left: 48px;
  }

  .timeline__item .timeline__punto {
    left: auto;
    right: -20px;
  }

  .timeline__item:nth-child(even) .timeline__punto {
    left: -20px;
    right: auto;
  }
}

/* ===================================================================
   RESPONSIVE >= 1024px (desktop: layouts mas ricos)
   =================================================================== */
@media (min-width: 1024px) {
  .galeria__grid {
    column-count: 4;
  }

  .hero__subtitulo {
    max-width: 46ch;
  }
}

/* ===================================================================
   ACCESIBILIDAD: respetar prefers-reduced-motion
   =================================================================== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  /* El reveal queda siempre visible (sin depender de transicion) */
  .reveal {
    opacity: 1;
    transform: none;
  }

  .fondo-flotante {
    display: none;   /* corazones flotando apagados */
  }
}

/* Foco visible accesible en elementos interactivos */
a:focus-visible,
button:focus-visible,
.galeria__item:focus-visible {
  outline: 3px solid var(--lavanda);
  outline-offset: 3px;
  border-radius: 6px;
}
