/* =============================================================
   Espacio San Carlos
   1. Fuentes y tokens · 2. Base · 3. Tipografía · 4. Botones
   5. Hero · 6. Secciones · 7. Fotos · 8. Formulario · 9. Mapa
   10. Fijos (teléfono, CTA flotante) · 11. Movimiento · 12. Responsive
   ============================================================= */

/* 1. Fuentes y tokens ------------------------------------------ */
@font-face {
  font-family: "Cormorant Garamond";
  src: url("fuentes/cormorant-garamond.woff2") format("woff2");
  font-weight: 400 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Jost";
  src: url("fuentes/jost.woff2") format("woff2");
  font-weight: 400 500;
  font-style: normal;
  font-display: swap;
}

/* Letter-spacing animable (títulos de sección) */
@property --ls {
  syntax: "<length>";
  inherits: false;
  initial-value: 0px;
}

:root {
  /* Paleta sacada de las fotos */
  --wood: #1b1410;        /* madera del techo, en sombra */
  --wood-mid: #6b5140;    /* madera clara: texto secundario sobre hueso */
  --gold: #d6ae68;        /* luces de guirnalda */
  --green: #162019;       /* pared verde y parque de noche */
  --bone: #efe9df;        /* manteles y almohadones */
  --ink: #2a1f17;

  --serif: "Cormorant Garamond", Garamond, "Times New Roman", serif;
  --sans: "Jost", "Futura", "Century Gothic", "Helvetica Neue", Arial, sans-serif;

  --track-title: 0.18em;
  --track-label: 0.28em;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);

  --gutter: clamp(1.5rem, 7vw, 8rem);
  --space: clamp(7rem, 15vw, 13rem);
}

/* 2. Base ------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }
body {
  background: var(--bone);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
a[href^="tel:"] { white-space: nowrap; }
ul { list-style: none; }
p { text-wrap: pretty; }
::selection { background: var(--gold); color: var(--wood); }

:focus-visible { outline: 2px solid var(--focus, var(--gold)); outline-offset: 5px; }

.skip {
  position: fixed; top: 1rem; left: 1rem; z-index: 100;
  padding: 0.9rem 1.2rem;
  background: var(--wood); color: var(--bone);
  font-family: var(--sans); font-size: 0.75rem; letter-spacing: 0.2em; text-transform: uppercase;
  translate: 0 -200%;
}
.skip:focus { translate: 0 0; }

.sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

/* 3. Tipografía -------------------------------------------------- */
.label {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.9;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
}

.title {
  --ls: var(--track-title);
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.1rem, 4.8vw, 3.8rem);
  line-height: 1.15;
  letter-spacing: var(--ls);
  text-transform: uppercase;
  text-wrap: balance;
}

/* 4. Botones ----------------------------------------------------- */
.btn {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.5rem;
  padding: 1.2rem 2.6rem 1.2rem calc(2.6rem + var(--track-label));
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--btn-fg, var(--bone));
  background: transparent;
  border: 1px solid var(--btn-line, var(--bone));
  border-radius: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color 240ms ease, border-color 240ms ease, transform 140ms var(--ease-out);
}
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--gold);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 280ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .btn:hover { color: var(--wood); border-color: var(--gold); }
  .btn:hover::before { transform: scaleY(1); }
}
.btn:focus-visible { color: var(--wood); border-color: var(--gold); }
.btn:focus-visible::before { transform: scaleY(1); }
.btn:active { color: var(--wood); border-color: var(--gold); transform: scale(0.97); }
.btn:active::before { transform: scaleY(1); transition-duration: 120ms; }

.text-link {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.7em;
  transition: color 200ms ease;
}
@media (hover: hover) and (pointer: fine) {
  .tone-dark .text-link:hover, .tone-green .text-link:hover { color: var(--gold); }
  .tone-light .text-link:hover { color: var(--wood-mid); }
}

/* 5. Hero -------------------------------------------------------- */
.hero {
  position: relative;
  display: grid;
  place-items: center;
  height: 100vh;
  height: 100svh;
  min-height: 34rem;
  overflow: hidden;
  background: var(--wood);
  color: var(--bone);
  text-align: center;
  --focus: var(--gold);
}
.hero-media { position: absolute; inset: 0; overflow: hidden; }

/* La foto trae una franja negra arriba (28px) y abajo (6px): el marco la deja afuera
   y cubre toda la pantalla con la proporción real del contenido (680 × 455). */
.hero-frame {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 100%;
  width: max(100%, 100vh * 1.4945, 34rem * 1.4945);
  width: max(100%, 100svh * 1.4945, 34rem * 1.4945);
  aspect-ratio: 680 / 455;
  overflow: hidden;
  transform: translate(-50%, -50%);
  animation: hero-zoom 8s cubic-bezier(0.33, 1, 0.68, 1) both;
}
.hero-frame img {
  position: absolute;
  left: 0;
  top: -6.154%;
  width: 100%;
  max-width: none;
  height: 107.473%;
}
.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 75% 55% at 50% 52%, rgba(18, 12, 9, 0.5), rgba(18, 12, 9, 0) 75%),
    linear-gradient(180deg, rgba(18, 12, 9, 0.62) 0%, rgba(18, 12, 9, 0.42) 42%, rgba(18, 12, 9, 0.8) 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 80rem;
  padding: 6rem clamp(1.5rem, 5vw, 4rem);
}
.hero-rating {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  padding-left: 0.14em;
  color: rgba(239, 233, 223, 0.92);
}
.hero-label { margin-top: 2rem; padding-left: var(--track-label); color: var(--gold); }
.hero-title {
  margin-top: 1.5rem;
  font-family: var(--serif);
  font-size: clamp(1.7rem, 9vw, 6.2rem);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: 0.2em;
  padding-left: 0.2em;
  text-transform: uppercase;
  text-wrap: balance;
}
.hero-title .line { display: block; white-space: nowrap; }
.hero-sub {
  margin-top: 1.5rem;
  font-family: var(--serif);
  font-size: clamp(1.3rem, 2.9vw, 2.4rem);
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: 0.22em;
  padding-left: 0.22em;
  text-transform: uppercase;
  text-wrap: balance;
}
.hero-btn { margin-top: 3.25rem; --btn-fg: var(--bone); --btn-line: rgba(239, 233, 223, 0.8); }

/* 6. Secciones --------------------------------------------------- */
.section { padding-block: var(--space); padding-inline: var(--gutter); }

.tone-light {
  background: var(--bone); color: var(--ink);
  --btn-fg: var(--ink); --btn-line: var(--ink); --muted: var(--wood-mid); --focus: var(--wood-mid);
}
.tone-dark, .tone-green {
  color: var(--bone);
  --btn-fg: var(--bone); --btn-line: rgba(239, 233, 223, 0.75); --muted: var(--gold); --focus: var(--gold);
}
.tone-dark { background: var(--wood); }
.tone-green { background: var(--green); }

.intro { max-width: 38rem; margin-inline: auto; text-align: center; }
.intro .label { color: var(--muted); padding-left: var(--track-label); }
.intro .title { margin-top: 1.5rem; padding-left: var(--ls); }
.intro > p:not(.label) { margin-top: 2.25rem; }
.intro > p:not(.label) + p:not(.label) { margin-top: 1.1rem; }
.tone-dark .intro > p:not(.label), .tone-green .intro > p:not(.label) { color: rgba(239, 233, 223, 0.88); }

.intro--left { text-align: left; margin-inline: 0; }
.intro--left .label, .intro--left .title { padding-left: 0; }

.intro--quiet { max-width: 34rem; }
.lead { font-size: clamp(1.4rem, 2.4vw, 1.75rem); line-height: 1.5; }

.cta { margin-top: clamp(5rem, 10vw, 9rem); text-align: center; }

/* Bodas */
.pair {
  display: grid;
  gap: clamp(4rem, 8vw, 7rem);
  max-width: 72rem;
  margin: clamp(4rem, 10vw, 9rem) auto 0;
}
.pair .fig--low { width: 78%; margin-left: auto; }

/* Empresas */
.formats { display: grid; gap: 3rem; max-width: 60rem; margin: clamp(4.5rem, 9vw, 7.5rem) auto 0; }
.formats li { max-width: 24rem; }
.formats .label { color: var(--gold); }
.formats p { margin-top: 0.5rem; color: rgba(239, 233, 223, 0.86); }

/* Fiestas de 15 */
.side { display: grid; gap: clamp(3.5rem, 7vw, 6rem); max-width: 76rem; margin-inline: auto; align-items: center; }

/* Reseñas */
.reviews {
  display: grid;
  gap: clamp(4rem, 6vw, 5rem);
  max-width: 76rem;
  margin: clamp(4rem, 9vw, 7rem) auto 0;
  text-align: center;
}
.review { max-width: 30rem; margin-inline: auto; }
.stars { color: var(--gold); font-family: var(--sans); font-size: 0.8rem; letter-spacing: 0.3em; padding-left: 0.3em; }
.review blockquote { margin-top: 1.5rem; font-size: 1.3rem; line-height: 1.6; }
.review figcaption { margin-top: 1.5rem; padding-left: var(--track-label); color: rgba(239, 233, 223, 0.72); }
.more { margin-top: clamp(4rem, 8vw, 6rem); text-align: center; padding-left: var(--track-label); }

/* Footer */
.footer {
  padding: clamp(6rem, 12vw, 9rem) var(--gutter) clamp(7rem, 10vw, 5rem);
  text-align: center;
}
.footer-brand {
  font-size: clamp(1.5rem, 3vw, 2rem);
  letter-spacing: 0.24em;
  padding-left: 0.24em;
  text-transform: uppercase;
}
.footer .label { margin-top: 0.75rem; padding-left: var(--track-label); color: var(--gold); }
.footer-small {
  margin-top: 3rem;
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: rgba(239, 233, 223, 0.72);
}
.footer-small + .footer-small { margin-top: 0.5rem; }
.footer-credit {
  margin-top: 3.5rem;
  font-family: var(--sans);
  font-size: 0.62rem;
  font-weight: 400;
  line-height: 1.8;
  letter-spacing: 0.24em;
  padding-left: 0.24em;
  text-transform: uppercase;
}
.footer-credit a { color: rgba(239, 233, 223, 0.5); transition: color 200ms ease; }
@media (hover: hover) and (pointer: fine) {
  .footer-credit a:hover { color: rgba(239, 233, 223, 0.82); }
}

/* Página de gracias */
.thanks { min-height: 100vh; min-height: 100svh; display: grid; place-items: center; background: var(--wood); }
.thanks-main { max-width: 34rem; padding: 6rem var(--gutter); text-align: center; }
.thanks-main .label { color: var(--gold); padding-left: var(--track-label); }
.thanks-main .title { margin-top: 1.5rem; padding-left: var(--ls); }
.thanks-main > p:not(.label) { margin-top: 2rem; color: rgba(239, 233, 223, 0.88); }
.thanks-alt a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.25em; }
.thanks-main .btn { margin-top: 3rem; }

/* 7. Fotos ------------------------------------------------------- */
.fig figcaption {
  margin-top: 1.1rem;
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--muted);
}
.fig--wide { max-width: 86rem; margin: clamp(4.5rem, 10vw, 8.5rem) auto 0; }

.ph { position: relative; overflow: hidden; background: rgba(107, 81, 64, 0.16); }
.ph img { width: 100%; height: 100%; object-fit: cover; }
.ph--wide { aspect-ratio: 16 / 9; }
.ph--land { aspect-ratio: 3 / 2; }
.ph--tall { aspect-ratio: 4 / 5; }
.ph--square { aspect-ratio: 1 / 1; }

.ph--ceremonia img { object-position: 50% 60%; }
.ph--novios img { object-position: 52% 50%; }
.ph--brindis img { object-position: 43% 50%; }
.ph--lounge img { object-position: 50% 30%; }
.ph--mesa img { object-position: 55% 50%; }
.ph--postres img { object-position: 50% 60%; }
.ph--exterior img { object-position: 50% 45%; }
.ph--fiesta img { object-position: 50% 45%; }

/* Parallax: la foto tiene un 10% de margen para desplazarse sin mostrar bordes */
.ph.has-parallax img { position: absolute; left: 0; top: -5%; height: 110%; will-change: transform; }

/* Foto que falta: se ve el nombre del archivo, no un ícono roto */
[data-file].is-missing img { visibility: hidden; }
[data-file].is-missing::before {
  content: "imagenes/" attr(data-file);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-align: center;
  color: var(--muted, var(--gold));
  border: 1px solid currentColor;
}
.hero-media.is-missing::before { place-items: end center; padding-bottom: 2rem; border: 0; z-index: 1; }

/* 8. Formulario -------------------------------------------------- */
.form {
  display: grid;
  gap: 2.5rem clamp(2rem, 5vw, 4.5rem);
  max-width: 52rem;
  margin: clamp(4rem, 9vw, 6.5rem) auto 0;
}
.field { display: flex; flex-direction: column; }
.field label {
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--wood-mid);
}
.field input, .field select {
  width: 100%;
  min-height: 3.25rem;
  margin-top: 0.35rem;
  padding: 0.5rem 0;
  font: 500 1.3rem/1.3 var(--serif);
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(42, 31, 23, 0.5);
  border-radius: 0;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 200ms ease;
}
.field select {
  padding-right: 2rem;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%232a1f17' stroke-width='1'/%3E%3C/svg%3E") no-repeat right 0.2rem center;
}
.field select:invalid { color: rgba(42, 31, 23, 0.62); }
.field input::-webkit-date-and-time-value { text-align: left; }
.field input:hover, .field select:hover { border-bottom-color: var(--ink); }
.field input:focus, .field select:focus { border-bottom-color: var(--ink); outline: none; }
.field input:focus-visible, .field select:focus-visible { outline: 2px solid var(--wood-mid); outline-offset: 4px; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-foot { display: flex; flex-direction: column; align-items: center; gap: 2rem; margin-top: 1.5rem; text-align: center; }
.form-alt { font-size: 1.15rem; color: var(--wood-mid); }
.form-alt a { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.25em; }

/* 9. Mapa -------------------------------------------------------- */
.visit {
  display: grid;
  gap: clamp(3.5rem, 6vw, 6rem);
  max-width: 72rem;
  margin: clamp(4rem, 9vw, 6.5rem) auto 0;
  align-items: center;
}
.map { aspect-ratio: 4 / 3; background: rgba(239, 233, 223, 0.06); }
.map iframe { display: block; width: 100%; height: 100%; border: 0; border-radius: 0; filter: grayscale(1) contrast(0.92); }
.visit-info dt { color: var(--gold); }
.visit-info dd { margin-top: 0.4rem; font-size: 1.4rem; line-height: 1.45; }
.visit-info dd + dt { margin-top: 2.25rem; }
.visit-info dd a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.25em; }
.visit-info > p { margin-top: 2.75rem; }
.visit-info .btn { margin-top: 3rem; }

/* 10. Fijos ------------------------------------------------------ */
.rail { display: none; }

.float-cta {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 50;
  padding: 1.05rem 1.3rem 1.05rem calc(1.3rem + 0.26em);
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--bone);
  background: var(--wood);
  border: 1px solid var(--gold);
  -webkit-tap-highlight-color: transparent;
  opacity: 0;
  visibility: hidden;
  translate: 0 0.5rem;
  transition: opacity 240ms var(--ease-out), translate 240ms var(--ease-out), transform 140ms var(--ease-out), visibility 0s linear 240ms;
}
.float-cta.is-on { opacity: 1; visibility: visible; translate: 0 0; transition-delay: 0s; }
.float-cta:active { transform: scale(0.97); }

/* 11. Movimiento -------------------------------------------------- */
@keyframes hero-zoom {
  from { transform: translate(-50%, -50%) scale(1.08); }
  to { transform: translate(-50%, -50%) scale(1); }
}
@keyframes hero-in {
  from { opacity: 0; translate: 0 14px; }
  to { opacity: 1; translate: 0 0; }
}
.hero-content > * { animation: hero-in 1000ms var(--ease-out) both; }
.hero-content > :nth-child(1) { animation-delay: 700ms; }
.hero-content > :nth-child(2) { animation-delay: 830ms; }
.hero-content > :nth-child(3) { animation-delay: 960ms; }
.hero-content > :nth-child(4) { animation-delay: 1090ms; }
.hero-content > :nth-child(5) { animation-delay: 1220ms; }

/* Fotos: revelado de abajo hacia arriba (solo las que JS deja pendientes, debajo del pliegue) */
.ph[data-reveal="pending"] { clip-path: inset(100% 0 0 0); }
.ph[data-reveal="in"] { clip-path: inset(0 0 0 0); transition: clip-path 1300ms var(--ease-out); }

/* Títulos: fade corto con el espaciado cerrándose */
.title[data-reveal="pending"] { opacity: 0; --ls: calc(var(--track-title) + 0.06em); }
.title[data-reveal="in"] { opacity: 1; transition: opacity 700ms ease-out, --ls 1000ms var(--ease-out); }

/* 12. Responsive -------------------------------------------------- */
@media (min-width: 720px) {
  .pair { grid-template-columns: 7fr 5fr; align-items: start; }
  .pair .fig--low { width: auto; margin-top: clamp(8rem, 18vw, 16rem); }
  .formats { grid-template-columns: 1fr 1fr; gap: 3.5rem clamp(3rem, 7vw, 6rem); }
  .form { grid-template-columns: 1fr 1fr; }
  .form-foot { grid-column: 1 / -1; }
}

@media (min-width: 960px) {
  .side { grid-template-columns: 7fr 4fr; }
  .visit { grid-template-columns: 7fr 5fr; }
  .footer { padding-bottom: clamp(5rem, 8vw, 7rem); }

  .rail {
    display: block;
    position: fixed;
    top: 50%;
    z-index: 40;
    padding: 1rem 0.5rem;
    writing-mode: vertical-rl;
    font-family: var(--sans);
    font-size: 0.66rem;
    font-weight: 500;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--bone);
    opacity: 0.85;
    visibility: visible;
    transition: opacity 240ms ease, visibility 0s linear 0s;
  }
  html[data-rail-hidden] .rail {
    opacity: 0;
    visibility: hidden;
    transition: opacity 240ms ease, visibility 0s linear 240ms;
  }
  .rail--tel { left: clamp(0.75rem, 1.6vw, 2rem); transform: translateY(-50%) rotate(180deg); }
  .rail--cta { right: clamp(0.75rem, 1.6vw, 2rem); transform: translateY(-50%); }
  html[data-rail="light"] .rail { color: var(--ink); }
  .rail:focus-visible { opacity: 1; outline-color: var(--gold); }
  .float-cta { display: none; }
}
@media (min-width: 1280px) {
  .reviews { grid-template-columns: repeat(3, 1fr); gap: clamp(4rem, 5vw, 6rem); }
}
@media (min-width: 960px) and (hover: hover) and (pointer: fine) {
  .rail:hover { opacity: 1; }
}

/* Movimiento reducido: la página queda completa, sin desplazamientos */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-frame { animation: none; transform: translate(-50%, -50%); }
  .hero-content > * { animation: none; }
  .btn, .float-cta { transition: color 200ms ease, border-color 200ms ease, opacity 200ms ease, visibility 0s linear 200ms; }
  .btn::before { transform: none; opacity: 0; transition: opacity 200ms ease; }
  .btn:hover::before, .btn:focus-visible::before, .btn:active::before { transform: none; opacity: 1; }
  .btn:active, .float-cta:active { transform: none; }
  .float-cta { translate: 0 0; }
  .float-cta.is-on { transition-delay: 0s; }
}
