/* 1. Schriftart laden (MUSS in der ersten Zeile stehen!) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

body, h1, h2, h3, h4, h5, h6, #sidebar {
    font-family: 'Inter', sans-serif !important;
}

/* 2. Screenshots linksbündig mit dem Fließtext. Das Theme zentriert #body img per margin: auto. */
#body img {
    margin-left: 0 !important;
    margin-right: auto !important;
}

/* Kleine Symbole in Überschriften und Listen bleiben in der Zeile */
#body img[style*="inline-block"] {
    display: inline-block !important;
    margin: 0 0.25rem !important;
    vertical-align: middle !important;
}

/* Download-Karten und bewusst zentrierte Blöcke behalten ihre Mitte */
#body [style*="align-items: center"] img,
#body [style*="align-items:center"] img,
#body [style*="text-align: center"] > img,
#body [style*="text-align:center"] > img {
    margin-left: auto !important;
    margin-right: auto !important;
}

/* 3. Seitenleiste: Einheitliches BusWay-Blau mit weißer Schrift */
#header,
#sidebar,
#sidebar ul,
#sidebar ul li,
#sidebar ul.topics > li,
#sidebar ul.topics > li.parent,
#sidebar ul.topics > li.parent > ul,
#sidebar ul.topics > li.active,
#sidebar ul.topics > li.active > ul,
#sidebar ul.topics ul li,
#sidebar ul.topics ul li.active,
#sidebar ul.topics ul li.active > a {
    background: #1e3a8a !important;
    background-color: #1e3a8a !important;
}

#header {
    border-bottom: 1px solid #1e40af !important;
}

#sidebar a,
#sidebar ul li > a,
#sidebar ul.topics > li > a,
#sidebar ul.topics ul li > a,
#sidebar ul.topics ul li.active > a {
    color: #ffffff !important;
}

/* Sanfter Hover-Effekt im Menü */
#sidebar a:hover,
#sidebar ul li > a:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
}

/* 4. CI-Akzente: Gelbe Icons in der Seitenleiste */
#sidebar .fa-check, 
#sidebar .fa-chevron-down, 
#sidebar .fa-chevron-right {
    color: #facc15 !important;
}

/* 5. Suchfeld abdunkeln und modernisieren */
.searchbox {
    background: rgba(0, 0, 0, 0.2) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 6px;
}
.searchbox input {
    color: #ffffff !important;
}

/* 6. Lesebereich (Texte, Überschriften, Links) */
#body h1, #body h2, #body h3 {
    color: #1e3a8a !important;
    font-weight: 700 !important;
}

#body a {
    color: #2563eb !important;
    font-weight: 600;
}

#body a:hover {
    color: #1e40af !important;
    text-decoration: underline;
}
/* --- KORREKTUR FÜR ZIFFERN UND AKTIVEN MENÜPUNKT --- */

/* 1. Ordnungsziffern (die <b> Tags im Link) zwingend weiß machen */
#sidebar a b, 
#sidebar ul.topics > li > a b,
#sidebar ul.topics ul li > a b {
    color: #ffffff !important;
}

/* 2. Aktiven Menüpunkt korrigieren (Weiß auf Weiß verhindern) */
#sidebar ul.topics > li.active > a,
#sidebar ul.topics ul li.active > a,
#sidebar ul li.active > a {
    background: #1e40af !important; /* Ein minimal helleres Blau (#1e40af) als der Rest (#1e3a8a) zur sauberen Hervorhebung */
    background-color: #1e40af !important;
    color: #ffffff !important;
}
/* --- SIDEBAR BREITE UND TEXT-ABSTAND KORRIGIEREN --- */

@media only screen and (min-width: 768px) {
    /* 1. Sidebar und Header breiter machen */
    #sidebar, 
    #header {
        width: 380px !important; 
    }
    
    /* 2. Den Hauptbereich zwingend verschieben */
    /* Manche Theme-Versionen nutzen 'left', andere 'margin-left' - wir überschreiben beides */
    #body {
        margin-left: 380px !important;
        left: 0 !important; 
    }
}

/* 3. Den inneren Abstand des Textes erzwingen (spricht den wrapper .padding an) */
#body .padding {
    padding-left: 3rem !important;
    padding-right: 3rem !important;
}

/* --- LANGUAGE SELECTOR IN DER SIDEBAR --- */
.busway-langswitcher-sidebar {
    margin-top: 15px;
    width: 100%;
}

.busway-langswitcher-sidebar select {
    width: 100%;
    padding: 8px 12px;
    border-radius: 4px;
    background-color: rgba(0, 0, 0, 0.15); /* Leicht transparent, passend zum Suchfeld */
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none; /* Entfernt den klobigen Standard-Pfeil von Windows */
}

/* Das aufgeklappte Menü braucht einen soliden Hintergrund, sonst ist die weiße Schrift nicht lesbar */
.busway-langswitcher-sidebar select option {
    background-color: #1e3a8a; 
    color: #ffffff;
}

.image-note {
    font-size: 1rem;
    color: #64748b;
    margin-top: -40px;
    margin-bottom: 20px;
}

.busway-langswitcher-sidebar select:hover,
.busway-langswitcher-sidebar select:focus {
    border-color: #facc15; /* BusWay Gelb als Hover-Akzent */
    background-color: rgba(0, 0, 0, 0.25);
}

/* Standardmäßig (Desktop) das mobile Logo ausblenden */
.mobile-logo-container {
    display: none;
}

/* --- MOBILE OPTIMIERUNGEN (Smartphones & Tablets) --- */
@media only screen and (max-width: 768px) {
    
    /* 1. Hamburger Menü fixieren und oben links verankern */
    #sidebar-toggle {
        top: 15px !important;
        left: 15px !important;
        position: absolute !important;
        z-index: 1000 !important; /* Stellt sicher, dass das Menü immer klickbar bleibt */
    }

    /* 2. Top-Bar als Flexbox (zwingt Logo und Breadcrumbs sauber untereinander) */
    #top-bar {
        position: relative !important;
        margin-left: 50px !important; /* Hält den linken Bereich für das Hamburger-Icon komplett frei */
        margin-bottom: 25px !important; /* Schiebt die große H1-Überschrift deutlich nach unten */
        padding-top: 15px !important;
        height: auto !important;
        display: flex !important;
        flex-direction: column !important; /* Logo oben, Breadcrumbs darunter */
        align-items: flex-start !important; /* Linksbündig */
        gap: 15px !important; /* Luft zwischen Logo und Breadcrumbs */
    }

    /* 3. Mobiles Logo-Feld (Blau, symmetrisch, Bild zentriert) */
    .mobile-logo-container {
        display: flex !important;
        justify-content: center !important; /* Horizontale Zentrierung des Inhalts */
        align-items: center !important;     /* Vertikale Zentrierung */
        background-color: #1e3a8a !important; /* BusWay Blau */
        border-radius: 6px !important;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
        
        /* Der Symmetrie-Trick */
        align-self: stretch !important; /* Zieht die Box über die verfügbare Breite... */
        margin-right: 50px !important;  /* ...und hält rechts denselben Abstand wie links das Menü */
        
        padding: 12px 0 !important; /* Etwas Luft nach oben und unten (vergrößert die blaue Fläche) */
        position: static !important;
        float: none !important;
    }
    
    .mobile-logo-container a {
        display: block !important; 
        color: transparent !important;
        font-size: 0 !important; 
        
        /* Das Bild einfügen und zentrieren */
        background-image: url('../images/bw-logo.png') !important;
        background-size: contain !important;
        background-repeat: no-repeat !important;
        background-position: center center !important; /* Bild mittig platzieren */
        
        /* Die Größe des Logos innerhalb der Box */
        width: 150px !important;
        height: 40px !important;
    }

    /* 4. Breadcrumbs erden und MEHR Abstand zum Logo schaffen */
    #top-bar .breadcrumbs,
    #top-bar #breadcrumbs {
        position: static !important; 
        float: none !important; 
        display: block !important;
        width: 100% !important;
        white-space: normal !important; 
        line-height: 1.6 !important;
        font-size: 0.85rem !important;
        padding: 0 !important;
        /* Der erste Wert (25px) steuert den Abstand nach oben zum Logo */
        margin: 25px 0 0 0 !important; 
    }

    /* 5. Riesige Überschriften (z.B. Firmeneinstellungen) zwingend umbrechen */
    #body h1 {
        font-size: 1.8rem !important;
        line-height: 1.25 !important;
        margin-top: 0 !important;
        clear: both !important;
        width: 100% !important;
        overflow-wrap: break-word !important; /* Silbentrennung erzwingen */
        word-wrap: break-word !important;
        hyphens: auto !important;
    }

    #body h2 {
        font-size: 1.5rem !important;
        line-height: 1.3 !important;
        overflow-wrap: break-word !important;
        word-wrap: break-word !important;
        hyphens: auto !important;
        margin-top: 25px !important;
    }

    /* 6. Weiße Ränder anpassen */
    #body .padding {
        padding: 15px 15px 40px 15px !important; /* Oben, Rechts, Unten, Links */
    }
}