/* Accessibility Enhancements for Dr. Dashe's website */

/* Skip to main content link */
.skip-link {
  position: absolute;
  top: -50px;
  left: 0;
  background: var(--primary-color);
  color: white;
  padding: 8px 15px;
  z-index: 1000;
  transition: top 0.3s ease;
  border-radius: 0 0 5px 0;
}

.skip-link:focus {
  top: 0;
  outline: 2px solid var(--accent-color);
  outline-offset: 3px;
}

/* Enhanced focus states for all interactive elements */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--accent-color);
  outline-offset: 3px;
  text-decoration: none;
  transition: outline-offset 0.2s ease;
}

/* Focus style for the mobile navigation toggle */
.menu-toggle:focus-visible {
  outline: 3px solid var(--accent-color);
  outline-offset: 3px;
}

/* Improved color contrast for links within content */
.content a {
  color: var(--high-contrast-blue); /* Using lighter blue for 4.5:1+ contrast with dark backgrounds */
  text-decoration: underline; /* Always underline links for better visibility */
}

.content a:hover,
.content a:focus {
  color: var(--accent-color);
  text-decoration: underline;
}

/* Screen reader only text (visually hidden but accessible to screen readers) */
.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;
}

/* Make sure focus ring is visible in dark mode */
@media (prefers-color-scheme: dark) {
  a:focus-visible,
  button:focus-visible,
  input:focus-visible,
  select:focus-visible,
  textarea:focus-visible {
    outline-color: var(--accent-color);
  }
}

/* Enhanced visible labels for form fields */
label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
}

/* ARIA-based form field error styling */
.form-field[aria-invalid="true"] input,
.form-field[aria-invalid="true"] textarea,
.form-field[aria-invalid="true"] select {
  border: 2px solid var(--danger-color);
  background-color: rgba(207, 102, 121, 0.1);
}

.error-message {
  color: var(--danger-color);
  font-size: 0.9rem;
  margin-top: 5px;
  display: none;
}

.form-field[aria-invalid="true"] .error-message {
  display: block;
}

/* Animation reduction for users with vestibular/motion sensitivities */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* Improve breadcrumb navigation accessibility */
.breadcrumbs {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  flex-wrap: wrap;
}

.breadcrumbs li {
  display: inline-flex;
  align-items: center;
}

.breadcrumbs li:not(:last-child)::after {
  content: "/";
  margin: 0 0.5rem;
  color: var(--text-color-secondary);
}

.breadcrumbs a {
  color: var(--high-contrast-blue);
  text-decoration: underline;
}

.breadcrumbs .current {
  color: var(--text-color-body);
}
