/* ============================================================
   Boda Sofía & Daniel · Contenido de la invitación (etapa 3)
   Se muestra sobre la imagen ../img/fondo.png
   ============================================================ */

.inv,
.capa--fondo {
  --sage: #8e9a77;
  --sage-light: #a8b496;
  --sage-dark: #4a5232;
  --moss: #3b4228;
  --paper: #faf9f4;
  /* Papel translúcido: deja ver la textura de fondo.png */
  --paper-soft: rgba(250, 249, 244, .92);
  --paper-firm: rgba(250, 249, 244, .96);
  --ink: #3d4230;
  --white: #fff;
  --serif: "Cormorant Garamond", "Times New Roman", serif;
  --script: "Great Vibes", cursive;
  --display: "Playfair Display", "Cormorant Garamond", serif;
  --body: "Libre Baskerville", Georgia, serif;
}

/* El contenido hereda la tipografía de la invitación, no la de la portada */
.contenido {
  font-family: var(--body);
  color: var(--ink);
  overflow-x: hidden;
}

.wrap {
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
}

/* ---------- Papel texturizado ---------- */
.grain {
  position: relative;
}

.grain::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .18;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .5 0'/></filter><rect width='160' height='160' filter='url(%23n)'/></svg>");
  border-radius: inherit;
}

/* ---------- Tarjetas ---------- */
.card {
  box-shadow: 0 3px 14px rgba(61, 66, 48, .13);
  border-radius: 4px;
}

.card.sage {
  background: var(--sage);
  color: #fff;
}

.card.cream {
  background: var(--paper-soft);
  color: var(--ink);
}

.card h2 {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* Elegant section titles */
.section-title {
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.6rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  line-height: 1.15;
  margin-bottom: 8px;
}

.card .small {
  font-size: .7rem;
  line-height: 1.65;
  letter-spacing: .02em;
}

.card .address {
  font-size: .62rem;
  margin-top: 6px;
  line-height: 1.5;
  opacity: .85;
}

.card .time {
  font-family: var(--display);
  font-size: 1.3rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  font-weight: 400;
  font-style: normal;
}

.card .place {
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-weight: 700;
}

/* ---------- Sellos de cera (imagen img/sello.png) ---------- */
.seal {
  position: absolute;
  z-index: 5;
  width: auto;
  height: 68px;
  display: block;
  pointer-events: none;
  filter: drop-shadow(0 4px 7px rgba(40, 44, 30, .42));
}

.seal img {
  display: block;
  width: auto;
  height: 100%;
}

/* ---------- Botón de música ---------- */
.music {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top));
  right: 12px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  cursor: pointer;
  background: var(--sage);
  color: #fff;
  font-family: var(--serif);
  font-size: .95rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 10px 16px;
  border-radius: 999px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, .25);
  max-width: calc(100vw - 24px);
}

.music .dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  color: var(--moss);
  display: grid;
  place-items: center;
  font-size: .7rem;
  line-height: 1;
  flex: 0 0 auto;
}

/* En pantallas angostas queda solo el círculo, para no chocar con el botón del video */
@media (max-width:519px) {
  .music {
    padding: 6px;
  }

  .music .txt {
    display: none;
  }
}

/* ---------- Cuenta regresiva ---------- */
.count {
  text-align: center;
  padding: 100px 0 50px;
}

.count .label {
  font-family: var(--serif);
  letter-spacing: .4em;
  font-size: .82rem;
  color: var(--ink);
  font-weight: 600;
  text-indent: .4em;
  text-transform: uppercase;
}

.count .nums {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 4px;
  font-family: var(--serif);
  font-size: 2.6rem;
  font-weight: 300;
  color: var(--sage-dark);
  margin-top: 8px;
}

.count .nums div {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 60px;
}

.count .nums span#d,
.count .nums span#h,
.count .nums span#m,
.count .nums span#s {
  font-weight: 300;
  line-height: 1;
}

.count .nums .sep {
  font-size: 2.4rem;
  font-weight: 300;
  line-height: 1;
  margin-top: 2px;
  color: var(--sage-dark);
}

.count .nums small {
  font-size: .55rem;
  letter-spacing: .12em;
  margin-top: 6px;
  font-family: var(--body);
  text-transform: uppercase;
  color: var(--sage-dark);
  font-weight: 400;
}

/* ---------- Portada ---------- */
.hero {
  position: relative;
  width: 100%;
  isolation: isolate;
}

/* Sello: se alinea al centro real de toda la secci\u00f3n hero, no de la tarjeta. */
.hero .seal {
  top: -34px;
  left: 68%;
  /* centro de la tarjeta verde (64% de ancho, pegada a la derecha) */
  transform: translateX(-50%);
  transform-origin: center;
}

/* La tarjeta principal con los nombres */
.hero .main {
  position: relative;
  margin-left: auto;
  width: 64%;
  text-align: center;
  padding: 70px 18px 72px;
  border-radius: 6px;
}

.hero .main .intro {
  font-size: .65rem;
  line-height: 1.8;
  letter-spacing: .06em;
  text-transform: uppercase;
  opacity: .9;
}

/* ---------- Nombres elegantes con fuente script ---------- */
.hero .main .names {
  font-family: var(--script);
  font-size: clamp(1.8rem, 8vw, 2.8rem);
  line-height: 1.2;
  margin: 22px 0 20px;
  letter-spacing: .02em;
  font-weight: 400;
  text-transform: none;
}

.name-script {
  font-family: var(--script);
  font-weight: 400;
}

.amp {
  font-family: var(--script);
  font-size: clamp(1.4rem, 6vw, 2.2rem);
  opacity: .8;
  display: inline-block;
  margin: 2px 0;
}

/* Divisor decorativo */
.date-divider {
  width: 50px;
  height: 1px;
  background: rgba(255, 255, 255, .4);
  margin: 8px auto 12px;
}

.hero .main .date {
  font-family: var(--display);
  font-size: clamp(.78rem, 3.2vw, 1.05rem);
  letter-spacing: .1em;
  line-height: 1.6;
  padding: 0 4px;
  margin-top: 2px;
  font-style: italic;
}

/* ---------- Fotograf\u00edas principales ---------- */
.polaroid {
  position: absolute;
  padding: 10px;
  background: linear-gradient(135deg, #fffef8 0%, #e8e5d9 100%);
  border: 1px solid rgba(97, 105, 75, .28);
  border-radius: 3px;
  box-shadow: 0 7px 18px rgba(45, 48, 34, .24), inset 0 0 0 3px rgba(255, 255, 255, .58);
}

.polaroid::after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(93, 107, 77, .2);
  border-radius: 1px;
  pointer-events: none;
}

.polaroid .ph {
  width: 100%;
  height: 100%;
  background: linear-gradient(160deg, #b6bfa2, #6f7a58);
  overflow: hidden;
  border: 1px solid rgba(75, 83, 55, .25);
}

/* ---------- Encuadres de las fotos ---------- */
.polaroid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.polaroid.p1 img {
  object-position: 14% 42%;
}

.polaroid.p2 img {
  object-position: 16% 46%;
}

.hero .fotos {
  position: relative;
  height: 280px;
  margin-top: -120px;
}

.polaroid.p1 {
  left: -6px;
  top: 50px;
  width: 52%;
  height: 160px;
  transform: rotate(-8deg);
}

.polaroid.p2 {
  left: 22%;
  top: 95px;
  width: 54%;
  height: 180px;
  transform: rotate(7deg);
}

/* ---------- Detalles ---------- */
.grid {
  position: relative;
  margin-top: -14px;
}

.row {
  position: relative;
  display: flex;
  margin-bottom: 30px;
  gap: 10px;
}

.row .card {
  width: 50%;
  padding: 24px 12px 20px;
  text-align: center;
  container-type: inline-size;
  /* permite escalar el título según el ancho de la tarjeta */
}

/* Iconos: imágenes PNG, no SVG */
.row .card img.ico {
  display: block;
  width: auto;
  height: 68px;
  margin: 0 auto 10px;
  object-fit: contain;
}

/* El de la iglesia es más apaisado: se le da algo más de alto */
.row.r1 .card.cream img.ico {
  height: 76px;
}

.card.cream img.ico {
  /* icono oscuro propio sobre tarjeta crema */
}

.card.sage img.ico {
  /* icono claro propio sobre tarjeta verde */
}

/* Fila 1: Ceremonia (izquierda) y Recepción en arco (derecha, más abajo y encimada) */
.row.r1 {
  display: grid;
  grid-template-columns: 48.4% 51.6%;
  gap: 0;
  align-items: start;
  margin-bottom: -24px;
  /* Vestimenta sube y queda junto a la cola de Recepción */
}

.row.r1 .a {
  grid-column: 1;
  grid-row: 1;
  width: 115.7%;
  /* 56% del ancho total, invade un poco la columna derecha */
  padding-right: 34px;
  /* el texto no queda bajo la tarjeta de Recepción */
  min-width: 0;
  margin-left: 0;
  border-radius: 4px;
  position: relative;
  z-index: 2;
}

.row.r1 .b {
  grid-column: 2;
  grid-row: 1;
  width: 100%;
  min-width: 0;
  margin-left: 0;
  margin-top: 110px;
  border-top-left-radius: 999px;
  border-top-right-radius: 999px;
  border-bottom-left-radius: 4px;
  border-bottom-right-radius: 4px;
  padding-top: 34px;
  position: relative;
  z-index: 3;
}

/* Sello entre Ceremonia y Recepción: entre las dos tarjetas */
.seal-row {
  position: absolute;
  z-index: 10;
}

/* Fila 2: Vestimenta (izquierda) y Regalos (derecha, más abajo y encimada) */
.row.r2 {
  display: grid;
  grid-template-columns: 48.4% 51.6%;
  gap: 0;
  align-items: start;
  margin-bottom: -26px;
  /* Información adicional sube junto a Regalos */
}

.row.r2 .card {
  min-width: 0;
}

.row.r2 .a {
  grid-column: 1;
  grid-row: 1;
  width: 106.6%;
  /* 51.6% del ancho total */
  padding-right: 22px;
  /* el texto no queda bajo la tarjeta de Regalos */
  margin-left: 0;
  margin-top: 0;
  border-radius: 4px;
  position: relative;
  z-index: 2;
}

.row.r2 .b {
  grid-column: 2;
  grid-row: 1;
  width: 100%;
  margin-left: 0;
  margin-top: 108px;
  border-radius: 4px;
  position: relative;
  z-index: 3;
}

/* Sello en la esquina donde se cruzan Recepción y Vestimenta */
.row.r2 .seal-row {
  left: 47.3%;
  top: 8px;
  height: 52px;
  transform: translate(-50%, -50%);
}

.row .card h2 {
  font-size: 12.2cqw;
  letter-spacing: .04em;
  line-height: 1.1;
  margin-bottom: 6px;
  white-space: nowrap;
}

.btn {
  display: inline-block;
  margin-top: 14px;
  padding: 7px 20px;
  border: 1.3px solid currentColor;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font-family: var(--serif);
  font-size: .92rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background .2s, color .2s;
}

.btn:hover {
  background: rgba(255, 255, 255, .15);
}

.card.cream .btn {
  color: var(--moss);
}

.card.cream .btn:hover {
  background: var(--moss);
  color: #fff;
}

.palette {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(4px, 2vw, 10px);
  width: 100%;
  margin-top: 12px;
}

.palette i {
  width: 100%;
  max-width: 20px;
  aspect-ratio: 1;
  height: auto;
  justify-self: center;
  border-radius: 50%;
  display: block;
  border: 1px solid rgba(0, 0, 0, .08);
}

/* Número de evento de la mesa de regalos */
.evento {
  font-family: var(--serif);
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-top: 14px;
  line-height: 1.5;
}

.evento b {
  display: block;
  font-size: 1.05rem;
  letter-spacing: .06em;
  user-select: all;
}

/* ---------- Cómo llegar (croquis) ---------- */
.croquis {
  margin: 6px 0 10px;
  text-align: center;
}

.croquis__titulo {
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.5rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--sage-dark);
}

.croquis__sub {
  font-family: var(--serif);
  font-size: 1rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink);
  margin-top: 2px;
}

.croquis__marco {
  display: block;
  margin: 14px auto 0;
  padding: 9px;
  background: var(--paper-firm);
  box-shadow: 0 3px 10px rgba(61, 66, 48, .2);
  border-radius: 4px;
  transform: rotate(-1deg);
}

.croquis__marco img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 2px;
}

/* ---------- Fila 3: Información adicional + foto cierre ---------- */
.row.r3 {
  margin-top: 12px;
  min-height: 440px;
  align-items: flex-start;
}

.row.r3 .card {
  width: 50.2%;
  padding: 28px 12px 26px;
  margin-left: 0;
  border-radius: 4px;
}

.row.r3 .info {
  padding-right: 14px;
}

.row.r3 .info h2,
.row.r3 .info .section-title {
  font-size: 11cqw;
  white-space: normal;
  color: #eef0e4;
  text-align: center;
  line-height: 1.3;
}

.row.r3 .info .small {
  margin-top: 12px;
}

.row.r3 .info b {
  font-weight: 700;
}

.row.r3 .info .q {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: .04em;
  font-style: italic;
  font-size: .76rem;
  margin-top: 20px;
}

.closing {
  position: absolute;
  right: 0;
  top: 92px;
  width: 51%;
  height: 330px;
  transform: rotate(8deg);
  background: #f1f1ec;
  padding: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .2);
  overflow: hidden;
  border-radius: 2px;
}

.closing .ph {
  width: 100%;
  height: 100%;
  background: #2b2b28;
  overflow: hidden;
}

.closing img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Velo oscuro para que el texto se lea sobre la foto */
.closing::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 48%;
  background: linear-gradient(to top, rgba(18, 20, 14, .78) 10%, rgba(18, 20, 14, 0) 100%);
  pointer-events: none;
}

.closing span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 14px;
  z-index: 2;
  text-align: center;
  font-family: var(--script);
  font-size: 1.1rem;
  letter-spacing: .04em;
  color: #fff;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .6);
}

/* ---------- RSVP ---------- */
.rsvp {
  position: relative;
  margin: 90px 0 60px;
  padding: 50px 22px 24px;
  background: var(--paper-firm);
  border: 2px solid var(--sage-dark);
  border-radius: 16px;
  box-shadow: 0 4px 18px rgba(61, 66, 48, .12);
}

/* Sello centrado arriba del formulario */
.rsvp .seal {
  top: -34px;
  left: 50%;
  transform: translateX(-50%);
}

.rsvp-title {
  font-family: var(--script);
  font-size: 2rem;
  font-weight: 400;
  color: #1f2216;
  margin-bottom: 6px;
  letter-spacing: .02em;
}

.rsvp label,
.rsvp legend {
  display: block;
  font-family: var(--serif);
  font-size: .95rem;
  margin: 16px 0 8px;
  color: #1f2216;
  font-weight: 500;
  letter-spacing: .02em;
}

.rsvp input[type=text] {
  width: 100%;
  height: 40px;
  border: 1px solid var(--sage);
  border-radius: 8px;
  background: #fff;
  padding: 0 12px;
  font: inherit;
  font-size: .85rem;
  color: var(--ink);
  transition: border-color .2s;
}

.rsvp input[type=text]:focus {
  border-color: var(--sage-dark);
  outline: none;
  box-shadow: 0 0 0 3px rgba(142, 154, 119, .2);
}

.rsvp fieldset {
  border: 0;
  padding: 0;
  margin: 0;
}

.opt {
  display: block;
  position: relative;
  margin-bottom: 8px;
}

.opt input {
  position: absolute;
  opacity: 0;
}

.opt span {
  display: block;
  background: rgba(222, 222, 218, .85);
  padding: 12px 14px;
  font-family: var(--serif);
  font-size: .95rem;
  cursor: pointer;
  border-radius: 6px;
  transition: background .15s, color .15s;
  text-align: center;
}

.opt input:checked+span {
  background: var(--sage);
  color: #fff;
}

.opt input:focus-visible+span {
  outline: 2px solid var(--moss);
  outline-offset: 2px;
}

/* Grid para las opciones numéricas */
.personas-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.personas-grid .opt {
  margin-bottom: 0;
}

.personas-grid .opt span {
  padding: 10px 0;
  text-align: center;
  font-size: 1rem;
  font-weight: 500;
}

.rsvp .send {
  width: 100%;
  margin-top: 16px;
  padding: 14px;
  border: 0;
  border-radius: 22px;
  background: var(--sage);
  color: #fff;
  font-family: var(--serif);
  font-size: 1.05rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .2s;
}

.rsvp .send:hover {
  background: #6d7a56;
}

.rsvp .note {
  display: block;
  text-align: center;
  font-size: .58rem;
  margin-top: 12px;
  color: #777;
}

.rsvp .err {
  color: #9b2c2c;
  font-size: .75rem;
  margin-top: 8px;
  display: none;
}

/* ---------- Pie ---------- */
.capa--fondo footer {
  margin-top: 20px;
  height: 96px;
  background: var(--sage);
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  padding-bottom: env(safe-area-inset-bottom);
}

.capa--fondo footer a {
  position: relative;
  z-index: 2;
  color: #fff;
  font-family: var(--serif);
  letter-spacing: .1em;
  font-size: .8rem;
  text-transform: uppercase;
  text-decoration: none;
}

.capa--fondo footer::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .3;
  background: repeating-linear-gradient(115deg, rgba(255, 255, 255, .18) 0 2px, transparent 2px 22px),
    repeating-linear-gradient(65deg, rgba(0, 0, 0, .12) 0 2px, transparent 2px 26px);
}

/* ---------- Ajustes para pantallas grandes ---------- */
@media (min-width:700px) {
  .wrap {
    max-width: 460px;
  }

  .music {
    top: 20px;
    right: 20px;
  }
}

@media (prefers-reduced-motion:reduce) {
  .opt span {
    transition: none;
  }

  .btn {
    transition: none;
  }
}

/* ---------- Flores decorativas (PNG img/flores1-5.png y img/rosas.png) ----------
   Cada racimo es un contenedor absoluto dentro de su tarjeta; el tamaño y la
   posición de cada flor van en variables inline (--l izquierda, --t arriba,
   --w ancho, --h alto, --r giro) en porcentaje del racimo. */
.flores {
  position: absolute;
  z-index: 8;
  pointer-events: none;
  filter: drop-shadow(0 2px 3px rgba(40, 44, 30, .22));
}

.flores img {
  position: absolute;
  display: block;
  max-width: none;
  left: var(--l, 0);
  top: var(--t, 0);
  width: var(--w, auto);
  height: var(--h, auto);
  transform: rotate(var(--r, 0deg));
  transform-origin: var(--o, center);
  -webkit-user-drag: none;
  user-select: none;
}

/* Medidas en cqw (ancho de la tarjeta) para que 'top' no dependa de su alto */
/* Arriba del arco de Recepción, cayendo sobre el borde de Ceremonia */
.flores--recepcion {
  left: -10cqw;
  top: -11cqw;
  width: 68cqw;
  aspect-ratio: 1.4/1;
}

/* Esquina superior derecha de Regalos */
.flores--regalos {
  right: 0;
  top: -28cqw;
  width: 36cqw;
  aspect-ratio: .62/1;
}

/* Esquina superior izquierda de Información adicional */
.flores--info {
  left: -9cqw;
  top: -18cqw;
  width: 60cqw;
  aspect-ratio: 1.3/1;
}