/* ============================================================
   SHARED/BASE.CSS
   Lo UNICO que debe vivir aqui: reset global, variables de color,
   el "shell" de la invitacion (contenedor que todas las secciones
   comparten) y componentes de UI que se repiten en 2+ secciones
   (boton, tarjeta de sede, texto de mensaje, sistema de animacion
   al hacer scroll).

   Si un estilo le pertenece a UNA sola seccion, va en el css de
   esa seccion, NO aqui. Esto es el "idioma visual" comun, no
   contenido.
   ============================================================ */

/* ── RESET & VARIABLES DE TEMA ──────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0f0c1a;
  --envelope:  #f5ead8;
  --flap:      #e8d5b0;
  --folds:     #ddc89a;
  --seal:      #8b1a1a;
  --gold:      #c9a96e;
  --card-bg:   #fffdf7;
  --card-text: #2c1a0e;
}

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: var(--bg);
  font-family: 'Georgia', serif;
  -webkit-font-smoothing: antialiased;
}

/* ── SHELL DE LA INVITACION (contenedor de TODAS las secciones) ── */
#invitation {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: 430px;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  background: #0f0c1a;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  transition: transform 0.8s cubic-bezier(0.2, 0.9, 0.3, 1);
  scroll-behavior: smooth;
}

#invitation.open {
  transform: translateX(-50%) translateY(0);
}

/* ── SECCION GENERICA (usada por todas las secciones) ───────── */
.inv-section {
  padding: 72px 24px;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  /* text-shadow se hereda a TODO el texto de la seccion -- sirve para
     mantener legibilidad sobre fotos de fondo claras/con mucho detalle
     sin tener que oscurecer la foto (overlayOpacity). */
  text-shadow: 0 2px 6px rgba(0,0,0,0.55), 0 1px 2px rgba(0,0,0,0.8);
}

.inv-section--dark {
  background: rgba(255,255,255,0.025);
}

/* Cuando una seccion tiene imagen de fondo, quitamos el tinte plano */
.inv-section--dark:has(.inv-section-bg-layer) {
  background: transparent;
}

/* Capas de fondo de seccion, inyectadas por shared/section-background.js.
   Cada seccion decide SU propia imagen/opacidad; este css solo define
   como se ven las dos capas. */
.inv-section-bg-layer {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  pointer-events: none;
  background-blend-mode: normal;
}

.inv-section-bg-overlay {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.inv-section-label {
  font-size: 1.8rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: #c9a96e;
  display: block;
  margin-bottom: 10px;
  text-align: center;
}

.inv-section-title {
  font-family: 'Georgia', serif;
  font-size: 1.6rem;
  font-style: italic;
  color: #f5f0e8;
  text-align: center;
  margin-bottom: 32px;
  line-height: 1.3;
}

/* ── TEXTO DE MENSAJE (usado por message, padrinos, dresscode, rsvp) ── */
.inv-message-text {
  font-size: 0.9rem;
  color: #f5f0e8;
  line-height: 1.9;
  text-align: center;
  font-style: italic;
  max-width: 320px;
  margin: 0 auto;
}

/* ── BLOQUE "PENDIENTE" (usado por rsvp y gphotos cuando falta un link) ── */
.inv-rsvp-pending {
  font-size: 0.82rem;
  color: #f5f0e8;
  line-height: 1.8;
  text-align: center;
  font-style: italic;
  max-width: 300px;
  margin: 24px auto 0;
  padding: 16px 20px;
  border: 1px dashed rgba(201,169,110,0.25);
  border-radius: 14px;
}

/* ── BOTON (usado por casi todas las secciones) ─────────────── */
.inv-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  border-radius: 999px;
  background: linear-gradient(135deg, #8b6914, #c9a96e, #e8d5a3);
  color: #1a1000;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
  text-shadow: none;
  border: none;
  cursor: pointer;
  margin-top: 24px;
  box-shadow: 0 4px 20px rgba(201,169,110,0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.inv-btn:active {
  transform: scale(0.97);
  box-shadow: 0 2px 10px rgba(201,169,110,0.2);
}

.inv-btn--sm {
  min-height: 44px;
  font-size: 0.65rem;
  padding: 10px 24px;
  align-self: flex-start;
}

.inv-btn--outline {
  background: transparent;
  border: 1.5px solid rgba(201,169,110,0.55);
  color: #c9a96e;
  box-shadow: none;
}

.inv-btn--outline:active {
  background: rgba(201,169,110,0.08);
}

.inv-btn--pinterest {
  margin: 20px 0 0;
  width: 100%;
}

/* ── DETALLE LABEL/VALUE (usado dentro de la tarjeta de sede) ── */
.inv-detail-label {
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #c9a96e;
  margin-bottom: 4px;
}

.inv-detail-value {
  font-size: 0.9rem;
  color: #f5f0e8;
  line-height: 1.5;
}

/* ── TARJETA DE SEDE (compartida EXACTAMENTE igual por
   Ceremonia y Recepcion -- por eso vive aqui y no duplicada
   en cada seccion). Si algun dia quieres que luzcan distinto,
   avisame y la separamos en ceremony.css / reception.css. ── */
.inv-venue-card {
  background: rgba(255,255,255,0.07);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 20px;
  overflow: hidden;
  margin-top: 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.1);
}

.inv-venue-img-wrap {
  width: 100%;
  height: 443px;
  overflow: hidden;
  background: rgba(201,169,110,0.06);
  border-bottom: 1px solid rgba(201,169,110,0.1);
}

.inv-venue-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: transparent;
}

.inv-venue-body {
  padding: 20px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.inv-venue-address {
  font-size: 0.78rem;
  color: #f5f0e8;
  line-height: 1.5;
  margin-top: 2px;
}

.inv-venue-time-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0 6px;
}

.inv-venue-time-badge {
  background: linear-gradient(135deg, #8b6914, #c9a96e);
  color: #1a1000;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 4px 14px;
  border-radius: 999px;
  text-shadow: none;
}

.inv-venue-note {
  font-size: 0.78rem;
  color: #f5f0e8;
  font-style: italic;
  line-height: 1.6;
  margin-bottom: 12px;
}

/* ── SISTEMA DE ANIMACION AL HACER SCROLL (usado por TODAS) ─── */
[data-animate] {
  opacity: 0;
  will-change: opacity, transform;
}

[data-animate="fade-up"]    { transform: translateY(28px); }
[data-animate="fade-left"]  { transform: translateX(28px); }
[data-animate="fade-right"] { transform: translateX(-28px); }
[data-animate="scale-in"]   { transform: scale(0.88); }

[data-animate].visible {
  opacity: 1;
  transform: none;
  transition:
    opacity  0.65s cubic-bezier(0.22,1,0.36,1),
    transform 0.65s cubic-bezier(0.22,1,0.36,1);
}

[data-delay="100"].visible { transition-delay: 100ms; }
[data-delay="200"].visible { transition-delay: 200ms; }
[data-delay="300"].visible { transition-delay: 300ms; }
[data-delay="400"].visible { transition-delay: 400ms; }

@keyframes invFadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0);    }
}
