/* ===================================================================
   HOJA DE ESTILOS PERSONALIZADA - CRISTINA & JULIO
   Diseño Premium de Invitación Digital (Verde Oliva, Blanco y Oro)
   Optimizado para Cloudflare Pages · 60fps · Mobile-First
   =================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Alex+Brush&family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,600&family=Great+Vibes&family=Montserrat:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,500;0,600;0,700;0,800;1,400;1,600&display=swap');

:root {
  --color-olive: #556b2f;
  --color-olive-dark: #283618;
  --color-olive-deep: #131c15;
  --color-olive-light: #87986a;
  --color-olive-pale: #e9edc9;
  --color-gold: #d4af37;
  --color-gold-light: #f4e0ad;
  --color-gold-dark: #b38f28;
  --color-gold-sand: #e6ca85;
  --color-ivory: #fdfbf7;
  --color-ivory-soft: #f7f4ec;
  --color-dark-bg: #0d140f;
  --color-dark-card: #152219;
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-editorial: 'Cormorant Garamond', Georgia, serif;
  --font-script: 'Great Vibes', 'Alex Brush', cursive;
  --font-sans: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Tipografías y configuraciones base */
html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-dark-bg);
  color: #2b2b2b;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

.font-serif-title {
  font-family: var(--font-serif);
}

.font-editorial {
  font-family: var(--font-editorial);
}

.font-script {
  font-family: var(--font-script);
}

.font-sans-clean {
  font-family: var(--font-sans);
}

/* Scrollbar estética verde oliva y oro */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #0d140f;
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(to bottom, #556b2f, #d4af37);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #f4e0ad;
}

/* ===================================================================
   1. PANTALLA DE INICIO (TARJETA SOBRE FLOTANTE 3D)
   =================================================================== */
#welcome-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.85s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.85s ease;
  will-change: opacity, visibility;
  background-color: rgba(13, 20, 15, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 1.25rem;
}

#welcome-overlay.hidden-overlay {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.envelope-card {
  position: relative;
  background-color: var(--color-ivory);
  background-image: radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.95), rgba(253, 251, 247, 0.98));
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: 1.75rem;
  box-shadow: 
    0 25px 60px -15px rgba(0, 0, 0, 0.75),
    0 0 35px rgba(85, 107, 47, 0.25),
    0 0 20px rgba(212, 175, 55, 0.2),
    inset 0 0 0 1px rgba(255, 255, 255, 0.9);
  padding: 2rem 1.25rem;
  max-width: 24.5rem;
  width: 100%;
  text-align: center;
  animation: floatEnvelope 4.5s ease-in-out infinite alternate;
  z-index: 10;
}

@media (min-width: 640px) {
  .envelope-card {
    padding: 3rem 2.25rem;
    max-width: 27rem;
    border-radius: 2rem;
  }
}

@keyframes floatEnvelope {
  0% {
    transform: translateY(0px) rotate(0deg);
  }
  100% {
    transform: translateY(-8px) rotate(0.35deg);
  }
}

/* Adorno superior de moño / lazo fino */
.bow-ornament {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #556b2f;
  margin-bottom: 0.5rem;
  filter: drop-shadow(0 2px 4px rgba(85, 107, 47, 0.2));
}

/* Círculo dorado con las iniciales estrictas "C & J" en una sola línea */
.gold-initials-ring {
  width: 5.75rem;
  height: 5.75rem;
  min-width: 5.75rem;
  border-radius: 9999px;
  border: 2px solid var(--color-gold);
  background: radial-gradient(circle, rgba(253, 251, 247, 1) 0%, rgba(244, 238, 224, 0.8) 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  margin-right: auto;
  box-shadow: 0 6px 18px rgba(212, 175, 55, 0.25);
  position: relative;
  white-space: nowrap;
}

.gold-initials-ring::after {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 9999px;
  border: 1px dashed rgba(85, 107, 47, 0.45);
}

.gold-initials-text {
  font-family: var(--font-script);
  font-size: 1.75rem;
  line-height: 1;
  color: #283618;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: 0.04em;
  display: inline-block;
  user-select: none;
}

@media (min-width: 640px) {
  .gold-initials-ring {
    width: 6rem;
    height: 6rem;
    min-width: 6rem;
  }
  .gold-initials-text {
    font-size: 2rem;
  }
}

/* Botón circular de apertura de sobre */
.btn-open-envelope {
  width: 4.75rem;
  height: 4.75rem;
  border-radius: 9999px;
  background: linear-gradient(135deg, #e6ca85 0%, #d4af37 50%, #b38f28 100%);
  color: #0d140f;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(212, 175, 55, 0.45);
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  margin-left: auto;
  margin-right: auto;
  cursor: pointer;
  border: none;
  outline: none;
}

.btn-open-envelope:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 14px 32px rgba(212, 175, 55, 0.65);
  background: linear-gradient(135deg, #f4e0ad 0%, #e6ca85 50%, #d4af37 100%);
}

.btn-open-envelope:active {
  transform: scale(0.96);
}

/* ===================================================================
   2. REGLA DE ENCUADRE DE FONDOS (bg-top bg-contain / bg-cover estilizado)
   =================================================================== */
.bg-section-adaptive {
  background-position: center center !important;
  background-repeat: no-repeat !important;
  background-size: cover !important;
  background-color: var(--color-dark-bg);
}

@media (max-width: 768px) {
  .bg-section-adaptive {
    background-position: center center !important;
    background-size: cover !important;
    background-repeat: no-repeat !important;
  }
}

/* Overlays para garantizar alto contraste */
.overlay-dark-olive {
  background: linear-gradient(180deg, rgba(13, 20, 15, 0.72) 0%, rgba(13, 20, 15, 0.88) 100%);
}

.overlay-dark-soft {
  background: rgba(13, 20, 15, 0.76);
}

.overlay-dark-vignette {
  background: radial-gradient(circle at center, rgba(13, 20, 15, 0.6) 0%, rgba(13, 20, 15, 0.92) 100%);
}

/* ===================================================================
   3. SISTEMA DE PARTÍCULAS DORADAS Y HOJAS FLOTANTES (60 FPS)
   =================================================================== */
.particles-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

/* ===================================================================
   4. CONTROL DE AUDIO FLOTANTE
   =================================================================== */
.music-button {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 9999px;
  background: rgba(19, 28, 21, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 2px solid var(--color-gold);
  color: var(--color-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5), 0 0 15px rgba(212, 175, 55, 0.35);
  z-index: 50;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.music-button:hover {
  transform: scale(1.12);
  box-shadow: 0 12px 30px rgba(212, 175, 55, 0.6);
  color: #fff;
}

.music-button.is-playing i {
  animation: spinSlow 6s linear infinite;
}

@keyframes spinSlow {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.music-wave {
  position: absolute;
  inset: -4px;
  border-radius: 9999px;
  border: 1.5px solid var(--color-gold);
  opacity: 0;
  pointer-events: none;
}

.music-button.is-playing .music-wave {
  animation: wavePulse 2.2s infinite ease-out;
}

@keyframes wavePulse {
  0% {
    transform: scale(1);
    opacity: 0.85;
  }
  100% {
    transform: scale(1.45);
    opacity: 0;
  }
}

/* ===================================================================
   5. LÍNEA DE TIEMPO LINEAL (ITINERARIO VERTICAL ANIMADO)
   =================================================================== */
.timeline-track {
  position: relative;
  padding-left: 4.75rem; /* Separación generosa del borde izquierdo en móvil */
}

@media (min-width: 640px) {
  .timeline-track {
    padding-left: 5.5rem;
  }
}

@media (min-width: 768px) {
  .timeline-track {
    padding-left: 0;
  }
}

.timeline-track::before {
  content: '';
  position: absolute;
  top: 0.5rem;
  bottom: 0.5rem;
  left: 2.25rem; /* Centrado con el icono en móvil */
  width: 2px;
  background: linear-gradient(to bottom, transparent, var(--color-gold) 10%, var(--color-gold) 90%, transparent);
  transform: translateX(-50%);
  z-index: 0;
}

@media (min-width: 640px) {
  .timeline-track::before {
    left: 2.6rem;
  }
}

@media (min-width: 768px) {
  .timeline-track::before {
    left: 50%;
  }
}

.timeline-node {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.75s cubic-bezier(0.4, 0, 0.2, 1), transform 0.75s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: opacity, transform;
}

.timeline-node.in-view {
  opacity: 1;
  transform: translateY(0);
}

.timeline-icon {
  position: absolute;
  top: 0;
  left: -3.75rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  background-color: #131c15;
  border-width: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
  z-index: 10;
}

@media (min-width: 640px) {
  .timeline-icon {
    left: -4.15rem;
  }
}

@media (min-width: 768px) {
  .timeline-icon {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }
}

/* ===================================================================
   6. GALERÍA MASONRY (SIN RECORTES DE ROSTROS NI BORDES)
   =================================================================== */
.masonry-container {
  column-gap: 1.25rem;
}

.masonry-item {
  break-inside: avoid;
  margin-bottom: 1.25rem;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  cursor: pointer;
  border-radius: 1.25rem;
  overflow: hidden;
  position: relative;
  background-color: rgba(255, 255, 255, 0.05);
}

.masonry-item:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 35px -8px rgba(0, 0, 0, 0.6), 0 0 20px rgba(212, 175, 55, 0.2);
}

.masonry-item img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.masonry-item:hover img {
  transform: scale(1.03);
}

/* Overlay sutil en hover de galería */
.masonry-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(13, 20, 15, 0.6) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.35s ease;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 1.25rem;
}

.masonry-item:hover .masonry-overlay {
  opacity: 1;
}

/* ===================================================================
   7. FORMULARIO RSVP DE CONFIRMACIÓN (ESTILO IMAGEN.PNG)
   =================================================================== */
.rsvp-card {
  background: rgba(19, 28, 21, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: 2rem;
  box-shadow: 
    0 25px 60px -15px rgba(0, 0, 0, 0.8),
    0 0 35px rgba(212, 175, 55, 0.18);
}

.input-underline {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1.5px solid rgba(212, 175, 55, 0.45);
  padding: 0.85rem 0.25rem;
  color: #ffffff;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.input-underline:focus {
  border-bottom-color: var(--color-gold-light);
  box-shadow: 0 2px 0 0 var(--color-gold);
}

.input-underline::placeholder {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.95rem;
}

/* Estilo de selector desplegable */
select.input-underline {
  cursor: pointer;
  background-color: #131c15;
}

select.input-underline option {
  background-color: #131c15;
  color: #ffffff;
  padding: 0.75rem;
}

/* Botón Píldora Dorado WhatsApp */
.btn-whatsapp-rsvp {
  background: linear-gradient(135deg, #e6ca85 0%, #d4af37 50%, #b38f28 100%);
  color: #0b120e;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 9999px;
  padding: 1.1rem 2.5rem;
  box-shadow: 0 10px 25px rgba(212, 175, 55, 0.35);
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  border: none;
  cursor: pointer;
}

.btn-whatsapp-rsvp:hover {
  background: linear-gradient(135deg, #f4e0ad 0%, #e6ca85 50%, #d4af37 100%);
  box-shadow: 0 14px 32px rgba(212, 175, 55, 0.55);
  transform: translateY(-2px);
}

.btn-whatsapp-rsvp:active {
  transform: translateY(0);
}

/* ===================================================================
   8. FOOTER / CRÉDITOS Y CAPTACIÓN DE CLIENTES
   =================================================================== */
.footer-container {
  background-color: #090e0b;
  border-top: 1px solid rgba(212, 175, 55, 0.25);
}

.footer-link {
  position: relative;
  color: var(--color-gold);
  font-weight: 700;
  text-decoration: none;
  transition: color 0.3s ease;
  padding: 0.25rem 0.5rem;
}

.footer-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--color-gold-light);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.footer-link:hover {
  color: var(--color-gold-light);
}

.footer-link:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* ===================================================================
   9. ELEMENTOS ANIMADOS AL SCROLL (FADE-UP)
   =================================================================== */
.fade-up-item {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: opacity, transform;
}

.fade-up-item.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* ===================================================================
   10. LIGHTBOX MODAL PARA FOTOGRAFÍAS
   =================================================================== */
#lightbox-modal {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
  z-index: 10000;
}

#lightbox-modal.active {
  opacity: 1;
  visibility: visible;
}
