/* ============================================================
   ÁLBUM — Proyecto 3. Galería profesional post-boda.
   ============================================================ */
:root {
  --fondo: #faf6ef;
  --fondo-2: #f3ecdd;
  --tinta: #3d3528;
  --tinta-suave: #7a6f5c;
  --acento: #b08d3f;
  --acento-claro: #d9bf7f;
  --tarjeta: #fffdf8;
  --sombra: rgba(61, 53, 40, .18);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: "Cormorant Garamond", Georgia, serif;
  background: radial-gradient(ellipse at top, var(--fondo-2), var(--fondo) 60%);
  color: var(--tinta);
  min-height: 100vh;
}

.script { font-family: "Great Vibes", cursive; font-weight: 400; }

#decoracion {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}

/* ---------- Hero ---------- */
.hero {
  min-height: 88vh;
  min-height: 88svh; /* móvil: ignora la barra del navegador */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 40px 20px;
  position: relative;
  overflow: hidden;
}

.ornamento { color: var(--acento); letter-spacing: .5em; margin-bottom: 18px; }

/* Foto de fondo del hero (difuminada y oscurecida) */
.hero-fondo {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 30%;
  filter: brightness(.62) saturate(.95);
  transform: scale(1.03);
  z-index: -1;
}
.hero-fondo::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(20, 14, 4, .38), rgba(20, 14, 4, .18) 45%, var(--fondo) 97%);
}

/* Con foto de fondo, el texto pasa a claro */
.hero.con-fondo .hero-sobre,
.hero.con-fondo .hero-fecha,
.hero.con-fondo .stat-txt { color: #f0e8d8; text-shadow: 0 1px 12px rgba(0,0,0,.5); }
.hero.con-fondo .hero-nombres,
.hero.con-fondo .stat-num,
.hero.con-fondo .ornamento,
.hero.con-fondo .flecha-abajo { color: var(--acento-claro); text-shadow: 0 2px 16px rgba(0,0,0,.55); }
.hero.con-fondo .stat-sep { color: rgba(240, 232, 216, .6); }

.hero-sobre {
  font-size: 1.1rem;
  letter-spacing: .35em;
  text-transform: uppercase;
  color: var(--tinta-suave);
}

.hero-nombres {
  font-size: clamp(3.4rem, 12vw, 6.5rem);
  color: var(--acento);
  line-height: 1.15;
  margin: 10px 0;
}

.hero-fecha {
  font-size: 1.15rem;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--tinta-suave);
}

/* Estadísticas animadas */
.hero-stats {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-top: 22px;
  flex-wrap: wrap;
  justify-content: center;
}
.stat { display: flex; align-items: baseline; gap: 7px; }
.stat-num {
  font-family: "Cinzel", serif;
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  color: var(--acento);
  font-variant-numeric: tabular-nums;
}
.stat-txt {
  font-size: .85rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--tinta-suave);
}
.stat-sep { color: var(--acento-claro); font-size: 1.4rem; }

.linea-dorada {
  width: 160px;
  height: 1px;
  margin: 26px auto 0;
  background: linear-gradient(90deg, transparent, var(--acento), transparent);
}

.flecha-abajo {
  position: absolute;
  bottom: 26px;
  font-size: 1.6rem;
  color: var(--acento);
  animation: flotar 2s ease-in-out infinite;
}
@keyframes flotar {
  0%, 100% { transform: translateY(0); opacity: .7; }
  50% { transform: translateY(10px); opacity: 1; }
}

/* Entrada en cascada */
.reveal { opacity: 0; transform: translateY(24px); animation: aparecer 1s ease forwards; }
.reveal:nth-child(2) { animation-delay: .15s; }
.reveal:nth-child(3) { animation-delay: .3s; }
.reveal:nth-child(4) { animation-delay: .45s; }
.reveal:nth-child(5) { animation-delay: .6s; }
.reveal:nth-child(6) { animation-delay: .75s; }
.reveal:nth-child(7) { animation-delay: 1.1s; }
@keyframes aparecer { to { opacity: 1; transform: translateY(0); } }

/* Botón de presentación — dentro del hero, sobre la foto */
.btn-pase {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 34px;
  padding: 14px 38px;
  border-radius: 999px;
  border: 1px solid rgba(217, 191, 127, .8);
  background: rgba(20, 14, 4, .28);
  color: #f5ecd8;
  font-family: inherit;
  font-size: .95rem;
  letter-spacing: .22em;
  text-indent: .11em;
  text-transform: uppercase;
  cursor: pointer;
  backdrop-filter: blur(6px);
  box-shadow: 0 10px 32px rgba(0, 0, 0, .35);
  transition: all .35s ease;
}
.btn-pase:hover {
  background: var(--acento);
  border-color: var(--acento);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 16px 42px rgba(0, 0, 0, .45);
}
.btn-pase-icono { font-size: .75em; }

/* ---------- Galería masonry (columnas repartidas por JS) ---------- */
.galeria {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  padding: 20px clamp(16px, 4vw, 48px) 60px;
  max-width: 1500px;
  margin: 0 auto;
}
.galeria .col {
  flex: 1 1 0;
  min-width: 0;
}

.foto {
  margin-bottom: 18px;
  background: var(--tarjeta);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 10px 30px var(--sombra);
  cursor: zoom-in;
  opacity: 0;
  transform: translateY(36px) scale(.97);
  transition: opacity .8s ease, transform .8s cubic-bezier(.2, .8, .25, 1), box-shadow .35s;
  position: relative;
}
.foto.visible { opacity: 1; transform: translateY(0) scale(1); }
.foto:hover { box-shadow: 0 22px 50px var(--sombra); }

.foto img {
  width: 100%;
  display: block;
  transition: transform .6s ease;
}
.foto:hover img { transform: scale(1.04); }

/* Pie de cada foto (degradado sobre la imagen) */
.foto .info {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  padding: 36px 14px 12px;
  background: linear-gradient(transparent, rgba(20, 14, 4, .72));
  color: #fff;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .4s, transform .4s;
}
.foto:hover .info { opacity: 1; transform: translateY(0); }
.foto .info .t { font-size: 1.15rem; font-weight: 600; line-height: 1.25; }
.foto .info .a { font-size: .95rem; opacity: .85; font-style: italic; }

/* Tarjetas del libro de visitas intercaladas */
.foto-mensaje {
  cursor: default;
  background: var(--tarjeta);
  border: 1px solid var(--acento-claro);
  padding: 26px 22px 20px;
  text-align: center;
}
.foto-mensaje:hover { box-shadow: 0 10px 30px var(--sombra); }
.msg-comilla {
  font-family: "Cormorant Garamond", serif;
  font-size: 3rem;
  line-height: .6;
  color: var(--acento-claro);
}
.msg-texto {
  font-size: 1.12rem;
  font-style: italic;
  line-height: 1.6;
  color: var(--tinta);
  margin-top: 10px;
}
.msg-autor {
  margin-top: 14px;
  font-size: 1.5rem;
  color: var(--acento);
}

/* En táctil el hover no existe: info siempre visible pero discreta */
@media (hover: none) {
  .foto .info { opacity: 1; transform: none; padding-top: 28px; }
}

/* ---------- Dedicatoria ---------- */
.dedicatoria {
  max-width: 640px;
  margin: 30px auto 10px;
  padding: 0 24px 30px;
  text-align: center;
}
.dedicatoria .ornamento { font-size: 1.2rem; margin-bottom: 14px; }
.dedicatoria-texto {
  font-size: clamp(1.25rem, 3.5vw, 1.55rem);
  line-height: 1.7;
  font-style: italic;
  color: var(--tinta);
}
.dedicatoria-firma {
  margin-top: 18px;
  font-size: 2.2rem;
  color: var(--acento);
}

/* ---------- Estados ---------- */
.estado {
  text-align: center;
  padding: 40px 20px 80px;
  font-size: 1.25rem;
  font-style: italic;
  color: var(--tinta-suave);
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(18, 13, 5, .93);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 28px;
}
.lightbox.abierto { display: flex; animation: lbFade .3s ease; }
@keyframes lbFade { from { opacity: 0; } to { opacity: 1; } }

.lightbox figure {
  max-width: min(1100px, 92vw);
  max-height: 88vh;
  text-align: center;
}
.lightbox img {
  max-width: 100%;
  max-height: 74vh;
  border-radius: 6px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .6);
  animation: lbZoom .35s cubic-bezier(.2, 1.2, .4, 1);
}
@keyframes lbZoom { from { transform: scale(.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.lightbox figcaption { margin-top: 16px; color: #fff; }
.lb-titulo { font-size: 1.6rem; }
.lb-autor { font-size: 1.1rem; font-style: italic; opacity: .75; margin-top: 2px; }

.lb-contador {
  position: fixed;
  top: max(18px, env(safe-area-inset-top));
  left: 24px;
  color: #fff;
  opacity: .7;
  font-size: 1.05rem;
  letter-spacing: .1em;
}

.lb-acciones { display: flex; gap: 10px; justify-content: center; margin-top: 14px; }
.lb-accion {
  padding: 9px 20px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .45);
  background: rgba(255, 255, 255, .08);
  color: #fff;
  font-family: inherit;
  font-size: .95rem;
  cursor: pointer;
  transition: background .25s;
  backdrop-filter: blur(4px);
}
.lb-accion:hover { background: rgba(255, 255, 255, .22); }

.lb-cerrar, .lb-prev, .lb-next {
  position: fixed;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  opacity: .7;
  transition: opacity .2s, transform .2s;
  font-family: inherit;
}
.lb-cerrar:hover, .lb-prev:hover, .lb-next:hover { opacity: 1; transform: scale(1.12); }
.lb-cerrar { top: 18px; right: 24px; font-size: 1.8rem; }
.lb-prev, .lb-next { top: 50%; transform: translateY(-50%); font-size: 3.4rem; padding: 0 10px; }
.lb-prev { left: 12px; }
.lb-next { right: 12px; }

/* ---------- Modo presentación ---------- */
.pase {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: #0c0903;
  display: none;
  overflow: hidden;
  cursor: pointer;
}
.pase.activo { display: block; animation: lbFade .5s ease; }

.pase img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
/* Efecto Ken Burns alternado */
.pase img.kb1 { animation: kb1 5.6s ease-in-out forwards; }
.pase img.kb2 { animation: kb2 5.6s ease-in-out forwards; }
@keyframes kb1 { from { transform: scale(1); opacity: 0; } 8% { opacity: 1; } to { transform: scale(1.07); opacity: 1; } }
@keyframes kb2 { from { transform: scale(1.07); opacity: 0; } 8% { opacity: 1; } to { transform: scale(1); opacity: 1; } }

.pase-caption {
  position: absolute;
  bottom: max(40px, env(safe-area-inset-bottom));
  left: 0; right: 0;
  text-align: center;
  color: #fff;
  text-shadow: 0 2px 18px rgba(0, 0, 0, .8);
  padding: 0 20px;
}
.pase-titulo { font-size: clamp(2rem, 6vw, 3.2rem); }
.pase-autor { font-size: 1.15rem; font-style: italic; opacity: .8; margin-top: 2px; }

.pase-progreso {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: rgba(255, 255, 255, .15);
}
#paseBarra { height: 100%; width: 0%; background: var(--acento-claro); }

.pase-salir {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  right: 20px;
  color: rgba(255, 255, 255, .5);
  font-size: .85rem;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.pase-mute {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  left: 20px;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 1.2rem;
  cursor: pointer;
  backdrop-filter: blur(4px);
}

/* ---------- Volver arriba ---------- */
.btn-arriba {
  position: fixed;
  bottom: max(20px, env(safe-area-inset-bottom));
  right: 20px;
  z-index: 90;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--acento);
  background: var(--tarjeta);
  color: var(--acento);
  font-size: 1.3rem;
  cursor: pointer;
  box-shadow: 0 8px 24px var(--sombra);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity .3s, transform .3s;
}
.btn-arriba.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.btn-arriba:hover { background: var(--acento); color: #fff; }

/* ---------- Móvil ---------- */
@media (max-width: 620px) {
  .galeria { gap: 10px; padding: 12px 10px 50px; }
  .foto { margin-bottom: 10px; border-radius: 8px; }
  .foto .info { padding: 22px 9px 8px; }
  .foto .info .t { font-size: .95rem; }
  .foto .info .a { font-size: .8rem; }

  .hero { min-height: 78svh; }
  .hero-stats { gap: 10px; }

  /* Lightbox táctil: botones grandes y caption compacta */
  .lb-prev, .lb-next { font-size: 2.6rem; padding: 18px 8px; }
  .lb-cerrar { font-size: 1.5rem; padding: 10px; right: 12px; }
  .lightbox { padding: 14px; }
  .lightbox img { max-height: 62vh; }
  .lb-titulo { font-size: 1.25rem; }
  .lb-autor { font-size: .95rem; }
  .lb-accion { padding: 10px 16px; font-size: .9rem; }
}

/* ---------- Footer ---------- */
.pie {
  text-align: center;
  padding: 30px 20px 46px;
  position: relative;
}
.pie::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 140px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--acento), transparent);
}
.pie-iniciales {
  font-family: "Cinzel", serif;
  font-weight: 500;
  font-size: 1.5rem;
  letter-spacing: .35em;
  text-indent: .35em;
  color: var(--acento);
}
.pie-marca {
  margin-top: 6px;
  font-size: .78rem;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--tinta-suave);
}
.pie-marca span { color: var(--acento); font-weight: 600; }
