/**
 * Accessibility Styles für krabbenhoeft.pro
 * WCAG 2.1 Level AA konform
 * 
 */


/* ============================================
   SKIP LINK
   WCAG 2.4.1 (Bypass Blocks)
   ============================================ */

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #000000;
  color: #ffffff;
  padding: 8px 16px;
  text-decoration: none;
  z-index: 10000;
  border-radius: 0 0 4px 0;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.5;
  white-space: nowrap;
}

.skip-link:focus {
  top: 0;
  outline: 3px solid #4A90E2;
  outline-offset: 2px;
}

.skip-link:hover {
  background: #333333;
  color: #ffffff;
}


/* ============================================
   FOCUS INDICATORS
   WCAG 2.4.7 (Focus Visible)
   ============================================ */

/* Grundlegender Focus-Style für alle interaktiven Elemente */
a:focus,
button:focus,
[role="button"]:focus,
input:focus,
select:focus,
textarea:focus,
[tabindex]:focus {
  outline: 3px solid #4A90E2;
  outline-offset: 2px;
}

/* Deaktiviere Outline nur für Maus-Klicks, nicht für Keyboard-Navigation */
a:focus:not(:focus-visible),
button:focus:not(:focus-visible),
[role="button"]:focus:not(:focus-visible) {
  outline: none;
}

/* Verstärkte Focus-States für Keyboard-User */
a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible {
  outline: 3px solid #4A90E2;
  outline-offset: 2px;
  box-shadow: 0 0 0 5px rgba(74, 144, 226, 0.2);
}

/* Spezielle Focus-States für Buttons */
.btn:focus-visible {
  outline: 3px solid #4A90E2;
  outline-offset: 2px;
}

.btn-outline-primary:focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 2px;
  box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.3);
}

/* Modal Close Button */
.btn-close:focus {
  outline: 3px solid #4A90E2;
  outline-offset: 2px;
  box-shadow: 0 0 0 5px rgba(74, 144, 226, 0.2);
}

/* Scroll Arrows */
.scroll-down-arrow:focus,
.scroll-up-arrow:focus {
  outline: 3px solid #ffffff;
  outline-offset: 5px;
}


/* ============================================
   PREFERS-REDUCED-MOTION
   WCAG 2.2.2, 2.3.3 (Animation from Interactions)
   ============================================ */

@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;
  }
  
  /* Parallax-Effekte deaktivieren */
  .parallax {
    background-attachment: scroll !important;
    transform: none !important;
  }
  
  /* Preloader ausblenden */
  .preloader {
    display: none !important;
  }
  
  /* Typed.js Animation deaktivieren */
  .typed-cursor {
    animation: none !important;
  }
  
  /* Owl Carousel Transitions */
  .owl-carousel .owl-stage {
    transition: none !important;
  }
  
  /* Smooth Scroll ausschalten */
  html {
    scroll-behavior: auto !important;
  }
  
  /* Hover-Animationen reduzieren */
  a,
  button {
    transition: none !important;
      
  }
/* Hero Background Videos pausieren */
  .hero-bg-video {
    display: none !important;
  }
}


/* ============================================
   HIGH CONTRAST MODE
   WCAG 1.4.3 (Contrast Minimum)
   ============================================ */

@media (prefers-contrast: high) {
  /* Verstärkte Borders */
  .btn-outline-primary {
    border-width: 2px;
  }
  
  /* Bessere Sichtbarkeit von Links */
  a {
    text-decoration: underline;
  }
  
  /* Stärkere Abgrenzung von Cards/Sections */
  .section {
    border-top: 2px solid currentColor;
  }
}


/* ============================================
   FORCED COLORS MODE (Windows High Contrast)
   ============================================ */

@media (forced-colors: active) {
  /* Skip Link sichtbar machen */
  .skip-link {
    border: 2px solid;
  }
  
  /* Focus-Indicator */
  a:focus,
  button:focus {
    outline: 2px solid;
    outline-offset: 2px;
  }
  
  /* Icons */
  .social-icons a {
    border: 1px solid;
  }
}


/* ============================================
   TOUCH TARGET SIZES
   WCAG 2.5.5 (Target Size)
   ============================================ */

/* Mindestgröße 44x44px für Touch-Targets */
@media (pointer: coarse) {
  .social-icons a {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  
  .scroll-down-arrow,
  .scroll-up-arrow {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  
  .btn-sm {
    min-height: 44px;
    padding-left: 16px;
    padding-right: 16px;
  }
  
  .btn-close {
    min-width: 44px;
    min-height: 44px;
  }
}


/* ============================================
   TEXT SPACING
   WCAG 1.4.12 (Text Spacing)
   ============================================ */

/* Unterstütze User-definierte Text-Abstände */
/* WICHTIG: Buttons und interaktive Elemente ausschließen! */
*:not(.btn):not(.btn-link):not(button):not(.nav-link):not(.scroll-down-arrow):not(.scroll-up-arrow) {
  line-height: inherit !important;
  letter-spacing: inherit !important;
  word-spacing: inherit !important;
}

/* Mindest-Abstände sicherstellen */
p {
  line-height: 1.5;
  margin-bottom: 1em;
}

h1, h2, h3, h4, h5, h6 {
  line-height: 1.3;
  margin-bottom: 0.75em;
}

/* Button-spezifische Spacing-Regeln - Original beibehalten */
.btn,
button,
.btn-link {
  line-height: normal !important;
  letter-spacing: normal !important;
  word-spacing: normal !important;
}


/* ============================================
   REFLOW (Responsive)
   WCAG 1.4.10 (Reflow)
   ============================================ */

/* Verhindere horizontales Scrolling bei 320px Breite */
@media (max-width: 320px) {
  body {
    overflow-x: hidden;
  }
  
  .container {
    max-width: 100%;
    padding-left: 15px;
    padding-right: 15px;
  }
  
  img {
    max-width: 100%;
    height: auto;
  }
}


/* ============================================
   SCREEN READER ONLY
   Utility Class
   ============================================ */

.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;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
}


/* ============================================
   MODAL ACCESSIBILITY
   WCAG 2.4.3 (Focus Order)
   ============================================ */

/* Fokus innerhalb Modal halten */
.modal.show {
  /* Focus-Trap wird via JavaScript gehandhabt */
}

.modal-content {
  /* Sicherstellen dass Modal visuell hervorsticht */
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

/* Modal Trigger Buttons als Links gestylt */
.nav-link.btn-link {
  /* Button-Standardstyle überschreiben */
  border: none;
  padding: 0.5rem 1rem;
  color: inherit;
  text-decoration: none;
  background: none;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  cursor: pointer;
  display: inline-block;
}

.nav-link.btn-link:hover,
.nav-link.btn-link:focus {
  text-decoration: underline;
  color: inherit;
  background: none;
}

.nav-link.btn-link:focus {
  outline: 3px solid #4A90E2;
  outline-offset: 2px;
}

.nav-link.btn-link:focus-visible {
  outline: 3px solid #4A90E2;
  outline-offset: 2px;
  box-shadow: 0 0 0 5px rgba(74, 144, 226, 0.2);
}

/* Für Footer mit dunklem Hintergrund */
.footer-text-light .nav-link.btn-link {
  color: rgba(255, 255, 255, 0.7);
}

.footer-text-light .nav-link.btn-link:hover,
.footer-text-light .nav-link.btn-link:focus {
  color: rgba(255, 255, 255, 1);
}


/* ============================================
   CAROUSEL ACCESSIBILITY
   ============================================ */

/* Pause Button für Autoplay (falls implementiert) */
.owl-carousel .pause-button {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10;
  min-width: 44px;
  min-height: 44px;
}


/* ============================================
   CONTRAST HELPERS
   Nur wenn Original-CSS nicht ausreichend ist
   ============================================ */

/* Falls fw-100, fw-200 zu dünn sind: */
.fw-100 {
  font-weight: 300 !important; /* Mindestens 300 für bessere Lesbarkeit */
}

.fw-200 {
  font-weight: 300 !important;
}

/* Stärkerer Kontrast für Hero-Overlays falls nötig */
.hero-mask.opacity-4 {
  opacity: 0.5 !important; /* Von 0.4 auf 0.5 erhöhen */
}

.hero-mask.opacity-5 {
  opacity: 0.6 !important; /* Von 0.5 auf 0.6 erhöhen */
}


/* ============================================
   PRINT STYLES (Bonus)
   ============================================ */

@media print {
  /* Skip Link ausblenden */
  .skip-link {
    display: none;
  }
  
  /* Focus-Outlines ausblenden */
  *:focus {
    outline: none;
  }
  
  /* Links mit URL anzeigen */
  a[href]:after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
  }
  
  /* Social Media Icons ausblenden */
  .social-icons {
    display: none;
  }
}


/* ============================================
   DEBUGGING HELPER (in Produktion entfernen)
   ============================================ */

/*
.debug-focus *:focus {
  outline: 5px solid red !important;
}

.debug-headings h1,
.debug-headings h2,
.debug-headings h3 {
  outline: 2px solid blue;
}
*/


/* ============================================
   BUTTON FIXES - Original Bootstrap Style beibehalten
   ============================================ */

/* Connect Button und E-Mail Button - Original Style */
.btn.shadow-none {
  box-shadow: none !important;
}

.btn-dark:focus:not(:focus-visible) {
  outline: none;
  box-shadow: none;
}

/* ALLE Button-Schatten entfernen */
.btn:not(.btn-link),
.btn:not(.btn-link):hover,
.btn:not(.btn-link):focus,
.btn:not(.btn-link):active {
  box-shadow: none !important;
}

/* Sicherstellen dass Buttons zentrierten Text haben */
.btn,
.btn-sm,
.btn-dark,
.btn-outline-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  vertical-align: middle;
  line-height: 1.5 !important;
}

/* Rounded pill Buttons - keine Outline-Verschiebung */
.rounded-pill:focus-visible {
  outline-offset: 3px;
}


/* ============================================
   HERO TITLE H1 - Responsive Font-Size Fix
   CONTAINER BLEIBT SCHMAL (col-xl-4) wie #hello und #about
   ============================================ */

/* Basis-Größe für alle Screens - OPTIMAL für Mobile */
.hero-content h1,
.hero-title h1 {
  font-size: 1.5rem !important;  /* 24px - Mobile perfekt */
  line-height: 1.3 !important;
}

/* Tablet Portrait - Minimal größer */
@media (min-width: 576px) {
  .hero-content h1,
  .hero-title h1 {
    font-size: 1.5rem !important;  /* 24px - gleich wie Mobile */
  }
}

/* Tablet Landscape - Leicht größer */
@media (min-width: 768px) {
  .hero-content h1,
  .hero-title h1 {
    font-size: 1.5rem !important;  /* 24px - Container ist 50% */
  }
}

/* Desktop - Minimal größer */
@media (min-width: 992px) {
  .hero-content h1,
  .hero-title h1 {
    font-size: 1.625rem !important;  /* 26px - Container ist 42% */
  }
}

/* Large Desktop - Etwas größer */
@media (min-width: 1200px) {
  .hero-content h1,
  .hero-title h1 {
    font-size: 1.75rem !important;  /* 28px - Container ist 33% */
  }
}

/* Extra Large Desktop - Maximum */
@media (min-width: 1400px) {
  .hero-content h1,
  .hero-title h1 {
    font-size: 1.875rem !important;  /* 30px - Container ist 33% */
  }
}


/* Footer Navigation - Span statt Link */
#footer .nav .nav-item span.nav-link {
  color: rgba(255, 255, 255, 0.7);
  cursor: default;
  pointer-events: none;
}

#footer.footer-text-light .nav .nav-item span.nav-link {
  color: rgba(255, 255, 255, 0.7);
}




/* ============================================
   VISUALLY HIDDEN - Screen Reader Only
   Für WAVE Empty Link/Button Fixes
   ============================================ */

/* Versteckt Elemente visuell, aber zugänglich für Screen Reader */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Macht versteckte Elemente sichtbar wenn sie fokussiert werden */
.visually-hidden-focusable:focus {
  position: static !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  overflow: visible !important;
  clip: auto !important;
  white-space: normal !important;
}

/* Verbesserte btn-close Focus States */
.btn-close:focus {
  outline: 3px solid #4A90E2 !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 5px rgba(74, 144, 226, 0.2) !important;
}
