/* ═══════════════════════════════════════════════════════════
   Boda Lidia & David — estilo "Romántico clásico"
   Paleta: crema · verde salvia · dorado
   ═══════════════════════════════════════════════════════════ */

:root {
  --crema:        #FAF6EF;
  --marfil:       #F3EDE2;
  --salvia:       #8A9A7B;
  --salvia-suave: #B9C4AB;
  --verde-oscuro: #4A5D43;
  --dorado:       #C5A55A;
  --dorado-claro: #DCC894;
  --tinta:        #3E3A33;
  --tinta-suave:  #6E675C;

  --f-serif:  'Cormorant Garamond', Georgia, serif;
  --f-script: 'Great Vibes', cursive;
  --f-sans:   'Jost', 'Segoe UI', sans-serif;

  --ancho: 1120px;
  --nav-h: 84px;
}

/* ── Base ─────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
}

body {
  font-family: var(--f-sans);
  font-weight: 300;
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--tinta);
  background: var(--crema);
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--verde-oscuro); }

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

/* ── Ornamento separador ──────────────────────────────────── */

.ornament {
  width: 200px;
  height: 24px;
  margin: 1.4rem auto;
  display: block;
  color: var(--salvia);
}

.ornament--gold { color: var(--dorado); }

/* ── Navegación ───────────────────────────────────────────── */

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1.2rem, 4vw, 3rem);
  color: var(--verde-oscuro);
  background: transparent;
  transition: background .4s ease, box-shadow .4s ease, height .4s ease;
}

.nav--scrolled {
  height: 68px;
  background: rgba(250, 246, 239, .92);
  backdrop-filter: blur(8px);
  box-shadow: 0 1px 0 rgba(197, 165, 90, .35), 0 8px 28px rgba(62, 58, 51, .07);
}

.nav__brand {
  display: block;
  width: 52px;
  height: 52px;
  color: var(--dorado);
  transition: transform .3s ease;
}

.nav__brand:hover { transform: rotate(-6deg) scale(1.05); }
.nav__brand svg { width: 100%; height: 100%; }

.nav__menu ul {
  display: flex;
  gap: clamp(1.2rem, 3vw, 2.6rem);
  list-style: none;
}

.nav__menu a {
  font-family: var(--f-sans);
  font-size: .8rem;
  font-weight: 400;
  letter-spacing: .22em;
  text-transform: uppercase;
  text-decoration: none;
  color: inherit;
  padding: .4rem 0;
  position: relative;
}

.nav__menu a::after {
  content: "";
  position: absolute;
  left: 50%; bottom: 0;
  width: 0; height: 1px;
  background: var(--dorado);
  transition: width .35s ease, left .35s ease;
}

.nav__menu a:hover::after,
.nav__menu a:focus-visible::after { width: 100%; left: 0; }

/* Hamburguesa (solo móvil) */
.nav__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 44px; height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 102;
}

.nav__toggle span {
  display: block;
  width: 26px; height: 1.6px;
  margin: 0 auto;
  background: var(--verde-oscuro);
  transition: transform .3s ease, opacity .3s ease;
}

/* ── Hero ─────────────────────────────────────────────────── */

.hero {
  min-height: 100svh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: calc(var(--nav-h) + 2rem) 1.5rem 4rem;
  background:
    url("../img/hero-bg.svg") center / cover no-repeat,
    linear-gradient(160deg, var(--crema), var(--marfil));
}

.hero__content {
  max-width: 780px;
  animation: hero-in 1.4s ease both;
}

@keyframes hero-in {
  from { opacity: 0; transform: translateY(26px); }
  to   { opacity: 1; transform: none; }
}

.hero__monogram {
  width: 92px;
  height: 92px;
  margin: 0 auto 1.6rem;
  color: var(--dorado);
}

.hero__eyebrow {
  font-size: .85rem;
  font-weight: 400;
  letter-spacing: .5em;
  text-indent: .5em; /* compensa el letter-spacing del último carácter */
  text-transform: uppercase;
  color: var(--salvia);
  margin-bottom: .6rem;
}

.hero__names {
  font-family: var(--f-script);
  font-weight: 400;
  font-size: clamp(3.4rem, 11vw, 6.8rem);
  line-height: 1.15;
  color: var(--verde-oscuro);
}

.hero__amp {
  color: var(--dorado);
  font-size: .72em;
  margin: 0 .08em;
}

.hero__date {
  font-family: var(--f-serif);
  font-size: clamp(1.15rem, 2.6vw, 1.45rem);
  font-weight: 500;
  letter-spacing: .08em;
  color: var(--tinta);
}

.hero__dot { color: var(--dorado); margin: 0 .35rem; }

/* Cuenta atrás */
.countdown {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(.5rem, 2vw, 1.1rem);
  margin-top: 2.4rem;
}

.countdown__unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: clamp(68px, 16vw, 96px);
  padding: .9rem .4rem .7rem;
  background: rgba(255, 255, 255, .55);
  border: 1px solid var(--dorado-claro);
  box-shadow: inset 0 0 0 4px var(--crema), inset 0 0 0 5px rgba(197, 165, 90, .45);
}

.countdown__num {
  font-family: var(--f-serif);
  font-size: clamp(1.7rem, 4.5vw, 2.4rem);
  font-weight: 500;
  line-height: 1.1;
  color: var(--verde-oscuro);
  font-variant-numeric: tabular-nums;
}

.countdown__label {
  font-size: .62rem;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--tinta-suave);
  margin-top: .25rem;
}

.countdown__sep {
  font-family: var(--f-serif);
  font-size: 1.5rem;
  color: var(--dorado);
  transform: translateY(-.5rem);
}

.countdown--done {
  font-family: var(--f-script);
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  color: var(--verde-oscuro);
}

/* Flecha de scroll */
.hero__scroll {
  display: inline-block;
  margin-top: 3rem;
  width: 34px; height: 34px;
  color: var(--salvia);
  animation: float 2.2s ease-in-out infinite;
}

.hero__scroll svg { width: 100%; height: 100%; }
.hero__scroll:hover { color: var(--dorado); }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(9px); }
}

/* ── Secciones (base) ─────────────────────────────────────── */

.section {
  padding: clamp(4.5rem, 10vw, 7.5rem) 1.5rem;
}

.section__head {
  max-width: var(--ancho);
  margin: 0 auto clamp(2.6rem, 6vw, 4.2rem);
  text-align: center;
}

.section__eyebrow {
  font-family: var(--f-script);
  font-size: clamp(1.6rem, 3.5vw, 2.1rem);
  color: var(--dorado);
  line-height: 1.2;
}

.section__title {
  font-family: var(--f-serif);
  font-size: clamp(2.1rem, 5.5vw, 3.1rem);
  font-weight: 500;
  letter-spacing: .04em;
  color: var(--verde-oscuro);
  margin-top: .2rem;
}

/* ── Nuestra historia ─────────────────────────────────────── */

.story__timeline {
  max-width: var(--ancho);
  margin: 0 auto;
  position: relative;
  display: grid;
  gap: clamp(3.5rem, 8vw, 6rem);
}

/* línea central vertical */
.story__timeline::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  left: 50%;
  width: 1px;
  background: linear-gradient(to bottom, transparent, var(--dorado-claro) 12%, var(--dorado-claro) 88%, transparent);
}

.story__item {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 6vw, 4.5rem);
  align-items: center;
  position: relative;
}

/* nodo sobre la línea */
.story__item::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) rotate(45deg);
  width: 11px; height: 11px;
  background: var(--crema);
  border: 1.5px solid var(--dorado);
  z-index: 1;
}

.story__item .arch      { justify-self: end; }
.story__item .story__text { text-align: left; }

.story__item--reverse .arch { order: 2; justify-self: start; }
.story__item--reverse .story__text { order: 1; text-align: right; }

/* Marco en arco tipo capilla. La proporción es 10:13 por defecto, pero
   el panel puede fijar otra por foto (aspect-ratio en línea) — el radio
   en % (en vez de px) mantiene la forma de cúpula sea cual sea la forma. */
.arch {
  width: min(330px, 78vw);
  padding: 13px;
  border: 1px solid var(--dorado);
  border-radius: 50% 50% 0 0;
  background: rgba(255, 255, 255, .5);
  box-shadow: 0 22px 45px -22px rgba(74, 93, 67, .35);
}

.arch img {
  border-radius: 50% 50% 0 0;
  aspect-ratio: 10 / 13;
  object-fit: cover;
}

.story__year {
  display: inline-block;
  font-family: var(--f-script);
  font-size: 2rem;
  color: var(--dorado);
  line-height: 1;
  margin-bottom: .4rem;
}

.story__text h3 {
  font-family: var(--f-serif);
  font-size: clamp(1.5rem, 3.4vw, 1.95rem);
  font-weight: 500;
  color: var(--verde-oscuro);
  margin-bottom: .7rem;
}

.story__text p {
  color: var(--tinta-suave);
  max-width: 46ch;
  white-space: pre-line; /* respeta los saltos de línea escritos en el panel */
}

.story__item--reverse .story__text p { margin-left: auto; }

/* ── La boda (detalles) ───────────────────────────────────── */

.details { background: var(--marfil); }

.details__cards {
  max-width: var(--ancho);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: clamp(1.5rem, 4vw, 2.5rem);
}

/* cuando todo se celebra en un único lugar: una sola tarjeta centrada */
.details__cards--single {
  grid-template-columns: min(100%, 520px);
  justify-content: center;
}

.card {
  background: var(--crema);
  border: 1px solid var(--dorado-claro);
  box-shadow: inset 0 0 0 6px var(--crema), inset 0 0 0 7px rgba(197, 165, 90, .4);
  padding: clamp(2.2rem, 5vw, 3.2rem) 2rem 2.6rem;
  text-align: center;
  transition: transform .35s ease, box-shadow .35s ease;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow:
    inset 0 0 0 6px var(--crema), inset 0 0 0 7px rgba(197, 165, 90, .4),
    0 24px 48px -20px rgba(74, 93, 67, .3);
}

.card__icon {
  width: 58px; height: 58px;
  margin: 0 auto 1.1rem;
  color: var(--salvia);
}

.card__title {
  font-family: var(--f-serif);
  font-size: 1.8rem;
  font-weight: 500;
  color: var(--verde-oscuro);
}

.card__time {
  font-family: var(--f-script);
  font-size: 1.7rem;
  color: var(--dorado);
  margin: .3rem 0 .9rem;
}

.card__place { font-weight: 400; letter-spacing: .04em; }

.card__address {
  font-size: .92rem;
  color: var(--tinta-suave);
  margin-bottom: 1.6rem;
}

.btn {
  display: inline-block;
  font-size: .78rem;
  font-weight: 400;
  letter-spacing: .24em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--verde-oscuro);
  border: 1px solid var(--verde-oscuro);
  padding: .8rem 2.1rem;
  transition: background .3s ease, color .3s ease, border-color .3s ease;
}

.btn:hover, .btn:focus-visible {
  background: var(--verde-oscuro);
  border-color: var(--verde-oscuro);
  color: var(--crema);
}

/* Agenda del día */
.agenda {
  max-width: 640px;
  margin: clamp(3.5rem, 8vw, 5.5rem) auto 0;
}

.agenda__title {
  font-family: var(--f-serif);
  font-size: clamp(1.6rem, 3.5vw, 2rem);
  font-weight: 500;
  text-align: center;
  color: var(--verde-oscuro);
  margin-bottom: 2.2rem;
}

.agenda__list { list-style: none; }

.agenda__item {
  display: grid;
  grid-template-columns: 76px 46px 1fr;
  align-items: center;
  gap: 1.1rem;
  padding: .95rem .4rem;
}

.agenda__item + .agenda__item {
  border-top: 1px dashed rgba(197, 165, 90, .5);
}

.agenda__time {
  font-family: var(--f-serif);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--dorado);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.agenda__icon { width: 38px; height: 38px; color: var(--salvia); }

.agenda__what { letter-spacing: .03em; }

/* ── Galería ──────────────────────────────────────────────── */

.gallery__grid {
  max-width: var(--ancho);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 240px;
  grid-auto-flow: dense;
  gap: clamp(.8rem, 2vw, 1.4rem);
}

.gallery__item {
  position: relative;
  overflow: hidden;
  cursor: zoom-in;
  border: 1px solid rgba(197, 165, 90, .45);
  padding: 8px;
  background: #fff;
}

.gallery__item--tall { grid-row: span 2; }

.gallery__item img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .6s ease, filter .6s ease;
}

.gallery__item::after {
  content: "✦";
  position: absolute;
  inset: 8px;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  color: var(--crema);
  background: rgba(74, 93, 67, .34);
  opacity: 0;
  transition: opacity .4s ease;
  pointer-events: none;
}

.gallery__item:hover img { transform: scale(1.06); }
.gallery__item:hover::after { opacity: 1; }

/* ── Footer ───────────────────────────────────────────────── */

.footer {
  background: var(--verde-oscuro);
  color: var(--crema);
  text-align: center;
  padding: clamp(3.5rem, 8vw, 5.5rem) 1.5rem 2.5rem;
}

.footer__monogram {
  width: 84px; height: 84px;
  margin: 0 auto 1.4rem;
  color: var(--dorado-claro);
}

.footer__names {
  font-family: var(--f-script);
  font-size: clamp(2.1rem, 5vw, 2.9rem);
  line-height: 1.2;
}

.footer__date {
  font-family: var(--f-serif);
  font-size: 1.1rem;
  letter-spacing: .35em;
  text-indent: .35em;
  margin-top: .4rem;
  color: var(--salvia-suave);
}

.footer .ornament--gold { color: var(--dorado-claro); }

.footer__quote {
  font-family: var(--f-serif);
  font-style: italic;
  font-size: clamp(1.1rem, 2.6vw, 1.3rem);
  max-width: 34ch;
  margin: 0 auto;
  color: rgba(250, 246, 239, .88);
}

.footer__credit {
  margin-top: 2.6rem;
  font-size: .74rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: rgba(250, 246, 239, .55);
}

.footer__credit span[aria-hidden] { color: var(--dorado-claro); }

/* candado de acceso al panel — casi invisible, solo para quien sabe que está */
.footer__lock {
  display: inline-block;
  width: 18px; height: 18px;
  margin-top: 1.6rem;
  color: var(--crema);
  opacity: .18;
  transition: opacity .3s ease;
}

.footer__lock svg { width: 100%; height: 100%; }
.footer__lock:hover, .footer__lock:focus-visible { opacity: .65; }

/* ── Lightbox ─────────────────────────────────────────────── */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  background: rgba(42, 48, 38, .93);
  padding: 3.5rem 1rem;
}

.lightbox[hidden] { display: none; }

.lightbox__img {
  max-width: min(92vw, 1000px);
  max-height: 84vh;
  border: 1px solid var(--dorado-claro);
  padding: 10px;
  background: var(--crema);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
}

.lightbox__close,
.lightbox__nav {
  position: absolute;
  background: none;
  border: none;
  color: var(--crema);
  font-family: var(--f-serif);
  cursor: pointer;
  line-height: 1;
  padding: .5rem .9rem;
  transition: color .25s ease, transform .25s ease;
}

.lightbox__close:hover,
.lightbox__nav:hover { color: var(--dorado-claro); transform: scale(1.12); }

.lightbox__close { top: 1rem; right: 1.4rem; font-size: 2.6rem; }

.lightbox__nav {
  top: 50%;
  transform: translateY(-50%);
  font-size: 3.4rem;
}

.lightbox__nav:hover { transform: translateY(-50%) scale(1.12); }
.lightbox__nav--prev { left: .8rem; }
.lightbox__nav--next { right: .8rem; }

/* ── Animaciones de entrada ───────────────────────────────── */

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .9s ease var(--d, 0s), transform .9s ease var(--d, 0s);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero__content { animation: none; }
  .hero__scroll { animation: none; }
  .gallery__item img { transition: none; }
}

/* ── Responsive ───────────────────────────────────────────── */

@media (max-width: 880px) {

  /* menú móvil */
  .nav__toggle { display: flex; }

  .nav__menu {
    position: fixed;
    inset: 0;
    background: rgba(250, 246, 239, .97);
    display: grid;
    place-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity .35s ease, visibility .35s ease;
  }

  .nav--open .nav__menu { opacity: 1; visibility: visible; }

  .nav__menu ul {
    flex-direction: column;
    align-items: center;
    gap: 2.2rem;
  }

  .nav__menu a { font-size: 1rem; }

  .nav--open .nav__toggle span:nth-child(1) { transform: translateY(7.6px) rotate(45deg); }
  .nav--open .nav__toggle span:nth-child(2) { opacity: 0; }
  .nav--open .nav__toggle span:nth-child(3) { transform: translateY(-7.6px) rotate(-45deg); }

  /* historia en columna */
  .story__timeline::before,
  .story__item::before { display: none; }

  .story__item,
  .story__item--reverse { grid-template-columns: 1fr; }

  .story__item .arch,
  .story__item--reverse .arch { order: 0; justify-self: center; }

  .story__item .story__text,
  .story__item--reverse .story__text {
    order: 1;
    text-align: center;
  }

  .story__text p { margin: 0 auto; }
  .story__item--reverse .story__text p { margin: 0 auto; }

  /* galería a 2 columnas */
  .gallery__grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 200px;
  }
}

@media (max-width: 520px) {
  .gallery__grid {
    grid-template-columns: 1fr;
    grid-auto-rows: 260px;
  }

  .gallery__item--tall { grid-row: span 1; }

  .agenda__item { grid-template-columns: 60px 38px 1fr; gap: .8rem; }

  .countdown__sep { display: none; }
}
