/* =========================================================
   Invitación de grado — Sara Fernanda Gil Anzola
   Paleta botánica verde + crema/dorado (ver PLAN-IMPLEMENTACION.md §3)
   ========================================================= */

:root {
  --verde-oscuro: #2F4A3D;
  --verde-medio: #4F7359;
  --verde-salvia: #8CA893;
  --dorado: #B8985A;
  --dorado-contraste: #CDB07A; /* solo para texto pequeño sobre --verde-oscuro: 4.65:1 (AA) vs 3.54:1 de --dorado */
  --crema: #FAF6EC;
  --hueso: #FFFDF8;
  --texto: #2B2B26;

  --fuente-script: "Parisienne", cursive;
  --fuente-cuerpo: "Cormorant Garamond", serif;
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden; /* nunca en body: rompe el scroll real (ver Aprendizajes §9.2) */
  scroll-behavior: smooth;
  /* Tamaño base más grande a pedido del usuario (2026-09-27): casi todo el
     texto del sitio usa rem/clamp(rem), así que subir el font-size raíz
     (por defecto 16px del navegador) escala proporcionalmente la mayoría
     de los tamaños sin tener que tocar cada regla una por una. */
  font-size: 18px;
}

body {
  margin: 0;
  background: var(--crema);
  color: var(--texto);
  font-family: var(--fuente-cuerpo);
  font-size: 21px;
  line-height: 1.6;
}

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

a {
  color: inherit;
}

.contenedor {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------------------------------------------------------
   Motivo decorativo SVG (hojas y flores)
   Estructura de 3 niveles — ver BLUEPRINT-INVITACIONES-WEB.md §6
   --------------------------------------------------------- */

.fondo-decoracion {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.decor-parallax {
  will-change: transform;
}

.decor-hoja {
  transform-origin: center top;
  animation: balanceo 7s ease-in-out infinite;
}

.decor-flor {
  transform-origin: center;
  animation: latido-suave 6s ease-in-out infinite;
}

@keyframes balanceo {
  0%, 100% { transform: rotate(-4deg); }
  50% { transform: rotate(4deg); }
}

@keyframes latido-suave {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

@media (prefers-reduced-motion: reduce) {
  /* Las animaciones en bucle automático se apagan; el parallax de
     scroll/mouse (decor-parallax, controlado por JS) queda activo porque
     responde directamente al usuario, no es autoplay (Aprendizajes §9.5). */
  .decor-hoja,
  .decor-flor {
    animation: none !important;
  }
}

/* ---------------------------------------------------------
   Hero
   --------------------------------------------------------- */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  padding: 40px 20px;
  background: linear-gradient(180deg, var(--crema) 0%, var(--hueso) 100%);
}

.hero__contenido {
  position: relative;
  z-index: 1;
  max-width: 720px;
}

.hero__pretitulo {
  font-family: var(--fuente-cuerpo);
  font-size: 1.05rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--verde-medio);
  margin: 0 0 18px;
}

.hero__nombre {
  font-family: var(--fuente-script);
  font-weight: 400;
  font-size: clamp(2.6rem, 9vw, 5.2rem);
  /* 1.4 en vez de 1.15: Parisienne tiene mayúsculas con florituras altas
     (S, F, G, A) que un line-height ajustado corta contra la caja de línea. */
  line-height: 1.4;
  margin: 0 0 20px;
  color: var(--verde-oscuro);
}

.hero__nombre-linea {
  display: block;
  white-space: nowrap;
  overflow: visible;
}

/* En viewports angostos, "Sara Fernanda" / "Gil Anzola" no caben en una
   sola línea al tamaño mínimo del clamp() y quedaban recortadas por el
   overflow-x:hidden de <html> (bug real reportado por el usuario en su
   propio navegador — "se ve cortado" — confirmado con captura a 375px
   donde el texto se salía del viewport). Permitir que cada línea envuelva
   sus palabras evita el desborde sin tocar el layout de escritorio. */
@media (max-width: 480px) {
  .hero__nombre-linea {
    white-space: normal;
    text-align: center;
  }

  .hero__nombre {
    font-size: clamp(2.1rem, 13vw, 3.2rem);
  }

  .palabra {
    margin-right: 0.15em;
  }
}

.palabra {
  display: inline-block;
  white-space: nowrap;
  /* Parisienne tiene mayúsculas con swashes grandes (la "F" de "Fernanda",
     la "A" de "Anzola") que se extienden hacia atrás y se enredan con la
     palabra anterior si van pegadas — este espacio extra les da lugar sin
     que toquen la palabra de al lado. 0.4em (primer intento) se veía
     demasiado separado, como dos bloques flotantes en vez de una sola
     línea fluida — 0.12em es el punto medio: suficiente para el swash,
     sin romper la lectura como una sola línea (revisión real de usuario,
     2026-09-23, cuarto ajuste en este punto). */
  margin-right: 0.12em;
  /* Antes esto usaba un degradado con background-clip:text (verde→dorado
     dentro de la misma palabra). Se quitó por completo: esa técnica pinta
     el color solo DENTRO de la caja del elemento, y las florituras de
     Parisienne en S/F/G se disparan hacia arriba Y hacia la izquierda más
     allá de esa caja (side-bearing negativo, típico de cursivas
     ornamentadas) — cada intento de agrandar la caja con padding/margen
     negativo arreglaba un eje y dejaba el otro cortado, confirmado con 2
     rondas de revisión real del usuario el 2026-09-23. Color sólido por
     palabra (alternando verde/dorado vía :last-child más abajo) logra el
     mismo efecto visual de dos tonos sin ninguna caja que pueda recortar
     una floritura — el color de un glifo con `color` normal se pinta
     donde sea que esté el trazo, sin superficie de recorte. */
  color: var(--dorado);
  opacity: 0;
  transform: translateY(14px);
  animation: aparecer-letra 0.6s ease forwards;
  animation-delay: var(--retraso, 0s);
  will-change: transform, opacity;
  -webkit-transform: translateZ(0);
}

.palabra:last-child {
  margin-right: 0;
  color: var(--dorado);
}

@keyframes aparecer-letra {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .palabra {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

.hero__confiere {
  font-family: var(--fuente-cuerpo);
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  font-weight: 700;
  color: var(--verde-medio);
  margin: 0 0 10px;
}

.hero__subtitulo {
  font-family: var(--fuente-cuerpo);
  font-style: italic;
  font-weight: 700;
  font-size: clamp(1.35rem, 3.4vw, 1.8rem);
  line-height: 1.25;
  color: var(--texto);
  margin: 0 0 18px;
}

.hero__subtitulo-linea {
  display: block;
}

.hero__subtitulo-linea + .hero__subtitulo-linea {
  margin-top: 8px;
}

.hero__subtitulo-y {
  font-weight: 400;
  font-size: 0.8em;
}

.hero__logo-universidad {
  height: auto;
  max-width: 200px;
  margin: 0 auto 20px;
}

.hero__fecha {
  font-family: var(--fuente-cuerpo);
  font-size: clamp(1.05rem, 2.4vw, 1.25rem);
  letter-spacing: 0.04em;
  color: var(--verde-oscuro);
  margin: 0 0 36px;
}

.hero__countdown {
  display: flex;
  gap: 18px;
  justify-content: center;
  margin-bottom: 36px;
  flex-wrap: wrap;
}

.hero__countdown-item {
  min-width: 68px;
  padding: 12px 8px;
  background: var(--hueso);
  border: 1px solid var(--verde-salvia);
  border-radius: 10px;
}

.hero__countdown-num {
  display: block;
  font-size: 1.7rem;
  font-weight: 600;
  color: var(--verde-oscuro);
  font-variant-numeric: tabular-nums;
}

.hero__countdown-label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--verde-medio);
}

.boton {
  display: inline-block;
  padding: 14px 36px;
  border-radius: 999px;
  background: var(--verde-oscuro);
  color: var(--crema);
  text-decoration: none;
  font-family: var(--fuente-cuerpo);
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.boton:hover,
.boton:focus-visible {
  background: var(--verde-medio);
  transform: translateY(-1px);
}

.boton--dorado {
  background: var(--dorado);
  color: var(--texto);
}

.boton--dorado:hover,
.boton--dorado:focus-visible {
  background: #a5854a;
}

.boton--whatsapp {
  background: #25D366;
  color: #0b3b21;
}

.boton--whatsapp:hover,
.boton--whatsapp:focus-visible {
  background: #1ebc59;
}

/* ---------------------------------------------------------
   Mensaje breve
   --------------------------------------------------------- */

.mensaje {
  padding: 70px 0;
  text-align: center;
  background: var(--hueso);
}

.mensaje__texto {
  font-family: var(--fuente-script);
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  color: var(--verde-oscuro);
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.5;
}

/* ---------------------------------------------------------
   Línea de tiempo — patrón "stack sticky"
   --------------------------------------------------------- */

.linea-tiempo {
  position: relative;
  background: var(--crema);
}

.linea-tiempo__titulo {
  /* Sticky: su contenedor (.linea-tiempo) abarca todas las fotos, así que
     el título queda fijo arriba durante todo el recorrido. */
  position: sticky;
  top: 0;
  z-index: 10;
  text-align: center;
  font-family: var(--fuente-script);
  font-size: clamp(2rem, 5vw, 2.8rem);
  color: var(--verde-oscuro);
  padding: 14px 20px 12px;
  margin: 0;
  background: var(--crema);
  box-shadow: 0 10px 14px -6px var(--crema);
}

.seccion-tl {
  padding: 20px 20px 0;
  background: var(--crema);
}

.seccion-tl__titulo {
  /* Sticky durante todo el recorrido de scroll de SU sección: como el
     título vive dentro de `.seccion-tl` (que mide título + todos sus
     `.foto-riel`), se mantiene fijo mientras esa sección pasa y cambia
     naturalmente al llegar la siguiente `.seccion-tl__titulo` — sin
     coordinación manual adicional con los rieles, solo un `top` menor al
     de `.foto-tl` (12vh vs 3vh) para que no se pisen, y z-index/fondo por
     si una foto aún en camino a su propio punto de stick pasa por detrás. */
  position: sticky;
  top: 3vh;
  z-index: 5;
  background: var(--crema);
  text-align: center;
  font-family: var(--fuente-cuerpo);
  font-weight: 600;
  font-size: clamp(1.4rem, 3.4vw, 1.9rem);
  color: var(--verde-oscuro);
  margin: 0 0 10px;
  padding: 8px 16px;
  letter-spacing: 0.02em;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.seccion-tl__titulo.en-vista {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .seccion-tl__titulo {
    transition: none;
  }
}

.seccion-tl__fotos {
  position: relative;
}

/* Patrón real "fotos como stack sticky" (BLUEPRINT-INVITACIONES-WEB.md §4):
   cada foto es `position: sticky` con el mismo `top`, envuelta en un
   "riel" (`.foto-riel`) cuyo alto le da distancia de scroll antes de que
   la siguiente foto la cubra — el "empuje" de escala/brillo lo aplica
   `iniciarPilaFotos()` en JS a medida que el riel llega a su fin. */
.foto-riel {
  position: relative;
  height: 78vh;
  min-height: 380px;
}

.foto-riel--secundaria {
  height: 55vh;
  min-height: 280px;
}

.foto-tl {
  position: sticky;
  top: 14vh;
  margin: 0 auto;
  width: 340px;
  max-width: calc(100vw - 40px);
  background: var(--hueso);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 16px 34px rgba(47, 74, 61, 0.2);
  will-change: transform, filter;
}

.foto-tl--secundaria {
  width: 230px;
}

.foto-tl__marco {
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--verde-salvia);
}

.foto-tl__marco img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------------------------------------------------------
   Detalles del evento + RSVP
   --------------------------------------------------------- */

.evento {
  position: relative;
  background: var(--verde-oscuro);
  color: var(--crema);
  padding: 80px 0;
}

.evento__titulo {
  text-align: center;
  font-family: var(--fuente-script);
  font-size: clamp(2.1rem, 5vw, 2.9rem);
  margin: 0 0 46px;
  color: var(--hueso);
}

.evento__lista {
  list-style: none;
  margin: 0 0 46px;
  padding: 0;
  display: grid;
  gap: 22px;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

.evento__item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  border-bottom: 1px solid rgba(250, 246, 236, 0.18);
  padding-bottom: 18px;
}

.evento__item-icono {
  font-family: var(--fuente-cuerpo);
  font-weight: 600;
  color: var(--dorado-contraste);
  min-width: 96px;
  text-transform: uppercase;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  padding-top: 3px;
}

.evento__item-texto {
  font-size: 1.15rem;
}

/* Lluvia de sobres: sobre de línea fina que "respira" (flota y varía
   su opacidad muy poco). Corre solo; se detiene con prefers-reduced-motion. */
.evento__item-texto--sobre {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.sobre-anim {
  flex: none;
  fill: none;
  stroke: var(--dorado-contraste);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: sobre-respira 5s ease-in-out infinite;
}

@keyframes sobre-respira {
  0%, 100% { transform: translateY(0);    opacity: 0.75; }
  50%      { transform: translateY(-3px); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .sobre-anim {
    animation: none;
  }
}

.evento__acciones {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}

.evento__rsvp {
  margin-top: 46px;
  text-align: center;
}

.evento__rsvp-titulo {
  font-family: var(--fuente-script);
  font-size: clamp(1.5rem, 3.6vw, 1.9rem);
  color: var(--hueso);
  margin: 0 0 20px;
}

/* ---------------------------------------------------------
   Lightbox
   --------------------------------------------------------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(43, 43, 38, 0.92);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease;
}

.lightbox--visible {
  opacity: 1;
  visibility: visible;
}

.lightbox__img {
  max-width: 100%;
  max-height: 90vh;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox__cerrar {
  position: absolute;
  top: 20px;
  right: 24px;
  background: none;
  border: none;
  color: var(--crema);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  padding: 6px 10px;
}

/* ---------------------------------------------------------
   Footer
   --------------------------------------------------------- */

.footer {
  position: relative;
  background: var(--hueso);
  text-align: center;
  padding: 70px 20px 50px;
  overflow: hidden;
}

.footer__contenido {
  position: relative;
  z-index: 1;
}

.footer__nombre {
  font-family: var(--fuente-script);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  color: var(--verde-oscuro);
  margin: 0 0 8px;
}

.footer__fecha {
  font-size: 1rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--verde-medio);
  margin: 0;
}

/* ---------------------------------------------------------
   Responsive
   --------------------------------------------------------- */

@media (max-width: 768px) {
  .evento__item {
    flex-direction: column;
    gap: 4px;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 19px;
  }

  .hero__countdown {
    gap: 10px;
  }

  .hero__countdown-item {
    min-width: 58px;
    padding: 10px 6px;
  }

  .evento {
    padding: 60px 0;
  }
}
