/* ============================================================
   HRHK Solutions — Accessibility CSS
   File: assets/css/accessibility.css
   Purpose: Focus states, screen reader text, reduced motion, contrast
   ============================================================ */

/* --- Enhanced Focus States --- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Remove default outline for mouse users, keep for keyboard */
a:focus:not(:focus-visible),
button:focus:not(:focus-visible) {
  outline: none;
}

/* --- Screen Reader Only --- */
.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;
}

/* --- Skip Navigation --- */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-accent);
  color: var(--color-text-inverse);
  padding: var(--space-sm) var(--space-md);
  z-index: var(--z-modal);
  font-weight: 600;
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 0;
}

/* --- High Contrast Mode --- */
@media (prefers-contrast: high) {
  :root {
    --color-text: #000000;
    --color-text-light: #333333;
    --color-border: #000000;
  }

  a {
    text-decoration: underline;
  }

  .btn {
    border-width: 3px;
  }

  .card {
    border-width: 2px;
  }
}

/* --- Reduced Motion --- */
@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;
  }
}

/* --- Forced Colors (Windows High Contrast) --- */
@media (forced-colors: active) {
  .btn {
    border: 2px solid ButtonText;
  }

  .card {
    border: 1px solid CanvasText;
  }

  .badge {
    border: 1px solid CanvasText;
  }
}

/* --- Minimum Touch Target --- */
button,
a.btn,
input[type="button"],
input[type="submit"],
input[type="reset"],
[role="button"] {
  min-height: 44px;
  min-width: 44px;
}

/* --- Link Underlines --- */
.content a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.content a:hover {
  text-decoration-thickness: 2px;
}

/* --- Form Error Accessibility --- */
.form-group__error[role="alert"] {
  font-weight: 600;
}

.form-input[aria-invalid="true"] {
  border-color: var(--color-error);
}

/* --- Landmark Styles (for development) --- */
/* Uncomment to visualize ARIA landmarks during development */
/*
[role="banner"] { outline: 2px solid red; }
[role="navigation"] { outline: 2px solid blue; }
[role="main"] { outline: 2px solid green; }
[role="contentinfo"] { outline: 2px solid purple; }
*/
