/**
 * OYROPA Go-Live Accessibility Fixes
 * WCAG AA Compliance - Kritische Violations behoben
 */

/* ========================================
   1. KONTRAST-FIXES (WCAG AA 4.5:1)
   ======================================== */

/* Grau-Texte von #999 → #666 (4.6:1 Kontrast) */
.text-muted,
.muted,
[style*="color: #999"],
[style*="color: #ccc"],
[style*="color: rgb(153, 153, 153)"],
[style*="color: rgb(204, 204, 204)"] {
  color: #666 !important;
}

/* Footer Links - Weiß auf Navy (8.5:1) */
footer a,
.footer a {
  color: #ffffff !important;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

footer a:hover,
.footer a:hover {
  color: #D69E2E !important; /* Gold */
}

/* Platzhalter-Text */
input::placeholder,
textarea::placeholder,
select::placeholder {
  color: #666 !important;
  opacity: 1;
}

/* Disabled-Texte */
input:disabled,
textarea:disabled,
select:disabled,
button:disabled {
  color: #666 !important;
  opacity: 0.8;
}

/* Navy auf Hell - ausreichend Kontrast */
.bg-white .navy-text,
.bg-light .navy-text {
  color: #1A365D !important; /* Navy hat 10.8:1 auf Weiß */
}

/* ========================================
   2. MOBILE-OPTIMIERUNG
   ======================================== */

/* Horizontales Scrolling verhindern */
html,
body {
  overflow-x: hidden !important;
  max-width: 100vw !important;
}

* {
  max-width: 100% !important;
  box-sizing: border-box;
}

/* Zoom 200% Kompatibilität */
@media (max-width: 768px) {
  body {
    font-size: 16px !important; /* Verhindert iOS Auto-Zoom */
  }

  * {
    max-width: 100% !important;
  }

  img,
  video,
  iframe {
    max-width: 100% !important;
    height: auto !important;
  }

  .container,
  .row,
  .col {
    max-width: 100% !important;
    padding-left: 15px !important;
    padding-right: 15px !important;
  }
}

/* Touch-Targets mindestens 44x44px */
@media (max-width: 768px) {
  button,
  a,
  input[type="submit"],
  input[type="button"],
  .btn,
  .button {
    min-height: 44px !important;
    min-width: 44px !important;
    padding: 10px 16px !important;
  }
}

/* ========================================
   3. FOCUS-STATES (Keyboard Navigation)
   ======================================== */

/* Sichtbare Focus-Ringe */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus {
  outline: 3px solid #D69E2E !important; /* Gold */
  outline-offset: 2px !important;
  box-shadow: 0 0 0 3px rgba(214, 158, 46, 0.3) !important;
}

/* Skip-Link sichtbar machen */
.skip-link:focus {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 9999;
  background: #1A365D;
  color: #fff;
  padding: 10px 20px;
  text-decoration: none;
}

/* ========================================
   4. SEMANTISCHE ELEMENTE
   ======================================== */

/* Header als Banner */
header,
.header {
  display: block;
}

/* Main Content Landmark */
main,
.main,
#main {
  display: block;
  min-height: 300px;
}

/* Footer als Contentinfo */
footer,
.footer {
  display: block;
}

/* Navigation */
nav,
.nav,
.navigation {
  display: block;
}

/* ========================================
   5. ARIA-LIVE REGIONS
   ======================================== */

/* Live-Regions für dynamische Inhalte */
[aria-live] {
  position: relative;
}

/* ========================================
   6. SCREENREADER-OPTIMIERUNGEN
   ======================================== */

/* Screenreader-Only Text */
.sr-only,
.visually-hidden {
  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:focus,
.visually-hidden-focusable:focus {
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

/* ========================================
   7. FORMULAR-OPTIMIERUNGEN
   ======================================== */

/* Labels sichtbar und zugeordnet */
label {
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
  color: #1A365D;
}

/* Required-Felder */
input[required] + label::after,
textarea[required] + label::after,
select[required] + label::after {
  content: " *";
  color: #d32f2f;
}

/* Validierungs-Feedback */
.invalid,
.error {
  border-color: #d32f2f !important;
  background-color: #ffebee !important;
}

.valid,
.success {
  border-color: #388e3c !important;
  background-color: #e8f5e9 !important;
}

/* ========================================
   8. RESPONSIVE TABLES
   ======================================== */

@media (max-width: 768px) {
  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100% !important;
  }
}

/* ========================================
   9. PERFORMANCE-OPTIMIERUNGEN
   ======================================== */

/* Reduce Motion für Animationen */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ========================================
   10. PRINT-OPTIMIERUNGEN
   ======================================== */

@media print {
  * {
    color: #000 !important;
    background: #fff !important;
  }
}
