/* assets/css/info.css */

/* Haupt-Layout: Grid mit zwei Spalten */
.info-layout {
    display: grid;
    grid-template-columns: 260px 1fr; /* Sidebar (fix) | Hauptinhalt (flexibel) */
    gap: 2rem;
    align-items: flex-start;
}

/* --- Linke Spalte: Sidebar --- */
.info-sidebar {
    position: sticky;
    top: 90px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
}

.sidebar-title {
    font-size: 1.1rem;
    margin: 0 0 0.5rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav > ul > li {
    margin-bottom: 2px;
}

/* Styling für alle klickbaren Elemente der Ebene 1 & 2 */
.sidebar-nav a,
.sidebar-nav summary {
    display: block;
    padding: 0.2rem 0.25rem;
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    cursor: pointer;
}

.sidebar-nav a:hover,
.sidebar-nav summary:hover {
    background-color: #113e56ba;
    color: var(--text-main);
}

.sidebar-nav a.active {
    background-color: #144864;
    color: white;
    font-weight: 600;
}

.category-collapsible[open] > summary {
    background-color: #113e56ba;
}

/* Unterlisten (Ebene 2 und 3) */
.subcategory-list, .article-sidebar-list {
    list-style: none;
    margin-top: 4px;
    padding-left: 1.2rem; /* Klare Einrückung */
}

/* Spezielles, noch kompakteres Styling für Artikel-Links (Ebene 3) */
.article-sidebar-list {
    padding-left: 1rem; /* Zusätzliche Einrückung */
    margin-top: 4px;
}

.sidebar-article-link {
    font-size: 0.85rem;
    font-weight: 400;
    padding: 0.2rem 0.5rem; /* Sehr kompakt */
    color: #94a3b8; /* Helleres Grau, um sie unterzuordnen */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* =========================================
   STYLING FÜR AUFKLAPPBARE KATEGORIEN
   ========================================= */
.category-collapsible {
    border-radius: var(--radius-sm);
    transition: background-color 0.2s ease;
}

.category-collapsible summary {
    display: flex;
    align-items: center;
    cursor: pointer;
    list-style: none; /* Entfernt den Standard-Pfeil (wir erstellen einen eigenen) */
}

/* Ersetzt den Standard-Pfeil durch ein ::before-Pseudoelement */
.category-collapsible summary::before {
    content: '\25B6'; /* Unicode für ein Dreieck nach rechts ► */
    font-size: 0.7em;
    margin-right: 0.75rem;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.category-collapsible[open] > summary::before {
    transform: rotate(90deg); /* Dreht das Dreieck nach unten ▼ */
}

.category-collapsible summary span {
    color: var(--text-muted);
    font-weight: 500;
}

.category-collapsible:hover summary span {
    color: var(--text-main);
}

.subcategory-list {
    list-style: none;
    padding-left: 1.5rem; /* Einrückung für Unterpunkte */
    margin-top: 0.5rem;
}

/* --- Rechte Spalte: Hauptinhalt --- */
.info-content {
    min-width: 0; /* Verhindert Überlaufen bei Flex/Grid-Items */
}

/* Obere Navigationsleiste */
.info-top-nav {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.info-top-nav a {
    padding: 0.8rem 1.2rem;
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px; /* Zieht den Link auf die Border-Linie */
    transition: all 0.2s ease;
}

.info-top-nav a:hover {
    color: var(--text-main);
}

.info-top-nav a.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

/* Suchleiste */
.info-search-bar {
    position: relative;
    margin-bottom: 2rem;
}

.info-search-bar input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem; /* Platz für das Icon links */
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background-color: var(--bg-input);
    color: var(--text-main);
    font-size: 1rem;
}

.info-search-bar .fa-magnifying-glass {
    position: absolute;
    top: 50%;
    left: 1rem;
    transform: translateY(-50%);
    color: var(--text-muted);
}

/* Artikelliste */
.article-list {
    display: grid;
    gap: 1.5rem;
}

.article-item {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.article-item:hover {
    border-color: var(--accent-color);
    box-shadow: var(--shadow);
}

.article-item-category {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent-color);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.article-item-title a {
    text-decoration: none;
    color: var(--text-main);
    font-size: 1.25rem;
}

.article-item-title a:hover {
    text-decoration: underline;
}

.article-item-excerpt {
    color: var(--text-muted);
    margin-top: 0.5rem;
    font-size: 0.95rem;
}

/* --- Responsive Anpassungen --- */
@media (max-width: 992px) {
    .info-layout {
        grid-template-columns: 1fr; /* Sidebar und Inhalt untereinander */
    }

    .info-sidebar {
        position: static; /* Sticky-Positionierung aufheben */
        top: 90px;
        margin-top: 120px;
        margin-bottom: 2rem;
    }
}