/* ===== Tipografías (descargadas de Google Fonts, licencia OFL; ver fuentes/OFL-*.txt) ===== */
@font-face {
  font-family: "Cormorant Garamond";
  src: url("../fuentes/cormorant-garamond.woff2") format("woff2");
  font-weight: 300 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Cormorant Garamond";
  src: url("../fuentes/cormorant-garamond-cursiva.woff2") format("woff2");
  font-weight: 300 700; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "EB Garamond";
  src: url("../fuentes/eb-garamond.woff2") format("woff2");
  font-weight: 400 800; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "EB Garamond";
  src: url("../fuentes/eb-garamond-cursiva.woff2") format("woff2");
  font-weight: 400 800; font-style: italic; font-display: swap;
}

/* ===== Colores medidos en el save the date (tema/STD.jpg) ===== */
:root {
  --crema: #faf5f2;        /* fondo: rgb(250,245,242) */
  --tinta: #1e1f14;        /* letras oscuras: rgb(30,31,20) */
  --texto: #3a3c2e;
  --texto-suave: #6b6c5c;
  --oro: #ad915c;          /* dorado: rgb(173,145,92) */
  --oro-suave: rgba(173, 145, 92, .35);
  --titulos: "Cormorant Garamond", "EB Garamond", Georgia, serif;
  --cuerpo: "EB Garamond", Georgia, serif;

  /* Casas de Cuenca fijas abajo: ancho limitado por pantalla, 1035 px o 96vh (para que no pasen del ~30% del alto).
     0.3179 = 329/1035, proporción de la imagen recortada */
  --ancho-cuenca: min(100vw, 1035px, 96vh);
  --alto-cuenca: calc(var(--ancho-cuenca) * 0.3179);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--crema);
  color: var(--texto);
  font-family: var(--cuerpo);
  font-size: 1.125rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--titulos); color: var(--tinta); font-weight: 500; line-height: 1.1; margin: 0; }
p { margin: 0 0 .6em; }
a { color: var(--tinta); }

/* ===== Cabecera con pestañas ===== */
.cabecera {
  position: sticky; top: 0; z-index: 20;
  background: var(--crema);
  border-bottom: 1px solid var(--oro-suave);
  padding-top: env(safe-area-inset-top);
}
.pestanas {
  display: flex; gap: .25rem;
  justify-content: center;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  padding: 0 .75rem;
}
.pestanas::-webkit-scrollbar { display: none; }
.pestanas a {
  flex: none;
  scroll-snap-align: center;
  padding: .9rem .8rem .75rem;
  font-family: var(--titulos);
  font-size: 1.05rem; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--texto-suave);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color .3s, border-color .3s;
}
.pestanas a[aria-current="page"] { color: var(--tinta); border-bottom-color: var(--oro); }
@media (max-width: 720px) {
  .pestanas {
    justify-content: flex-start;
    -webkit-mask-image: linear-gradient(to right, #000 85%, transparent);
            mask-image: linear-gradient(to right, #000 85%, transparent);
  }
  .pestanas a { font-size: .95rem; padding: .85rem .6rem .7rem; }
}

/* ===== Contenido ===== */
main {
  max-width: 46rem;
  margin: 0 auto;
  padding: 2.5rem 1.25rem calc(var(--alto-cuenca) * 0.85 + 1.5rem);
  text-align: center;
}
.seccion { padding-bottom: 2rem; }
.con-js .seccion.entrando { animation: aparecer .7s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes aparecer {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}
.sin-js .seccion + .seccion { border-top: 1px solid var(--oro-suave); padding-top: 3rem; }

.antetitulo {
  font-family: var(--titulos); font-weight: 500;
  font-size: 1.15rem; letter-spacing: .28em; text-transform: uppercase;
  color: var(--tinta); margin: .4rem 0 .3rem;
}
h2 { font-size: clamp(2.6rem, 9vw, 3.6rem); }
h3 { font-size: 1.7rem; margin-bottom: .3rem; }

.separador { display: flex; align-items: center; justify-content: center; gap: .6rem; margin: .9rem auto 2rem; max-width: 22rem; }
.separador span { flex: 1; height: 1px; background: var(--tinta); opacity: .55; }
.corazon-mini { width: 14px; height: 13px; color: var(--oro); display: block; margin: 0 auto; flex: none; }

.etiqueta { font-family: var(--titulos); font-weight: 600; letter-spacing: .22em; text-transform: uppercase; font-size: .9rem; color: var(--oro); margin-bottom: .2rem; }
.hora { font-family: var(--titulos); font-size: 1.5rem; color: var(--tinta); margin-bottom: .2rem; }

/* ===== Portada ===== */
.portada { margin-top: -1.25rem; } /* menos hueco entre la barra de pestañas y la rama */
.rama img { width: min(63vw, 306px); height: auto; display: block; margin: 0 auto .9rem; }
.rayita { display: block; width: 2.2rem; height: 1px; background: var(--oro); margin: .2rem auto .5rem; }
.nombres { display: flex; flex-direction: column; align-items: center; font-size: clamp(4.2rem, 19vw, 7rem); line-height: .95; font-weight: 500; margin: .4rem 0 .2rem; }
.nombres .y { color: var(--oro); font-style: italic; font-size: .55em; line-height: 1.2; }
.ramita img { width: 64px; height: auto; display: block; margin: .3rem auto .8rem; }
.fecha { display: flex; align-items: center; justify-content: center; gap: 1rem; font-family: var(--titulos); font-weight: 500; font-size: clamp(1.2rem, 5vw, 1.6rem); letter-spacing: .18em; text-transform: uppercase; color: var(--tinta); margin-bottom: .1rem; }
.fecha .raya { width: 1.6rem; height: 1px; background: var(--oro); }
.ciudad { font-family: var(--titulos); font-weight: 500; font-size: 1.5rem; letter-spacing: .3em; text-transform: uppercase; color: var(--tinta); margin: 0 0 2.2rem; }

/* entrada escalonada de la portada */
.con-js .portada.entrando > * { animation: aparecer .9s cubic-bezier(.2, .7, .2, 1) both; }
.con-js .portada.entrando { animation: none; }
.con-js .portada.entrando > :nth-child(2)  { animation-delay: .05s; }
.con-js .portada.entrando > :nth-child(3)  { animation-delay: .12s; }
.con-js .portada.entrando > :nth-child(4)  { animation-delay: .18s; }
.con-js .portada.entrando > :nth-child(5)  { animation-delay: .26s; }
.con-js .portada.entrando > :nth-child(6)  { animation-delay: .34s; }
.con-js .portada.entrando > :nth-child(7)  { animation-delay: .40s; }
.con-js .portada.entrando > :nth-child(8)  { animation-delay: .46s; }
.con-js .portada.entrando > :nth-child(9)  { animation-delay: .52s; }
.con-js .portada.entrando > :nth-child(n+10) { animation-delay: .6s; }

.resumen {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; align-items: start;
  border: 1px solid var(--oro-suave); border-radius: 999px;
  padding: 1.1rem 1.5rem; margin: 0 auto 2.2rem; max-width: 34rem;
}
.resumen p { margin: 0; }
.resumen .hora { font-size: 1.3rem; }
.resumen-linea { width: 1px; align-self: stretch; background: var(--oro-suave); }
@media (max-width: 480px) {
  .resumen { grid-template-columns: 1fr; border-radius: 1.5rem; }
  .resumen-linea { width: 40%; height: 1px; justify-self: center; }
}

.cuenta-atras { margin-bottom: 2rem; }
.cifras { display: flex; justify-content: center; gap: clamp(.6rem, 4vw, 1.8rem); }
.cifras div { display: flex; flex-direction: column; align-items: center; min-width: 3.6rem; }
.cifras span { font-family: var(--titulos); font-size: clamp(2.2rem, 9vw, 3rem); font-weight: 500; color: var(--tinta); line-height: 1; font-variant-numeric: lining-nums tabular-nums; }
.cifras small { font-size: .85rem; letter-spacing: .12em; text-transform: uppercase; color: var(--texto-suave); margin-top: .35rem; }

/* ===== Botones ===== */
.boton {
  display: inline-block; cursor: pointer;
  font-family: var(--titulos); font-weight: 600; font-size: 1rem;
  letter-spacing: .18em; text-transform: uppercase; text-decoration: none;
  color: var(--tinta); background: transparent;
  border: 1px solid var(--tinta); border-radius: 999px;
  padding: .7rem 1.5rem;
  transition: background .25s, color .25s;
}
.boton:hover, .boton:focus-visible { background: var(--tinta); color: var(--crema); }

/* cerrado queda por detrás de las casas de Cuenca (z-index 5); abierto, por delante para que se vea el menú */
.calendario { position: relative; display: inline-block; }
.calendario[open] { z-index: 10; }
.calendario summary { list-style: none; }
.calendario summary::-webkit-details-marker { display: none; }
.calendario-menu {
  position: absolute; left: 50%; transform: translateX(-50%); top: calc(100% + .5rem);
  background: var(--crema); border: 1px solid var(--oro-suave); border-radius: 1rem;
  box-shadow: 0 10px 30px rgba(30, 31, 20, .12);
  padding: .4rem; min-width: 15rem;
  display: flex; flex-direction: column;
  animation: aparecer .3s ease both;
}
.calendario-menu a { padding: .7rem 1rem; text-decoration: none; border-radius: .6rem; }
.calendario-menu a:hover { background: rgba(173, 145, 92, .12); }

/* ===== El día ===== */
.programa { list-style: none; margin: 0 auto; padding: 0; max-width: 30rem; position: relative; }
.programa::before { content: ""; position: absolute; left: 50%; top: .5rem; bottom: .5rem; width: 1px; background: var(--oro-suave); }
.programa li { position: relative; background: var(--crema); padding: .8rem 0 1.6rem; }
.programa li::before {
  content: ""; display: block; width: 9px; height: 9px; margin: 0 auto .7rem;
  border-radius: 50%; background: var(--oro); box-shadow: 0 0 0 6px var(--crema);
}

/* ===== Cómo llegar ===== */
.sitios { display: grid; gap: 2.5rem; margin-bottom: 2.5rem; }
@media (min-width: 860px) {
  main:has([data-pestana="como-llegar"]:not([hidden])) { max-width: 60rem; }
  .sitios { grid-template-columns: 1fr 1fr; gap: 2rem; }
}
.sitio { text-align: center; }
.direccion { color: var(--texto-suave); }
.foto-hueco, .formulario-hueco {
  display: grid; place-items: center;
  aspect-ratio: 4 / 3; margin-bottom: 1.2rem; padding: 1rem;
  border-radius: .5rem; font-style: italic;
}
.formulario-hueco { aspect-ratio: auto; min-height: 16rem; margin-top: 1.5rem; }
.mapa { display: block; width: 100%; height: 230px; border: 1px solid var(--oro-suave); border-radius: .5rem; margin: 1rem 0; background: #eee9e3; }
.botones { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; }
.botones .boton { font-size: .9rem; padding: .6rem 1.1rem; }

.bloque { border-top: 1px solid var(--oro-suave); padding: 1.6rem 0 .6rem; }
.intro { max-width: 34rem; margin: 0 auto 1.5rem; }

/* ===== Pie ===== */
.pie { padding: 1.5rem 0 0; font-family: var(--titulos); color: var(--tinta); }
.pie p { margin: 0; font-size: 1.4rem; }
.pie .y { color: var(--oro); font-style: italic; }
.pie-fecha { letter-spacing: .3em; font-size: 1rem !important; color: var(--texto-suave); }

/* ===== Casas de Cuenca fijas abajo; el contenido pasa por detrás ===== */
.cuenca {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  display: flex; justify-content: center;
  pointer-events: none;
}
.cuenca-niebla {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: calc(var(--alto-cuenca) * 0.8);
  background: linear-gradient(to bottom, rgba(250, 245, 242, 0), var(--crema) 55%);
}
.cuenca picture { position: relative; }
.cuenca img {
  display: block; width: var(--ancho-cuenca); height: auto;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 7%, #000 93%, transparent);
          mask-image: linear-gradient(to right, transparent, #000 7%, #000 93%, transparent);
}
@media (max-width: 1035px) and (max-aspect-ratio: 1/1) {
  /* en móvil en vertical ocupa todo el ancho: sin difuminar los lados */
  .cuenca img { -webkit-mask-image: none; mask-image: none; }
}

/* ===== Marcas de contenido pendiente (quitar antes de enviar la web) ===== */
.pendiente {
  outline: 1px dashed var(--oro);
  outline-offset: 2px;
  background: rgba(173, 145, 92, .10);
  border-radius: 3px;
  font-style: italic;
  color: #7a6337;
}
span.pendiente { padding: 0 .25em; font-size: .85em; font-family: var(--cuerpo); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
