/* Accessibility Enhancements */

/* Enhanced focus indicators for keyboard navigation */
*:focus {
  outline: 2px solid #2563eb; /* blue-600 */
  outline-offset: 2px;
}

/* Skip link styles - hidden by default, visible on focus */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.focus\:not-sr-only:focus {
  position: static;
  width: auto;
  height: auto;
  padding: 0.5rem 1rem;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

/* Ensure links have proper focus states */
a:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
  border-radius: 0.125rem;
}

/* Button focus states */
button:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

/* Improve contrast for disabled states */
button:disabled,
a[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Screen reader only text */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border-width: 0 !important;
}

/* Ensure proper color contrast for links */
a {
  text-decoration-skip-ink: auto;
}

/* Reduce motion for users who prefer it */
@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;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  * {
    border-color: currentColor !important;
  }

  a {
    text-decoration: underline;
  }
}
