/* public/css/styles.css */
@font-face {
  font-family: 'wingman';
  src: url('/fonts/TAYWingman.woff2') format('woff2');
  font-weight: 400 700; /* quita esta línea si el archivo no es variable, y pon un peso fijo */
  font-display: swap;
}
/* public/css/styles.css */

:root {
  /* Colores muestreados directamente de las capturas de diseno */
  --color-bg: #337453;
  --color-bg-soft: #2c6548;
  --color-accent: #f5c8c2;
  --color-accent-soft: #eeb7af;
  --color-text: #f5efe4;
  --color-text-muted: #cfe2d6;
  --color-on-accent: #2c6548;

  --font-mono: 'wingman', 'Courier New', monospace;
  --font-script: 'Caveat', cursive;
  --font-display: 'Anton', sans-serif;

  --container: 1180px;
  --gap: clamp(1.5rem, 4vw, 4rem);
  --header-height: 84px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-mono);
  line-height: 1.5;
  min-height: 100vh;
}

/* Texto justificado en todos los parrafos. "hyphens: auto" ayuda a que
   el espaciado entre palabras no quede tan irregular en columnas
   estrechas de movil -- el navegador ya sabe partir en español porque
   <html lang="es"> esta puesto. Una linea suelta (o la ultima linea de
   un parrafo) nunca se estira con justify, asi que esto no afecta a
   textos cortos de una sola linea (botones, avisos breves, etc.). */
p {
  text-align: justify;
  hyphens: none; /* desactivado por defecto, para que no se partan palabras en desktop */
}

/* Estos son mas "titulares cortos" a proposito (centrados, pensados
   para leerse de un vistazo) que parrafos de cuerpo -- se quedan como
   estaban, no justificados. */
.hero-copy,
.hero-meta,
.closing-script {
  text-align: center;
  letter-spacing: -0.3px;
}

a {
  color: inherit;
}

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

button {
  font-family: inherit;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 3rem);
  /* relative + z-index: 1 para quedar POR DELANTE de .sticker-field
     (ver mas abajo), que vive detras a z-index: 0 dentro de .section. */
  position: relative;
  z-index: 1;
}

/* ---------- Modo RSVP embebido en index.html (public/index.html) ----------
   Activado por el script del <head> cuando la URL trae ?code=. Selectores
   con "html.mode-rsvp" de proposito, para ganar por especificidad a las
   reglas base sin importar donde caigan en el fichero. */

.rsvp-page.rsvp-embed {
  display: none;
}

html.mode-rsvp .site-header,
html.mode-rsvp main,
html.mode-rsvp .site-footer,
html.mode-rsvp .brand-mark-floating {
  display: none;
}

html.mode-rsvp .rsvp-page.rsvp-embed {
  display: flex;
}

/* ---------- Header / nav ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-height);
  padding: 1.25rem clamp(1.25rem, 4vw, 3rem);
  background: var(--color-bg);
}

.brand-mark {
  display: inline-block;
  line-height: 0; /* que la imagen no arrastre hueco extra de linea */
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}

.brand-mark img {
  height: 50px;
  width: auto;
  display: block;
}

/* Al entrar, el logo vive arriba a la izquierda (cabecera). En cuanto se
   baja del hero, este se desvanece y aparece el flotante de abajo. */
body.is-scrolled .brand-mark {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  pointer-events: none;
}

/* Mismo logo que .brand-mark, pero fijo abajo a la izquierda: hace de
   boton "volver arriba" una vez se ha hecho scroll mas alla del hero. */
.brand-mark-floating {
  position: fixed;
  left: clamp(1.25rem, 4vw, 2.5rem);
  bottom: clamp(1.25rem, 4vw, 2.5rem);
  z-index: 45;
  display: inline-block;
  line-height: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}

.brand-mark-floating img {
  height: 50px;
  width: auto;
  display: block;
}

body.is-scrolled .brand-mark-floating {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.main-nav ul {
  list-style: none;
  display: flex;
  gap: clamp(1rem, 3vw, 2.5rem);
  margin: 0;
  padding: 0;
}

.main-nav a {
  text-decoration: none;
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  color: var(--color-text);
  opacity: 0.85;
  padding-bottom: 0.35rem;
  border-bottom: 2px solid transparent;
  transition: opacity 0.2s ease, border-color 0.2s ease;
}

.main-nav a:hover,
.main-nav a.is-active {
  opacity: 1;
  border-color: var(--color-accent);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--color-text);
  color: var(--color-text);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
}

/* ---------- Secciones (one page, scroll continuo) ---------- */

.section {
  padding: clamp(3rem, 10vh, 6rem) 0;
  /* offset para que la cabecera sticky no tape el titulo al saltar por ancla */
  scroll-margin-top: var(--header-height);
  /* contexto de posicionamiento para .sticker-field (ver mas abajo) */
  position: relative;
}

.section + .section {
  border-top: 2px dashed rgba(255, 255, 255, 0.12);
}

.section-hero {
  padding-top: clamp(2rem, 6vh, 4rem);
}

/* Home / hero */

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2rem;
}

.hero > img {
  height: clamp(110px, 22vw, 150px);
  width: auto;
}

.hero-copy {
  max-width: 560px;
  font-size: clamp(1rem, 1.6vw, 1.35rem);
}

.highlight {
  display: inline-block;
  background: var(--color-accent);
  color: var(--color-on-accent);
  padding: 0.05em 0.5em;
  border-radius: 0.3em;
  font-weight: 700;
}

.hero-meta {
  max-width: 520px;
  color: var(--color-text-muted);
  font-size: 1.15rem;
}

/* Nosotros / Vosotros / Todos juntos */

.section-view {
  max-width: 720px;
  margin: 0 auto;
}

.section-view h1 {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(1.4rem, 3.5vw, 2rem);
  letter-spacing: 0.3em;
  color: var(--color-accent);
  margin: 0 0 2rem;
}

.section-view p {
  margin: 0 0 2rem;
  font-size: clamp(0.95rem, 1.4vw, 1.05rem);
}

.section-view figure {
  margin: 0 0 2rem;
}

.section-view figure img {
  width: 100%;
  border-radius: 4px;
}

.section-view .section-meta {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

.gallery-heading {
  font-family: var(--font-script);
  font-size: 1.5rem;
  color: var(--color-accent);
  margin: 0 0 1rem;
}

.story-block {
  position: relative;
}

/* Cuadricula de fotos: 3 columnas en desktop, 2 en tablet, 1 en movil
   (ver los @media mas abajo). Celdas uniformes -- se dejo de lado el
   bento de tamanos desiguales para que la progresion de columnas sea
   predecible. */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.gallery-tile {
  position: relative;
}

.gallery-tile img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 4px;
  display: block;
  /* Tilt 3D al pasar el raton -- main.js escribe --tilt-x/--tilt-y */
  transform: perspective(800px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
  transition: transform 0.15s ease-out;
}

/* "Cintas" de washi tape en un par de fotos, solo CSS, como si estuvieran
   pegadas en un diario -- angulo distinto en cada una para que no se vea
   repetido. */
.gallery-tile--tape-1::before,
.gallery-tile--tape-2::before {
  content: '';
  position: absolute;
  top: -9px;
  width: 64px;
  height: 22px;
  background: rgba(245, 200, 194, 0.8);
  border: 1px solid rgba(51, 116, 83, 0.3);
  z-index: 2;
  pointer-events: none;
}

.gallery-tile--tape-1::before {
  left: 12%;
  transform: rotate(-7deg);
}

.gallery-tile--tape-2::before {
  right: 12%;
  transform: rotate(6deg);
}

/* ---------- Pegatinas: capa de fondo repartida por toda la web ----------
   Cada seccion es un contenedor de posicionamiento (.section, ver arriba)
   con una capa de pegatinas (.sticker-field) DETRAS del contenido real
   (.container va por delante, tambien definido arriba con z-index mas
   alto). Donde una pegatina cae debajo de una foto opaca, queda tapada
   del todo -- solo se ve en los huecos y margenes, que es justo el efecto
   de "detras de las fotos" pedido. Las posiciones van en el propio HTML
   (estilo en linea) por seccion, para que cada una parezca puesta a
   mano, no repetida. */
.sticker-field {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}

.sticker-field .sticker {
  position: absolute;
  opacity: 0.55;
}

@keyframes sticker-spin {
  from { transform: rotate(var(--sticker-rotate, 0deg)) rotateY(0deg); }
  to { transform: rotate(var(--sticker-rotate, 0deg)) rotateY(360deg); }
}

@media (prefers-reduced-motion: no-preference) {
  .sticker--spin {
    animation: sticker-spin 7s linear infinite;
  }
}

/* Seccion de cierre ("Gracias por ser parte de nuestra historia"),
   aparte del nav -- a mano alzada, como una nota final en la carta. */
.closing {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}

.closing-script {
  font-family: var(--font-mono);
  text-transform: uppercase;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.15;
  color: var(--color-accent);
  margin: 0;
}

.closing-script--last {
  color: var(--color-text);
}

/* Boton CTA sobre fondo verde. Distinto de .btn (mas abajo), que se usa
   dentro de la tarjeta ROSA del RSVP y por eso tiene los colores invertidos. */

.btn-cta {
  display: inline-block;
  align-items: center;
  background: var(--color-accent);
  color: var(--color-on-accent);
  border: none;
  padding: 0.85rem 1.9rem 0.55rem 1.9rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.05em;
  font-size: 1.2rem;
  text-decoration: none;
  text-transform: uppercase;
  transition: transform 0.15s ease, background 0.15s ease;
}

.btn-cta:hover {
  background: var(--color-accent-soft);
  transform: translateY(-2px);
}

/* ---------- Footer ---------- */

.site-footer {
  text-align: center;
  padding: 2rem 1rem 3rem;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
}

/* ---------- Responsive ---------- */

@media (max-width: 720px) {
  :root {
    --header-height: 72px;
  }

  .nav-toggle {
    display: inline-block;
    padding: 0.65rem 1rem; /* objetivo tactil mas comodo (~44px) */
  }

  .brand-mark img,
  .brand-mark-floating img {
    height: 38px;
  }

  .main-nav {
    position: fixed;
    inset: var(--header-height) 0 auto 0;
    background: var(--color-bg-soft);
    padding: 2rem 1.5rem;
    transform: translateY(-120%);
    transition: transform 0.25s ease;
    z-index: 20;
  }

  .main-nav.is-open {
    transform: translateY(0);
  }

  .main-nav ul {
    flex-direction: column;
    gap: 0.5rem;
  }

  .main-nav a {
    display: block;
    padding: 0.6rem 0; /* fila entera tocable, no solo el texto */
  }

  .brand-mark-floating {
    left: 1.25rem;
    bottom: 1.25rem;
  }
}

/* =========================================================
   RSVP page (public/rsvp.html)
   ========================================================= */

.rsvp-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.rsvp-card {
  position: relative;
  background: var(--color-accent);
  color: var(--color-on-accent);
  max-width: 520px;
  width: 100%;
  margin-bottom: 16px;
  border-radius: 18px 18px 4px 4px;
  padding: clamp(1.75rem, 5vw, 3rem);
}

/* Remate de "ticket picado": una tira del mismo rosa que la tarjeta, con
   mordiscos semicirculares del verde de fondo -- como el borde perforado
   de una entrada o un recibo de cafeteria. */
.rsvp-card::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -14px;
  height: 14px;
  background-color: var(--color-accent);
  background-image: radial-gradient(circle at 7px 0, var(--color-bg) 7px, transparent 7px);
  background-repeat: repeat-x;
  background-size: 14px 14px;
  border-radius: 0 0 4px 4px;
}

.rsvp-card h1 {
  font-family: var(--font-display);
  letter-spacing: 0.03em;
  font-size: 1.6rem;
  margin: 0 0 1rem;
}

/* Detalle de "prompt" de terminal: un cursor parpadeando junto al nombre,
   el unico gesto de tecnologia -- todo lo demas tira a cafeteria/menu. */
.blink-cursor::after {
  content: '▌';
  display: inline-block;
  margin-left: 0.15em;
  color: var(--color-bg);
}

@media (prefers-reduced-motion: no-preference) {
  .blink-cursor::after {
    animation: blink 1s steps(1) infinite;
  }
}

@keyframes blink {
  50% { opacity: 0; }
}

.rsvp-card .rsvp-brand {
  font-family: var(--font-script);
  font-size: 1.8rem;
  margin: 0 0 1.5rem;
  display: block;
}

.rsvp-state {
  display: none;
}

.rsvp-state.is-active {
  display: block;
}

.field {
  margin-bottom: 1.25rem;
}

.field label {
  display: block;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  margin-bottom: 0.4rem;
  font-weight: 700;
}

.field input[type="number"],
.field input[type="text"],
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--color-on-accent);
  background: var(--color-text);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 1rem; /* 16px: por debajo de esto, iOS Safari hace zoom automatico al enfocar */
}

.field textarea {
  min-height: 100px;
  resize: vertical;
}

.field select[multiple] {
  min-height: 140px;
}

.btn {
  display: inline-block;
  background: var(--color-on-accent);
  color: var(--color-accent);
  border: none;
  padding: 0.75rem 1.75rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
  font-size: 0.9rem;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.form-error {
  color: #a4302a;
  font-size: 0.85rem;
  margin-top: 0.75rem;
  display: none;
}

.form-error.is-active {
  display: block;
}

/* ---------- Cuestionario tipo Typeform (una pregunta a la vez) ---------- */

.typeform-progress {
  height: 4px;
  background: rgba(44, 101, 72, 0.15);
  border-radius: 999px;
  overflow: hidden;
}

.typeform-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--color-on-accent);
  transition: width 0.3s ease;
}

.typeform-step {
  margin: 0.6rem 0 1.5rem;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  opacity: 0.7;
}

.typeform-question {
  min-height: 160px;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.typeform-question.is-transitioning {
  opacity: 0;
  transform: translateY(8px);
}

.typeform-question h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: 0.01em;
  margin: 0 0 0.5rem;
}

.typeform-question .question-hint {
  font-size: 0.8rem;
  opacity: 0.75;
  margin: 0 0 1.25rem;
}

.field-block {
  margin-bottom: 1.5rem;
}

.field-block:last-child {
  margin-bottom: 0.5rem;
}

.field-label {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.9rem;
  margin: 0 0 0.35rem;
}

.options-grid {
  display: flex;
  flex-direction: column;
  margin-bottom: 1rem;
}

/* Cada opcion es una linea de "carta": etiqueta, guia de puntos, marca --
   el mismo dispositivo que un menu impreso usa para el precio. */
.option-btn {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  text-align: left;
  width: 100%;
  padding: 0.6rem 0;
  border: none;
  border-bottom: 1px solid rgba(44, 101, 72, 0.18);
  background: none;
  color: var(--color-on-accent);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  cursor: pointer;
  transition: color 0.15s ease;
}

.option-btn .option-label {
  white-space: nowrap;
  min-width: 0;
}

.option-btn .option-leader {
  flex: 1;
  align-self: center;
  min-width: 16px;
  border-bottom: 2px dotted rgba(44, 101, 72, 0.4);
  margin-bottom: 0.25em;
}

.option-btn .option-mark {
  flex: none;
  align-self: center;
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.option-btn--multiple .option-mark {
  border-radius: 4px;
}

.option-btn.is-selected {
  color: var(--color-bg);
}

.option-btn.is-selected .option-mark {
  background: currentColor;
}

.typeform-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.5rem;
}

.btn-ghost {
  background: none;
  border: none;
  color: var(--color-on-accent);
  text-decoration: underline;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 0.5rem;
  cursor: pointer;
}

.btn-ghost:disabled {
  opacity: 0;
  pointer-events: none;
}

/* ---------- Pagina de informacion para invitados (public/invitados.html) ---------- */

.info-card {
  max-width: 640px;
}

.info-block {
  margin-bottom: 2rem;
}

/* Cabeceras de categoria a mano alzada, como un cartel de especialidades. */
.info-block h2 {
  font-family: var(--font-script);
  font-weight: 700;
  font-size: 1.7rem;
  margin: 0 0 0.5rem;
}

.link-inline {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: underline;
}

/* Fila generica "etiqueta .......... valor", el mismo recurso que un menu
   impreso usa para el precio -- se reutiliza en el horario. */
.menu-row {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}

.menu-row-leader {
  flex: 1;
  align-self: center;
  min-width: 16px;
  border-bottom: 2px dotted rgba(44, 101, 72, 0.4);
  margin-bottom: 0.3em;
}

.schedule-list {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
}

.schedule-list li {
  padding: 0.65rem 0;
  border-top: 1px dashed rgba(44, 101, 72, 0.25);
}

.schedule-list li:first-child {
  border-top: none;
}

.schedule-title {
  white-space: nowrap;
  min-width: 0;
  font-weight: 700;
  font-size: 0.95rem;
}

.schedule-time {
  flex: none;
  font-weight: 700;
  font-size: 0.95rem;
}

.schedule-desc {
  display: block;
  font-size: 0.8rem;
  opacity: 0.75;
  margin-top: 0.3rem;
}

.iban-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: var(--color-text);
  border: 2px dashed var(--color-on-accent);
  border-radius: 10px;
  padding: 0.75rem 1rem;
}

.iban-box code {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  word-break: break-all;
}

.news-item {
  padding: 1rem 0;
  border-top: 1px dashed rgba(44, 101, 72, 0.25);
}

.news-item:first-child {
  border-top: none;
  padding-top: 0;
}

.news-item .news-date {
  font-family: var(--font-script);
  font-size: 1.15rem;
  opacity: 0.85;
  margin: 0 0 0.1rem;
}

.news-item h3 {
  font-size: 1rem;
  margin: 0 0 0.35rem;
}

.news-item p {
  margin: 0;
  font-size: 0.9rem;
}

/* ---------- Ajustes especificos de telefono ---------- */
/* Colocado al final a proposito: tiene que ganar por orden de cascada a
   TODAS las reglas base de arriba que sobrescribe (misma especificidad).
   La mayoria de invitados va a entrar desde el movil, asi que se prioriza
   que nada desborde ni quede apretado por encima de que se vea "perfecto"
   en desktop. */
@media (max-width: 480px) {
  .rsvp-page {
    padding: 1rem;
  }

  .rsvp-card {
    padding: 1.5rem 1.25rem;
  }

  .section-view h1 {
    letter-spacing: 0.18em;
  }

  /* Con textos largos ("Recepcion de invitados", "Autobus organizado") la
     fila de menu puede no caber en una linea en un telefono estrecho --
     mejor que la etiqueta pase a dos lineas a que se corte o desborde. */
  .option-btn .option-label,
  .schedule-title {
    white-space: normal;
  }

  .iban-box {
    flex-direction: column;
    align-items: stretch;
  }

  .iban-box #copyIbanBtn {
    align-self: flex-end;
  }
}

/* ---------- Movimiento: reveal al hacer scroll ----------
   IntersectionObserver (en main.js) anade "is-visible" una vez por
   elemento -- nunca se vuelve a ocultar al subir, para no ser cansino.
   Todo detras de prefers-reduced-motion: si el usuario pide menos
   movimiento, el contenido esta visible desde el principio, sin depender
   de que el JS llegue a ejecutarse. */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
  }

  .reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
  }

  /* La galeria revela foto a foto, no de golpe -- efecto "reveladas una
     a una", motivado (es la unica seccion con ese ritmo especial). */
  .gallery-grid .gallery-tile {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s ease, transform 0.5s ease;
  }

  .gallery-grid.is-visible .gallery-tile {
    opacity: 1;
    transform: translateY(0);
  }

  .gallery-grid.is-visible .gallery-tile:nth-child(1) { transition-delay: 0s; }
  .gallery-grid.is-visible .gallery-tile:nth-child(2) { transition-delay: 0.08s; }
  .gallery-grid.is-visible .gallery-tile:nth-child(3) { transition-delay: 0.16s; }
  .gallery-grid.is-visible .gallery-tile:nth-child(4) { transition-delay: 0.24s; }
  .gallery-grid.is-visible .gallery-tile:nth-child(5) { transition-delay: 0.32s; }
  .gallery-grid.is-visible .gallery-tile:nth-child(6) { transition-delay: 0.4s; }
}

/* ---------- Parallax nativo (sin JS de scroll -- ver nota abajo) ----------
   El logo del hero se mueve mas despacio que el scroll segun sales de la
   seccion. Usa animation-timeline de CSS, no un listener de "scroll": un
   listener de scroll + JS repintando en cada frame cuesta rendimiento en
   movil (justo lo que pediste priorizar); esto lo hace el navegador por
   su cuenta, acelerado por GPU. Donde no este soportado (Safari/Firefox
   mas antiguos) el @supports hace que se quede simplemente estatico --
   nunca roto. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .hero-parallax {
      animation: hero-parallax-move linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 40%;
    }

    @keyframes hero-parallax-move {
      from { transform: translateY(30px) scale(0.94); }
      to { transform: translateY(-16px) scale(1); }
    }
  }
}

/* ---------- Galeria: 3 columnas en desktop, 2, luego 1 ----------
   .gallery-grid ya empieza en 3 columnas (regla base). Aqui solo se
   reduce el numero segun el ancho. Colocado al final del fichero para
   ganar por orden de cascada sobre la regla base (misma especificidad:
   un unico selector de clase en los dos sitios). */
@media (max-width: 860px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Panel de administracion (public/admin.html) ----------
   Reutiliza la paleta y la tipografia del resto del sitio, pero la tabla
   en si es una tabla normal y corriente -- forzar el lenguaje de "menu"
   sobre datos tabulares densos no ayuda a leerlos. */

.admin-dashboard {
  min-height: 100vh;
  padding: 2rem clamp(1.25rem, 4vw, 3rem) 4rem;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
}

.admin-header-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.admin-header .rsvp-brand {
  font-family: var(--font-script);
  font-size: 1.6rem;
  color: var(--color-accent);
}

.admin-main {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.admin-card {
  background: var(--color-accent);
  color: var(--color-on-accent);
  border-radius: 14px;
  padding: clamp(1.5rem, 4vw, 2.5rem);
}

.admin-card h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  margin: 0 0 1.25rem;
}

.admin-create-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1rem;
  align-items: end;
}

.admin-create-form .field {
  margin-bottom: 0;
}

/* El campo de nombres necesita mas sitio que una casilla normal -- ocupa
   toda la fila en vez de compartir columna con los demas. */
.admin-field-wide {
  grid-column: 1 / -1;
}

.admin-code-field {
  display: flex;
  gap: 0.5rem;
}

.admin-code-field input {
  flex: 1;
  min-width: 0;
}

.admin-code-field .admin-action-btn {
  flex: none;
}

.admin-field-wide textarea {
  width: 100%;
  border: 1px solid var(--color-on-accent);
  background: var(--color-text);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 1rem;
  resize: vertical;
}

.admin-form-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.admin-table-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.admin-summary {
  font-size: 0.82rem;
  opacity: 0.8;
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 0.6rem 0.7rem;
  border-bottom: 1px dashed rgba(44, 101, 72, 0.25);
  white-space: nowrap;
}

.admin-table small {
  opacity: 0.7;
  font-weight: 400;
}

.admin-table th {
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  opacity: 0.7;
}

.admin-detail-row td {
  white-space: normal;
  background: rgba(255, 255, 255, 0.35);
  font-size: 0.82rem;
}

.admin-detail-row p {
  margin: 0 0 0.35rem;
}

.admin-detail-row p:last-child {
  margin-bottom: 0;
}

/* Una tarjeta por invitado, en vez de una lista con todo junto por linea. */
.admin-people-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.admin-person-card {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  background: var(--color-text);
  border: 1px solid rgba(44, 101, 72, 0.25);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  min-width: 140px;
  font-size: 0.8rem;
}

.admin-person-card strong {
  font-size: 0.85rem;
}

.admin-person-card .admin-status {
  align-self: flex-start;
}

/* Las respuestas generales (lado, transporte, mensaje) una debajo de
   otra, no todas juntas en una sola linea. */
.admin-detail-general p {
  margin: 0 0 0.3rem;
}

.admin-detail-general p:last-child {
  margin-bottom: 0;
}

.admin-status {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.admin-status--pending {
  background: rgba(44, 101, 72, 0.12);
  color: var(--color-on-accent);
}

.admin-status--yes {
  background: var(--color-on-accent);
  color: var(--color-accent);
}

.admin-status--no {
  background: rgba(164, 48, 42, 0.15);
  color: #a4302a;
}

.admin-row-actions {
  display: flex;
  gap: 0.35rem;
}

.admin-action-btn {
  background: none;
  border: 1px solid var(--color-on-accent);
  color: var(--color-on-accent);
  border-radius: 6px;
  padding: 0.3rem 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  cursor: pointer;
}

.admin-action-btn:hover {
  background: var(--color-on-accent);
  color: var(--color-accent);
}

.admin-action-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.admin-action-btn--danger {
  border-color: #a4302a;
  color: #a4302a;
}

.admin-action-btn--danger:hover {
  background: #a4302a;
  color: #fff;
}

@media (max-width: 640px) {
  .admin-create-form {
    grid-template-columns: 1fr;
  }
}

/* ---------- Lightbox: ampliar foto de la galeria a pantalla completa ----------
   <dialog> nativo en vez de un div a mano: Escape para cerrar y el
   apilamiento por encima de todo lo demas los da el propio navegador,
   sin JS de mas -- solo hace falta programar el cierre al hacer clic
   fuera de la imagen (ver main.js). */

.lightbox {
  border: none;
  background: transparent;
  padding: 0;
  max-width: none;
  max-height: none;
  width: 100vw;
  height: 100vh;
  margin: 0;
  /* OJO: aqui NO va "display". El navegador oculta un <dialog> cerrado
     con su propia regla "dialog:not([open]) { display: none }", pero
     cualquier "display" que pongamos nosotros en la regla base la pisa
     y deja el dialogo siempre visible, abierto o no. */
}

.lightbox[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox::backdrop {
  background: rgba(20, 20, 20, 0.88);
}

.lightbox img {
  max-width: min(92vw, 1100px);
  max-height: 88vh;
  width: auto;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.lightbox-close {
  position: fixed;
  top: clamp(1rem, 3vw, 2rem);
  right: clamp(1rem, 3vw, 2rem);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--color-text);
  background: rgba(0, 0, 0, 0.3);
  color: var(--color-text);
  font-family: var(--font-mono);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Las fotos de la galeria pasan a ser interactivas (foco de teclado
   incluido, ver main.js) -- el cursor lo deja claro, igual que un boton. */
.gallery-tile img {
  cursor: pointer;
}

.gallery-tile img:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

/* ---------- Texto de VOSOTROS / TODOS JUNTOS ----------
   Los selectores llevan ".section-view" delante a proposito: ".section-view p"
   (margin, font-size) tiene mas especificidad que una clase suelta, y sin el
   prefijo ganaria siempre sobre estas reglas. */

/* Subtitulos a mano (Caveat), como los carteles de "especialidades" de la
   tarjeta rosa pero en rosa sobre el verde. */
.section-view .script-heading {
  font-family: var(--font-script);
  font-weight: 700;
  font-size: clamp(1.6rem, 4vw, 2rem);
  line-height: 1.1;
  color: var(--color-accent);
  margin: 0 0 1.25rem;
}

/* Frase suelta, grande y a mano, centrada: el "respiro" entre parrafos. */
.section-view .script-quote {
  font-family: var(--font-script);
  font-weight: 700;
  font-size: clamp(1.9rem, 5.5vw, 2.7rem);
  line-height: 1.15;
  color: var(--color-accent);
  text-align: center;
  margin: 2.5rem 0;
}

/* "Lo practico": filas etiqueta ........ valor, el mismo recurso de linea de
   puntos que ya usa el horario de la pagina de invitados (.menu-row), pero
   con colores pensados para el fondo verde. */
.info-list {
  list-style: none;
  margin: 0 0 2rem;
  padding: 0;
}

.info-row {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.6rem 0;
}

.info-label {
  flex: none;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-accent);
  white-space: nowrap;
}

.info-leader {
  flex: 1;
  align-self: center;
  min-width: 16px;
  border-bottom: 2px dotted rgba(245, 239, 228, 0.35);
  margin-bottom: 0.25em;
}

.info-value {
  max-width: 65%;
  text-align: right;
  font-size: 0.95rem;
}

.info-value a {
  text-decoration: underline;
  text-underline-offset: 0.25em;
  text-decoration-color: var(--color-accent);
}

.info-value a:hover {
  color: var(--color-accent);
}

/* En movil estrecho una etiqueta + un valor largo ("Parkings cercanos y
   metro...") no caben en la misma linea: se apilan, etiqueta arriba. */
@media (max-width: 480px) {
  .info-row {
    flex-wrap: wrap;
    row-gap: 0.15rem;
  }

  .info-leader {
    display: none;
  }

  .info-value {
    flex-basis: 100%;
    max-width: none;
    text-align: left;
  }
}

/* public/css/landing-mobile.css
   ===========================================================================
   AÑADE este bloque al FINAL de public/css/styles.css (despues de todo lo
   demas, para que gane a las reglas anteriores). No hay que borrar nada.
   =========================================================================== */

/* ---------- 1) Menu movil CERRADO: que no se vea nada ----------
   Antes se subia solo un 120% de su alto, pero esta colocado a --header-height
   del borde: sobraba una franja asomando arriba (32 px con 3 enlaces) que tapaba
   la parte de arriba del logo y del boton "Menu". Ahora se sube su alto MAS esa
   distancia, y ademas se oculta del todo (visibility) para que tampoco se pueda
   llegar a sus enlaces con el teclado mientras esta cerrado. */
@media (max-width: 720px) {
  .main-nav {
    transform: translateY(calc(-100% - var(--header-height) - 2px));
    visibility: hidden;
    transition: transform 0.25s ease, visibility 0s linear 0.25s;
  }

  .main-nav.is-open {
    transform: translateY(0);
    visibility: visible;
    transition: transform 0.25s ease, visibility 0s;
  }
}

/* ---------- 2) Flecha "sigue bajando" (primera pantalla) ----------
   Es un boton redondo fijo abajo en el centro. main.js la muestra solo arriba del
   todo y cuando cabe sin tapar el boton de RSVP; en cuanto se hace scroll, se va. */
.scroll-cue {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
  z-index: 30;
  width: 42px;
  height: 42px;
  margin-left: -21px; /* centrada sin usar transform (lo usa la animacion del icono) */
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--color-accent);
  border-radius: 50%;
  background: rgba(51, 116, 83, 0.92); /* el verde de la web: se lee sobre cualquier cosa */
  color: var(--color-accent);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s ease, visibility 0s linear 0.35s;
}

.scroll-cue.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.35s ease;
}

.scroll-cue svg {
  display: block;
}

@media (prefers-reduced-motion: no-preference) {
  .scroll-cue.is-visible svg {
    animation: scroll-cue-bounce 1.6s ease-in-out infinite;
  }

  @keyframes scroll-cue-bounce {
    0%, 100% { transform: translateY(-2px); }
    50% { transform: translateY(4px); }
  }
}

/* Cuando se abre una invitacion personal (/?code=...) la landing esta oculta. */
html.mode-rsvp .scroll-cue {
  display: none;
}

/* public/css/admin-extra.css
   ===========================================================================
   AÑADE este bloque al final de public/css/styles.css. No sustituye nada:
   estilos del detalle por cuestionario y de la flecha de scroll del panel
   de admin (public/js/admin.js).
   =========================================================================== */

/* "Canción:", "Correo:"... un poco mas suaves que el valor que acompanan. */
.admin-field-label {
  opacity: 0.65;
}

/* ---------- Flecha de scroll horizontal (movil) ----------
   admin.js envuelve cada tabla en ".admin-scroll" y le pone las clases
   "can-scroll-left" / "can-scroll-right" solo cuando de verdad queda
   contenido por ese lado. Sin scroll (escritorio), no se ve nada. */

.admin-scroll {
  position: relative;
}

/* Capa "pegajosa" de altura 0: se queda a ~40% de la pantalla mientras la tabla
   esta a la vista, en vez de en el centro de una tabla que puede ser altisima. */
.admin-scroll-hints {
  position: sticky;
  top: 40vh;
  height: 0;
  z-index: 3;
  pointer-events: none; /* es solo un aviso: los clics pasan a la tabla */
}

.admin-scroll-arrow {
  position: absolute;
  top: -1.2rem; /* la mitad de su alto: queda centrada en ese 40% */
  width: 2.4rem;
  height: 2.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--color-on-accent);
  color: var(--color-accent);
  font-size: 1.7rem;
  font-weight: 700;
  line-height: 1;
  padding-bottom: 0.15rem; /* el "›" queda visualmente centrado */
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.admin-scroll-arrow--right {
  right: 0.3rem;
}

.admin-scroll-arrow--left {
  left: 0.3rem;
}

.admin-scroll.can-scroll-right .admin-scroll-arrow--right,
.admin-scroll.can-scroll-left .admin-scroll-arrow--left {
  opacity: 0.92;
}

@media (prefers-reduced-motion: no-preference) {
  .admin-scroll.can-scroll-right .admin-scroll-arrow--right {
    animation: admin-nudge-right 1.3s ease-in-out infinite;
  }

  .admin-scroll.can-scroll-left .admin-scroll-arrow--left {
    animation: admin-nudge-left 1.3s ease-in-out infinite;
  }

  @keyframes admin-nudge-right {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(4px); }
  }

  @keyframes admin-nudge-left {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(-4px); }
  }
}

/* public/css/rsvp-flow.css
   ===========================================================================
   AÑADE este bloque al FINAL de public/css/styles.css. No sustituye nada:
   estilos de las pantallas del RSVP "ya has respondido", "gracias" y error.
   =========================================================================== */

/* Aviso de "ya has respondido": Editar (principal) + volver a la web. */
.rsvp-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.rsvp-actions .btn-ghost {
  padding-left: 0;
}

/* Salida unica de las pantallas finales: un .btn dentro de un <a>, sin subrayado. */
.rsvp-exit {
  margin-top: 1.25rem;
  text-decoration: none;
}

/* "¿No eres X?": discreto, solo para dispositivos compartidos. */
.rsvp-notme {
  display: block;
  margin-top: 1.5rem;
  padding-left: 0;
  font-size: 0.8rem;
  opacity: 0.75;
}

.rsvp-notme[hidden] {
  display: none;
}

/* En las pantallas FINALES (gracias, codigo invalido) solo debe haber UNA salida, y en el
   aviso de "ya has respondido" ya hay un "Volver" explicito: se esconde el enlace
   "← Ver la web de la boda" de arriba (rsvp.js pone data-current en la tarjeta). */
.rsvp-card[data-current="success"] > .link-inline,
.rsvp-card[data-current="invalid"] > .link-inline,
.rsvp-card[data-current="done"] > .link-inline {
  display: none;
}
