/**
 * Verde Encanto — Home Global
 * Utilidades, secciones decorativas, animaciones compartidas entre secciones de la home
 */

/* ── Overrides contenedor ── */
#page .site-content { padding: 0 !important; }
.ast-container { max-width: 100% !important; padding: 0 !important; }
body { padding-left: 0 !important; padding-right: 0 !important; }
#primary { margin: 0 !important; padding: 0 !important; }
.entry-content { margin-top: 0 !important; padding: 0 !important; }
#ve-home { width: 100%; overflow-x: hidden; }

/* ── Animaciones de scroll ── */
.ve-animate-on-scroll {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.ve-animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
  /* Soltar la promoción de capa GPU una vez terminada la animación: si se
     mantiene, la capa se rasteriza a 1x y desenfoca imágenes en retina. */
  will-change: auto;
}

/* Stagger */
.ve-stagger-1 { transition-delay: 0.1s; }
.ve-stagger-2 { transition-delay: 0.2s; }
.ve-stagger-3 { transition-delay: 0.3s; }
.ve-stagger-4 { transition-delay: 0.4s; }

/* ── Fondo crema ── */
.ve-bg-cream { background: #F5F1E8; }

/* ── Fondo blanco + diamante ── */
.ve-bg-white-diamond {
  background: #ffffff;
  position: relative;
  overflow: hidden;
  background: radial-gradient(circle at center, #ffffff 0%, #f8f8f8 100%);
  padding: 5rem 0 4rem;
}

/* Patrón sutil de fondo tipo tela */
.ve-bg-white-diamond::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: 
    radial-gradient(circle at 25% 25%, rgba(212, 175, 55, 0.03) 1px, transparent 1px),
    radial-gradient(circle at 75% 75%, rgba(212, 175, 55, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

.ve-bg-white-diamond > .ve-container {
  position: relative;
  z-index: 1;
}

/* Diamante dorado premium */
.ve-bg-white-diamond::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(45deg);
  width: 600px;
  height: 600px;
  background: radial-gradient(
    ellipse at center,
    rgba(212, 175, 55, 0.08) 0%,
    rgba(212, 175, 55, 0.04) 40%,
    transparent 70%
  );
  pointer-events: none;
  animation: diamondGlow 4s ease-in-out infinite;
}

@keyframes diamondGlow {
  0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) rotate(45deg) scale(1); }
  50% { opacity: 1; transform: translate(-50%, -50%) rotate(45deg) scale(1.1); }
}

/* Borde superior arcoíris */
.ve-bg-white-diamond::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg,
    #228B22 0%,
    #32CD32 15%,
    #90EE90 30%,
    #D4AF37 45%,
    #FFD700 50%,
    #D4AF37 55%,
    #90EE90 70%,
    #32CD32 85%,
    #228B22 100%
  );
  z-index: 10;
  box-shadow: 0 2px 10px rgba(212, 175, 55, 0.3);
}

.ve-bg-white-diamond > .ve-container {
  position: relative;
  z-index: 1;
}

/* ── Borde decorativo inferior ── */
.ve-section-border-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    #D4AF37 20%,
    #F4E4BC 50%,
    #D4AF37 80%,
    transparent 100%
  );
  z-index: 10;
  /* Sombra dorada */
  box-shadow: 
    0 2px 15px rgba(212, 175, 55, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

/* Línea adicional sutil */
.ve-section-border-bottom::after {
  content: '';
  position: absolute;
  top: -8px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(212, 175, 55, 0.3),
    transparent
  );
}

/* ── Esquinas decorativas ── */
.ve-corner-decoration {
  position: absolute;
  width: 40px;
  height: 40px;
  z-index: 11;
  opacity: 0.9;
}

/* Glow dorado */
.ve-corner-decoration::before,
.ve-corner-decoration::after {
  content: '';
  position: absolute;
  background: linear-gradient(135deg, #FFD700, #D4AF37, #B8860B);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

.ve-corner-decoration.top-left { top: 8px; left: 8px; }
.ve-corner-decoration.top-left::before { width: 25px; height: 3px; top: 0; left: 0; }
.ve-corner-decoration.top-left::after { width: 3px; height: 25px; top: 0; left: 0; }

.ve-corner-decoration.top-right { top: 8px; right: 8px; }
.ve-corner-decoration.top-right::before { width: 25px; height: 3px; top: 0; right: 0; }
.ve-corner-decoration.top-right::after { width: 3px; height: 25px; top: 0; right: 0; }

.ve-corner-decoration.bottom-left { bottom: 8px; left: 8px; }
.ve-corner-decoration.bottom-left::before { width: 25px; height: 3px; bottom: 0; left: 0; }
.ve-corner-decoration.bottom-left::after { width: 3px; height: 25px; bottom: 0; left: 0; }

.ve-corner-decoration.bottom-right { bottom: 8px; right: 8px; }
.ve-corner-decoration.bottom-right::before { width: 25px; height: 3px; bottom: 0; right: 0; }
.ve-corner-decoration.bottom-right::after { width: 3px; height: 25px; bottom: 0; right: 0; }

/* ── Fondo bosque onírico ── */
.ve-bg-forest {
  background: linear-gradient(135deg,
    rgba(16, 52, 29, 0.95) 0%,
    rgba(34, 139, 34, 0.85) 30%,
    rgba(212, 175, 55, 0.75) 70%,
    rgba(245, 228, 188, 0.85) 100%
  );
  position: relative;
}

.ve-bg-forest::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('https://images.pexels.com/photos/1547813/pexels-photo-1547813.jpeg?auto=compress&cs=tinysrgb&w=1920');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.3;
  z-index: 0;
}

.ve-bg-forest > * {
  position: relative;
  z-index: 1;
}

/* ── Divider ── */
.ve-divider {
  width: 80px;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    #D4AF37 20%,
    #F4E4BC 50%,
    #D4AF37 80%,
    transparent 100%
  );
  margin: 1.5rem auto 2rem;
  border-radius: 2px;
  position: relative;
}

/* Diamante central en el divider */
.ve-divider::after {
  content: '◆';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: #D4AF37;
  font-size: 0.6rem;
  background: var(--ve-white);
  padding: 0 0.5rem;
}

/* ── Section header ── */
.ve-section-header h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2.75rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 1rem;
  text-align: center;
  position: relative;
  /* Gradiente dorado sutil en el texto */
  background: linear-gradient(
    135deg,
    #1a1a1a 0%,
    #2d2d2d 50%,
    #1a1a1a 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Línea decorativa dorada debajo del título */
.ve-section-header h2::after {
  content: '';
  display: block;
  width: 60px;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    #D4AF37,
    transparent
  );
  margin: 0.75rem auto 0;
}

.ve-section-header p {
  color: #666666;
  font-size: 1.1rem;
  line-height: 1.6;
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .ve-section-header h2 {
    font-size: 1.9rem;
  }
  .ve-section-header p {
    font-size: 1rem;
  }
  .ve-bg-white-diamond {
    padding: 3rem 0 2rem;
  }
}

/* ── Reduced Motion ── Accesibilidad: respetar prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .ve-animate-on-scroll,
  .ve-animate-on-scroll.is-visible {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    will-change: auto !important;
  }

  .ve-stagger-1,
  .ve-stagger-2,
  .ve-stagger-3,
  .ve-stagger-4 {
    transition-delay: 0s !important;
    transition: none !important;
  }

  .ve-bg-white-diamond::before {
    animation: none !important;
    opacity: 0.6 !important;
    transform: translate(-50%, -50%) scale(1) !important;
  }
}
