/* Accessibility Styles
   Comprehensive accessibility enhancements following WCAG guidelines
*/

/* Skip Link - Hidden visually but available for screen readers and keyboard users */
.skip-link {
  position: absolute;
  top: -50px;
  left: 0;
  background: var(--color-teal);
  color: var(--color-dark);
  padding: 8px;
  z-index: 1001;
  transition: top 0.3s ease;
}

.skip-link:focus {
  top: 0;
  outline: 2px solid var(--color-teal-light);
}

/* Focus styles for keyboard navigation - highly visible focus indicators */
:focus {
  outline: 2px solid var(--color-teal);
  outline-offset: 3px;
}

/* Remove focus outline for mouse users, but keep for keyboard navigation */
.js *:focus:not(:focus-visible) {
  outline: none;
}

.js *:focus-visible {
  outline: 2px solid var(--color-teal);
  outline-offset: 3px;
}

/* Ensure elements are visible when focused */
[tabindex="-1"]:focus {
  outline: none;
}

/* Improve contrast for better readability */
.section-subtitle {
  color: #f0f0f0; /* Ensuring enough contrast with dark background */
}

/* Ensure form elements have adequate text contrast */
input, textarea, select, button {
  color: rgba(255, 255, 255, 0.9);
}

/* Make focus visible on interactive elements */
button:focus, 
a:focus,
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid var(--color-teal);
  outline-offset: 3px;
}

/* Ensure text is legible */
body {
  line-height: 1.5;
  font-size: var(--font-size-base);
}

/* Add hover styles that don't rely solely on color changes */
.btn:hover, 
.btn:focus {
  transform: translateY(-3px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Improved link accessibility - underlines for links in content */
main a:not(.btn) {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Better form field labeling */
.form-group label {
  display: block;
  margin-bottom: 0.5rem;
}

/* ARIA-expanded states for UI components */
[aria-expanded="true"] .expand-icon::before {
  content: "−";
}

[aria-expanded="false"] .expand-icon::before {
  content: "+";
}

/* Screen reader utilities */
.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;
}

.sr-only-focusable:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Ensure adequate text spacing */
p, li, td, th {
  line-height: 1.5;
}

/* Better contrast for disabled elements */
[disabled], 
.disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
