/* =============================================================================
   FOOTER · Glassmorphism + diamantes brand + grid responsive
   Recurso compartido entre TODAS las páginas. NO añadir reglas ajenas
   (octaedro, botones, etc.) — este archivo se mantiene puro de footer.
   Versión canónica tomada del index.html (la más completa).
   ============================================================================= */

/* --- Base glass del footer ---------------------------------------------------- */
footer {
  /* Glass tier "standard" · ALPHA bajo para que el octaedro 3D + body::before aura
     se vean atravesando el cristal. Coherente con .panel.iridescent del sitio. */
  background: linear-gradient(
    135deg,
    rgba(216, 238, 247, 0.45) 0%,
    rgba(232, 230, 248, 0.45) 50%,
    rgba(221, 243, 230, 0.45) 100%
  ) !important;
  backdrop-filter: blur(14px) saturate(150%) !important;
  -webkit-backdrop-filter: blur(14px) saturate(150%) !important;
  color: #0a0a0a !important;
  border-top: 1px solid rgba(255, 255, 255, 0.7) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    0 -8px 32px rgba(11, 13, 18, 0.04) !important;
  padding: 80px 6vw 40px !important;
  position: relative;
  z-index: 5;
  overflow: hidden;
}

/* --- Layout interno del grid (max-width + margin para centrar contenido) ----- */
footer .grid {
  display: grid !important;
  margin: 0 auto 40px !important;
}

/* --- Tipografía estructural h4/ul que el inline definía ------------------------ */
footer h3 {
  font-size: 11px !important;
  letter-spacing: 0.14em !important;
  text-transform: uppercase !important;
  margin: 0 0 14px !important;
  font-weight: 600 !important;
}
footer ul {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
}
footer .copy {
  max-width: 1200px !important;
  margin: 0 auto !important;
  font-size: 12px !important;
  padding-top: 22px !important;
}

/* --- Aura decorativa SIBLING antes del footer ---------------------------------
   IMPORTANTE: body::before NO funciona aquí. Usamos body::after posicionado
   ABSOLUTE relative al body con altura limitada al footer area. Esto garantiza
   que las diamantes están FUERA del stacking context del footer, así
   `backdrop-filter: blur(32px)` del footer SÍ las blurrea (efecto glass real).
   En pages sin Three.js scene (blog/legal/calc), esta aura provee el "algo
   detrás para blurrear" que glassmorphism requiere visualmente. */
/* CRITICAL: body needs position:relative so body::before positions relative
   to body (full document height), NOT al initial containing block (viewport).
   Sin esto, el aura aparece a 900px del top viewport, no detrás del footer. */
body {
  position: relative;
}
body::before {
  /* Aura decorativa SIBLING para que glass del footer tenga contenido detrás
     incluso en pages sin Three.js scene. Anclada al fondo del documento. */
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 900px;
  background:
    radial-gradient(ellipse 55% 60% at 85% 75%, rgba(30, 200, 255, 0.35), transparent 65%),
    radial-gradient(ellipse 55% 60% at 15% 85%, rgba(183, 148, 244, 0.30), transparent 65%),
    radial-gradient(ellipse 45% 40% at 50% 95%, rgba(110, 231, 168, 0.22), transparent 65%);
  pointer-events: none;
  z-index: 0;
}

/* --- Dos rombos decorativos en esquinas opuestas (DENTRO del footer · refuerzo
   visual además de la aura externa) ------------------------------------------- */
footer::before,
footer::after {
  content: '';
  position: absolute;
  width: 320px;
  height: 320px;
  background: conic-gradient(
    from 200deg,
    var(--accent),
    var(--accent-2),
    var(--accent-3),
    var(--accent)
  );
  -webkit-mask-image: var(--diamond-mask);
  mask-image: var(--diamond-mask);
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  opacity: 0.25;
  filter: blur(0.5px);
  pointer-events: none;
  z-index: 0;
}
footer::before {
  top: -90px;
  right: -90px;
  transform: rotate(15deg);
}
footer::after {
  bottom: -90px;
  left: -90px;
  transform: rotate(-25deg);
}

/* Contenido del footer por encima de los rombos */
footer > * {
  position: relative;
  z-index: 1;
}

/* --- Tipografía y colores del contenido ------------------------------------- */
footer .logo p,
footer p,
footer ul li {
  color: rgba(11, 13, 18, 0.78) !important;
  opacity: 1 !important;
}
footer h3 {
  color: rgba(11, 13, 18, 0.55) !important;
  opacity: 1 !important;
}
footer .copy {
  color: rgba(11, 13, 18, 0.55) !important;
  border-top: 1px solid rgba(11, 13, 18, 0.1) !important;
  opacity: 1 !important;
}
/* El logo del header tiene un span con conic-gradient que aquí no queremos
   (se reemplaza por la <img> del SVG) */
footer .logo > span:first-child {
  display: none !important;
}

/* --- Enlaces ----------------------------------------------------------------- */
footer a {
  color: inherit !important;
  text-decoration: none !important;
  transition:
    opacity 0.2s ease,
    color 0.2s ease;
}
footer a:hover {
  opacity: 0.65;
  color: var(--accent) !important;
}
footer ul li {
  padding: 4px 0;
  font-size: 14px;
}

/* --- Grid de 4 columnas (brand + páginas + contacto + legal) ----------------- */
footer .grid {
  grid-template-columns: 2fr 1fr 1fr 1fr !important;
  gap: 48px !important;
  max-width: 1100px !important;
}
@media (max-width: 760px) {
  footer .grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 32px !important;
  }
  footer .footer-brand {
    grid-column: 1 / -1;
  }
}
@media (max-width: 480px) {
  footer .grid {
    grid-template-columns: 1fr !important;
  }
}
