/* =========================================================
   Invitación · diseño minimalista
   Temas: marfil (por defecto) · salvia · noche · velas, editorial y boho (en temas.css)
   ========================================================= */
:root, [data-theme="marfil"] {
  --bg: #F6F2EB; --bg2: #EEE8DD; --ink: #2A2724; --muted: #8B847A;
  --line: #DCD4C7; --accent: #9C8462; --on-ink: #F6F2EB;
}
[data-theme="salvia"] {
  --bg: #F2F3EE; --bg2: #E6E9E0; --ink: #262C26; --muted: #7F877C;
  --line: #D1D7C9; --accent: #6F7F66; --on-ink: #F2F3EE;
}
[data-theme="noche"] {
  --bg: #17181A; --bg2: #202124; --ink: #ECE7DF; --muted: #9A958D;
  --line: #36373B; --accent: #C4AA7C; --on-ink: #17181A;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Jost", system-ui, sans-serif; font-weight: 300;
  font-size: 16px; line-height: 1.7; letter-spacing: .01em;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
body.has-envelope { overflow: hidden; }
img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.serif, .names, .title, .dear, .place-time, .dress-name, .quote p,
.cd-grid span, .env-name, .monogram, .passes-num, .foot-names, .done-icon {
  font-family: "Cormorant Garamond", Georgia, serif; font-weight: 300;
  font-variant-numeric: lining-nums;
}

.eyebrow {
  font-size: .7rem; font-weight: 400; letter-spacing: .34em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 1.2rem;
}
.muted { color: var(--muted); }
.tiny { font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.title { font-size: clamp(2.2rem, 6.5vw, 3.3rem); font-style: italic; line-height: 1.1; margin: 0 0 2.2rem; }
.lead { font-family: "Cormorant Garamond", Georgia, serif; font-size: clamp(1.35rem, 3.6vw, 1.7rem); line-height: 1.55; margin: 0 auto; max-width: 30ch; }
.lead-sm { font-size: 1.02rem; color: var(--ink); max-width: 46ch; margin: 0 auto 2rem; }
.note { font-size: .92rem; color: var(--muted); font-style: italic; margin-top: 2rem; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  border: 1px solid var(--ink); background: transparent; color: var(--ink);
  padding: 1rem 2.1rem; font-size: .7rem; font-weight: 400; letter-spacing: .26em; text-transform: uppercase;
  text-decoration: none; cursor: pointer; transition: background .35s, color .35s, opacity .3s;
}
.btn:hover, .btn:focus-visible { background: var(--ink); color: var(--on-ink); }
.btn-solid { background: var(--ink); color: var(--on-ink); }
.btn-solid:hover { opacity: .85; }
.btn-sm { padding: .75rem 1.3rem; font-size: .64rem; }
.btn:disabled { opacity: .35; cursor: default; }
.btn-row { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; }
.link { background: none; border: 0; padding: 0; cursor: pointer; font-size: .78rem; letter-spacing: .2em; text-transform: uppercase; border-bottom: 1px solid var(--line); padding-bottom: 3px; text-decoration: none; }
.link:hover { border-color: var(--ink); }

/* ---------- Sobre de entrada ---------- */
.envelope {
  position: fixed; inset: 0; z-index: 100; background: var(--bg);
  display: grid; place-items: center; padding: 2rem; text-align: center;
  transition: opacity 1s ease, transform 1.1s cubic-bezier(.7,0,.2,1);
}
.envelope.gone { opacity: 0; transform: translateY(-4%); pointer-events: none; }
.env-inner { animation: rise 1.4s ease both; }
.env-name { font-size: clamp(2.4rem, 9vw, 4rem); line-height: 1.05; margin: 0 0 2.6rem; font-style: italic; }
.monogram { display: inline-flex; align-items: center; gap: .9rem; font-size: 2.1rem; margin-bottom: 2.4rem; color: var(--ink); }
.monogram i { width: 1px; height: 2.6rem; background: var(--accent); transform: rotate(24deg); }
.monogram.small { font-size: 1.5rem; margin-bottom: 1rem; }
.monogram.small i { height: 1.8rem; }

/* ---------- Portada ---------- */
.hero {
  min-height: 100svh; padding: clamp(4.5rem, 13vh, 8rem) 1.5rem 5rem;
  text-align: center; position: relative; display: flex; flex-direction: column; align-items: center;
}
.names { font-size: clamp(3.6rem, 13vw, 7.4rem); line-height: .92; margin: 0; letter-spacing: -.01em; }
.names span { display: block; }
.names em { display: block; font-size: .42em; color: var(--accent); margin: .35em 0 .3em; }
.date-line {
  display: flex; align-items: center; justify-content: center; gap: .9rem; flex-wrap: wrap;
  margin: 2.4rem 0 0; font-size: .74rem; font-weight: 400; letter-spacing: .34em; text-transform: uppercase;
}
.date-line b { width: 22px; height: 1px; background: var(--ink); opacity: .45; }
.arch {
  margin: 3.6rem auto 0; width: min(80vw, 380px); aspect-ratio: 3 / 4;
  border-radius: 999px 999px 0 0; overflow: hidden; background: var(--bg2);
}
.arch img { width: 100%; height: 100%; object-fit: cover; animation: slowzoom 18s ease-out both; }
.scroll-hint { margin-top: 3rem; width: 1px; height: 56px; background: var(--line); position: relative; overflow: hidden; display: block; }
.scroll-hint span { position: absolute; left: 0; top: -50%; width: 1px; height: 50%; background: var(--ink); animation: drip 2.2s ease-in-out infinite; }

/* ---------- Secciones ---------- */
.section, .section-wide { margin: 0 auto; padding: 0 1.5rem 7rem; text-align: center; }
.section { max-width: 680px; }
.section-wide { max-width: 1140px; }
.section::before, .section-wide::before { content: ""; display: block; width: 1px; height: 56px; background: var(--line); margin: 0 auto 4rem; }
.welcome::before { display: none; }
.welcome { padding-top: 2rem; }
.dear { font-size: clamp(2.2rem, 7vw, 3.2rem); font-style: italic; line-height: 1.1; margin: -.4rem 0 2rem; }
.passes { margin: 3rem auto 0; display: inline-flex; align-items: center; gap: 1.1rem; padding: 1.1rem 1.8rem; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.passes-num { font-size: 2.8rem; line-height: 1; color: var(--accent); }
.passes-txt { font-size: .72rem; letter-spacing: .26em; text-transform: uppercase; text-align: left; max-width: 18ch; line-height: 1.6; }

/* Cuenta regresiva */
.cd-grid { display: grid; grid-template-columns: repeat(4, 1fr); max-width: 520px; margin: 0 auto; }
.cd-grid div { display: flex; flex-direction: column; align-items: center; padding: 0 .4rem; }
.cd-grid div + div { border-left: 1px solid var(--line); }
.cd-grid span { font-size: clamp(2.5rem, 10vw, 4.4rem); line-height: 1; font-variant-numeric: tabular-nums lining-nums; }
.cd-grid small { margin-top: .7rem; font-size: .62rem; letter-spacing: .3em; text-transform: uppercase; color: var(--muted); }
.cd-done { font-family: "Cormorant Garamond", serif; font-size: 2.2rem; font-style: italic; margin: 0; }
.cal-links { margin-top: 2.6rem; font-size: .7rem; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; }
.cal-links a { text-decoration: none; border-bottom: 1px solid var(--line); padding-bottom: 2px; color: var(--ink); }

/* Cita */
.quote p { font-size: clamp(1.7rem, 5vw, 2.5rem); font-style: italic; line-height: 1.3; margin: 0 auto; max-width: 22ch; color: var(--ink); }
.quote p::before, .quote p::after { color: var(--accent); }
.quote p::before { content: "“"; } .quote p::after { content: "”"; }

/* Galería */
.grid { display: grid; gap: 10px; }
.ph { padding: 0; border: 0; background: var(--bg2); overflow: hidden; cursor: zoom-in; position: relative; }
.ph img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.4s cubic-bezier(.2,.7,.2,1), opacity .6s; }
.ph:hover img { transform: scale(1.04); }
.grid-simple { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.grid-simple .ph { aspect-ratio: 4 / 5; }
.grid-10 { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 84px; grid-auto-flow: dense; }
.grid-10 .ph:nth-child(1), .grid-10 .ph:nth-child(6) { grid-column: span 2; grid-row: span 3; }
.grid-10 .ph:nth-child(2), .grid-10 .ph:nth-child(3), .grid-10 .ph:nth-child(9), .grid-10 .ph:nth-child(10) { grid-row: span 2; }
.grid-10 .ph:nth-child(4), .grid-10 .ph:nth-child(5), .grid-10 .ph:nth-child(7), .grid-10 .ph:nth-child(8) { grid-row: span 3; }
@media (min-width: 760px) {
  .grid { gap: 14px; }
  .grid-10 { grid-template-columns: repeat(6, 1fr); grid-auto-rows: 92px; }
  .grid-10 .ph { grid-column: span 2 !important; grid-row: span 3 !important; }
  .grid-10 .ph:nth-child(1) { grid-column: span 4 !important; grid-row: span 4 !important; }
  .grid-10 .ph:nth-child(2), .grid-10 .ph:nth-child(3) { grid-row: span 2 !important; }
  .grid-10 .ph:nth-child(7) { grid-row: span 4 !important; }
  .grid-10 .ph:nth-child(8) { grid-column: span 4 !important; grid-row: span 4 !important; }
  .grid-10 .ph:nth-child(9), .grid-10 .ph:nth-child(10) { grid-column: span 3 !important; grid-row: span 3 !important; }
}

/* Video */
.video-frame { position: relative; aspect-ratio: 16 / 9; background: var(--bg2); overflow: hidden; }
.video-frame iframe, .video-frame video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: cover; background: #000; }
.video-ph { position: absolute; inset: 0; display: grid; place-content: center; gap: .8rem; color: var(--muted); }
.video-ph span { width: 64px; height: 64px; border: 1px solid var(--muted); border-radius: 50%; display: grid; place-items: center; margin: 0 auto; font-size: 1.1rem; padding-left: 4px; }
.video-ph small { letter-spacing: .24em; text-transform: uppercase; font-size: .66rem; }

/* Lugares */
.places-grid { display: grid; gap: 1.5rem; }
@media (min-width: 820px) { .places-grid.count-2 { grid-template-columns: 1fr 1fr; } .places-grid.count-1 { max-width: 560px; margin: 0 auto; } }
.place { border: 1px solid var(--line); padding: 2.8rem 1.6rem 2.2rem; }
.place .eyebrow { margin-bottom: .6rem; }
.place-time { font-size: 3.2rem; line-height: 1; margin: 0 0 1.2rem; color: var(--accent); }
.place h3 { font-family: "Cormorant Garamond", serif; font-weight: 400; font-size: 1.6rem; line-height: 1.2; margin: 0 0 .4rem; }
.place .muted { margin: 0; font-size: .95rem; }
.map { margin: 1.8rem 0 1.6rem; aspect-ratio: 4 / 3; background: var(--bg2); overflow: hidden; }
.map iframe { width: 100%; height: 100%; border: 0; filter: grayscale(1) contrast(.92) brightness(1.03); }
[data-theme="noche"] .map iframe { filter: grayscale(1) invert(.9) contrast(.9); }

/* Vestimenta */
.dress-name { font-size: clamp(2rem, 6vw, 2.8rem); margin: -1rem 0 1rem; color: var(--accent); font-style: italic; }
.swatches { display: flex; justify-content: center; gap: .8rem; margin: .5rem 0 .9rem; flex-wrap: wrap; }
.swatches span { width: 46px; height: 46px; border-radius: 50%; box-shadow: 0 0 0 1px var(--line), inset 0 0 0 1px rgba(0,0,0,.05); }

/* Regalos */
.bank { margin: 2rem auto 0; max-width: 440px; background: var(--bg2); padding: 2rem 1.6rem; animation: rise .6s ease both; }
.bank dl { margin: 0 0 1.6rem; text-align: left; }
.bank dl div { display: grid; grid-template-columns: 8.5rem 1fr; gap: 1rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.bank dl div:last-child { border-bottom: 0; }
.bank dt { font-size: .66rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); padding-top: .2rem; }
.bank dd { margin: 0; word-break: break-word; font-weight: 400; }
.gift .link { display: inline-block; margin-top: 1.5rem; }

/* Confirmación */
.rsvp-form { max-width: 460px; margin: 0 auto; text-align: left; }
.choice { display: flex; gap: .7rem; justify-content: center; flex-wrap: wrap; margin-bottom: 2.2rem; }
.pill { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: .9rem 1.6rem; cursor: pointer; font-size: .92rem; transition: all .3s; }
.pill:hover { border-color: var(--ink); }
.pill.on { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.when-yes { display: none; }
.rsvp-form.yes .when-yes { display: block; animation: rise .5s ease both; }
.field { display: block; margin-bottom: 1.8rem; }
.field > span { display: block; font-size: .66rem; letter-spacing: .24em; text-transform: uppercase; color: var(--muted); margin-bottom: .4rem; }
.field em { text-transform: none; letter-spacing: 0; font-style: italic; }
.field input, .field select, .field textarea {
  width: 100%; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink);
  padding: .6rem 0; font: inherit; font-size: 1.05rem; border-radius: 0; outline: none; transition: border-color .3s;
  -webkit-appearance: none; appearance: none;
}
.field select { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 10px) 55%, calc(100% - 5px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
.field select option { background: var(--bg); color: var(--ink); }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--ink); }
.field textarea { resize: vertical; min-height: 4.5rem; }
.rsvp-form .btn { width: 100%; margin-top: .6rem; }
.form-error { color: #B4533C; font-size: .9rem; margin: 0 0 1rem; }
.rsvp-done { margin: 0 auto 1rem; }
.done-icon { width: 64px; height: 64px; border: 1px solid var(--accent); color: var(--accent); border-radius: 50%; display: grid; place-items: center; margin: 0 auto 1.4rem; font-size: 1.8rem; }
.done-msg { font-family: "Cormorant Garamond", serif; font-size: 1.6rem; line-height: 1.4; margin: 0 auto 1.6rem; max-width: 26ch; }

/* Pie */
.footer { text-align: center; padding: 5rem 1.5rem calc(4rem + env(safe-area-inset-bottom)); background: var(--bg2); }
.foot-names { font-size: 1.6rem; font-style: italic; margin: 0 0 .4rem; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(12, 12, 12, .95); display: flex; align-items: center; justify-content: center; animation: fade .3s ease; touch-action: pan-y; }
.lightbox img { max-width: 92vw; max-height: 84vh; object-fit: contain; }
.lightbox button { position: absolute; background: none; border: 0; color: #eee; cursor: pointer; font-size: 2.6rem; line-height: 1; padding: 1rem; font-family: "Cormorant Garamond", serif; opacity: .8; }
.lightbox button:hover { opacity: 1; }
.lb-close { top: .5rem; right: .8rem; }
.lb-prev { left: .3rem; top: 50%; transform: translateY(-50%); }
.lb-next { right: .3rem; top: 50%; transform: translateY(-50%); }
.lb-count { position: absolute; bottom: 1.2rem; left: 0; right: 0; text-align: center; color: #aaa; font-size: .7rem; letter-spacing: .3em; margin: 0; }

.toast { position: fixed; left: 50%; bottom: calc(1.6rem + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: var(--on-ink); padding: .8rem 1.4rem; font-size: .82rem; letter-spacing: .06em; z-index: 300; animation: rise .35s ease both; }
.admin-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 150; background: #2a2724; color: #f6f2eb; font-size: .72rem; letter-spacing: .12em; text-align: center; padding: .35rem; }

/* Animaciones */
html.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity 1.1s ease, transform 1.1s cubic-bezier(.2,.7,.2,1); }
html.js .reveal.in { opacity: 1; transform: none; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes slowzoom { from { transform: scale(1.08); } to { transform: scale(1); } }
@keyframes drip { 0% { top: -50%; } 100% { top: 100%; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html.js .reveal { opacity: 1; transform: none; }
}

/* Restricciones */
.rules-list { list-style: none; margin: 0 auto; padding: 0; max-width: 520px; text-align: left; }
.rules-list li { display: grid; grid-template-columns: 44px 1fr; gap: 1.1rem; align-items: start; padding: 1.3rem 0; border-bottom: 1px solid var(--line); }
.rules-list li:first-child { border-top: 1px solid var(--line); }
.rule-ic { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; color: var(--accent); }
.rules-list p { margin: .45rem 0 0; font-size: .98rem; line-height: 1.65; }

/* Buenos deseos */
.wish-lock { border: 1px solid var(--line); padding: 1.8rem 1.4rem; margin: 0 auto 2.4rem; max-width: 460px; }
.wish-lock p { margin: 0 0 1.2rem; font-family: "Cormorant Garamond", serif; font-size: 1.35rem; line-height: 1.4; }
.wish-lock p:last-child { margin-bottom: 0; }
.wish-form { max-width: 460px; margin: 0 auto 2.6rem; text-align: left; }
.wish-as { font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin: 0 0 .5rem; }
.wish-as b { color: var(--ink); font-weight: 400; }
.wish-form textarea { width: 100%; border: 1px solid var(--line); background: transparent; color: var(--ink); font: inherit; font-size: 1rem; padding: .9rem 1rem; resize: vertical; min-height: 6rem; outline: none; border-radius: 0; transition: border-color .3s; }
.wish-form textarea:focus { border-color: var(--ink); }
.wish-foot { display: flex; justify-content: space-between; align-items: center; margin-top: .7rem; gap: 1rem; }
.wish-list { list-style: none; margin: 0 auto; padding: 0; max-width: 520px; text-align: left; display: grid; gap: 1rem; }
.wish { position: relative; background: var(--bg2); padding: 1.5rem 1.4rem 1.1rem; }
.wish::before { content: "“"; position: absolute; top: .2rem; left: .8rem; font-family: "Cormorant Garamond", serif; font-size: 3rem; line-height: 1; color: var(--accent); opacity: .5; }
.wish-text { margin: .4rem 0 1rem; font-family: "Cormorant Garamond", serif; font-size: 1.25rem; line-height: 1.45; word-wrap: break-word; }
.wish-meta { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .8rem; font-size: .76rem; letter-spacing: .06em; color: var(--muted); }
.wish-meta b { color: var(--ink); font-weight: 400; letter-spacing: .1em; text-transform: uppercase; font-size: .7rem; }
.wish-ok { color: var(--accent); }
.wish-del { position: absolute; top: .7rem; right: .8rem; background: none; border: 0; color: var(--muted); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; cursor: pointer; padding: .3rem; }
.wish-del:hover { color: var(--ink); text-decoration: underline; }
.wish.new { animation: rise .6s ease both; }
.wish-empty { font-style: italic; margin-top: 1rem; }
[data-theme="velas"] .wish { background: rgba(44,32,23,.8); box-shadow: inset 0 0 0 1px var(--line); }

/* Firma Confirmame.cl en el pie */
.hecho-con { display: inline-block; margin-top: 1.8rem; font-size: .66rem; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); text-decoration: none; opacity: .8; }
.hecho-con b { font-weight: 500; color: var(--accent); }
.hecho-con:hover { opacity: 1; }

/* Cabecera de revista: solo la usa el estilo Editorial */
.mast { display: none; }
