/* ============================================================
   5. WISSENSDATENBANK / DOKU (WIKI-STYLE)
   ============================================================ */

/* 5.1 Automatisches Inhaltsverzeichnis (.orga-toc) */
.orga-toc {
    background: #f8f9fa;
    border: 1px solid #a2a9b1;
    padding: 15px;
    display: table;
    margin-bottom: 25px;
    font-size: 0.9rem;
    border-radius: 2px;
}

.orga-toc strong {
    display: block;
    margin-bottom: 10px;
    text-align: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

.orga-toc ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.orga-toc li.toc-level-3 { margin-left: 15px; font-size: 0.85rem; }
.orga-toc li.toc-level-4 { margin-left: 30px; font-size: 0.8rem; }

.orga-toc a {
    text-decoration: none;
    color: var(--wp--preset--color--accent-3);
}

.orga-toc a:hover {
    text-decoration: underline;
}

/* 5.2 Der große Stammbaum (.orga-doku-tree) */
.orga-doku-tree ul {
    list-style: none;
    padding-left: 20px;
    border-left: 2px solid #eee;
}

.orga-doku-tree > ul {
    border-left: none;
    padding-left: 0;
}

.orga-doku-tree > ul > li > a {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--wp--preset--color--primary);
}

.orga-doku-tree li {
    margin: 8px 0;
    position: relative;
}

.orga-doku-tree li a {
    text-decoration: none;
    font-weight: 500;
    color: var(--wp--preset--color--accent-3);
}

.orga-doku-tree li a:hover {
    text-decoration: underline;
}

.orga-doku-tree ul ul {
    margin-top: 5px;
    font-size: 0.95em;
    border-left: 1px solid #ddd;
}

/* 5.3 Rubrik-Vorschau (.orga-doku-sub-tree) */
.orga-doku-sub-tree {
    background: #f0f4f8;
    padding: 20px;
    border-radius: 8px;
    margin: 25px 0;
    border-left: 5px solid var(--wp--preset--color--accent-3);
}

.orga-doku-sub-tree strong {
    display: block;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.orga-doku-sub-tree ul {
    list-style: square;
    margin-left: 20px;
}

.orga-doku-sub-tree li {
    margin-bottom: 5px;
}
/* ============================================================
   6. AUTOMATISCHES SEITENMENÜ (Finaler Fix: Padding & Layout)
   ============================================================ */

/* 1. RESET & POSITIONING */
.src-seitenmenü, 
.src-seitenmenü * {
    border: none !important;         /* Killt alle Rahmen */
    background: none !important;     /* Killt alle Hintergründe */
    box-shadow: none !important;     /* Killt alle Schatten */
}

.src-seitenmenü .wp-block-navigation__container,
.src-seitenmenü .wp-block-navigation__submenu-container {
    display: flex !important;
    flex-direction: column !important; /* Zwingt alles untereinander */
    align-items: stretch !important;
    position: static !important;
    width: 100% !important;            /* Volle Breite der Spalte */
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
}

/* 2. LOGIK: Nur das zeigen, was wir wollen */
/* Alles verstecken, was kein Elternteil oder das aktuelle Item ist */
.src-seitenmenü .wp-block-navigation-item:not(.current-menu-item):not(.current-menu-ancestor) {
    display: none !important;
}

/* Den Text des aktiven Hauptmenü-Punkts verstecken (nur Unterpunkte zeigen) */
.src-seitenmenü .current-menu-item > .wp-block-navigation-item__content,
.src-seitenmenü .current-menu-ancestor > .wp-block-navigation-item__content {
    display: none !important;
}

/* 3. MOBILE & RESPONSIVE FIX */
/* Verhindert, dass WordPress auf Tablets das Menü einklappt */
.src-seitenmenü .wp-block-navigation__responsive-container,
.src-seitenmenü .wp-block-navigation__responsive-container-content {
    display: block !important;
    width: 100% !important;
    position: static !important;
}

/* Deaktiviert den "Hamburger"-Button oder Pfeile */
.src-seitenmenü button.wp-block-navigation__responsive-container-open,
.src-seitenmenü .wp-block-navigation-submenu__toggle {
    display: none !important;
}
/* ============================================================
   8. RECHTSBÜNDIGE BILDER mobil zentriert
   ============================================================ */

/* Mobile Optimierung: Rechtsbündige Bilder am Handy zentrieren */
@media (max-width: 600px) {
    .wp-block-image.alignright {
        float: none !important;
        margin: 0 auto 1.5em auto !important;
        max-width: 100% !important;
        display: block !important;
    }
}
