/* Konsistente Fokusdarstellung bei Tastaturbedienung (nicht bei Maus-Klick).
   Rechtsfrage C-26, Antwort 14 (WCAG 2.4.7, 1.4.11): kräftig (Kontrast 5,4:1 auf
   Weiß) und gegen „outline: none“ einzelner Seiten durchgesetzt – dort zeigte ein
   Feld seinen Fokus sonst nur über eine andere Rahmenfarbe oder gar nicht. */
:focus-visible {
    outline: 3px solid #4c5fd5 !important;
    outline-offset: 2px !important;
    /* Weißer Rand innen und außen: sichtbar auf weißen Flächen (blau) wie auf den
       blau-lila Kacheln und Kopfzeilen (weiß). */
    box-shadow: 0 0 0 7px #fff !important;
}

/* Schalter: Das Kontrollkästchen ist versteckt, gezeichnet wird der Schieber –
   der Fokus muss am Schieber zu sehen sein. */
input:focus-visible + .toggle-slider,
input:focus-visible + .slider {
    outline: 3px solid #4c5fd5;
    outline-offset: 2px;
    box-shadow: 0 0 0 7px #fff;
}

/* Datums- und Zeitfelder: Chrome fokussiert dort ein Teilfeld (Tag, Monat …) und
   markiert nur dieses; das Feld selbst bekommt keinen Fokusrahmen. */
input[type='date']:focus,
input[type='datetime-local']:focus,
input[type='time']:focus,
input[type='month']:focus,
input[type='week']:focus,
input[type='date']:focus-within,
input[type='datetime-local']:focus-within,
input[type='time']:focus-within,
input[type='month']:focus-within,
input[type='week']:focus-within {
    outline: 3px solid #4c5fd5 !important;
    outline-offset: 2px !important;
}

/* Nur für Screenreader: unsichtbar, aber vorgelesen (etwa Ansagen nach dem Sortieren) */
.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Sortieren ohne Maus (public/js/sortierKnoepfe.js) */
.sortier-knoepfe {
    display: inline-flex;
    gap: 4px;
    flex-shrink: 0;
}
.sortier-knopf {
    min-width: 28px;
    min-height: 28px;
    padding: 2px 6px;
    border: 1px solid #a0aec0;
    border-radius: 6px;
    background: #fff;
    color: #2d3748;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
}
.sortier-knopf:hover:not([disabled]) {
    background: #edf2f7;
}
.sortier-knopf[disabled] {
    opacity: 0.4;
    cursor: default;
}

/* Bewegungsreduzierung für Nutzer mit prefers-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;
    }
}
