/* ===== Paleta "Sage & Baby Blue" (la que eligieron Isaura y Rodrigo) =====
   Contraste medido (WCAG): --ink 8.9:1, --muted 4.9:1, botón blanco/--sage-deep 5.2:1,
   --blue-ink 5.3:1. Sage, Dusty Blue y Gold NO tienen contraste para texto: solo fondos,
   bordes y detalles. */
:root {
  --sage: #A8B69A;
  --dusty-sage: #8FA18B;
  --sage-mist: #C7D1C4;
  --baby-blue: #B7CDE6;
  --dusty-blue: #8FAECC;
  --ivory: #F4F2EC;
  --warm-white: #FBF9F6;
  --gold: #D4AF37;

  --ink: #3F4A3C;
  --muted: #66705F;
  --sage-deep: #5F7259;
  --sage-deeper: #4F6049;
  --blue-ink: #4F6A8A;
  --danger: #A04F3B;

  --shadow: 0 14px 40px rgba(63, 74, 60, 0.12);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--warm-white);
  color: var(--ink);
  font-family: "Montserrat", system-ui, sans-serif;
  font-weight: 300;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

h1, h2 { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 500; }
strong { font-weight: 500; }

/* ===== Portada ===== */
.hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 26px 20px 34px;
  background:
    radial-gradient(90% 60% at 50% 0%, #fff 0%, transparent 70%),
    linear-gradient(180deg, var(--warm-white) 0%, var(--ivory) 100%);
}
.hero__inner { position: relative; z-index: 1; animation: fadeUp 1.1s ease both; }
.hero__logo { width: min(92px, 24vw); height: auto; aspect-ratio: 1802 / 2080; color: var(--ink); display: block; margin: 0 auto 18px; }

.hero__arch {
  width: min(210px, 54vw);
  aspect-ratio: 3 / 4;
  margin: 0 auto 16px;
  padding: 9px;
  border-radius: 999px 999px 20px 20px;
  background: #fff;
  border: 1px solid var(--sage-mist);
  box-shadow: var(--shadow);
  position: relative;
}
.hero__arch::before {
  /* Fondo del arco mientras no haya foto (o mientras carga). */
  content: "";
  position: absolute; inset: 9px;
  border-radius: inherit;
  background: linear-gradient(160deg, var(--sage-mist) 0%, var(--baby-blue) 100%);
  opacity: .7;
}
.hero__arch img {
  position: relative;
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 999px 999px 14px 14px;
  display: block;
}

.hero__names {
  font-family: "Pinyon Script", "Cormorant Garamond", cursive;
  font-weight: 400;
  font-size: clamp(2.5rem, 11vw, 4.8rem);
  line-height: 1.1;
  color: var(--sage-deep);
  margin: 18px 0 22px;
}
/* Follaje sobre el arco: la única pieza decorativa de la página. */
.arch-sprig {
  position: absolute; z-index: 2; pointer-events: none;
  height: auto; aspect-ratio: 1;
  color: var(--dusty-sage);
  overflow: visible;
}
/* Arriba: abraza el hombro izquierdo del arco. Abajo: contenida en la esquina, sin tocar los nombres. */
.arch-sprig--top { width: 89%; top: -15.5%; left: -23.7%; }
.arch-sprig--bottom { width: 57%; bottom: -8.1%; right: -13.5%; transform: rotate(180deg); }

/* ===== Uploader ===== */
.uploader { max-width: 620px; margin: 0 auto; padding: 30px 18px 40px; scroll-margin-top: 4px; }
.uploader__intro { text-align: center; margin: 0 0 22px; }
.uploader__intro h2 { font-size: clamp(1.75rem, 7.4vw, 2.6rem); line-height: 1.12; margin: 0 0 10px; }
.uploader__intro p:last-child { margin: 0 auto; max-width: 30em; font-size: .95rem; color: var(--muted); }

/* En pantallas grandes la portada vuelve a ser de pantalla completa. */
@media (min-width: 900px) and (min-height: 760px) {
  .hero { min-height: 92svh; }
  .hero__logo { width: 120px; }
  .hero__arch { width: 260px; }
}

.who { display: block; margin: 0 0 16px; text-align: left; }
.who__label { display: block; font-size: .88rem; color: var(--ink); margin: 0 0 6px; padding-left: 4px; }
.who__label em { color: var(--muted); font-style: normal; }
.who input {
  width: 100%;
  font: inherit; font-size: 1rem; /* 16px evita el zoom automático en iPhone */
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--sage-mist);
  border-radius: 12px;
  padding: 12px 14px;
}
.who input:focus { outline: 2px solid var(--dusty-blue); outline-offset: 1px; border-color: var(--dusty-blue); }

.dropzone {
  border: 2px dashed var(--baby-blue);
  border-radius: var(--radius);
  background: #fff;
  padding: 24px 18px 20px;
  text-align: center;
  transition: border-color .2s, background .2s, transform .1s;
  cursor: pointer;
}
.dropzone:hover, .dropzone:focus-visible { border-color: var(--dusty-blue); background: #F7FAFD; outline: none; }
.dropzone.dragover { border-color: var(--dusty-sage); background: #F5F8F3; transform: scale(1.01); }
.dropzone__icon { width: 48px; height: 48px; color: var(--dusty-blue); }
.dropzone__icon { display: block; margin: 0 auto 12px; }
.dropzone__hint { color: var(--muted); font-size: .8rem; margin: 12px 0 0; }
.btn--pick { width: 100%; max-width: 320px; padding: 16px 24px; font-size: 1rem; }

/* Texto según el dispositivo: en celular no tiene sentido "arrastrar". */
.only-desktop { display: none; }
@media (hover: hover) and (pointer: fine) {
  .only-desktop { display: inline; }
  .only-touch { display: none; }
}

.btn {
  display: inline-block;
  font-family: "Montserrat", sans-serif;
  font-weight: 500;
  font-size: .95rem;
  letter-spacing: .04em;
  color: #fff;
  background: var(--sage-deep);
  border: none;
  border-radius: 999px;
  padding: 14px 30px;
  cursor: pointer;
  text-decoration: none;
  transition: background .2s, transform .1s;
}
.btn:hover { background: var(--sage-deeper); }
.btn:active { transform: translateY(1px); }
.btn--hero { box-shadow: 0 8px 22px rgba(95, 114, 89, .28); }

.turnstile { margin: 18px 0 0; display: flex; justify-content: center; }

/* Cola de subida */
.queue { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 10px; }
.queue__item {
  background: #fff;
  border: 1px solid var(--sage-mist);
  border-radius: 12px;
  padding: 11px 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  align-items: center;
}
.queue__name { font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue__pct { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.queue__bar { grid-column: 1 / -1; height: 6px; background: var(--ivory); border-radius: 999px; overflow: hidden; }
.queue__fill { display: block; height: 100%; width: 0%; background: var(--dusty-blue); transition: width .25s ease; } /* block: un <span> en línea ignora width y la barra nunca se llenaba */
.queue__item.done .queue__fill { background: var(--sage); }
.queue__item.done .queue__pct { color: var(--sage-deep); }
.queue__item.error .queue__fill { background: var(--danger); }
.queue__item.error .queue__pct { color: var(--danger); }

.global-status { text-align: center; color: var(--sage-deep); margin-top: 18px; font-size: .95rem; min-height: 1.2em; }
.keep-open { text-align: center; color: var(--blue-ink); font-size: .9rem; font-weight: 400; margin: 16px 0 0; }

/* ===== Galería ===== */
.gallery-section {
  max-width: 1100px; margin: 0 auto; padding: 48px 14px 64px; text-align: center;
  border-top: 1px solid var(--sage-mist);
}
.gallery-section h2 { font-size: clamp(1.9rem, 7vw, 2.6rem); margin: 0 0 2px; }
.gallery-meta { color: var(--muted); font-size: .9rem; margin: 0; min-height: 1.4em; }
.gallery-empty { color: var(--muted); margin: 18px 0 0; }
.gallery {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 6px;
}
@media (min-width: 640px) { .gallery { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; } }
.tile {
  position: relative;
  aspect-ratio: 1;
  border: none;
  padding: 0;
  background: var(--sage-mist);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
}
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.tile:hover img { transform: scale(1.05); }
.tile--video { background: #2E3A2C; }
.tile--video img { opacity: .92; }
.tile__play {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.2rem; color: #fff;
  background: rgba(0,0,0,.16);
  text-shadow: 0 2px 8px rgba(0,0,0,.4);
  pointer-events: none;
}

/* Moderación */
.admin-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 18px;
  margin: 16px auto 0; padding: 10px 16px; max-width: 520px;
  background: #FFF6E5; border: 1px solid #E8D6A8; border-radius: 12px; font-size: .88rem;
}
.admin-bar[hidden] { display: none; }
.admin-bar span { font-weight: 500; }
.admin-bar label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.admin-bar__exit { font: inherit; background: none; border: 1px solid var(--muted); color: var(--ink); border-radius: 999px; padding: 3px 12px; cursor: pointer; }
.tile__mod {
  position: absolute; top: 6px; right: 6px; z-index: 2;
  font: 500 .72rem "Montserrat", sans-serif;
  color: #fff; background: rgba(160, 79, 59, .92);
  border: none; border-radius: 999px; padding: 6px 10px; cursor: pointer;
}
.tile--hidden img { opacity: .3; filter: grayscale(1); }
.tile--hidden .tile__mod { background: var(--sage-deep); }
.tile--hidden::after {
  content: "Oculta"; position: absolute; left: 6px; bottom: 6px;
  font: 500 .7rem "Montserrat", sans-serif; color: #fff; background: rgba(0,0,0,.55);
  padding: 3px 8px; border-radius: 999px;
}

/* Botón flotante "Subir fotos" (aparece al bajar a la galería) */
.fab {
  position: fixed; z-index: 40;
  left: 0; right: 0; margin: 0 auto; width: max-content; /* centrado sin transform (la animación usa transform) */
  bottom: calc(16px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 8px;
  font: 500 .95rem "Montserrat", sans-serif; letter-spacing: .03em;
  color: #fff; background: var(--sage-deep);
  padding: 13px 22px; border-radius: 999px; text-decoration: none;
  box-shadow: 0 10px 28px rgba(63, 74, 60, .35);
  animation: fadeUp .3s ease both;
}
.fab[hidden] { display: none; }
/* En celulares el Safari nuevo (iOS 26) y Chrome ponen la barra de dirección flotando abajo:
   subimos el botón para que no quede tapado. */
@media (hover: none) and (pointer: coarse) {
  .fab { bottom: calc(46px + env(safe-area-inset-bottom)); }
  .footer { padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
}
.fab svg { width: 20px; height: 20px; }

/* ===== Footer ===== */
.footer { text-align: center; padding: 34px 20px 96px; color: var(--muted); font-size: .82rem; background: var(--ivory); }
.footer__logo { width: 64px; height: 74px; color: var(--ink); opacity: .85; }
.footer p { margin: 6px 0 0; }

/* ===== Lightbox ===== */
.lightbox {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(30, 37, 29, .985);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.lightbox[hidden] { display: none; }

.lb-top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 3;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  background: linear-gradient(to bottom, rgba(0,0,0,.55), transparent);
}
.lb-counter { color: #fff; font-size: .9rem; letter-spacing: .05em; font-variant-numeric: tabular-nums; }
.lb-tools { display: flex; gap: 10px; }

.lb-btn {
  background: rgba(255,255,255,.12); color: #fff;
  border: none; cursor: pointer; border-radius: 999px;
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  text-decoration: none; font-size: 1.1rem; transition: background .2s;
}
.lb-btn:hover { background: rgba(255,255,255,.28); }
.lb-btn svg { width: 20px; height: 20px; }

.lightbox__stage { max-width: 92vw; max-height: 64vh; display: flex; align-items: center; justify-content: center; }
.lightbox__stage img, .lightbox__stage video { max-width: 92vw; max-height: 64vh; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }

.lightbox__nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  background: rgba(255,255,255,.12); color: #fff;
  border: none; cursor: pointer; border-radius: 999px;
  width: 48px; height: 48px; font-size: 1.8rem; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.lightbox__nav:hover { background: rgba(255,255,255,.25); }
.lightbox__prev { left: 14px; }
.lightbox__next { right: 14px; }

.lb-caption {
  color: rgba(255,255,255,.82); font-size: .9rem; margin-top: 14px;
  max-width: 80vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center;
}

.lb-thumbs {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 3;
  display: flex; gap: 8px; overflow-x: auto; padding: 14px 16px;
  background: linear-gradient(to top, rgba(0,0,0,.55), transparent);
  scrollbar-width: thin;
}
.lb-thumb {
  flex: 0 0 auto; width: 62px; height: 62px;
  border: 2px solid transparent; border-radius: 8px; overflow: hidden;
  padding: 0; cursor: pointer; background: #2E3A2C; opacity: .55;
  transition: opacity .2s, border-color .2s; position: relative;
}
.lb-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lb-thumb:hover { opacity: .85; }
.lb-thumb.active { opacity: 1; border-color: var(--baby-blue); }
.lb-thumb__play {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1rem; text-shadow: 0 1px 4px rgba(0,0,0,.6);
}

@media (max-width: 560px) {
  .lightbox__nav { width: 40px; height: 40px; }
  .lightbox__stage, .lightbox__stage img, .lightbox__stage video { max-height: 56vh; }
  .lb-thumb { width: 52px; height: 52px; }
}

/* ===== Animaciones ===== */
@keyframes fadeUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; scroll-behavior: auto; }
}
