/* Barrierefreiheit - Verbesserte Sichtbarkeit für Tastaturfokus */
*:focus {
    outline: 2px solid rgb(250, 155, 0);
    outline-offset: -2px;
}

/* Sicherstellen, dass Untermenüs bei Fokus sichtbar bleiben */
#menu li:focus-within > ul[role="menu"] {
    max-height: 1000px !important;
    padding: 0px 10px 20px 10px !important;
    visibility: visible !important;
    opacity: 1 !important;
    display: block !important;
}
.button:focus {
    outline-offset: 4px;
}

.filter-options input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none; /* Damit Klick nur aufs Label geht */
}
.filter-options input[type="radio"]:focus + label {
    outline: 2px solid #fa9b00; /* Fokus-Rahmen */
    outline-offset: 10px;
    border-radius: 0px;
}


/* Für Screenreader versteckte Inhalte */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
    color: black !important;
    background-color: white !important;
}

/* Verbesserte visuelle Hinweise für Untermenüs */
#menu [aria-expanded="true"] {
    background-color: rgba(146, 107, 110, 0.2);
}

/* Stellen Sie sicher, dass Untermenüs durch Tastaturnavigation geöffnet sichtbar bleiben */
#menu [aria-expanded="true"] + ul {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Spezifischer Fokusindikator für aktuelle Elemente */
#menu .current:focus {
    outline-color: #444;
}

/* Styles für das Sprach-Menü */
.altlang-container {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 1000;
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 3px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    padding: 5px 0;
    /* Wichtig: Für geschmeidigen Übergang zwischen Anzeigen/Verbergen */
    transition: opacity 0.2s ease-out;
}

/* Sprach-Links Styling */
.altlang {
    display: block;
    padding: 5px 10px;
    text-decoration: none;
    color: #333;
}

.altlang:hover {
    background-color: #f5f5f5;
}

/* Unterstützung für aria-expanded */
button.linkasspan[aria-expanded="true"] .fa-angle-down {
    transform: rotate(180deg);
    transition: transform 0.2s ease;
}

/* Verbessere das Erscheinungsbild des Language-Menü-Buttons für bessere Tastatur-Navigation */
#langmenu {
    border: none;
    background: none;
    cursor: pointer;
    padding: 5px;
    border-radius: 3px;
}

/* Verbesserte Sichtbarkeit für aktivierte Menüelemente */
[aria-expanded="true"] {
    background-color: rgba(146, 107, 110, 0.1);
}


/* Skip-Links Styling */
.skip-links {
    position: absolute;
    top: 0px;
    left: 0;
    z-index: 10000;
}

.skip-link {
    position: absolute;
    top: -60px;
    left: 0;
    padding: 8px 16px;
    background: #000;
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    border-radius: 0 0 4px 0;
    transition: top 0.2s ease-in;
}

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

/* Visually hidden content for screen readers */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Show visually hidden content on focus */
.visually-hidden:focus {
    position: static !important;
    width: auto !important;
    height: auto !important;
    margin: inherit !important;
    padding: inherit !important;
    overflow: visible !important;
    clip: auto !important;
    white-space: inherit !important;
}

/* Verbesserte Button-Styles */
button {
    cursor: pointer;
    border: none;
    background: transparent;
}

button:focus {
    outline: 2px solid #fa9b00;
    outline-offset: 2px;
}

.menu-opener,
.menu-closer {
    background: transparent;
    border: none;
    padding: 8px;
    border-radius: 4px;
}

.menu-opener:focus
{
    background-color: rgba(250, 155, 0, 0.2);
}
.menu-closer:focus
{
    background-color: rgba(250, 155, 0, 0.2);
}

/* Zurück zum Seitenanfang Link */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: black;
    color: white;
    padding: 12px;
    text-decoration: none;
    border-radius: 50%;
    font-size: 16px;
    font-weight: bold;
    z-index: 1000;
    transition: opacity 0.3s ease;
}

.back-to-top:focus,
.back-to-top:hover {
    background: #e8890a;
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* Verbesserte Link-Styles für externe Links */
a[target="_blank"]::after {
    content: " (öffnet in neuem Fenster)";
    font-size: 0;
    width: 0;
    height: 0;
    overflow: hidden;
    position: absolute;
}

/* Aria-live Regionen */
[aria-live] {
    /* Stelle sicher, dass Live-Regionen für Screen Reader zugänglich sind */
}

/* Verbesserte Fokus-Indikatoren */
a:focus {
    outline: 2px solid #fa9b00;
    outline-offset: 2px;
}

/* Menü-Button States */
.menu-opener[aria-expanded="true"],
.menu-closer[aria-expanded="true"] {
    background-color: transparent;
}

/* Navigation States */
.main-navigation[aria-hidden="true"] {
    display: none;
}

.main-navigation[aria-hidden="false"] {
    display: block;
}

/* Kontrast-Verbesserungen */
.claim .top,
.claim .bottom {
    text-shadow: 1px 1px 2px rgba(0,0,0,0.7);
}

/* Responsive Skip-Links */
@media (max-width: 768px) {
    .skip-link {
        font-size: 14px;
        padding: 6px 12px;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    *:focus {
        outline: 3px solid;
        outline-offset: 2px;
    }

    .skip-link {
        border: 2px solid;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .skip-link,
    .back-to-top,
    .menu-opener,
    .menu-closer {
        transition: none;
    }
}
