/* ==========================================================================
   Bitácora de nuestra boda — comparte la paleta de la invitación
   (verde olivo · marfil · salvia · dorado). Mobile-first.
   ========================================================================== */
:root {
  --olive-950: #232a17; --olive-900: #2d3520; --olive-800: #3b4529; --olive-700: #4a5634; --olive-600: #5c6b40;
  --sage: #9aa88a; --sage-200: #d5dccb; --sage-100: #e8ecdf;
  --ivory: #faf6ee; --ivory-200: #f3ecdf; --white: #fffdf9;
  --gold: #b8955a; --gold-300: #d9bf86; --gold-100: #f1e3c2;
  --ink: #2c3122; --ink-soft: #5a604c;
  --danger: #9b2c2c; --danger-bg: #fbeaea; --ok: #2f6b3a; --ok-bg: #e8f3e8; --warn-bg: #fbf1dc;
  --gold-grad: linear-gradient(135deg, #a78345 0%, #e6cd92 45%, #b8955a 70%, #8f6c34 100%);
  --font-script: "Great Vibes", "Brush Script MT", cursive;
  --font-serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-caps: "Cinzel", "Cormorant Garamond", Georgia, serif;
  --radius: 16px; --radius-sm: 10px;
  --shadow-sm: 0 2px 10px rgba(45, 53, 32, .08);
  --shadow: 0 14px 40px -14px rgba(45, 53, 32, .30);
  --ease: cubic-bezier(.22, .7, .25, 1);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font-serif); font-size: 1.15rem; line-height: 1.55; color: var(--ink);
  background: radial-gradient(1200px 500px at 50% -10%, var(--gold-100), transparent 60%), var(--ivory);
  -webkit-font-smoothing: antialiased; min-height: 100dvh;
}
img { max-width: 100%; display: block; }
h1, h2, h3 { font-weight: 500; line-height: 1.2; margin: 0 0 .5em; }
p { margin: 0 0 1em; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }
.script { font-family: var(--font-script); font-weight: 400; }

/* ---------- Portada (Hero Banner) ---------- */
.hero {
  position: relative;
  min-height: clamp(480px, 66svh, 580px);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  color: var(--white);
  overflow: hidden;
  isolation: isolate;
  background-color: #1a2012;
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: -3;
  background: radial-gradient(ellipse at 50% 30%, rgba(85, 102, 58, 0.55) 0%, rgba(25, 32, 18, 0.92) 65%, #0e120a 100%);
}

.hero__img {
  position: absolute;
  top: clamp(1.5rem, 4vh, 2.8rem);
  left: 50%;
  transform: translateX(-50%);
  width: min(320px, 72vw);
  height: clamp(190px, 34vh, 270px);
  object-fit: contain;
  object-position: center bottom;
  z-index: 0;
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.6));
  transition: transform .4s ease;
}

.hero__veil {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0) 0%,
    rgba(14, 18, 10, 0.08) 35%,
    rgba(14, 18, 10, 0.75) 70%,
    rgba(14, 18, 10, 0.98) 100%
  );
  pointer-events: none;
}

.hero__inner {
  text-align: center;
  padding: 2.2rem 1.25rem 2rem;
  width: min(820px, 100%);
  z-index: 1;
  animation: rise .9s var(--ease) both;
}

.hero__kicker {
  font-family: var(--font-caps);
  letter-spacing: .28em;
  text-transform: uppercase;
  font-size: .8rem;
  color: var(--gold-300);
  margin-bottom: .25rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
}

.hero__names {
  font-size: clamp(3rem, 13vw, 5.2rem);
  line-height: 1.05;
  margin: 0;
  text-shadow: 0 4px 28px rgba(0, 0, 0, 0.75);
}

.hero__names .hero__amp,
.foot__names .hero__amp {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-weight: 500;
  font-size: .48em;
  color: var(--gold-300);
  margin: 0 .28em;
  text-transform: lowercase;
  display: inline-block;
  vertical-align: middle;
}

.hero__date {
  margin: .4rem 0 0;
  font-style: italic;
  font-size: 1.2rem;
  color: var(--ivory);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.65);
}

.hero__date i {
  color: var(--gold-300);
  margin-right: .3rem;
}

/* Responsividad para tabletas y pantallas de escritorio */
@media (min-width: 640px) {
  .hero {
    min-height: 70svh;
  }
  .hero__img {
    object-position: center top;
  }
}

@media (min-width: 960px) {
  .hero {
    min-height: 74svh;
    max-height: 740px;
  }
  .hero__img {
    object-fit: contain;
    object-position: center top;
    filter: drop-shadow(0 12px 35px rgba(0, 0, 0, 0.65));
  }
  .hero__inner {
    padding-bottom: 2.6rem;
  }
}

@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* ---------- Contenedor / intro ---------- */
.wrap { width: min(1180px, 100%); margin: 0 auto; padding: 0 1rem 3rem; }
.intro { text-align: center; max-width: 640px; margin: 0 auto; padding: 2.2rem 0 1.5rem; animation: rise .8s .15s var(--ease) both; }
.intro h1 { font-size: clamp(1.9rem, 6.5vw, 2.7rem); color: var(--olive-800); }
.lead { color: var(--ink-soft); font-size: 1.22rem; }

/* ---------- Botón principal ---------- */
.cta {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .9rem;
  width: min(100%, 420px); min-height: 70px; padding: .9rem 1.6rem; margin-top: .6rem;
  border: 0; border-radius: 999px; color: var(--olive-950);
  background: var(--gold-grad); background-size: 160% 160%;
  font-family: var(--font-caps); font-weight: 500; letter-spacing: .08em; font-size: 1.15rem; text-transform: uppercase;
  box-shadow: 0 16px 34px -12px rgba(143,108,52,.75), inset 0 1px 0 rgba(255,255,255,.55);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background-position .6s;
  animation: pulse 3.2s ease-in-out infinite;
}
.cta:hover { transform: translateY(-2px); background-position: 100% 0; }
.cta:active { transform: scale(.98); }
.cta__icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--olive-800); color: var(--gold-300); font-size: 1.35rem; }
.cta__hint { margin: .8rem 0 0; font-size: 1rem; color: var(--ink-soft); font-style: italic; }
@keyframes pulse { 0%,100% { box-shadow: 0 16px 34px -12px rgba(143,108,52,.75), 0 0 0 0 rgba(184,149,90,.45); } 50% { box-shadow: 0 16px 34px -12px rgba(143,108,52,.75), 0 0 0 14px rgba(184,149,90,0); } }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .55rem; min-height: 50px; padding: .6rem 1.4rem; border-radius: 999px; border: 1.5px solid transparent; font-family: var(--font-caps); font-size: .9rem; letter-spacing: .06em; text-transform: uppercase; transition: transform .2s var(--ease), background .2s, opacity .2s; }
.btn:active { transform: scale(.98); }
.btn--block { width: 100%; }
.btn--olive { background: var(--olive-800); color: var(--ivory); }
.btn--olive:hover { background: var(--olive-700); }
.btn--ghost { background: transparent; border-color: var(--olive-700); color: var(--olive-800); }
.btn--ghost:hover { background: var(--sage-100); }
.btn--gold { background: var(--gold-grad); color: var(--olive-950); box-shadow: 0 10px 24px -12px rgba(143,108,52,.8); }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--sage-200); background: var(--white); color: var(--olive-800); font-size: 1.15rem; transition: background .2s, transform .3s var(--ease); }
.icon-btn:hover { background: var(--sage-100); }
.icon-btn--light { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.3); color: #fff; backdrop-filter: blur(6px); }
.icon-btn--light:hover { background: rgba(255,255,255,.28); }
.icon-btn.is-spinning i { animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Galería ---------- */
.gallery { padding-top: 1rem; }
.gallery__bar { display: flex; align-items: center; gap: .8rem; padding: .9rem 0 1rem; border-top: 1px solid var(--sage-200); }
.gallery__title { flex: 1; margin: 0; font-family: var(--font-caps); font-size: 1rem; letter-spacing: .14em; text-transform: uppercase; color: var(--olive-800); }
.gallery__count { margin: 0; color: var(--ink-soft); }
.gallery__count strong { color: var(--olive-800); font-size: 1.35rem; font-weight: 600; }

.grid { list-style: none; margin: 0; padding: 0; column-count: 2; column-gap: .7rem; }
@media (min-width: 720px) { .grid { column-count: 3; column-gap: .9rem; } }
@media (min-width: 1100px) { .grid { column-count: 4; } }
.card { break-inside: avoid; margin: 0 0 .7rem; background: var(--white); border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--shadow-sm); animation: cardIn .55s var(--ease) both; }
@media (min-width: 720px) { .card { margin-bottom: .9rem; } }
.card.is-new { animation: cardNew .9s var(--ease) both; }
.card__btn { display: block; width: 100%; padding: 0; border: 0; background: var(--sage-100); position: relative; overflow: hidden; }
.card__btn img { width: 100%; height: auto; opacity: 0; transition: opacity .5s, transform .6s var(--ease); background: linear-gradient(110deg, var(--sage-100) 30%, var(--ivory-200) 50%, var(--sage-100) 70%); }
.card__btn img.is-loaded { opacity: 1; }
.card__btn:hover img { transform: scale(1.04); }
.card__btn::after { content: "\F52A"; font-family: "bootstrap-icons"; position: absolute; right: .5rem; top: .5rem; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: rgba(35,42,23,.55); color: #fff; font-size: .9rem; opacity: 0; transition: opacity .25s; }
.card__btn:hover::after, .card__btn:focus-visible::after { opacity: 1; }
.card__cap { padding: .5rem .7rem .6rem; font-size: .95rem; line-height: 1.3; }
.card__name { font-weight: 600; color: var(--olive-800); }
.card__time { display: block; font-size: .82rem; color: var(--ink-soft); }
.card__text { margin: .25rem 0 0; font-size: .95rem; color: var(--ink-soft); font-style: italic; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@keyframes cardIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes cardNew { 0% { opacity: 0; transform: scale(.92); box-shadow: 0 0 0 0 rgba(184,149,90,.8); } 60% { box-shadow: 0 0 0 12px rgba(184,149,90,0); } 100% { opacity: 1; transform: none; } }

.skeletons { column-count: 2; column-gap: .7rem; }
@media (min-width: 720px) { .skeletons { column-count: 3; } }
@media (min-width: 1100px) { .skeletons { column-count: 4; } }
.skeletons span { display: block; height: var(--h); margin-bottom: .7rem; border-radius: var(--radius-sm); break-inside: avoid; background: linear-gradient(110deg, var(--sage-100) 30%, var(--ivory-200) 50%, var(--sage-100) 70%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.more { text-align: center; padding: 1rem 0; }

/* ---------- Estados ---------- */
.state { text-align: center; padding: 2.5rem 1rem; color: var(--ink-soft); }
.state i { font-size: 3rem; color: var(--sage); display: block; margin-bottom: .5rem; }
.state h3 { color: var(--olive-800); }
.state--error i { color: var(--danger); }
.banner { display: flex; align-items: center; gap: .6rem; padding: .7rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; font-size: 1rem; }
.banner--warn { background: var(--warn-bg); border: 1px solid var(--gold-300); }

/* ---------- Pie ---------- */
.foot { text-align: center; padding: 2.5rem 1.25rem 3rem; color: var(--ivory); background: linear-gradient(180deg, var(--olive-800), var(--olive-950)); }
.foot__names { font-size: 2.6rem; margin: 0 0 .2rem; color: var(--gold-300); }
.foot__priv { font-size: .92rem; opacity: .75; margin: 1rem auto 0; max-width: 520px; }

/* ---------- Hoja de subida (bottom sheet) ---------- */
.sheet { border: 0; padding: 0; width: 100%; max-width: 560px; max-height: 94dvh; margin: auto auto 0; border-radius: 22px 22px 0 0; background: var(--ivory); color: var(--ink); box-shadow: var(--shadow); overflow: hidden; }
.sheet::backdrop { background: rgba(35,42,23,.6); backdrop-filter: blur(3px); animation: fade .25s both; }
.sheet[open] { animation: sheetUp .38s var(--ease) both; }
@media (min-width: 640px) { .sheet { margin: auto; border-radius: 22px; } }
@keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } }
.sheet__body { display: flex; flex-direction: column; max-height: 94dvh; padding: 1.1rem 1.1rem 0; overflow-y: auto; }
.sheet__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .6rem; }
.sheet__head h2 { margin: 0; font-size: 1.5rem; color: var(--olive-800); }
.sheet__foot { position: sticky; bottom: 0; margin: .8rem -1.1rem 0; padding: .8rem 1.1rem calc(.9rem + env(safe-area-inset-bottom)); background: linear-gradient(180deg, rgba(250,246,238,0), var(--ivory) 30%); }
.pick { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.pick__btn { display: flex; flex-direction: column; align-items: center; gap: .35rem; padding: 1rem .5rem; border-radius: var(--radius); border: 1.5px dashed var(--olive-600); background: var(--white); color: var(--olive-800); font-family: var(--font-caps); font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; transition: background .2s, transform .2s var(--ease); }
.pick__btn i { font-size: 1.9rem; color: var(--gold); }
.pick__btn:hover { background: var(--sage-100); }
.pick__btn:active { transform: scale(.97); }
.field__hint { font-size: .92rem; color: var(--ink-soft); margin: .6rem 0 .2rem; text-align: center; }

.previews { list-style: none; margin: .6rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: .6rem; }
.pv { position: relative; aspect-ratio: 1; border-radius: var(--radius-sm); overflow: hidden; background: var(--sage-100); animation: cardIn .3s var(--ease) both; }
.pv img { width: 100%; height: 100%; object-fit: cover; }
.pv__rm { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border: 0; border-radius: 50%; background: rgba(35,42,23,.75); color: #fff; display: grid; place-items: center; font-size: .8rem; }
.pv__badge { position: absolute; inset: auto 0 0 0; padding: .25rem .4rem; font-size: .72rem; line-height: 1.15; color: #fff; background: rgba(35,42,23,.78); text-align: center; }
.pv.is-error { outline: 2px solid var(--danger); }
.pv.is-error .pv__badge { background: rgba(155,44,44,.92); }
.pv.is-done { outline: 2px solid var(--ok); }
.pv.is-done .pv__badge { background: rgba(47,107,58,.92); }
.pv__bar { position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: rgba(255,255,255,.5); }
.pv__bar span { display: block; height: 100%; width: 0; background: var(--gold); transition: width .2s; }

.msg { margin-top: .8rem; padding: .75rem .9rem; border-radius: var(--radius-sm); font-size: 1rem; display: flex; gap: .6rem; align-items: flex-start; }
.msg i { margin-top: .15rem; }
.msg--ok { background: var(--ok-bg); color: var(--ok); border: 1px solid #b9d9bd; }
.msg--err { background: var(--danger-bg); color: var(--danger); border: 1px solid #efc3c3; }
.msg--info { background: var(--warn-bg); border: 1px solid var(--gold-300); color: #6a5320; }

.fields { margin-top: .9rem; display: grid; gap: .8rem; }
.field { display: grid; gap: .25rem; font-weight: 500; }
.field small { font-weight: 400; color: var(--ink-soft); }
.field input, .field textarea { width: 100%; padding: .7rem .85rem; border: 1.5px solid var(--sage-200); border-radius: var(--radius-sm); background: var(--white); font-size: 1.05rem; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--olive-600); box-shadow: 0 0 0 3px rgba(92,107,64,.18); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.consent { display: flex; gap: .65rem; align-items: flex-start; font-size: 1rem; line-height: 1.35; }
.consent input { width: 22px; height: 22px; margin-top: .1rem; accent-color: var(--olive-700); flex: none; }
.priv { font-size: .92rem; color: var(--ink-soft); }
.priv summary { cursor: pointer; color: var(--olive-700); }
.progress { margin-top: .9rem; }
.progress__bar { height: 12px; border-radius: 99px; background: var(--sage-200); overflow: hidden; }
.progress__bar span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--gold-grad); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; transition: width .25s; }
.progress__text { text-align: center; margin: .35rem 0 0; font-size: .98rem; color: var(--ink-soft); }

/* ---------- Visor ---------- */
.lb { border: 0; padding: 0; width: 100vw; max-width: none; height: 100dvh; max-height: none; background: rgba(20,24,13,.96); color: #fff; }
.lb[open] { display: grid; place-items: center; animation: fade .25s both; }
.lb::backdrop { background: #000; }
.lb__fig { margin: 0; width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 3.2rem .5rem 1rem; position: relative; }
.lb__fig img { max-width: 100%; max-height: calc(100dvh - 11rem); object-fit: contain; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.6); animation: lbIn .35s var(--ease) both; touch-action: pan-y; user-select: none; }
.lb__fig figcaption { margin-top: 1rem; max-width: 640px; text-align: center; font-size: 1.05rem; line-height: 1.35; padding: 0 3.4rem; }
.lb__fig figcaption small { display: block; opacity: .7; }
.lb__fig figcaption em { display: block; margin-top: .3rem; opacity: .92; }
.lb__close { position: absolute; top: max(.7rem, env(safe-area-inset-top)); right: .7rem; z-index: 2; }
.lb__nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; }
.lb__nav--prev { left: .5rem; } .lb__nav--next { right: .5rem; }
.lb__spin { position: absolute; width: 38px; height: 38px; border: 3px solid rgba(255,255,255,.25); border-top-color: var(--gold-300); border-radius: 50%; animation: spin .8s linear infinite; top: 45%; }
.lb__spin[hidden] { display: none; }
@keyframes lbIn { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }

/* ---------- Toast Notificación ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(2rem + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 999999;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .65rem;
  max-width: min(92vw, 480px);
  padding: .85rem 1.45rem;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(28, 34, 20, 0.96), rgba(45, 54, 30, 0.98));
  color: #fff;
  font-family: var(--font-caps);
  font-size: .95rem;
  letter-spacing: .04em;
  box-shadow: 0 16px 36px rgba(0,0,0,.45), 0 0 0 1px rgba(184,149,90,.55);
  backdrop-filter: blur(8px);
  animation: toastPop .35s cubic-bezier(.16, 1, .3, 1) both;
  pointer-events: none;
  text-align: center;
}
.toast i { font-size: 1.3rem; color: var(--gold-300); flex-shrink: 0; }
@keyframes toastPop {
  from { opacity: 0; transform: translateX(-50%) translateY(24px) scale(.95); }
  to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

/* ---------- Galería cerrada ---------- */
.closed { min-height: 100dvh; display: grid; place-content: center; text-align: center; padding: 2rem; gap: .3rem; }
.closed i { font-size: 3.5rem; color: var(--gold); }
.closed h1 { color: var(--olive-800); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
