/* ============================================
   InfluenceHub – Footer links a11y
   - Visible :focus-visible ring for .footer-link
     and .footer-social anchors so keyboard users
     can see which footer link is focused.
   - 44px minimum touch target (WCAG 2.5.5) for
     mobile users on every footer link.
   - Dark mode, prefers-reduced-motion and
     forced-colors 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;
}

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

/* High-contrast, always-visible ring for keyboard users. The ring is
   drawn with both an outline and a box-shadow halo so it stays visible
   against the light footer background and the dark-mode surface. */
.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 mode ---------- */

.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);
  }
}

/* ---------- Small screens: keep the 44px target ---------- */

@media (max-width: 480px) {
  .footer-link,
  .footer-social {
    min-height: 44px;
    min-width: 44px;
  }
}

/* ---------- Reduced motion ---------- */

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

  /* Neutralise any hover/focus transform so no motion is perceived */
  .footer-link:hover,
  .footer-link:focus,
  .footer-link:active,
  .footer-social:hover,
  .footer-social:focus,
  .footer-social:active {
    transform: none !important;
    transition: 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;
  }
}
