/* KC EPÍSTOLA · secciones claras (dedicatoria → regalos). Carril A.
   Todo yace sobre el mismo lino marfil del hero; el ojival es el motivo; la plata es solo grabado.
   Estados ocultos solo bajo no-preference y con html.ep-pages-on (si falla el JS, todo se ve). */

/* ── Lino compartido + corte de papel entre secciones ──────────────── */
#dedicatoria, #counter, #familia, #historia, #ubicaciones, #itinerario, #vestimenta, #regalos {
  --ep-lx: 28%;
  --ep-shadow-paper: 0 1px 1px rgba(49, 19, 32, 0.2), 0 12px 26px -8px rgba(49, 19, 32, 0.3);
  --ep-grain: url('../../../assets/page/epistola-grain.webp');
  --ep-lancet-rule: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 16'%3E%3Cpath d='M0 8H102M138 8H240' stroke='%23A7AAB3' stroke-width='.7' fill='none'/%3E%3Cpath d='M120 .8C124.2 5 124.2 11 120 15.2C115.8 11 115.8 5 120 .8Z' fill='none' stroke='%23A7AAB3' stroke-width='.8'/%3E%3C/svg%3E");
  position: relative;
  isolation: isolate;
  /* Las entradas laterales (cartas, sedes, etiqueta) y la franja del jardín no ensanchan la página. */
  overflow-x: clip;
  background-color: #E8DFD2;
  background-image:
    linear-gradient(to bottom, rgb(var(--ep-dusk-c, 49 19 32) / 0) var(--ep-dusk-from, 74%), rgb(var(--ep-dusk-c, 49 19 32) / var(--ep-dusk, 0)) 100%),
    radial-gradient(120% 52% at var(--ep-lx) 36%, rgba(255, 253, 249, 0.62), rgba(255, 253, 249, 0) 68%),
    repeating-linear-gradient(0deg, rgba(82, 32, 54, 0.02) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(82, 32, 54, 0.016) 0 1px, transparent 1px 4px),
    var(--ep-grain);
  background-size: 100% 100%, 100% 100%, auto, auto, 96px 96px;
  background-repeat: no-repeat, no-repeat, repeat, repeat, repeat;
  color: var(--ep-ink-small);
}
#counter, #historia, #vestimenta { --ep-lx: 74%; }
/* R2 crítica: un solo lino continuo. La luz cae dentro de cada sección, nunca en el corte;
   solo #regalos se oscurece abajo: ahí empieza a anochecer (la franja de noche arranca de ese tono). */
/* El atardecer termina en un tono fijo (#D9CFC4 = primer paso de la franja de noche) a cualquier ancho. */
#regalos { --ep-dusk-c: 217 207 196; --ep-dusk: 0.94; --ep-dusk-from: 60%; }
#dedicatoria::before, #counter::before, #familia::before, #historia::before,
#ubicaciones::before, #itinerario::before, #vestimenta::before, #regalos::before {
  content: "";
  position: absolute;
  z-index: 1;
  top: 0;
  left: 50%;
  width: min(15rem, 62vw);
  height: 16px;
  transform: translate(-50%, -50%);
  background: var(--ep-lancet-rule) center / 100% 100% no-repeat;
  pointer-events: none;
}
#dedicatoria::before, #counter::before, #historia::before, #itinerario::before, #regalos::before { display: none; }
/* Canto de papel: una arista clara sobre la sombra suave de la sección anterior. */
#counter::after, #familia::after, #historia::after, #ubicaciones::after,
#itinerario::after, #vestimenta::after, #regalos::after {
  display: none;
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0 0 auto 0;
  height: 14px;
  background: linear-gradient(to bottom, rgba(49, 19, 32, 0.07), rgba(49, 19, 32, 0));
  pointer-events: none;
}

#dedicatoria .kc-eyebrow, #counter .kc-eyebrow, #familia .kc-eyebrow, #historia .kc-eyebrow,
#ubicaciones .kc-eyebrow, #itinerario .kc-eyebrow, #vestimenta .kc-eyebrow, #regalos .kc-eyebrow {
  font-size: 0.8rem;
  color: var(--ep-burgundy-ribbon);
}
#dedicatoria .kc-title, #counter .kc-title, #familia .kc-title, #historia .kc-title,
#ubicaciones .kc-title, #itinerario .kc-title, #vestimenta .kc-title, #regalos .kc-title {
  color: var(--ep-burgundy-ink);
  font-size: clamp(1.7rem, 1.3rem + 2vw, 2.45rem);
  line-height: 1.12;
  margin-bottom: clamp(1.5rem, 1rem + 2.5vw, 2.4rem);
}
#dedicatoria .kc-body, #counter .kc-body, #familia .kc-body, #itinerario .kc-body,
#vestimenta .kc-body, #regalos .kc-body {
  font-family: var(--kc-font-body);
  font-weight: 500;
  font-size: 1.1rem;
  line-height: 1.55;
  color: var(--ep-ink-small);
}

/* Entradas distintas (no el mismo fade-up en todo): rótulo se abre, título se enfoca. */
@media (prefers-reduced-motion: no-preference) {
  .ep-pages-on :is(#dedicatoria, #counter, #familia, #historia, #ubicaciones, #itinerario, #vestimenta, #regalos) .kc-eyebrow[data-reveal] {
    transform: none;
    letter-spacing: 0.42em;
    transition: opacity 0.9s var(--ep-ease-paper), letter-spacing 1.1s var(--ep-ease-paper);
  }
  .ep-pages-on :is(#dedicatoria, #counter, #familia, #historia, #ubicaciones, #itinerario, #vestimenta, #regalos) .kc-eyebrow.is-revealed {
    letter-spacing: 0.22em;
  }
  .ep-pages-on :is(#dedicatoria, #counter, #familia, #historia, #ubicaciones, #itinerario, #vestimenta, #regalos) .kc-title[data-reveal] {
    transform: translateY(8px);
    filter: blur(4px);
    transition: opacity 0.8s var(--ep-ease-paper) 0.08s, transform 0.8s var(--ep-ease-paper) 0.08s, filter 0.8s var(--ep-ease-paper) 0.08s;
  }
  .ep-pages-on :is(#dedicatoria, #counter, #familia, #historia, #ubicaciones, #itinerario, #vestimenta, #regalos) .kc-title.is-revealed {
    transform: none;
    filter: none;
  }
}

/* ── 1 · Dedicatoria: tarjeta de algodón con cabeza ojival ───────────── */
#dedicatoria .kc-container { position: relative; --arch-h: clamp(118px, 32vw, 148px); }
/* R3.1 (CEO): «Con cariño» vive dentro de la ojiva; sin eyebrow ni hueco arriba. */
#dedicatoria .kc-title {
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  top: calc(var(--arch-h) * 0.5);
  margin: 0;
  pointer-events: none;
}
#dedicatoria .kc-dedication {
  --arch-fill: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 112' preserveAspectRatio='none'%3E%3Cpath d='M0 112V72C0 46 34 14 50 0C66 14 100 46 100 72V112Z' fill='%23FBF8F3'/%3E%3C/svg%3E");
  --arch-line: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 96' preserveAspectRatio='none'%3E%3Cpath d='M.5 96V64C.5 42 32 12 50 .5C68 12 99.5 42 99.5 64V96' fill='none' stroke='%23A7AAB3' stroke-width='.9' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E");
  position: relative;
  max-width: 31rem;
  margin: 0 auto;
  padding: calc(var(--arch-h) + 0.9rem) clamp(1.5rem, 7vw, 2.6rem) 3.4rem;
  text-align: left;
  font-family: var(--kc-font-body);
  font-style: normal;
  font-weight: 500;
  font-size: clamp(1.2rem, 1.1rem + 0.5vw, 1.35rem);
  line-height: 1.58;
  color: var(--ep-ink-small);
  background:
    var(--arch-fill) top / 100% var(--arch-h) no-repeat,
    linear-gradient(#FBF8F3, #F5F0E8) 0 calc(var(--arch-h) - 1px) / 100% calc(100% - var(--arch-h) + 1px) no-repeat;
  filter: drop-shadow(0 1px 1px rgba(49, 19, 32, 0.2)) drop-shadow(0 14px 14px rgba(49, 19, 32, 0.17));
  text-wrap: pretty;
}
/* Marco de plata a un dedo del borde, con su ojiva. */
#dedicatoria .kc-dedication::before {
  content: "";
  position: absolute;
  inset: 11px;
  background:
    var(--ep-lancet-rule) 50% calc(var(--arch-h) * 0.9) / 6.5rem 12px no-repeat,
    var(--arch-line) top / 100% calc(var(--arch-h) - 16px) no-repeat,
    linear-gradient(rgba(167, 170, 179, 0.8), rgba(167, 170, 179, 0.8)) 0 calc((var(--arch-h) - 16px) * 0.667) / 0.7px calc(100% - (var(--arch-h) - 16px) * 0.667) no-repeat,
    linear-gradient(rgba(167, 170, 179, 0.8), rgba(167, 170, 179, 0.8)) 100% calc((var(--arch-h) - 16px) * 0.667) / 0.7px calc(100% - (var(--arch-h) - 16px) * 0.667) no-repeat,
    linear-gradient(rgba(167, 170, 179, 0.8), rgba(167, 170, 179, 0.8)) 0 100% / 100% 0.7px no-repeat;
  pointer-events: none;
}
/* Algodón: grano sobre la forma exacta de la tarjeta. */
#dedicatoria .kc-dedication::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--ep-grain) 0 0 / 96px 96px;
  mix-blend-mode: multiply;
  opacity: 0.55;
  pointer-events: none;
  -webkit-mask: var(--arch-fill) top / 100% var(--arch-h) no-repeat, linear-gradient(#000, #000) 0 calc(var(--arch-h) - 1px) / 100% calc(100% - var(--arch-h) + 1px) no-repeat;
  mask: var(--arch-fill) top / 100% var(--arch-h) no-repeat, linear-gradient(#000, #000) 0 calc(var(--arch-h) - 1px) / 100% calc(100% - var(--arch-h) + 1px) no-repeat;
}
#dedicatoria .kc-dedication::first-letter {
  float: left;
  font-family: var(--kc-font-display);
  font-optical-sizing: none;
  font-variation-settings: "opsz" 16;
  font-size: 3.2em;
  line-height: 0.8;
  padding: 0.08em 0.1em 0 0;
  color: var(--ep-burgundy-ink);
}
#dedicatoria .ep-dedication__seal {
  position: absolute;
  left: 50%;
  bottom: -1.9rem;
  z-index: 2;
  width: 3.6rem;
  height: 3.6rem;
  margin-left: -1.8rem;
  filter: drop-shadow(0 1px 1px rgba(49, 19, 32, 0.35)) drop-shadow(0 5px 6px rgba(49, 19, 32, 0.28));
}
#dedicatoria .ep-dedication__seal svg { display: block; width: 100%; height: 100%; overflow: visible; }
/* El markup pone el <use> en (0,0) de un viewBox centrado: se recentra aquí. */
#dedicatoria .ep-dedication__seal use { transform: translate(-32px, -32px); }
#dedicatoria { padding-top: calc(var(--kc-section-pad) * 0.5); padding-bottom: calc(var(--kc-section-pad) + 1.2rem); }

@media (prefers-reduced-motion: no-preference) {
  /* La tarjeta sube sobre el lino; los párrafos se entintan uno a uno. */
  .ep-pages-on #dedicatoria .kc-dedication[data-reveal] {
    transform: translateY(46px) rotate(-0.6deg);
    transition: opacity 0.9s var(--ep-ease-paper), transform 1.2s var(--ep-ease-paper);
  }
  .ep-pages-on #dedicatoria .kc-dedication.is-revealed { transform: none; }
  .ep-pages-on #dedicatoria .ep-ink {
    opacity: 0;
    filter: blur(3px);
    transition: opacity 1.3s ease, filter 1.3s ease;
    transition-delay: calc(0.55s + var(--i, 0) * 0.7s);
  }
  .ep-pages-on #dedicatoria .kc-dedication.is-revealed .ep-ink { opacity: 1; filter: none; }
  .ep-pages-on #dedicatoria .ep-dedication__seal {
    opacity: 0;
    transform: translateY(-10px) scale(1.18);
    transition: opacity 0.4s ease 1.9s, transform 0.5s cubic-bezier(0.3, 1.4, 0.5, 1) 1.9s;
  }
  .ep-pages-on #dedicatoria .kc-dedication.is-revealed ~ .ep-dedication__seal { opacity: 1; transform: none; }
}

/* ── 2 · Cuenta regresiva: reloj de claustro ─────────────────────────── */
#counter .kc-countdown {
  position: relative;
  gap: 0;
  max-width: 34rem;
  margin: 0 auto;
  padding: 1.9rem 0.6rem 2.3rem;
  border-radius: 3px 1px 4px 2px;
  background:
    radial-gradient(120% 80% at 10% 0%, rgba(255, 255, 255, 0.86), transparent 65%),
    repeating-linear-gradient(0deg, rgba(82, 32, 54, 0.025) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(90deg, rgba(82, 32, 54, 0.018) 0 1px, transparent 1px 5px),
    var(--ep-grain) 0 0 / 96px 96px,
    linear-gradient(#FBF8F3, #F2EBDD);
  clip-path: polygon(0 0, 15% .6%, 32% 0, 51% .5%, 72% 0, 88% .6%, 100% 0, 99.6% 25%, 100% 50%, 99.5% 75%, 99.7% 100%, 81% 99.4%, 60% 100%, 40% 99.4%, 20% 100%, 0 99.5%, .4% 74%, 0 50%, .4% 26%);
  filter: drop-shadow(0 2px 2px rgba(49, 19, 32, 0.2)) drop-shadow(0 10px 9px rgba(49, 19, 32, 0.25));
}
/* Doble filete de plata grabado, como las tarjetas de familia. */
#counter .kc-countdown::before,
#counter .kc-countdown::after {
  content: "";
  position: absolute;
  pointer-events: none;
}
#counter .kc-countdown::before { inset: 9px; border: 0.8px solid rgba(167, 170, 179, 0.85); }
#counter .kc-countdown::after { inset: 13px; border: 0.6px solid rgba(167, 170, 179, 0.45); }
#counter .kc-countdown__unit {
  position: relative;
  z-index: 1;
  min-width: 0;
  padding: 0.3rem 0.2rem;
  gap: 0.5rem;
  border: 0;
  border-radius: 0;
  background: none; /* theme.css pinta cápsulas blancas: aquí el reloj es una sola tarjeta */
}
#counter .kc-countdown__unit + .kc-countdown__unit::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18%;
  bottom: 18%;
  width: 1px;
  background: linear-gradient(rgba(167, 170, 179, 0), rgba(167, 170, 179, 0.9) 30%, rgba(167, 170, 179, 0.9) 70%, rgba(167, 170, 179, 0));
}
#counter .kc-countdown__value {
  display: block;
  font-family: var(--kc-font-display);
  font-optical-sizing: none;
  font-variation-settings: "opsz" 16;
  font-variant-numeric: lining-nums tabular-nums;
  font-size: clamp(2rem, 1.2rem + 3.6vw, 3.1rem);
  line-height: 1;
  color: var(--ep-burgundy-ink, #522036);
}
#counter .kc-countdown__label {
  font-family: var(--ep-font-caps);
  font-size: clamp(0.6rem, 0.54rem + 0.3vw, 0.74rem);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #8A8D96;
}
#counter .ep-counter__seal {
  position: relative;
  z-index: 2;
  display: block;
  width: 3.3rem;
  height: 3.3rem;
  margin: -1.65rem auto 0;
  filter: drop-shadow(0 1px 1px rgba(49, 19, 32, 0.35)) drop-shadow(0 5px 6px rgba(49, 19, 32, 0.28));
}
#counter .ep-counter__seal svg { display: block; width: 100%; height: 100%; overflow: visible; }
#counter .ep-counter__seal use { transform: translate(-32px, -32px); }
#counter .kc-countdown__value.ep-tick { animation: ep-tick 0.48s var(--ep-ease-paper); }
@keyframes ep-tick {
  from { opacity: 0.35; transform: translateY(0.18em); }
  to { opacity: 1; transform: none; }
}
#counter .kc-countdown__status:empty { display: none; }
#counter .kc-countdown__status { font-family: var(--kc-font-body); color: #5D4950; font-size: 1rem; }

/* ── 3 · Familia: tarjetas repartidas + cinta de padrinos ────────────── */
#familia .kc-container { max-width: 46rem; }
#familia .kc-family { gap: 1.1rem; }
#familia .kc-family + .kc-family { margin-top: 1.4rem; }
@media (min-width: 44rem) {
  #familia-padres { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.6rem; }
}
#familia-padres .kc-family__group {
  position: relative;
  padding: 2.7rem 1.4rem 1.7rem;
  gap: 0.55rem;
  background:
    radial-gradient(120% 70% at 8% 0%, rgba(255, 255, 255, 0.84), transparent 65%),
    repeating-linear-gradient(0deg, rgba(82, 32, 54, 0.025) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(90deg, rgba(82, 32, 54, 0.018) 0 1px, transparent 1px 5px),
    var(--ep-grain) 0 0 / 96px 96px,
    linear-gradient(#FBF8F3, #F2EBDD);
  border-radius: 3px 1px 4px 2px;
  clip-path: polygon(0 0, 15% .5%, 32% 0, 51% .4%, 72% 0, 88% .5%, 100% 0, 99.6% 19%, 100% 38%, 99.5% 57%, 100% 78%, 99.7% 100%, 81% 99.5%, 60% 100%, 40% 99.5%, 20% 100%, 0 99.6%, .4% 79%, 0 60%, .4% 41%, 0 20%);
  filter: drop-shadow(0 2px 2px rgba(49, 19, 32, 0.2)) drop-shadow(0 10px 9px rgba(49, 19, 32, 0.25));
}
#familia-padres .kc-family__group:nth-child(odd) { transform: rotate(-0.7deg); }
#familia-padres .kc-family__group:nth-child(even) { transform: rotate(0.6deg); }
/* Grano de algodón + marco de plata con ojiva sobre el rótulo. */
#familia-padres .kc-family__group::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.2), transparent 48%);
  pointer-events: none;
  border-radius: inherit;
}
#familia-padres .kc-family__group::after {
  content: "";
  position: absolute;
  inset: 8px 8px 9px;
  border: 0.7px solid rgba(167, 170, 179, 0.85);
  clip-path: polygon(0 0, 35% 0, 36% 1px, 66% 1px, 67% 0, 100% 0, 100% 100%, 72% 100%, 71% calc(100% - 1px), 29% calc(100% - 1px), 28% 100%, 0 100%);
  pointer-events: none;
}
#familia-padres .kc-family__group h3::before,
#familia-padrinos .kc-family__group h3::before {
  content: "";
  display: block;
  width: 17px;
  height: 25px;
  margin: 0 auto 0.75rem;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 17 25'%3E%3Cpath d='M8.5 .8C13 5.5 16.2 10 16.2 14.5V24.2H.8V14.5C.8 10 4 5.5 8.5 .8Z' fill='none' stroke='%23A7AAB3' stroke-width='.9'/%3E%3Cpath d='M8.5 7C11.4 10 13 12.6 13 15.4V24.2H4V15.4C4 12.6 5.6 10 8.5 7Z' fill='none' stroke='%23A7AAB3' stroke-width='.6'/%3E%3C/svg%3E") center / contain no-repeat;
}
#familia .kc-family__group h3 {
  font-family: var(--ep-font-caps);
  font-optical-sizing: auto;
  font-variation-settings: normal;
  font-size: 0.9rem;
  letter-spacing: 0.2em;
  line-height: 1.3;
  color: var(--ep-burgundy-ribbon);
}
#familia-padres .kc-family__group ul { display: grid; gap: 0.15rem; }
#familia-padres .kc-family__group li {
  font-family: var(--kc-font-display);
  font-optical-sizing: none;
  font-variation-settings: "opsz" 16;
  font-size: 1.3rem;
  line-height: 1.35;
  color: var(--ep-burgundy-ink);
}
#familia-padres .kc-family__group li + li::before {
  content: "";
  display: block;
  width: 5px;
  height: 5px;
  margin: 0.45rem auto 0.55rem;
  border: 0.8px solid #A7AAB3;
  transform: rotate(45deg);
}
/* Padrinos: placa textil bordó con marco y sello de plata. */
#familia-padrinos .kc-family__group {
  position: relative;
  max-width: 24rem;
  margin: 0 auto;
  padding: 2.7rem 1.4rem 1.7rem;
  gap: 0.55rem;
  border: 1px solid rgba(167, 170, 179, 0.8);
  border-radius: 3px 1px 4px 2px;
  background:
    radial-gradient(120% 75% at 12% 0%, rgba(255,255,255,.17), transparent 64%),
    repeating-linear-gradient(0deg, rgba(255,255,255,.035) 0 1px, transparent 1px 4px),
    var(--ep-grain) 0 0 / 96px 96px,
    linear-gradient(145deg, #602A41, #522036 48%, #3C1727);
  box-shadow: 0 1px 1px rgba(49, 19, 32, 0.24), 0 12px 24px -11px rgba(49, 19, 32, 0.42), inset 0 0 20px rgba(33, 9, 20, 0.22);
  color: var(--ep-ivory-paper);
}
#familia-padrinos .kc-family__group::before {
  content: "";
  position: absolute;
  z-index: 2;
  top: -1.2rem;
  left: 50%;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  transform: translateX(-50%);
  content: "AC";
  border: 1px solid rgba(229, 230, 235, 0.9);
  border-radius: 50%;
  background: radial-gradient(circle at 32% 24%, #fff, #D7D8DD 38%, #8D919B 72%, #E5E6EB);
  box-shadow: 0 2px 5px rgba(19, 6, 11, .38), inset 0 0 0 3px rgba(82, 32, 54, .76), inset 0 0 0 4px rgba(229, 230, 235, .82);
  font-family: var(--kc-font-display);
  font-size: .82rem;
  color: #522036;
  pointer-events: none;
}
#familia-padrinos .kc-family__group::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 0.7px solid rgba(229, 230, 235, 0.72);
  pointer-events: none;
}
#familia-padrinos .kc-family__group h3 { color: var(--ep-ivory-fold); }
#familia-padrinos .kc-family__group h3::before { display: none; }
#familia-padrinos .kc-family__group ul { display: grid; gap: 0.1rem; }
#familia-padrinos .kc-family__group li {
  font-family: var(--kc-font-display);
  font-optical-sizing: none;
  font-variation-settings: "opsz" 16;
  font-size: 1.28rem;
  line-height: 1.35;
  color: var(--ep-ivory-paper);
}

@media (prefers-reduced-motion: no-preference) {
  /* Se reparten en secuencia: cada tarjeta llega de su lado y se posa. */
  .ep-pages-on #familia .kc-family[data-reveal] { opacity: 1; transform: none; transition: none; }
  .ep-pages-on #familia .kc-family__group {
    opacity: 0;
    transition: opacity 0.7s var(--ep-ease-paper), transform 1.1s var(--ep-ease-paper);
  }
  .ep-pages-on #familia-padres .kc-family__group:nth-child(1) { transform: translate(-46px, 22px) rotate(-7deg); }
  .ep-pages-on #familia-padres .kc-family__group:nth-child(2) { transform: translate(46px, 22px) rotate(7deg); transition-delay: 0.28s; }
  .ep-pages-on #familia-padres.is-revealed .kc-family__group:nth-child(1) { opacity: 1; transform: rotate(-0.7deg); }
  .ep-pages-on #familia-padres.is-revealed .kc-family__group:nth-child(2) { opacity: 1; transform: rotate(0.6deg); }
  .ep-pages-on #familia-padrinos .kc-family__group { transform: translateY(34px) scaleX(0.9); transition-delay: 0.1s; }
  .ep-pages-on #familia-padrinos.is-revealed .kc-family__group { opacity: 1; transform: none; }
}

/* ── 5 · Ubicaciones: tarjetas de sede con viñeta grabada ────────────── */
#ubicaciones { overflow-x: clip; }
#ubicaciones .kc-container { max-width: 46rem; }
#ubicaciones .kc-locations { gap: 1.5rem; }
#ubicaciones .kc-location {
  position: relative;
  padding: 0.9rem 1.4rem 1.7rem;
  gap: 0.5rem;
  align-content: start;
  background: linear-gradient(#FBF8F3, #F5F0E8);
  border: 0;
  border-radius: 2px;
  box-shadow: var(--ep-shadow-paper);
}
#ubicaciones .kc-location::before {
  content: "";
  display: block;
  aspect-ratio: 4 / 3;
  width: calc(100% + 0.8rem);
  margin: 0.4rem -0.4rem 0.2rem;
  border: 1px solid rgba(167, 170, 179, 0.9);
  background-image: linear-gradient(rgba(191, 143, 91, 0.1), rgba(74, 33, 24, 0.08)), var(--vig, none);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  box-shadow: 0 2px 5px rgba(49, 19, 32, 0.24), 0 10px 15px -11px rgba(49, 19, 32, 0.48), inset 0 0 0 4px rgba(251, 248, 243, 0.35);
}
#ubicaciones .kc-location:nth-child(1) { --vig: url('../../../assets/page/venue-templo.webp'); }
#ubicaciones .kc-location:nth-child(2) { --vig: url('../../../assets/page/venue-jardin.webp'); }
#ubicaciones .kc-location::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 0.7px solid rgba(167, 170, 179, 0.65);
  pointer-events: none;
}
#ubicaciones .kc-location > * { position: relative; z-index: 1; }
#ubicaciones .kc-location::before { position: relative; z-index: 1; }
#ubicaciones .kc-location__address:empty { display: none; }
#ubicaciones .kc-location__title {
  font-family: var(--ep-font-caps);
  font-size: 0.86rem;
  font-weight: 400;
  letter-spacing: 0.22em;
  color: var(--ep-burgundy-ribbon);
}
#ubicaciones .kc-location h3 {
  font-family: var(--kc-font-display);
  font-optical-sizing: none;
  font-variation-settings: "opsz" 16;
  font-size: clamp(1.28rem, 1.1rem + 0.7vw, 1.5rem);
  line-height: 1.22;
  color: var(--ep-burgundy-ink);
  text-wrap: balance;
}
#ubicaciones .kc-location__time {
  margin-top: 0.1rem;
  font-family: var(--ep-font-caps);
  font-size: 1.1rem;
  letter-spacing: 0.12em;
  color: var(--ep-ink-small);
}
#ubicaciones .kc-location__time::before, #ubicaciones .kc-location__time::after {
  content: "";
  display: inline-block;
  width: 1.4rem;
  height: 1px;
  margin-inline: 0.7rem;
  vertical-align: middle;
  background: linear-gradient(to right, transparent, #A7AAB3);
}
#ubicaciones .kc-location__time::after { transform: scaleX(-1); }
#ubicaciones .kc-map-link {
  justify-self: center;
  margin-top: 0.7rem;
  min-height: 44px;
  padding: 0.55rem 1.6rem;
  border: 1px solid var(--ep-burgundy-ink);
  border-radius: 999px;
  background: transparent;
  font-family: var(--ep-font-caps);
  font-size: 0.9rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: var(--ep-burgundy-ink);
  box-shadow: inset 0 0 0 3px #FBF8F3, inset 0 0 0 3.7px rgba(82, 32, 54, 0.28);
  transition: background-color 0.28s var(--ep-ease-paper), color 0.28s var(--ep-ease-paper);
}
#ubicaciones .kc-map-link:hover { background: var(--ep-burgundy-ink); color: var(--ep-ivory-paper); }
#ubicaciones .kc-map-link:focus-visible { outline: 2px solid var(--ep-burgundy-ribbon); outline-offset: 3px; }
@media (prefers-reduced-motion: no-preference) {
  #ubicaciones .kc-location[data-reveal] { transition: opacity 0.9s var(--ep-ease-paper), transform 1.1s var(--ep-ease-paper); }
  #ubicaciones .kc-location:nth-child(1)[data-reveal] { transform: translateX(-38px); }
  #ubicaciones .kc-location:nth-child(2)[data-reveal] { transform: translateX(38px); transition-delay: 0.14s; }
  #ubicaciones .kc-location.is-revealed[data-reveal] { transform: none; }
}

/* ── 6 · Itinerario: línea de plata que se dibuja con el scroll ──────── */
#itinerario .kc-container { max-width: 34rem; }
.ep-iti {
  --ep-col: 5.7rem;
  --ep-bx: 1.9rem;
  position: relative;
  max-width: 26rem;
  margin-inline: auto;
}
.ep-iti__line, .ep-iti::before {
  position: absolute;
  left: calc(var(--ep-col) + var(--ep-bx) / 2);
  top: var(--lt, 1.5rem);
  height: var(--lh, calc(100% - 3rem));
  width: 1px;
  margin-left: -0.5px;
  pointer-events: none;
}
.ep-iti::before { content: ""; background: rgba(167, 170, 179, 0.38); }
.ep-iti__line {
  width: 1.5px;
  margin-left: -0.75px;
  background: linear-gradient(#777B85, #A7AAB3);
  transform-origin: top;
  transform: scaleY(1);
  z-index: 1;
}
#itinerario .kc-schedule { gap: 0; }
#itinerario .kc-stop {
  position: relative;
  grid-template-columns: var(--ep-col) var(--ep-bx) minmax(0, 1fr);
  align-items: start;
  gap: 0;
  padding: 0.8rem 0;
  border: 0;
  text-align: left;
}
.ep-iti .kc-stop__time {
  grid-column: 1;
  padding-right: 0.5rem;
  text-align: right;
  font-family: var(--ep-font-caps);
  font-weight: 400;
  font-size: 1.02rem;
  letter-spacing: 0.06em;
  line-height: 1.4;
  color: var(--ep-burgundy-ink);
  white-space: nowrap;
}
.ep-iti .kc-stop__label {
  grid-column: 3;
  padding-left: 0.5rem;
  font-family: var(--kc-font-body);
  font-weight: 500;
  font-size: 1.16rem;
  line-height: 1.4;
  color: var(--ep-ink-small);
}
/* Viñeta ojival: hueca en plata; se llena de burdeos al llegar la línea. */
.ep-iti .kc-stop::before, .ep-iti .kc-stop::after {
  content: "";
  position: absolute;
  left: calc(var(--ep-col) + var(--ep-bx) / 2 - 6.5px);
  top: calc(var(--by, 1.5rem) - 10px);
  width: 13px;
  height: 20px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 13 20'%3E%3Cpath d='M6.5 .7C10 5 12.2 9 12.2 12.4V19.3H.8V12.4C.8 9 3 5 6.5 .7Z' fill='%23F5F0E8' stroke='%23A7AAB3' stroke-width='1'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  z-index: 2;
}
.ep-iti .kc-stop::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 13 20'%3E%3Cpath d='M6.5 .7C10 5 12.2 9 12.2 12.4V19.3H.8V12.4C.8 9 3 5 6.5 .7Z' fill='%23571C30' stroke='%23571C30' stroke-width='1'/%3E%3C/svg%3E");
  transform: scale(0);
  transition: transform 0.45s cubic-bezier(0.3, 1.5, 0.5, 1);
}
.ep-iti .kc-stop.is-on::after { transform: none; }
@media (prefers-reduced-motion: no-preference) {
  /* El core esconde lista y paradas con [data-reveal]: aquí manda la línea. */
  #itinerario #itinerario-list[data-reveal], #itinerario .kc-stop[data-reveal] { opacity: 1; transform: none; transition: none; }
  .ep-pages-on .ep-iti .kc-stop .kc-stop__time,
  .ep-pages-on .ep-iti .kc-stop .kc-stop__label {
    opacity: 0.0;
    transform: translateX(12px);
    transition: opacity 0.6s var(--ep-ease-paper), transform 0.7s var(--ep-ease-paper);
  }
  .ep-pages-on .ep-iti .kc-stop .kc-stop__time { transform: translateX(-12px); }
  .ep-pages-on .ep-iti .kc-stop.is-on .kc-stop__time,
  .ep-pages-on .ep-iti .kc-stop.is-on .kc-stop__label { opacity: 1; transform: none; }
  .ep-pages-on .ep-iti .ep-iti__line { transform: scaleY(0); }
}

/* Tarjeta sellada para la celebración solo para adultos. */
#vestimenta #vestimenta-adults {
  position: relative;
  max-width: 28rem;
  margin: 2.6rem auto 0;
  padding: 3rem 1.55rem 1.75rem;
  overflow: visible;
  text-align: center;
  line-height: 1.55;
  color: var(--ep-ink-small);
  background:
    radial-gradient(120% 70% at 10% 0%, rgba(255,255,255,.86), transparent 64%),
    repeating-linear-gradient(0deg, rgba(82,32,54,.02) 0 1px, transparent 1px 4px),
    var(--ep-grain) 0 0 / 96px 96px,
    linear-gradient(#FBF8F3, #F3ECE2);
  border: 1px solid rgba(167, 170, 179, 0.82);
  border-radius: 3px 1px 4px 2px;
  box-shadow: 0 1px 1px rgba(49, 19, 32, .16), 0 14px 25px -13px rgba(49, 19, 32, .38);
}
#vestimenta #vestimenta-adults::before {
  content: "";
  position: absolute;
  top: 7px;
  left: 50%;
  width: 3.6rem;
  height: 2.1rem;
  transform: translateX(-50%);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 72 42'%3E%3Cpath d='M3 42V30C3 17 24 5 36 1C48 5 69 17 69 30V42M11 42V30C11 21 27 11 36 8C45 11 61 21 61 30V42' fill='none' stroke='%23A7AAB3' stroke-width='1'/%3E%3C/svg%3E") center / contain no-repeat;
  pointer-events: none;
}
#vestimenta #vestimenta-adults::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 0.7px solid rgba(167, 170, 179, 0.78);
  pointer-events: none;
}
#vestimenta-adults .ep-adults__seal {
  position: absolute;
  z-index: 2;
  top: -1.15rem;
  left: 50%;
  display: grid;
  place-items: center;
  width: 2.45rem;
  height: 2.45rem;
  transform: translateX(-50%);
  border: 1px solid rgba(229, 230, 235, 0.95);
  border-radius: 50%;
  background: radial-gradient(circle at 32% 24%, #fff, #D7D8DD 38%, #8D919B 72%, #E5E6EB);
  box-shadow: 0 2px 5px rgba(19, 6, 11, .35), inset 0 0 0 3px rgba(82, 32, 54, .78), inset 0 0 0 4px rgba(229, 230, 235, .85);
  font-family: var(--kc-font-display);
  font-size: .78rem;
  color: #522036;
}
#vestimenta #vestimenta-adults h3 {
  margin: 0 0 .55rem;
  font-family: var(--kc-font-display);
  font-optical-sizing: none;
  font-variation-settings: "opsz" 16;
  font-size: clamp(1.8rem, 1.4rem + 2vw, 2.25rem);
  font-weight: 400;
  line-height: 1.1;
  color: var(--ep-burgundy-ink);
}
#vestimenta-adults .ep-adults__lead {
  margin: 0 0 1.1rem;
  font-family: var(--ep-font-caps);
  font-size: 0.84rem;
  letter-spacing: 0.11em;
  line-height: 1.5;
  color: var(--ep-burgundy-ribbon);
}
#vestimenta #vestimenta-adults p:not(.ep-adults__lead) {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: 1rem;
}
#vestimenta #vestimenta-adults p + p:not(.ep-adults__lead) { margin-top: 0.85rem; }
@media (prefers-reduced-motion: no-preference) {
  .ep-pages-on #vestimenta #vestimenta-adults[data-reveal] { transform: translateY(18px); transition-delay: 0.5s; }
  .ep-pages-on #vestimenta #vestimenta-adults.is-revealed { transform: none; }
}


/* ── 8 · Regalos: tarjeta y lluvia de sobres ─────────────────────────── */
#regalos .kc-body:empty,
#regalos .kc-registries:empty,
#regalos .kc-bank:empty { display: none; }
/* R4: la CLABE vive en .ep-transfer (revela con un toque); el bloque del core nunca se pinta. */
#regalos #regalos-bank { display: none; }
#regalos .kc-envelopes {
  position: relative;
  max-width: 21rem;
  margin: 0.4rem auto 0;
  padding: 1.1rem 1.5rem 1.9rem;
  gap: 0.8rem;
  border: 0;
  background: linear-gradient(#FBF8F3, #F5F0E8);
  border-radius: 2px;
  box-shadow: var(--ep-shadow-paper);
}
#regalos .kc-envelopes::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 0.7px solid rgba(167, 170, 179, 0.85);
  pointer-events: none;
}
#regalos .kc-envelopes::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--ep-grain) 0 0 / 96px 96px;
  mix-blend-mode: multiply;
  opacity: 0.5;
  border-radius: inherit;
  pointer-events: none;
}
#regalos .kc-envelopes > * { position: relative; z-index: 1; }
#regalos .kc-envelopes h3 {
  font-family: var(--ep-font-caps);
  font-optical-sizing: auto;
  font-variation-settings: normal;
  font-size: 1rem;
  letter-spacing: 0.22em;
  color: var(--ep-burgundy-ink);
}
.ep-rain {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  height: 7.6rem;
  margin-top: 0.8rem;
}
.ep-rain__env {
  --r: 0deg;
  flex: none;
  width: 5.8rem;
  height: auto;
  overflow: visible;
  transform: rotate(var(--r));
  filter: drop-shadow(0 1px 1px rgba(49, 19, 32, 0.35)) drop-shadow(0 6px 5px rgba(49, 19, 32, 0.25));
}
.ep-rain__env:nth-child(1) { --r: -9deg; margin-right: -0.9rem; margin-bottom: -0.1rem; }
.ep-rain__env:nth-child(2) { --r: 2deg; z-index: 2; margin-bottom: 0.55rem; }
.ep-rain__env:nth-child(3) { --r: 8deg; margin-left: -0.9rem; margin-bottom: 0.05rem; }
@media (prefers-reduced-motion: no-preference) {
  .ep-pages-on .ep-rain__env { opacity: 0; }
  .ep-pages-on .kc-envelopes.is-revealed .ep-rain__env {
    animation: ep-drift 2.1s cubic-bezier(0.35, 0.05, 0.3, 1) both;
  }
  .ep-pages-on .kc-envelopes.is-revealed .ep-rain__env:nth-child(1) { animation-delay: 0.1s; }
  .ep-pages-on .kc-envelopes.is-revealed .ep-rain__env:nth-child(2) { animation-delay: 0.55s; }
  .ep-pages-on .kc-envelopes.is-revealed .ep-rain__env:nth-child(3) { animation-delay: 1s; }
}
/* R4 · Transferencia: hermana de la tarjeta de sobres; la CLABE espera un toque. */
#regalos .ep-transfer {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 0.55rem;
  max-width: 21rem;
  margin: 1.4rem auto 0;
  padding: 1.5rem 1.5rem 1.6rem;
  text-align: center;
  background: linear-gradient(#FBF8F3, #F5F0E8);
  border-radius: 2px;
  box-shadow: var(--ep-shadow-paper);
}
#regalos .ep-transfer::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 0.7px solid rgba(167, 170, 179, 0.85);
  pointer-events: none;
}
#regalos .ep-transfer > * { position: relative; z-index: 1; margin: 0; }
#regalos .ep-transfer h3 {
  font-family: var(--ep-font-caps);
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ep-burgundy-ink);
}
#regalos .ep-transfer__lead { max-width: 17rem; font-size: 0.98rem; line-height: 1.5; color: var(--ep-ink-small, #4A3A3F); text-wrap: balance; }
#regalos .ep-transfer__data { display: grid; gap: 0.2rem; }
#regalos .ep-transfer__data[hidden], #regalos .ep-transfer [hidden] { display: none; }
#regalos .ep-transfer__holder { font-family: var(--kc-font-display); font-size: 1.15rem; color: var(--ep-burgundy-ink); }
#regalos .ep-transfer__bank { font-family: var(--ep-font-caps); font-size: 0.74rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ep-ink-small, #4A3A3F); }
#regalos .ep-transfer__clabe {
  margin-top: 0.3rem;
  font-family: var(--kc-font-display);
  font-size: 1.2rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
  color: #3D2B32;
  -webkit-user-select: text;
  user-select: text;
}
#regalos .ep-transfer__soon { font-family: var(--kc-font-display); font-size: 1.1rem; font-style: italic; color: var(--ep-burgundy-ink); text-wrap: balance; }
#regalos .ep-transfer__btn {
  min-height: 44px;
  margin-top: 0.35rem;
  padding: 0.6rem 1.3rem;
  border: 1px solid rgba(103, 37, 67, 0.55);
  outline: 1px solid rgba(103, 37, 67, 0.2);
  outline-offset: 3px;
  border-radius: 0;
  background: #672543;
  color: #F5F0E8;
  font-family: var(--ep-font-caps);
  font-size: 0.74rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 200ms ease, transform 200ms ease;
}
#regalos .ep-transfer__btn:active { transform: scale(0.98); background: #522036; }
#regalos .ep-transfer__btn:focus-visible { outline: 1px solid #A7AAB3; outline-offset: 3px; }
@keyframes ep-drift {
  0% { opacity: 0; transform: translate(-6px, -11rem) rotate(calc(var(--r) - 24deg)); }
  12% { opacity: 1; }
  38% { transform: translate(9px, -6.4rem) rotate(calc(var(--r) + 14deg)); }
  62% { transform: translate(-5px, -2.1rem) rotate(calc(var(--r) - 8deg)); }
  82% { transform: translate(2px, -0.35rem) rotate(calc(var(--r) + 3deg)); }
  100% { opacity: 1; transform: translate(0, 0) rotate(var(--r)); }
}

/* ── Escritorio ───────────────────────────────────────────────────────── */
@media (min-width: 48rem) {
  #dedicatoria .kc-dedication { max-width: 33rem; }
  .ep-iti { --ep-col: 7rem; }
}

/* R2 crítica · Itinerario en escritorio: título a la izquierda y la línea de plata a la derecha. */
@media (min-width: 64rem) {
  #itinerario .kc-container {
    max-width: 60rem;
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    grid-template-rows: auto auto 1fr;
    column-gap: clamp(3rem, 6vw, 6rem);
    align-items: start;
  }
  #itinerario .kc-container > .kc-eyebrow { grid-area: 1 / 1; text-align: left; }
  #itinerario .kc-container > .kc-title { grid-area: 2 / 1; text-align: left; }
  #itinerario .ep-iti { grid-area: 1 / 2 / -1 / 3; max-width: 28rem; margin: 0; }
}
