/* ============================================================
 *  Lucía & Mateo — invitación de boda
 *  Paleta crema, tipografías cursiva + serif elegante.
 * ============================================================ */

:root {
  --cream: #faf6ef;
  --cream-2: #f3ebdd;
  --cream-3: #ece0cd;
  --ink: #4a3f33;
  --ink-soft: #6b5d4c;
  --gold: #a07856;
  --gold-dark: #6b4f3a;
  --line: #ddcdb6;
  --white: #fffdf9;
  --shadow: 0 12px 35px rgba(74, 63, 51, 0.12);
  --radius: 16px;
  --serif: "Cormorant Garamond", Georgia, serif;
  --script: "Parisienne", cursive;
}

* { box-sizing: border-box; }

/* el atributo hidden siempre oculta, aunque haya un display en una clase */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 500;
  line-height: 1.65;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-weight: 500; }

a { color: inherit; }

/* ---------- HERO / CARRUSEL ---------- */
.hero {
  position: relative;
  height: 100svh;
  min-height: 560px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--white);
}

.carousel { position: absolute; inset: 0; }

.carousel__slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.4s ease;
}
.carousel__slide.is-active { opacity: 1; }

.carousel::after {
  /* velo para que el texto se lea */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(40, 32, 24, 0.35),
    rgba(40, 32, 24, 0.15) 40%,
    rgba(40, 32, 24, 0.55)
  );
}

.hero__overlay { position: relative; z-index: 2; padding: 1.5rem; }

/* marco grabado, guiño a la invitación impresa */
.hero__frame {
  border: 1px solid rgba(255, 253, 249, 0.55);
  outline: 1px solid rgba(255, 253, 249, 0.55);
  outline-offset: 6px;
  padding: 2.6rem clamp(1.6rem, 7vw, 3.4rem);
  max-width: min(90vw, 620px);
}

.hero__pre {
  font-family: var(--serif);
  letter-spacing: 0.4em;
  text-transform: uppercase;
  font-size: 0.78rem;
  margin: 0 0 0.9rem;
  opacity: 0.9;
}

.hero__names {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: var(--script);
  font-size: clamp(2.8rem, 11vw, 5.4rem);
  line-height: 1.12;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}
.hero__name { padding: 0.06em 0; }
.hero__amp {
  font-size: 0.5em;
  line-height: 1;
  margin: 0.12em 0;
  opacity: 0.85;
}

.hero__place {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.15rem;
  margin: 1rem 0 0.2rem;
  opacity: 0.95;
}

.hero__date {
  margin-top: 0.2rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.carousel__dots {
  position: absolute;
  z-index: 3;
  bottom: 4.4rem;
  left: 0;
  right: 0;
  display: flex;
  gap: 0.55rem;
  justify-content: center;
}
.carousel__dots button {
  width: 9px; height: 9px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  padding: 0;
  transition: background 0.3s, transform 0.3s;
}
.carousel__dots button.is-active {
  background: var(--white);
  transform: scale(1.25);
}

.hero__scroll {
  position: absolute;
  z-index: 3;
  bottom: 1.4rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.8rem;
  text-decoration: none;
  color: var(--white);
  opacity: 0.85;
  animation: bob 2s ease-in-out infinite;
}
@keyframes bob { 0%,100%{ transform: translateX(-50%) translateY(0);} 50%{ transform: translateX(-50%) translateY(7px);} }

/* ---------- SECCIONES ---------- */
.section {
  max-width: 680px;
  margin: 0 auto;
  padding: 4.5rem 1.5rem;
  text-align: center;
}

.section:nth-of-type(even) { background: var(--cream-2); max-width: none; }
.section:nth-of-type(even) > * { max-width: 680px; margin-left: auto; margin-right: auto; }

.section__title {
  font-family: var(--script);
  font-size: clamp(2.4rem, 8vw, 3.4rem);
  color: var(--gold-dark);
  margin-bottom: 1.4rem;
}
/* firma del sitio: fleurón botánico flanqueado por dos hairlines */
.section__title::before {
  content: "❦";
  display: block;
  width: max-content;
  margin: 0 auto 0.7rem;
  padding: 0 3.6rem;
  font-family: var(--serif);
  font-size: 1.05rem;
  color: var(--gold);
  opacity: 0.85;
  background:
    linear-gradient(var(--line), var(--line)) left center / 2.4rem 1px no-repeat,
    linear-gradient(var(--line), var(--line)) right center / 2.4rem 1px no-repeat;
}

.ornament { display: none; }

.invite__text { font-size: 1.25rem; font-style: italic; color: var(--ink-soft); }

/* ---------- COUNTDOWN ---------- */
.countdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.7rem;
  margin-top: 1rem;
}
.count__cell {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 0.4rem;
  box-shadow: var(--shadow);
}
.count__num {
  display: block;
  font-size: clamp(1.8rem, 8vw, 2.8rem);
  font-weight: 600;
  color: var(--gold-dark);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.count__label {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.count__done { font-family: var(--script); font-size: 2rem; color: var(--gold-dark); }
.count__cta { margin-top: 1.9rem; }

/* ---------- MAPA ---------- */
.map__venue { font-size: 1.4rem; font-weight: 600; margin: 0; color: var(--gold-dark); }
.map__address { margin: 0.2rem 0 1.4rem; color: var(--ink-soft); font-style: italic; }
.map__embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 1.6rem;
}
.map__embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------- DRESS CODE ---------- */
.dress__title { font-size: 1.5rem; color: var(--gold-dark); margin: 0 0 0.4rem; }
.dress__text { color: var(--ink-soft); font-style: italic; }

/* ---------- INSTAGRAM ---------- */
.ig__text { color: var(--ink-soft); font-style: italic; margin-bottom: 0.6rem; }
.ig__hashtag {
  display: block;
  font-family: var(--script);
  font-size: 2.4rem;
  color: var(--gold);
  text-decoration: none;
  margin-bottom: 1.4rem;
}
.ig__icon { vertical-align: middle; margin-right: 0.45rem; }

/* ---------- BOTONES ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-family: var(--serif);
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  padding: 0.8rem 1.8rem;
  border-radius: 999px;
  border: 1.5px solid var(--gold);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.25s, color 0.25s;
  background: transparent;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--gold); color: var(--white); }
.btn--primary:hover { background: var(--gold-dark); border-color: var(--gold-dark); }
.btn--ghost { color: var(--gold-dark); background: var(--white); }
.btn--block { width: 100%; margin-top: 0.6rem; }

/* ---------- RSVP FORM ---------- */
.rsvp__lead { color: var(--ink-soft); font-style: italic; margin-bottom: 1.6rem; }
.rsvp__form { text-align: left; display: grid; gap: 1.2rem; }

.field { display: grid; gap: 0.4rem; border: 0; padding: 0; margin: 0; }
.field__label {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.field input[type="text"],
.field select,
.field textarea,
.song input {
  width: 100%;
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.7rem 0.9rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field input:focus,
.field select:focus,
.field textarea:focus,
.song input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(160, 120, 86, 0.15);
}
.field textarea { resize: vertical; }

.toggle { display: flex; gap: 0.8rem; }
.toggle label {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-weight: 600;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.7rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.toggle input { accent-color: var(--gold); }
.toggle label:has(input:checked) {
  border-color: var(--gold);
  background: var(--cream-3);
}

/* canción / spotify */
.song { position: relative; }
.song__inputwrap { position: relative; }
.song__spotify {
  position: absolute;
  left: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}
/* especificidad igual a .field input[type="text"] para ganar el padding-left */
.song__inputwrap input[type="text"] { padding-left: 3.1rem; padding-right: 2.6rem; }
.song__spinner {
  position: absolute;
  right: 0.95rem;
  top: 50%;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  border: 2px solid var(--line);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  pointer-events: none;
}
@keyframes spin { to { transform: rotate(360deg); } }
.song__results {
  list-style: none;
  margin: 0.3rem 0 0;
  padding: 0;
  position: absolute;
  z-index: 10;
  left: 0; right: 0;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
  max-height: 280px;
  overflow-y: auto;
}
.song__results li {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.8rem;
  cursor: pointer;
}
.song__results li:hover,
.song__results li.is-active { background: var(--cream-2); }
.song__results img { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; flex: none; }
.song__meta { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.song__meta strong { font-weight: 600; }
.song__meta small { color: var(--ink-soft); }
.song__meta strong, .song__meta small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Canción ya elegida por otra persona: grisada y no seleccionable */
.song__results li.is-taken { cursor: not-allowed; opacity: 0.55; }
.song__results li.is-taken:hover { background: transparent; }
.song__taken-label {
  margin-left: auto;
  flex: none;
  font-size: 0.85rem;
  font-weight: 600;
  font-style: italic;
  color: var(--ink-soft);
  white-space: nowrap;
}

.song__selected {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-top: 0.5rem;
  background: var(--cream-3);
  border-radius: 12px;
  padding: 0.6rem 0.9rem;
  font-style: italic;
}
.song__clear {
  border: 0; background: transparent; cursor: pointer;
  font-size: 1.4rem; line-height: 1; color: var(--ink-soft);
}
.song__hint { font-size: 0.8rem; color: var(--ink-soft); margin: 0.3rem 0 0; }

.rsvp__status { text-align: center; font-style: italic; min-height: 1.4em; margin: 0.4rem 0 0; }
.rsvp__status.is-ok { color: #4e7a4e; }
.rsvp__status.is-err { color: #a6504a; }

.btn[disabled] { opacity: 0.6; cursor: default; transform: none; }

/* ---------- REGALOS ---------- */
.gifts__lead { color: var(--ink-soft); font-style: italic; margin-bottom: 1.8rem; }
.gifts__list { list-style: none; margin: 0 0 2rem; padding: 0; display: grid; gap: 0.7rem; }
.gift {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem 1.2rem;
  box-shadow: var(--shadow);
}
.gift__name { display: flex; align-items: center; gap: 0.6rem; font-size: 1.15rem; }
.gift__icon { font-size: 1.3rem; }
.gift__value { font-weight: 600; color: var(--gold-dark); white-space: nowrap; }

.gifts__pay {
  background: var(--cream-3);
  border-radius: var(--radius);
  padding: 1.6rem 1.4rem;
  text-align: left;
}
.gifts__payTitle {
  font-family: var(--script);
  font-size: 2rem;
  color: var(--gold-dark);
  text-align: center;
  margin-bottom: 1rem;
}
.pay__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--white);
  border-radius: 12px;
  padding: 0.7rem 1rem;
  margin-bottom: 0.7rem;
}
.pay__data { display: flex; flex-direction: column; min-width: 0; }
.pay__k { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft); }
.pay__v { font-size: 1.1rem; font-weight: 600; word-break: break-all; }
.btn--copy { padding: 0.45rem 1.1rem; font-size: 0.95rem; flex: none; }
.pay__titular { text-align: center; color: var(--ink-soft); font-style: italic; margin: 0.6rem 0 1rem; }
.pay__copied { text-align: center; color: #4e7a4e; font-style: italic; margin: 0.6rem 0 0; }

/* ---------- FOOTER ---------- */
.footer {
  text-align: center;
  padding: 3rem 1.5rem;
  background: var(--gold-dark);
  color: var(--cream);
}
.footer__names { font-family: var(--script); font-size: 2.6rem; margin: 0; }
.footer__date { letter-spacing: 0.18em; text-transform: uppercase; font-size: 0.85rem; margin: 0.3rem 0 1rem; opacity: 0.85; }
.footer__heart { margin: 0; opacity: 0.8; }

/* ---------- ACCESIBILIDAD / MOVIMIENTO ---------- */
:focus-visible { outline: 2px solid var(--gold-dark); outline-offset: 3px; }
.btn:focus-visible,
.hero__scroll:focus-visible,
.carousel__dots button:focus-visible,
.ig__hashtag:focus-visible { outline: 2px solid var(--white); outline-offset: 3px; }
.btn:focus-visible { outline-color: var(--gold-dark); }

/* aparición suave al hacer scroll — sólo si el usuario no pidió menos movimiento */
@media (prefers-reduced-motion: no-preference) {
  .js .section {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity 0.8s ease, transform 0.8s ease;
  }
  .js .section.is-visible { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero__scroll { animation: none; }
  .carousel__slide { transition: none; }
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 480px) {
  body { font-size: 18px; }
  .countdown { gap: 0.45rem; }
  .count__cell { padding: 0.9rem 0.2rem; }
  .toggle { flex-direction: column; }
}
