/* ============================================================================
   CANTOVI · Footer global
   Markup único: template-parts/cantovi-footer.php (todas las páginas).
   Se encola DESPUÉS del CSS de cada página (functions.php, prioridad 100) y
   usa `html body #footer.site-footer` para ganar a las copias antiguas que
   siguen en assets/css/pages/*.css y front-page.css.
   - Fondo: --bg-inverse (#1b2124), igual en todas las páginas.
   - Wordmark «CANTOVI.» ocupa el ancho completo de la rejilla (container query).
   - Redes: Button ghost-inverse icon-only lg (48×48, icono 24).
   ========================================================================== */

html body #footer.site-footer {
  background: var(--bg-inverse, #1b2124);
  color: var(--base-white, #fff);
  margin: 0;
  padding: 64px 0 0;
  border: 0;
  font-family: var(--font-family-base);
  overflow: hidden;
}

html body #footer.site-footer .footer-grid {
  container-type: inline-size;
  box-sizing: border-box;
  width: 100%;
  max-width: calc(1080px + 48px);
  margin: 0 auto;
  padding: 0 24px;
  background: none;
}

html body #footer.site-footer .footer-nav {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 40px;
  margin: 0 0 48px;
}

html body #footer.site-footer .footer-col-title {
  margin: 0 0 16px;
  color: var(--base-white, #fff);
  font-size: 16px !important;
  line-height: 24px !important;
  font-weight: 700 !important;
  letter-spacing: 0 !important;
  opacity: 1;
  transform: none;
}

html body #footer.site-footer .footer-col-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

html body #footer.site-footer .footer-link {
  color: var(--grey-300, #bfc2c6);
  font-size: 16px !important;
  line-height: 24px !important;
  font-weight: 300 !important;
  letter-spacing: 0 !important;
  text-decoration: none;
  transition: color .2s;
}

html body #footer.site-footer .footer-link:hover,
html body #footer.site-footer .footer-link:focus-visible {
  color: var(--base-white, #fff);
}

html body #footer.site-footer .footer-link:not(.footer-link--external):hover {
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}

html body #footer.site-footer .footer-link--external {
  line-height: 24px !important;
}

html body #footer.site-footer .footer-link--external .footer-link__label {
  font-size: 16px !important;
  line-height: 24px !important;
  font-weight: 500 !important;
  letter-spacing: 0 !important;
}

/* Redes: icon button ghost; se compensa el padding interno (12px) para que
   el icono quede alineado con el texto de la columna. */
html body #footer.site-footer .footer-social {
  display: flex;
  gap: 8px;
  margin: -12px 0 0 -12px;
}

html body #footer.site-footer .footer-social-link {
  --btn-icon: 24px;
  box-sizing: border-box;
  flex: 0 0 48px;
  width: 48px;
  min-width: 0;
  max-width: 48px;
  height: 48px;
  padding: 0;
  gap: 0;
  border-radius: 0;
  color: var(--base-white, #fff);
}

html body #footer.site-footer .footer-social-link svg {
  width: 24px;
  height: 24px;
}

/* Wordmark al ancho completo de la rejilla.
   Tinta de «CANTOVI.» (Neue Haas 700, tracking -0.03em) ≈ 4.295× su font-size,
   con 0.02em de margen lateral izquierdo que se compensa con margin-left. */
html body #footer.site-footer .footer-wordmark {
  display: block;
  width: auto;
  margin: 0 0 24px -0.02em;
  padding: 0;
  color: var(--base-white, #fff);
  font-family: var(--font-family-base);
  font-size: calc(100cqw / 4.3) !important;
  font-weight: 700;
  line-height: .8;
  letter-spacing: -0.03em !important;
  white-space: nowrap;
  opacity: 1 !important;
  transform: none !important;
}

html body #footer.site-footer .footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0;
  padding: 16px 0 24px;
  border-top: 1px solid var(--opacity-light-10, rgba(255,255,255,.1));
}

html body #footer.site-footer .footer-legal {
  color: var(--grey-300, #bfc2c6);
  font-size: 14px !important;
  line-height: 20px !important;
  font-weight: 400 !important;
  letter-spacing: 0 !important;
}

@media (max-width: 1024px) {
  html body #footer.site-footer .footer-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 32px 24px;
  }
}

@media (max-width: 640px) {
  html body #footer.site-footer { padding-top: 48px; }
  html body #footer.site-footer .footer-grid { padding: 0 20px; }
  html body #footer.site-footer .footer-nav { margin-bottom: 40px; }
  html body #footer.site-footer .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}

/* ============================================================================
   Franja animada «CANTOVI. → foto → …» (debajo del copyright, ancho completo)
   - .footer-strip__viewport recorta (overflow: clip) y reserva la altura.
   - .footer-strip__rise     → entrada vertical (una vez por visita).
   - .footer-strip__track    → bucle horizontal: 2 × .footer-strip__seq y se
     desplaza -50 % (= una repetición exacta, incluido el hueco final).
   Todo se mide en em del font-size de la franja, así escala en móvil.
   JS (assets/js/footer-strip.js): .is-armed/.is-revealed, pausa fuera de
   pantalla (.is-offscreen) y botón Pausar/Reanudar (.is-paused).
   ========================================================================== */

html body #footer.site-footer .footer-strip {
  --strip-size: clamp(76px, 13.4vw, 220px);
  --strip-gap: .32em;
  --strip-photo-h: .72em;           /* = altura de mayúscula de Neue Haas 700 */
  --strip-photo-w: calc(var(--strip-photo-h) * 1.5);
  --strip-duration: 48s;
  --strip-rise: 105%;
  position: relative;
  width: 100%;
  margin: 32px 0 0;
}

html body #footer.site-footer .footer-strip__viewport {
  position: relative;
  width: 100%;
  overflow: hidden;
  overflow: clip;
  font-family: var(--font-family-base);
  font-size: var(--strip-size);
  line-height: 1;
}

html body #footer.site-footer .footer-strip__rise {
  transform: translate3d(0, 0, 0);
}

html body #footer.site-footer .footer-strip__track {
  display: flex;
  width: max-content;
  animation: cantovi-footer-strip var(--strip-duration) linear infinite;
  will-change: transform;
}

html body #footer.site-footer .footer-strip__seq {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: var(--strip-gap);
  padding-right: var(--strip-gap);  /* hueco entre el final y el inicio */
}

html body #footer.site-footer .footer-strip__word {
  display: block;
  flex: 0 0 auto;
  margin: 0;
  color: var(--grey-50, #f6f7f7);
  font-family: inherit;
  font-size: 1em !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  letter-spacing: -0.03em !important;
  white-space: nowrap;
  /* recorta la caja a altura de mayúscula → centra con la foto */
  text-box: trim-both cap alphabetic;
}

html body #footer.site-footer .footer-strip__photo {
  display: block;
  flex: 0 0 auto;
  width: var(--strip-photo-w);
  height: var(--strip-photo-h);
  max-width: none;
  margin: 0;
  object-fit: cover;
  border-radius: 0;
  background: var(--grey-800, #2b3237);
}

@keyframes cantovi-footer-strip {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-50%, 0, 0); }
}

/* Entrada vertical: solo cuando el JS la arma (sin JS se ve en su sitio).
   Sale hacia abajo al subir (scroll up) y vuelve a entrar al bajar. */
html body #footer.site-footer .footer-strip.is-armed .footer-strip__rise {
  transform: translate3d(0, var(--strip-rise), 0);
  transition: transform .55s cubic-bezier(.5, 0, .75, 0);
}

html body #footer.site-footer .footer-strip.is-armed.is-revealed .footer-strip__rise {
  transform: translate3d(0, 0, 0);
  transition: transform 1s cubic-bezier(.16, 1, .3, 1);
}

/* Fuera de pantalla o pausada por el usuario: la pista se detiene. */
html body #footer.site-footer .footer-strip.is-offscreen .footer-strip__track,
html body #footer.site-footer .footer-strip.is-paused .footer-strip__track {
  animation-play-state: paused;
}

/* Control Pausar / Reanudar: discreto, alineado con la rejilla. */
html body #footer.site-footer .footer-strip__controls {
  box-sizing: border-box;
  display: flex;
  justify-content: flex-end;
  max-width: calc(1080px + 48px);
  margin: 0 auto;
  padding: 12px 24px 20px;
}

html body #footer.site-footer .footer-strip__toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 32px;
  margin: 0 -8px 0 0;
  padding: 4px 8px;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--grey-300, #bfc2c6);
  font-family: var(--font-family-base);
  font-size: 14px !important;
  line-height: 20px !important;
  font-weight: 400 !important;
  letter-spacing: 0 !important;
  cursor: pointer;
  transition: color .2s;
}

html body #footer.site-footer .footer-strip__toggle[hidden] { display: none; }

html body #footer.site-footer .footer-strip__toggle:hover { color: var(--base-white, #fff); }

html body #footer.site-footer .footer-strip__toggle:focus-visible {
  color: var(--base-white, #fff);
  outline: 2px solid var(--base-white, #fff);
  outline-offset: 2px;
}

/* Icono: dos barras (pausar) / triángulo (reanudar). */
html body #footer.site-footer .footer-strip__toggle-icon {
  position: relative;
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
}

html body #footer.site-footer .footer-strip__toggle-icon::before,
html body #footer.site-footer .footer-strip__toggle-icon::after {
  content: "";
  position: absolute;
  top: 1px;
  width: 3px;
  height: 10px;
  background: currentColor;
}

html body #footer.site-footer .footer-strip__toggle-icon::before { left: 2px; }
html body #footer.site-footer .footer-strip__toggle-icon::after  { right: 2px; }

html body #footer.site-footer .footer-strip.is-paused .footer-strip__toggle-icon::before {
  left: 2px;
  width: 0;
  height: 0;
  background: none;
  border-style: solid;
  border-width: 5px 0 5px 9px;
  border-color: transparent transparent transparent currentColor;
}

html body #footer.site-footer .footer-strip.is-paused .footer-strip__toggle-icon::after { display: none; }

@media (max-width: 640px) {
  html body #footer.site-footer .footer-strip {
    --strip-duration: 40s;
    margin-top: 24px;
  }
  html body #footer.site-footer .footer-strip__controls { padding: 8px 20px 16px; }
}

/* Movimiento reducido: composición estática con un «CANTOVI.» completo
   alineado con la rejilla; sin entrada, sin bucle y sin botón. */
@media (prefers-reduced-motion: reduce) {
  html body #footer.site-footer .footer-strip .footer-strip__rise,
  html body #footer.site-footer .footer-strip.is-armed .footer-strip__rise {
    transform: none;
    transition: none;
  }
  html body #footer.site-footer .footer-strip__track {
    animation: none;
    transform: none;
  }
  html body #footer.site-footer .footer-strip__viewport {
    box-sizing: border-box;
    padding-left: max(24px, calc((100% - 1080px) / 2));
  }
  html body #footer.site-footer .footer-strip__toggle { display: none; }
  html body #footer.site-footer .footer-strip__controls { padding-top: 0; padding-bottom: 24px; }
}
