/* ============================================
   InfluenceHub – Footer reduced motion + contrast
   - WCAG AA contrast fix for .footer-link and
     .footer-social in both light and dark mode.
   - prefers-reduced-motion guard: disables the
     hover/focus transitions and any transform on
     footer navigation so users who prefer reduced
     motion are not exposed to motion.
   - 44px minimum touch target (WCAG 2.5.5).
   - Focus-visible ring for keyboard users.
   - Forced-colors (Windows High Contrast) support.
   ============================================ */

/* ---------- Base: 44px minimum touch targets ---------- */

.footer-link,
.footer-social {
  /* WCAG 2.5.5 – minimum 44x44px touch target for mobile users */
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  z-index: 1;
  border-radius: 0.5rem;
  transition: color 0.15s ease, background-color 0.15s ease,
    box-shadow 0.15s ease;
}

/* Text links need a little horizontal padding so the 44px target
   does not look cramped next to the surrounding copy. */
.footer-link {
  padding: 0.5rem 0.5rem;
  margin: -0.5rem -0.5rem;
}

/* Social icon links are square – center the icon inside the target. */
.footer-social {
  justify-content: center;
  padding: 0.5rem;
}

/* ---------- Light mode contrast (WCAG AA) ----------
   Light mode:
     - footer surface: #ffffff
     - link text: #475569 on #ffffff = 7.5:1 (passes AA)
     - link hover: #6d28d9 on #ffffff = 8.4:1 (passes AA)
     - social icon: #475569 on #ffffff = 7.5:1 (passes AA)
*/

.footer-link {
  color: #475569 !important;
}

.footer-link:hover {
  color: #6d28d9 !important;
}

.footer-social {
  color: #475569 !important;
}

.footer-social:hover {
  color: #6d28d9 !important;
}

/* ---------- Dark mode contrast (WCAG AA) ----------
   Dark mode:
     - footer surface: #020617
     - link text: #cbd5e1 on #020617 = 12.6:1 (passes AA)
     - link hover: #c4b5fd on #020617 = 9.6:1 (passes AA)
     - social icon: #cbd5e1 on #020617 = 12.6:1 (passes AA)
*/

.dark .footer-link {
  color: #cbd5e1 !important;
}

.dark .footer-link:hover {
  color: #c4b5fd !important;
}

.dark .footer-social {
  color: #cbd5e1 !important;
}

.dark .footer-social:hover {
  color: #c4b5fd !important;
}

/* ---------- Focus-visible ring (keyboard) ---------- */

.footer-link:focus-visible,
.footer-social:focus-visible {
  outline: 2px solid #7c3aed;
  outline-offset: 2px;
  box-shadow:
    0 0 0 2px #ffffff,
    0 0 0 6px rgba(124, 58, 237, 0.35);
  background: rgba(124, 58, 237, 0.06);
}

.dark .footer-link:focus-visible,
.dark .footer-social:focus-visible {
  outline-color: #c4b5fd;
  box-shadow:
    0 0 0 2px #0f172a,
    0 0 0 6px rgba(196, 181, 253, 0.45);
  background: rgba(196, 181, 253, 0.1);
}

/* ---------- Fallback for browsers without :focus-visible ---------- */

@supports not selector(:focus-visible) {
  .footer-link:focus,
  .footer-social:focus {
    outline: 2px solid #7c3aed;
    outline-offset: 2px;
    box-shadow:
      0 0 0 2px #ffffff,
      0 0 0 6px rgba(124, 58, 237, 0.35);
  }

  .dark .footer-link:focus,
  .dark .footer-social:focus {
    outline-color: #c4b5fd;
    box-shadow:
      0 0 0 2px #0f172a,
      0 0 0 6px rgba(196, 181, 253, 0.45);
  }
}

/* ---------- prefers-reduced-motion guard ----------
   Footer links may animate on hover/focus (color transitions,
   background tint). Users who prefer reduced motion should see
   state changes instantly, with no motion. */

@media (prefers-reduced-motion: reduce) {
  .footer-link,
  .footer-social {
    transition: none !important;
    animation: none !important;
    transform: none !important;
  }

  /* Neutralise any hover/focus/active transform on the links */
  .footer-link:hover,
  .footer-link:focus,
  .footer-link:focus-visible,
  .footer-link:active,
  .footer-social:hover,
  .footer-social:focus,
  .footer-social:focus-visible,
  .footer-social:active {
    transform: none !important;
    transition: none !important;
  }

  /* Icons inside the social links must not animate either */
  .footer-link i,
  .footer-link svg,
  .footer-social i,
  .footer-social svg {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }

  /* Disable any pulse/scale animation on the links */
  .footer-link,
  .footer-link::before,
  .footer-link::after,
  .footer-social,
  .footer-social::before,
  .footer-social::after {
    animation: none !important;
    transform: none !important;
  }

  /* Keep the focus ring visible but static (no animated halo) */
  .footer-link:focus-visible,
  .footer-social:focus-visible {
    box-shadow:
      0 0 0 2px #ffffff,
      0 0 0 6px rgba(124, 58, 237, 0.35) !important;
  }

  .dark .footer-link:focus-visible,
  .dark .footer-social:focus-visible {
    box-shadow:
      0 0 0 2px #0f172a,
      0 0 0 6px rgba(196, 181, 253, 0.45) !important;
  }
}

/* ---------- Forced colors (Windows High Contrast) ---------- */

@media (forced-colors: active) {
  .footer-link,
  .footer-social {
    border: 1px solid CanvasText;
    color: CanvasText;
    background: Canvas;
  }

  .footer-link:hover,
  .footer-social:hover {
    background: Highlight;
    color: HighlightText;
  }

  .footer-link:focus-visible,
  .footer-social:focus-visible,
  .footer-link:focus,
  .footer-social:focus {
    outline: 2px solid Highlight;
    outline-offset: 2px;
    box-shadow: none;
    background: Highlight;
    color: HighlightText;
  }
}
