/* =========================================================
   ADJ Ingeniería y Construcción SAS — footer.css
   Componente independiente: pie de página (<footer class="site-footer">).
   Autocontenido (tokens locales `--footer-*`, clases con prefijo
   `.site-footer`) para poder moverse o reutilizarse sin depender
   de otras secciones del sitio.

   Estructura:
   1. Tokens de color locales
   2. Contenedor y layout general
   3. Fila superior: grid de 4 columnas (marca + 3 columnas de enlaces)
   4. Bloque de marca (logo + mensaje)
   5. Columnas de navegación (encabezado + lista de enlaces)
   6. Columna "Contacto" (correo + ciudad, sin lista de navegación)
   7. Divisor y copyright
   8. Animación de entrada (IntersectionObserver, ver js/footer.js)
   9. Accesibilidad de movimiento reducido
   10. Responsive (tablet / móvil)
   ========================================================= */

/* ---------- 1. Tokens de color locales ---------- */
.site-footer {
  --footer-background: #071C2B;
  --footer-primary: #FFFFFF;
  --footer-secondary: #AEBCC6;
  --footer-muted: #6F8594;
  --footer-accent: #79B8E6;
  --footer-divider: rgba(174, 188, 198, 0.22);

  --footer-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- 2. Contenedor y layout general ---------- */
.site-footer {
  background-color: var(--footer-background);
  padding-block: clamp(80px, 8vw, 110px) clamp(28px, 4vw, 40px);
}

.site-footer__container {
  width: 100%;
  max-width: 1680px;
  margin-inline: auto;
  padding-inline: clamp(20px, 6vw, 96px);
}

/* ---------- 3. Fila superior: grid de 4 columnas ----------
   Los pisos mínimos son un poco más bajos que la "orientación" del
   encargo (430/150/180/230px): con esos valores la suma de mínimos
   supera el ancho disponible entre ~1180-1500px y el contenido se
   corta antes de llegar al quiebre a tablet (mismo problema ya
   resuelto en contact-section.css). */
.site-footer__top {
  display: grid;
  grid-template-columns:
    minmax(320px, 1.5fr)
    minmax(130px, 0.75fr)
    minmax(150px, 0.75fr)
    minmax(190px, 0.85fr);
  gap: clamp(2.5rem, 5vw, 7rem);
  overflow-x: hidden;
}

/* El <nav> agrupa semánticamente las 3 columnas de enlaces sin
   romper el grid de 4 pistas: sus hijos pasan a ser ítems directos
   de .site-footer__top gracias a display: contents. */
.site-footer__nav {
  display: contents;
}

/* ---------- 4. Bloque de marca ---------- */
.site-footer__brand {
  display: flex;
  align-items: center;
  gap: clamp(20px, 2.5vw, 32px);
  flex-wrap: wrap;
}

.site-footer__logo {
  flex-shrink: 0;
  width: clamp(105px, 11vw, 155px);
  height: auto;
  display: block;
}

.site-footer__message {
  margin: 0;
  max-width: 280px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(1rem, 1.4vw, 1.125rem);
  line-height: 1.4;
  color: var(--footer-primary);
}

/* ---------- 5. Columnas de navegación ---------- */
.site-footer__col {
  min-width: 0;
}

.site-footer__heading {
  margin: 0 0 22px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--footer-muted);
}

.site-footer__list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.site-footer__link {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 17px;
  color: var(--footer-secondary);
  text-decoration: none;
  transition: color 0.2s ease, transform 0.2s ease;
}

.site-footer__link:hover,
.site-footer__link:focus-visible {
  color: var(--footer-primary);
  transform: translateX(4px);
}

.site-footer__link:focus-visible {
  outline: 2px solid var(--footer-accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- 6. Columna "Contacto": texto plano sin enlace ---------- */
.site-footer__text {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 17px;
  color: var(--footer-secondary);
}

/* ---------- 7. Divisor y copyright ---------- */
.site-footer__divider {
  width: 100%;
  height: 1px;
  margin-block: clamp(75px, 8vw, 110px) clamp(30px, 3vw, 42px);
  border: none;
  background-color: var(--footer-divider);
}

.site-footer__copyright {
  margin: 0;
  text-align: left;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.6;
  color: var(--footer-muted);
}

/* ---------- 8. Animación de entrada (JS agrega .site-footer-js) ----------
   Por defecto el contenido es completamente visible: así se ve íntegro
   si JavaScript está desactivado. Solo cuando footer.js confirma que
   puede animar, añade `.site-footer-js` al <footer> y estas reglas
   ocultan los bloques para revelarlos con el IntersectionObserver. */
.site-footer-js .site-footer-reveal {
  opacity: 0;
  transform: translate3d(0, 28px, 0);
  transition: opacity 0.85s var(--footer-ease), transform 0.85s var(--footer-ease);
  will-change: opacity, transform;
}

.site-footer-js .site-footer-reveal.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* ---------- 9. Accesibilidad de movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  .site-footer-js .site-footer-reveal {
    opacity: 1;
    transform: none;
    transition: none;
    will-change: auto;
  }

  .site-footer__link {
    transition: color 0.2s ease;
  }

  .site-footer__link:hover,
  .site-footer__link:focus-visible {
    transform: none;
  }
}

/* ---------- 10. Responsive ---------- */
@media (max-width: 1180px) {
  .site-footer__top {
    grid-template-columns: 1fr;
    row-gap: clamp(2.5rem, 6vw, 4rem);
  }

  .site-footer__nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(140px, 1fr));
    gap: clamp(1.75rem, 4vw, 3rem);
  }
}

@media (max-width: 640px) {
  .site-footer {
    padding-block: clamp(56px, 12vw, 80px) 28px;
  }

  .site-footer__nav {
    grid-template-columns: 1fr;
    row-gap: 36px;
  }

  .site-footer__brand {
    gap: 20px;
  }

  .site-footer__divider {
    margin-block: 48px 28px;
  }

  .site-footer__link {
    padding-block: 4px;
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .site-footer__copyright {
    font-size: 15px;
    line-height: 1.7;
  }
}
