/* ==============================================================================
   FILE INFORMATION
   ==============================================================================
   File: accessibility.css
   Location: /assets/css/accessibility.css
   Purpose: Advanced accessibility features and WCAG 2.2 Level AA compliance
   Functions: High contrast, large text, reduced motion, dyslexia support, focus
   Version: 1.0.0
   Generated: 2025-11-01
   Author: AccessibilityFirst Team
   License: Proprietary
   
   ==============================================================================
   CHANGE HISTORY
   ==============================================================================
   Version 1.0.0 - 2025-11-01
     - Initial creation for AccessibilityFirst portal
     - High contrast mode implementation
     - Text scaling support
     - Reduced motion preferences
     - Dyslexia-friendly font option
     - Enhanced keyboard navigation
     - Screen reader optimizations
   ============================================================================== */

/* ==============================================================================
   HIGH CONTRAST MODE - WCAG 1.4.3, 1.4.6
   ============================================================================== */
.high-contrast {
  --color-primary: #0000ff;
  --color-primary-dark: #000080;
  --color-secondary: #000000;
  --color-success: #006400;
  --color-danger: #8b0000;
  --color-warning: #ff8c00;
  --color-white: #ffffff;
  --color-light: #f0f0f0;
  --color-dark: #000000;
  --color-gray-800: #000000;
}

.high-contrast body {
  background-color: #ffffff;
  color: #000000;
}

.high-contrast a {
  color: #0000ff;
  text-decoration: underline;
  font-weight: 600;
}

.high-contrast a:hover,
.high-contrast a:focus {
  color: #000080;
  background-color: #ffff00;
}

.high-contrast .btn {
  border: 2px solid #000000;
  font-weight: 700;
}

.high-contrast .btn-primary {
  background-color: #0000ff;
  color: #ffffff;
  border-color: #000000;
}

.high-contrast .btn-primary:hover,
.high-contrast .btn-primary:focus {
  background-color: #000080;
  color: #ffffff;
}

.high-contrast .card,
.high-contrast .service-card,
.high-contrast .stat-card {
  border: 3px solid #000000;
}

.high-contrast .navbar {
  background-color: #000000 !important;
  border-bottom: 3px solid #ffffff;
}

.high-contrast .site-footer {
  background-color: #000000 !important;
  border-top: 3px solid #ffffff;
}

/* ==============================================================================
   LARGE TEXT MODE - WCAG 1.4.4
   ============================================================================== */
.large-text {
  font-size: 1.25rem;
}

.large-text h1 { font-size: 3.125rem; }
.large-text h2 { font-size: 2.5rem; }
.large-text h3 { font-size: 2.1875rem; }
.large-text h4 { font-size: 1.875rem; }
.large-text h5 { font-size: 1.5625rem; }
.large-text h6 { font-size: 1.25rem; }

.large-text .btn {
  font-size: 1.375rem;
  padding: 0.875rem 1.75rem;
  min-height: 52px;
}

.large-text .nav-link {
  font-size: 1.25rem;
  padding: 0.75rem 1.25rem;
}

.large-text p,
.large-text li {
  font-size: 1.25rem;
  line-height: 1.8;
}

/* ==============================================================================
   REDUCED MOTION - WCAG 2.3.3
   ============================================================================== */
.reduced-motion *,
.reduced-motion *::before,
.reduced-motion *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
  scroll-behavior: auto !important;
}

.reduced-motion .carousel {
  animation: none !important;
}

.reduced-motion .fade {
  transition: none !important;
}

/* System preference for 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;
  }
}

/* ==============================================================================
   DYSLEXIA-FRIENDLY FONT - Supporting dyslexic users
   ============================================================================== */
.dyslexia-font {
  font-family: 'Comic Sans MS', 'Trebuchet MS', Arial, sans-serif;
  letter-spacing: 0.05em;
  word-spacing: 0.16em;
  line-height: 1.8;
}

.dyslexia-font h1,
.dyslexia-font h2,
.dyslexia-font h3,
.dyslexia-font h4,
.dyslexia-font h5,
.dyslexia-font h6 {
  font-family: 'Comic Sans MS', 'Trebuchet MS', Arial, sans-serif;
  font-weight: 700;
}

.dyslexia-font p {
  text-align: left;
  hyphens: none;
}

/* ==============================================================================
   ENHANCED KEYBOARD NAVIGATION - WCAG 2.1.1, 2.4.7
   ============================================================================== */
.keyboard-user *:focus {
  outline: 4px solid #0066cc;
  outline-offset: 3px;
  box-shadow: 0 0 0 6px rgba(0, 102, 204, 0.3);
}

/* Focus indicators for specific elements */
.keyboard-user a:focus,
.keyboard-user button:focus {
  background-color: #fffacd;
  color: #000000;
}

/* ==============================================================================
   PREFERS COLOR SCHEME - Dark Mode Support
   ============================================================================== */
@media (prefers-color-scheme: dark) {
  :root:not(.light-mode) {
    --color-white: #1a1a1a;
    --color-light: #2d2d2d;
    --color-gray-100: #3a3a3a;
    --color-gray-200: #4a4a4a;
    --color-gray-800: #e0e0e0;
    --color-dark: #f0f0f0;
  }
  
  body:not(.light-mode) {
    background-color: #1a1a1a;
    color: #e0e0e0;
  }
  
  body:not(.light-mode) a {
    color: #6ea8fe;
  }
}

/* ==============================================================================
   PREFERS CONTRAST - High Contrast Preference
   ============================================================================== */
@media (prefers-contrast: high) {
  :root {
    --focus-outline-width: 4px;
  }
  
  body {
    color: #000000;
    background-color: #ffffff;
  }
  
  a {
    color: #0000ff;
    text-decoration: underline;
  }
  
  .btn {
    border-width: 3px;
  }
}

/* ==============================================================================
   SCREEN READER ONLY CONTENT
   ============================================================================== */
.sr-only,
.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sr-only-focusable:active,
.sr-only-focusable:focus {
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

/* ==============================================================================
   ARIA LIVE REGIONS
   ============================================================================== */
[aria-live="polite"],
[aria-live="assertive"] {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ==============================================================================
   TEXT SELECTION
   ============================================================================== */
::selection {
  background-color: #b3d4fc;
  color: #000000;
  text-shadow: none;
}

::-moz-selection {
  background-color: #b3d4fc;
  color: #000000;
  text-shadow: none;
}

/* ==============================================================================
   CUSTOM FOCUS STYLES FOR FORM ELEMENTS
   ============================================================================== */
input:focus,
select:focus,
textarea:focus {
  outline: 3px solid #0066cc;
  outline-offset: 2px;
  border-color: #0066cc;
}

input[type="checkbox"]:focus,
input[type="radio"]:focus {
  outline: 3px solid #0066cc;
  outline-offset: 3px;
}

/* ==============================================================================
   TARGET SIZE - WCAG 2.5.5 (Minimum 44x44px)
   ============================================================================== */
a,
button,
input[type="submit"],
input[type="button"],
input[type="reset"],
select,
textarea {
  min-height: 44px;
  min-width: 44px;
}

/* Exception for inline text links */
p a,
li a {
  min-height: auto;
  min-width: auto;
  padding: 2px 4px;
}

/* ==============================================================================
   TEXT SPACING - WCAG 1.4.12
   ============================================================================== */
.enhanced-spacing p {
  line-height: 1.8;
  margin-bottom: 2em;
}

.enhanced-spacing li {
  line-height: 1.8;
  margin-bottom: 0.5em;
}

.enhanced-spacing h1,
.enhanced-spacing h2,
.enhanced-spacing h3 {
  letter-spacing: 0.05em;
  margin-bottom: 1.5em;
}

/* ==============================================================================
   READING MODE - Enhanced Readability
   ============================================================================== */
.reading-mode {
  max-width: 70ch;
  margin-left: auto;
  margin-right: auto;
  font-size: 1.125rem;
  line-height: 1.8;
}

.reading-mode p {
  margin-bottom: 1.5em;
}

.reading-mode h1,
.reading-mode h2,
.reading-mode h3 {
  margin-top: 2em;
  margin-bottom: 1em;
}

/* ==============================================================================
   FOCUS-VISIBLE POLYFILL
   ============================================================================== */
.js-focus-visible :focus:not(.focus-visible) {
  outline: none;
}

.js-focus-visible .focus-visible {
  outline: 3px solid #0066cc;
  outline-offset: 2px;
}

/* ==============================================================================
   TOOLTIPS ACCESSIBILITY
   ============================================================================== */
[data-tooltip] {
  position: relative;
  cursor: help;
}

[data-tooltip]:hover::after,
[data-tooltip]:focus::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.5rem 1rem;
  background-color: #000000;
  color: #ffffff;
  border-radius: 0.25rem;
  white-space: nowrap;
  z-index: 1070;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

/* ==============================================================================
   ERROR MESSAGES AND VALIDATION
   ============================================================================== */
.error-message,
[role="alert"] {
  padding: 1rem;
  margin-bottom: 1rem;
  border-left: 4px solid #dc3545;
  background-color: #f8d7da;
  color: #721c24;
}

.error-message::before,
[role="alert"]::before {
  content: "⚠ ";
  font-weight: bold;
}

.success-message {
  padding: 1rem;
  margin-bottom: 1rem;
  border-left: 4px solid #198754;
  background-color: #d1e7dd;
  color: #0f5132;
}

.success-message::before {
  content: "✓ ";
  font-weight: bold;
}

/* ==============================================================================
   RESPONSIVE TEXT RESIZING
   ============================================================================== */
@media (max-width: 768px) {
  .large-text {
    font-size: 1.125rem;
  }
  
  .large-text .btn {
    font-size: 1.25rem;
  }
}

/* ==============================================================================
   PRINT ACCESSIBILITY
   ============================================================================== */
@media print {
  .high-contrast,
  .high-contrast * {
    color: #000000 !important;
    background: #ffffff !important;
  }
  
  a[href]::after {
    content: " (" attr(href) ")";
  }
  
  .skip-links,
  .accessibility-toolbar,
  #back-to-top {
    display: none !important;
  }
}

/* ==============================================================================
   UTILITIES FOR ARIA HIDDEN CONTENT
   ============================================================================== */
[aria-hidden="true"] {
  display: none !important;
}

/* ==============================================================================
   LOADING STATES WITH ACCESSIBILITY
   ============================================================================== */
.loading {
  position: relative;
  pointer-events: none;
  opacity: 0.6;
}

.loading::after {
  content: "Wird geladen...";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(0, 0, 0, 0.8);
  color: #ffffff;
  padding: 1rem 2rem;
  border-radius: 0.5rem;
  font-weight: bold;
}