/* Grundlegende Stile für Barrierefreiheit und Responsivität */
:root {
    --primary-color: #0056b3;
    --text-color: #333;
    --bg-color: #fff;
    --footer-bg: #f8f9fa;
    --link-color: #0056b3;
    --focus-outline: 3px solid #ffbf47;
}

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 0;
}

/* Skip Link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    z-index: 100;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
    outline: var(--focus-outline);
}

/* Header */
header {
    background: #fff;
    border-bottom: 1px solid #ddd;
    padding: 0.5rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    gap: 2rem;
}

.logo {
    margin-right: auto;
}

.logo a {
    text-decoration: none;
    color: var(--text-color);
    font-size: 1.5rem;
}

/* Menu Toggle (Hamburger) */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1100;
}

.hamburger {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--text-color);
    position: relative;
    transition: background 0.3s;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    width: 25px;
    height: 3px;
    background: var(--text-color);
    left: 0;
    transition: transform 0.3s;
}

.hamburger::before { top: -8px; }
.hamburger::after { bottom: -8px; }

.menu-toggle[aria-expanded="true"] .hamburger {
    background: transparent;
}

.menu-toggle[aria-expanded="true"] .hamburger::before {
    transform: rotate(45deg) translate(5px, 6px);
}

.menu-toggle[aria-expanded="true"] .hamburger::after {
    transform: rotate(-45deg) translate(5px, -6px);
}

/* Nav Links & Submenu */
.nav-links {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    margin: 0;
    padding: 0;
}

.nav-links li {
    position: relative;
}

.nav-links a, 
.submenu-toggle {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    padding: 0.5rem 0;
    display: block;
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    font-family: inherit;
}

.nav-links a:hover,
.submenu-toggle:hover {
    color: var(--primary-color);
}

.has-submenu {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.arrow {
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 5px;
    vertical-align: middle;
    border-top: 4px solid;
    border-right: 4px solid transparent;
    border-left: 4px solid transparent;
    transition: transform 0.3s;
}

.submenu-toggle[aria-expanded="true"] .arrow {
    transform: rotate(180deg);
}

/* Desktop Submenu */
@media (min-width: 1025px) {
    .submenu {
        position: absolute;
        top: 100%;
        left: 0;
        background: #fff;
        border: 1px solid #ddd;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        list-style: none;
        padding: 0.5rem 0;
        margin: 0;
        min-width: 200px;
        opacity: 0;
        visibility: hidden;
        transform: translateY(10px);
        transition: all 0.3s;
        z-index: 1000;
    }

    .nav-links li:hover > .submenu,
    .nav-links li:focus-within > .submenu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .submenu li a {
        padding: 0.5rem 1rem;
    }

    .submenu li a:hover {
        background: #f8f9fa;
    }
}

/* Language Switcher */
.language-switcher {
    display: flex;
    align-items: center;
}

.language-switcher select {
    padding: 0.5rem;
    border-radius: 4px;
    border: 1px solid #ccc;
    font-size: 1rem;
    cursor: pointer;
}

/* Main Content */
main {
    flex: 1;
}

/* Footer */
footer {
    background-color: var(--footer-bg);
    border-top: 1px solid #ddd;
    padding: 2rem 0;
}

.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-links {
    list-style: none;
    display: flex;
    gap: 1rem;
    margin: 0;
    padding: 0;
}

.footer-links a {
    text-decoration: none;
    color: var(--text-color);
    font-size: 0.9rem;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Fokus-Stile */
a:focus, button:focus, select:focus {
    outline: var(--focus-outline);
    outline-offset: 2px;
}

/* Responsive */
@media (max-width: 1024px) {
    .header-container {
        gap: 1rem;
    }

    .language-switcher {
        margin-left: auto;
    }

    .menu-toggle {
        display: block;
        margin-left: 0.5rem;
    }

    .nav-wrapper {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: #fff;
        box-shadow: -2px 0 5px rgba(0,0,0,0.1);
        padding: 4rem 2rem 2rem;
        transition: right 0.3s ease-in-out;
        z-index: 1050;
        overflow-y: auto;
    }

    .nav-wrapper.is-active {
        right: 0;
    }

    .nav-links {
        flex-direction: column;
        gap: 1rem;
    }

    .has-submenu {
        flex-direction: column;
        align-items: flex-start;
    }

    .submenu {
        list-style: none;
        padding-left: 1.5rem;
        display: none;
        width: 100%;
    }

    .submenu.is-open {
        display: block;
    }

    .submenu li a {
        padding: 0.5rem 0;
    }
}
