/* ===== Reset & Basics ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
    overflow-x: hidden;
    margin: 0;
    /* Reserve space for fixed header to prevent content overlap */
    padding-top: var(--header-offset, 80px);
} 

/* ===== Header ===== */
.site-header {
    background: linear-gradient(135deg, #d32f2f, #b71c1c);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
}

/* Optional fine-tuning: if a page needs internal spacing on its first container */
.site-header + * {
    /* Use the same dynamic offset; no negative margin to avoid hiding content */
    padding-top: var(--header-offset, 80px);
}

/* ===== Navigation ===== */
.nav {
    max-width: 1600px;
    margin: auto;
    padding: 0.6rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ===== Brand ===== */
.brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    color: white;
    font-weight: 700;
    font-size: 2rem;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.brand:hover {
    opacity: 0.9;
}

.brand-text {
    font-size: 1.8rem;
    color: white;
}

.brand img {
    height: 70px;
}

/* ===== Toggle ===== */
.nav-toggle {
    display: none;
}

.nav-toggle-label {
    display: none;
    font-size: 3rem;
    color: white;
    cursor: pointer;
}

.nav-toggle-label::before {
    content: "☰";
}

.nav-toggle:checked + .nav-toggle-label::before {
    content: "✕";
}

/* ===== Menu ===== */
.nav-menu {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-menu a,
.nav-menu label {
    color: white;
    text-decoration: none;
    padding: 0.6rem 1rem;
    font-weight: 600;
    font-size: 1rem; /* consistent size for top-level menu */
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.2s ease;
} 

.nav-menu a:hover,
.nav-menu label:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* ===== Dropdown ===== */
.has-dropdown {
    position: relative;
}

.has-dropdown input {
    display: none;
}

.dropdown {
    display: none;
    position: absolute;
    top: 110%;
    left: 0;
    right: auto;
    background: #1f1f1f;
    min-width: 220px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
}

/* Letzte Dropdown-Items von rechts positionieren */
.nav-menu li:last-child .dropdown,
.nav-menu li:nth-last-child(2) .dropdown {
    left: auto;
    right: 0;
}

.dropdown a {
    display: block;
    padding: 0.7rem 1rem;
    font-weight: 500;
    font-size: 0.95rem; /* slightly smaller for dropdown items */
} 

.dropdown a:hover {
    background: rgba(255,255,255,0.1);
}

/* Desktop Hover */
@media (min-width: 901px) {
    .has-dropdown:hover .dropdown {
        display: block;
    }
}

/* ===== Mobile ===== */
@media (max-width: 900px) {

    .nav {
        flex-wrap: wrap;
        align-items: center;
        padding: 0.8rem 1rem;
    }

    .brand {
        gap: 0.5rem;
        min-width: 0;
        flex-shrink: 1;
        flex-basis: auto;
    }

    .brand img {
        height: 55px;
    }

    .brand-text {
        font-size: 1.3rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .search-container-header {
        display: none;
    }

    .nav-toggle-label {
        display: block;
        margin-left: auto;
        order: 2;
        padding: 0.5rem;
        font-size: 2.5rem;
    }

    .nav-menu {
        display: none;
        flex-direction: column;
        width: 100%;
        margin-top: 1rem;
        flex-basis: 100%;
        order: 3;
    }

    .nav-toggle:checked ~ .nav-menu {
        display: flex;
    }

    .nav-menu li {
        width: 100%;
        text-align: center;
    }

    .nav-menu a,
    .nav-menu label {
        font-size: 1.1rem;
        padding: 0.9rem 1.2rem;
        display: block;
        width: 100%;
    }

    .dropdown {
        position: static;
        box-shadow: none;
        background: #7f1d1d;
        width: 100%;
        border-radius: 0;
        margin-top: 0.5rem;
    }

    .dropdown a {
        font-size: 1rem;
        padding: 0.8rem 1rem;
    }

    .has-dropdown input:checked + label + .dropdown {
        display: block;
    }
}

/* ===== Search Container ===== */
.search-container-header {
    margin-left: auto;
    margin-right: 1rem;
}

.search-form {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 0.3rem 0.8rem;
    transition: background 0.3s;
}

.search-form:focus-within {
    background: rgba(255, 255, 255, 0.25);
}

.search-input-header {
    background: transparent;
    border: none;
    color: white;
    padding: 0.4rem;
    font-size: 0.95rem;
    width: 200px;
    outline: none;
}

.search-input-header::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.search-button-header {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-button-header:hover {
    opacity: 0.8;
}

@media (max-width: 900px) {
    .search-container-header {
        display: none;
    }
}

/* Suchleiste erst ab 1200px anzeigen */
@media (max-width: 1199px) {
    .search-container-header {
        display: none;
    }
}

/* ===== Large Screens ===== */
@media (min-width: 1800px) {
    .nav-menu a,
    .nav-menu label {
        font-size: 1.1rem; /* scaled up a bit for very large screens, but kept under brand size */
    }
}
