/* ========================================================================
   ACCESSIBILITY FOUNDATION
   Global keyboard focus indicators, reduced-motion support and skip link.
   Loaded in every layout, after the variable files.
   ======================================================================== */

/* ── Keyboard focus ──
   Several component files remove the default outline (outline: none)
   without a replacement. This restores a consistent, token-based focus
   ring for keyboard users only (:focus-visible), so mouse users see no
   change. `outline` does not affect layout, so it is safe everywhere. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--mc-accent-dark, #14b8a6);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Inputs already paint their own focus affordance (border + box-shadow)
   right at the edge; the offset ring would double up. Keep the ring flush. */
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline-offset: 0;
}

/* ── Reduced motion ──
   Honor the OS-level "reduce motion" setting (vestibular disorders).
   Collapses all animations/transitions to a single imperceptible frame
   instead of removing them, so JS animation-end events still fire. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── Skip link ──
   First focusable element on the page; lets keyboard and screen-reader
   users jump past the sidebar navigation straight to the main content. */
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 1000;
  padding: 10px 18px;
  background: var(--mc-primary, #1e3a5f);
  color: #fff;
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: 0 0 8px 8px;
  text-decoration: none;
  transition: top 0.15s ease;
}
.skip-link:focus {
  top: 0;
}
