/* ============================================================
   ANDREA & IVÁN · 2 AÑOS — sistema de diseño v2
   Identidad aniversario: coral + esmeralda + oro GC · tipografías
   reales de la boda (Brittany/Hadriel/Cinzel/Serlio/CubaLibre/Perpetua)
   Reglas de oro (heredadas del sitio de la boda):
   1) Ritmo vertical con GRID + gap — los bloques no pueden solaparse.
   2) Caligrafías con line-height ≥1.25 y aire vertical (colas largas).
   ============================================================ */

/* Tipografías LEGIBLES (pedido de Iván): la caligrafía queda solo como
   acento; títulos y lectura van en serif/sans claras. woff2 self-hosted. */
@font-face { font-family: "Great Vibes"; src: url("../fonts/GreatVibes-400.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Cormorant"; src: url("../fonts/CormorantGaramond-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Cormorant"; src: url("../fonts/CormorantGaramond-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Lora"; src: url("../fonts/Lora-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Lora"; src: url("../fonts/Lora-400i.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Lora"; src: url("../fonts/Lora-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Jost"; src: url("../fonts/Jost-300.woff2") format("woff2"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Jost"; src: url("../fonts/Jost-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Jost"; src: url("../fonts/Jost-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --coral: #e8705f;            /* solo superficies y textos GRANDES */
  --coral-texto: #c2543f;      /* coral 4.6:1 para texto pequeño / estados */
  --coral-suave: #fdf3f0;
  --esm: #0e5f4c;
  --esm-2: #147a62;
  --esm-suave: #e3efe9;
  --esm-texto: #2a6e51;
  --oro: #b98139;
  --oro-oscuro: #8e632b;
  --marfil: #fbf7f2;
  --blanco: #ffffff;
  --tinta: #2b2723;
  --gris: #6d6357;             /* 4.7:1 sobre marfil */
  --arena: #f6d9b8;

  --script: "Great Vibes", cursive;   /* SOLO acentos: nombres, firmas */
  --display: "Cormorant", Georgia, serif;  /* títulos */
  --serif: "Jost", "Segoe UI", sans-serif; /* etiquetas/uppercase/botones */
  --numeros: "Jost", sans-serif;
  --cuerpo: "Lora", Georgia, serif;   /* lectura */

  --sp-1: clamp(6px, 1vw, 10px);
  --sp-2: clamp(12px, 2vw, 18px);
  --sp-3: clamp(20px, 3vw, 30px);
  --sp-4: clamp(32px, 5vw, 48px);
  --sp-5: clamp(52px, 8vw, 84px);

  --ancho: 1080px;
  --sombra: 0 18px 50px -14px rgba(14, 95, 76, 0.22);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
/* la nav fija mide ~48px: sin esto las anclas del menú tapan los títulos */
html { scroll-behavior: smooth; scroll-padding-top: 68px; }
body {
  font-family: var(--cuerpo);
  font-size: 18px;
  line-height: 1.6;
  color: var(--tinta);
  background: var(--marfil);
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--esm-2); }
p, h1, h2, h3, h4, blockquote { overflow-wrap: break-word; }

:focus-visible {
  outline: 3px solid var(--coral);
  outline-offset: 3px;
  border-radius: 4px;
}
.icono-svg { width: 1em; height: 1em; stroke-width: 1.6; }

/* caligrafía (solo acentos): SIEMPRE con aire para las colas */
.caligrafia, .hero-caja h1, .anillo b,
footer.pie .lema, .cita .firma, .carta .firma, .carta .saludo {
  line-height: 1.3;
  padding-block: 0.12em;
}

.contenedor { max-width: var(--ancho); margin: 0 auto; padding: 0 22px; }
section { padding-block: var(--sp-5); position: relative; }

/* título de sección: ornamento + script */
.titulo {
  display: grid;
  gap: var(--sp-1);
  justify-items: center;
  text-align: center;
  margin-bottom: var(--sp-4);
}
.titulo .pre {
  font-family: var(--serif);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  font-size: clamp(11px, 1.6vw, 13px);
  color: var(--oro-oscuro);
  line-height: 1.6;
  display: flex; align-items: center; gap: 14px;
}
.titulo .pre::before, .titulo .pre::after {
  content: ""; height: 1px; width: clamp(28px, 6vw, 64px);
}
.titulo .pre::before { background: linear-gradient(90deg, transparent, var(--oro)); }
.titulo .pre::after { background: linear-gradient(90deg, var(--oro), transparent); }
.titulo h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(30px, 4.8vw, 46px);
  letter-spacing: 0.01em;
  color: var(--esm);
}
/* la caligrafía queda como ACENTO dentro del título legible */
.titulo h2 .acento {
  font-family: var(--script); font-weight: 400;
  font-size: 1.32em; color: var(--coral);
  line-height: 1.3; padding-inline: 0.06em;
}
.intro {
  text-align: center;
  color: var(--gris);
  max-width: 640px;
  margin: calc(var(--sp-3) * -0.5) auto var(--sp-4);
  line-height: 1.8;
}

.btn {
  display: inline-block;
  font-family: var(--serif); font-weight: 500;
  letter-spacing: 0.26em; text-transform: uppercase;
  font-size: clamp(11px, 1.6vw, 13px);
  line-height: 1.4;
  color: var(--blanco);
  background: linear-gradient(135deg, var(--esm-2), var(--esm));
  border: none; cursor: pointer;
  padding: 15px 32px;
  border-radius: 999px;
  text-decoration: none;
  box-shadow: 0 10px 26px rgba(14, 95, 76, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(14, 95, 76, 0.45); }
.btn.claro { background: var(--blanco); border: 1px solid var(--esm-2); color: var(--esm); box-shadow: none; }

/* ---------- NAV ---------- */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  background: rgba(251, 247, 242, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(14, 95, 76, 0.18);
}
.nav-int {
  max-width: var(--ancho); margin: 0 auto; padding: 8px 22px;
  display: flex; align-items: center; gap: 16px;
}
.nav-logo {
  font-family: var(--script); font-size: 24px; color: var(--esm);
  text-decoration: none; margin-right: auto; white-space: nowrap;
  line-height: 1.3; padding-block: 0.12em;
}
nav a.enlace {
  font-family: var(--serif); font-size: 11px;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--tinta); text-decoration: none;
  padding: 14px 6px; border-bottom: 2px solid transparent;
  white-space: nowrap;
}
nav a.enlace:hover, nav a.enlace.activo { color: var(--coral-texto); border-bottom-color: var(--coral); }
#nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
.hamb { display: none; }

/* ---------- HERO ---------- */
header.hero {
  min-height: 100svh;
  display: grid; place-items: center;
  position: relative; isolation: isolate;
  padding: 96px 20px 72px;
}
.hero-fondos { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.hero-fondos img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center 32%;
  opacity: 0; transition: opacity 1.6s ease;
}
.hero-fondos img.visible { opacity: 1; }
.hero-fondos::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(rgba(16, 30, 24, 0.46), rgba(10, 34, 27, 0.66));
}
.hero-caja {
  display: grid;
  gap: var(--sp-2);
  justify-items: center;
  text-align: center;
  color: var(--blanco);
  max-width: 900px;
}
.hero-caja .logo {
  width: clamp(84px, 12vw, 108px); height: auto;
  filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.45));
}
.hero-caja .peq {
  font-family: var(--serif); letter-spacing: 0.38em;
  text-transform: uppercase; font-size: clamp(11px, 1.8vw, 13px);
  line-height: 1.7; color: var(--arena);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.5);
}
.hero-caja h1 {
  font-family: var(--script); font-weight: 400;
  font-size: clamp(46px, 8.6vw, 84px);
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
}
.hero-caja .fechas {
  font-family: var(--numeros);
  font-size: clamp(15px, 2.6vw, 24px);
  letter-spacing: 0.22em;
  color: var(--arena);
  line-height: 1.6;
}
.anillo {
  display: grid; place-content: center; gap: 2px;
  width: clamp(132px, 20vw, 156px); aspect-ratio: 1;
  border-radius: 50%;
  border: 1.5px solid rgba(246, 217, 184, 0.85);
  outline: 1px dashed rgba(246, 217, 184, 0.4);
  outline-offset: 7px;
  background: rgba(10, 34, 27, 0.32);
  backdrop-filter: blur(3px);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.35);
}
.anillo b {
  font-family: var(--script); font-weight: 400;
  font-size: clamp(52px, 8vw, 64px);
}
.anillo span {
  font-family: var(--serif); font-size: 11px;
  letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--arena); line-height: 1.5;
}
.hero .baja {
  position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%);
  color: #fff; opacity: 0.85;
  display: grid; place-items: center;
  width: 44px; height: 44px;
}
.hero .baja .icono-svg { width: 26px; height: 26px; animation: baja 2.2s ease-in-out infinite; }
@keyframes baja { 0%, 100% { transform: translateY(0) } 50% { transform: translateY(7px) } }

/* ---------- CONTADOR ---------- */
.tiempo {
  background: linear-gradient(160deg, var(--esm) 0%, #0a4a3b 100%);
  color: var(--blanco);
  overflow: hidden;
}
.tiempo::before, .tiempo::after {
  content: ""; position: absolute; width: 340px; height: 340px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 112, 95, 0.26), transparent 65%);
  pointer-events: none;
}
.tiempo::before { top: -140px; left: -120px; }
.tiempo::after { bottom: -160px; right: -120px; }
.tiempo .titulo .pre { color: var(--arena); }
.tiempo .titulo h2 { color: var(--blanco); }
.tiempo .titulo h2 .acento { color: #f4a093; }
.tiempo .intro { color: #cde4da; }
.cifras {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 14px;
  max-width: 860px; margin: 0 auto;
}
.cifra {
  display: grid; gap: 6px; justify-items: center;
  min-width: 116px;
  padding: 18px 14px 15px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(246, 217, 184, 0.28);
}
.cifra b {
  font-family: var(--numeros); font-weight: 300;
  font-size: clamp(30px, 5vw, 42px); line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.cifra span {
  font-family: var(--serif); font-size: 10.5px;
  letter-spacing: 0.26em; text-transform: uppercase;
  color: var(--arena); line-height: 1.5;
}
.tiempo .desde {
  text-align: center; margin-top: var(--sp-3);
  font-family: var(--cuerpo); font-style: italic;
  font-size: clamp(17px, 2.4vw, 20px);
  color: #cde4da; line-height: 1.6;
}

/* ---------- CITA ---------- */
.cita { background: var(--coral-suave); text-align: center; }
.cita .deco { width: min(150px, 40vw); margin: 0 auto var(--sp-2); opacity: 0.9; }
.cita blockquote {
  font-family: var(--cuerpo); font-style: italic;
  max-width: 720px; margin: 0 auto;
  font-size: clamp(19px, 2.9vw, 26px);
  color: var(--esm);
  line-height: 1.7;
}
.cita .firma {
  margin-top: var(--sp-2);
  font-family: var(--script);
  font-size: clamp(20px, 3vw, 26px);
  color: var(--coral-texto);
}

/* ---------- CARTA (Iván → Andrea) ---------- */
.carta { background: var(--blanco); }
.papel {
  max-width: 660px; margin: 0 auto;
  background: var(--marfil);
  border: 1px solid rgba(185, 129, 57, 0.3);
  outline: 1px dashed rgba(185, 129, 57, 0.25);
  outline-offset: 7px;
  border-radius: 6px;
  box-shadow: var(--sombra);
  padding: clamp(28px, 5vw, 48px) clamp(22px, 5vw, 44px);
  display: grid; gap: var(--sp-2);
}
.carta .saludo {
  font-family: var(--script);
  font-size: clamp(28px, 4.2vw, 38px);
  color: var(--coral-texto);
}
.papel p { color: var(--tinta); line-height: 1.9; font-size: 17.5px; }
.carta .firma {
  font-family: var(--script);
  font-size: clamp(30px, 4.6vw, 40px);
  color: var(--esm);
  justify-self: end;
  padding-right: 0.2em;
}

/* ---------- HISTORIA ---------- */
.historia { background: var(--blanco); }
.hitos {
  display: grid; gap: var(--sp-3);
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  max-width: 980px; margin: 0 auto;
}
.hito {
  display: grid; gap: var(--sp-1); justify-items: center;
  background: var(--marfil);
  border-radius: 20px;
  padding: clamp(26px, 4vw, 36px) clamp(18px, 3vw, 26px);
  text-align: center;
  box-shadow: var(--sombra);
  border-top: 4px solid var(--coral);
  transition: transform 0.25s ease;
}
.hito:nth-child(2) { border-top-color: var(--oro); }
.hito:nth-child(3) { border-top-color: var(--esm-2); }
@media (hover: hover) { .hito:hover { transform: translateY(-6px); } }
.hito .icono { color: var(--esm); line-height: 0; }
.hito .icono .icono-svg { width: 46px; height: 46px; stroke-width: 1.4; }
.hito .cuando {
  font-family: var(--serif); font-size: 11px;
  letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--coral-texto); line-height: 1.6;
}
.hito h3 {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(19px, 2.6vw, 23px);
  color: var(--esm); letter-spacing: 0.02em; line-height: 1.4;
}
.hito p { color: var(--gris); font-size: 16px; line-height: 1.7; }

/* ---------- CARRUSEL (estilo vera) ---------- */
.momentos { background: var(--esm-suave); }
.carrusel-zona { position: relative; }
.carrusel {
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  margin-block: var(--sp-2) var(--sp-2);
  cursor: grab;
}
.carrusel::-webkit-scrollbar { display: none; }
.carrusel.arrastrando { cursor: grabbing; scroll-snap-type: none; }
.carrusel-pista {
  display: flex;
  gap: clamp(12px, 2vw, 20px);
  padding: 10px max(22px, calc((100vw - var(--ancho)) / 2 + 22px));
  width: max-content;
}
.carrusel-pista img {
  width: clamp(230px, 62vw, 330px);
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 16px;
  border: 4px solid var(--blanco);
  box-shadow: var(--sombra);
  scroll-snap-align: center;
  user-select: none;
  -webkit-user-drag: none;
  transition: transform 0.3s ease;
}
.carrusel-pista img:hover { transform: translateY(-4px); }
.carrusel-flecha {
  position: absolute; top: 50%; transform: translateY(-50%);
  z-index: 2;
  width: 46px; height: 46px;
  display: none; place-items: center;
  border: 1px solid rgba(14, 95, 76, 0.4);
  border-radius: 50%;
  background: rgba(251, 247, 242, 0.92);
  color: var(--esm);
  cursor: pointer;
  box-shadow: var(--sombra);
  transition: transform 0.2s ease, background 0.2s ease;
}
.carrusel-flecha:hover { background: var(--blanco); transform: translateY(-50%) scale(1.06); }
.carrusel-flecha .icono-svg { width: 20px; height: 20px; }
.carrusel-flecha.prev { left: clamp(8px, 2vw, 26px); }
.carrusel-flecha.sig { right: clamp(8px, 2vw, 26px); }
@media (hover: hover) and (pointer: fine) {
  .carrusel-flecha { display: grid; }
  .carrusel-hint { display: none; }
}
.carrusel-hint {
  text-align: center;
  font-family: var(--serif); letter-spacing: 0.24em; text-transform: uppercase;
  font-size: 11px; color: var(--gris);
  line-height: 1.6;
}

/* ---------- ÁLBUM ---------- */
.album { background: var(--blanco); }
.galeria-grid {
  columns: 4 240px; column-gap: 14px;
  max-width: var(--ancho); margin: 0 auto;
}
.galeria-grid a {
  display: block; margin-bottom: 14px; break-inside: avoid;
  border-radius: 10px; overflow: hidden;
  border: 3px solid var(--blanco); box-shadow: var(--sombra);
}
.galeria-grid img { width: 100%; height: auto; background: var(--esm-suave); transition: transform 0.35s ease, opacity 0.35s ease; }
.galeria-grid img.cargando { opacity: 0; }
.galeria-grid a:hover img { transform: scale(1.04); }
.galeria-mas { text-align: center; margin-top: var(--sp-3); }

dialog.visor {
  border: none; background: rgba(8, 22, 17, 0.93);
  max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh;
  padding: 56px 30px 96px;
}
/* display SOLO abierto (forzarlo en base filtra los controles fixed) */
dialog.visor[open] { display: grid; place-items: center; animation: aparecer 0.25s ease; }
@keyframes aparecer { from { opacity: 0 } to { opacity: 1 } }
body:has(dialog[open]) { overflow: hidden; }
dialog.visor img {
  max-width: min(92vw, 1200px);
  max-height: calc(100svh - 170px);
  object-fit: contain; border-radius: 6px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  transition: opacity 0.25s ease;
}
.visor-barra {
  position: fixed; bottom: 22px; left: 0; right: 0;
  display: flex; gap: 18px; justify-content: center; align-items: center;
  color: var(--blanco); font-family: var(--serif);
  letter-spacing: 0.2em; text-transform: uppercase; font-size: 12px;
}
.visor-btn {
  background: rgba(255, 255, 255, 0.12); color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px; padding: 10px 18px;
  min-width: 44px; min-height: 44px;
  display: grid; place-items: center;
  cursor: pointer; font-size: 14px;
}
.visor-btn .icono-svg { width: 18px; height: 18px; }
.visor-x { position: fixed; top: 18px; right: 22px; }

/* ---------- CANCIÓN ---------- */
.cancion { background: var(--marfil); text-align: center; }
.versos { display: grid; gap: var(--sp-3); max-width: 680px; margin: 0 auto; }
.verso {
  position: relative;
  background: var(--blanco);
  border-radius: 20px;
  box-shadow: var(--sombra);
  padding: clamp(24px, 4vw, 36px) clamp(20px, 4vw, 34px);
  font-family: var(--cuerpo); font-style: italic;
  font-size: clamp(17px, 2.3vw, 19.5px);
  color: #463f38;
  line-height: 1.9;
}
.verso::before {
  content: "\201C";
  position: absolute; top: -20px; left: 18px;
  font-family: var(--script); font-size: 64px; color: var(--coral);
  line-height: 1;
}
.verso.coro { border: 1.5px solid rgba(232, 112, 95, 0.5); background: var(--coral-suave); }
.verso-pie {
  font-family: var(--cuerpo); font-style: italic;
  font-size: clamp(17px, 2.4vw, 20px);
  color: var(--esm-texto);
  margin-top: var(--sp-3);
  line-height: 1.6;
}

/* ---------- FOOTER ---------- */
footer.pie {
  background: var(--esm);
  color: #cde4da;
  text-align: center;
  padding: var(--sp-5) 22px var(--sp-4);
  display: grid; gap: var(--sp-2); justify-items: center;
}
footer.pie .logo { width: 84px; filter: brightness(0) invert(1); opacity: 0.92; }
footer.pie .lema {
  font-family: var(--script);
  font-size: clamp(30px, 4.6vw, 42px);
  color: var(--blanco);
}
footer.pie .peq {
  font-family: var(--serif); letter-spacing: 0.3em; text-transform: uppercase;
  font-size: 12px; color: rgba(255, 255, 255, 0.75); line-height: 1.7;
}

/* ---------- REVEAL ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.8s ease, transform 0.8s ease; }
.reveal.visto { opacity: 1; transform: none; }

/* ---------- RESPONSIVE ----------
   El menú (6 enlaces) cabe desde 900px: hamburguesa hasta 899px. */
@media (max-width: 899px) {
  .hamb {
    display: grid; place-items: center;
    width: 44px; height: 44px;
    margin-left: auto;
    background: none; border: none; cursor: pointer;
    color: var(--esm);
  }
  .hamb .icono-svg { width: 26px; height: 26px; }
  #nav-toggle:focus-visible + .hamb { outline: 3px solid var(--coral); outline-offset: 2px; border-radius: 6px; }
  .nav-enlaces {
    position: absolute; top: 100%; left: 0; right: 0;
    background: rgba(251, 247, 242, 0.98);
    border-bottom: 1px solid rgba(14, 95, 76, 0.18);
    box-shadow: 0 18px 30px rgba(14, 95, 76, 0.12);
    display: none; flex-direction: column; padding: 8px 22px 14px; gap: 0;
  }
  .nav-enlaces a.enlace { padding: 13px 6px; }
  #nav-toggle:checked ~ .nav-enlaces { display: flex; }
  .nav-logo { margin-right: 0; }
}
@media (min-width: 900px) {
  .nav-enlaces { display: flex; gap: 14px; align-items: center; }
  #nav-toggle { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { transition: none; opacity: 1; transform: none; }
  .hero-fondos img { transition: none; }
  .hero .baja .icono-svg { animation: none; }
  .carrusel { scroll-behavior: auto; }
  .hito, .carrusel-pista img, .galeria-grid img { transition: none; }
}
