/* assets/css/news.css */

/* --- 3. Linke Sidebar (Navigation) --- */
.action-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.action-list .action-button {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    border: 1px solid transparent;
    color: var(--text-main);
    border-radius: 0.3rem;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.action-list .action-button:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.1);
    border-color: transparent;
}

.action-list .action-button.active-filter-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    font-weight: 600;
}

.action-list .action-button i {
    width: 1.2em;
    text-align: center;
    transition: color 0.2s ease;
}

.action-list .action-button.active-filter-link i {
    color: white;
}

/* --- 4. Mittlere Spalte (Artikel-Feed) --- */

/* Styling für die kompakte Filterleiste */
.news-filter-bar { /* Ersetzt news-filter-main-column-card */
    background-color: var(--bg-section); /* HIER IST DER HINTERGRUND WIEDER DA */
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.news-filter-bar .sidebar-title { /* Filter & Sortierung Überschrift */
    font-size: 1.1rem; /* Kleiner als H3, passender für Kompaktheit */
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.75rem; /* Etwas kleinerer Abstand nach unten */
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.news-filter-bar .filter-form {
    display: flex;
    flex-direction: column; /* Grundsätzlich als Spalte, um die Reihen getrennt zu halten */
    gap: 0.75rem; /* Abstand zwischen den Reihen */
}

.news-filter-bar .filter-controls-row { /* NEU: Wrapper für die Input-Felder und den Filtern-Button */
    display: flex;
    flex-wrap: wrap; /* Erlaubt Umbruch auf kleinen Bildschirmen */
    align-items: flex-end; /* Richtet die Elemente am unteren Rand aus */
    gap: 0.75rem; /* Abstand zwischen den Elementen */
    width: 100%; /* Wichtig, damit es die volle Breite nutzt */
}

.news-filter-bar .filter-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    /* max-width: 180px; */ /* Optional: Wenn du eine feste Max-Breite für Dropdowns/Inputs willst */
}

/* Wichtig: Auf größeren Bildschirmen müssen die Filter-Items wachsen können,
   außer die, die eine feste Breite haben sollen. */
.news-filter-bar .filter-item:nth-child(1), /* Sortieren */
.news-filter-bar .filter-item:nth-child(2) { /* Kategorie */
    flex-basis: 150px; /* Feste Breite für die ersten beiden Dropdowns */
    flex-grow: 0; /* Verhindert, dass sie wachsen */
}

.news-filter-bar .filter-item:nth-child(3) { /* Tags */
    flex-grow: 1; /* Dieses Feld darf den restlichen Platz einnehmen */
    min-width: 180px; /* Mindestbreite, bevor es umbricht */
}


.news-filter-bar .filter-label-compact {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-light);
    line-height: 1;
    white-space: nowrap; /* Verhindert Umbruch des Labels */
}

.news-filter-bar .form-select-sm,
.news-filter-bar .form-control-sm {
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
    height: 32px;
}

.news-filter-bar .filter-submit-button { /* Wrapper für den Filtern-Button */
    /* Positionierung kommt jetzt aus .filter-controls-row */
    flex-shrink: 0; /* Verhindert, dass der Button schrumpft */
    align-self: flex-end; /* Button am unteren Rand der Filter-Reihe ausrichten */
}

.news-filter-bar .btn.btn-sm {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
    height: 32px;
    width: 100%; /* Auf kleinen Bildschirmen volle Breite */
    min-width: 80px; /* Mindestbreite, damit der Button nicht zu klein wird */
}

.news-filter-bar .filter-reset-area {
    display: flex;
    justify-content: flex-end; /* Rechts ausrichten */
    align-items: center;
    width: 100%; /* Volle Breite unterhalb der Filter */
    margin-top: 0.75rem; /* Etwas mehr Abstand nach oben */
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color); /* Eine Trennlinie */
}

.news-filter-bar .filter-reset-link {
    font-size: 0.85rem;
    color: var(--bs-danger);
    text-decoration: none;
    transition: color 0.2s ease;
    white-space: nowrap;
}
.news-filter-bar .filter-reset-link:hover {
    color: var(--primary-color);
}

/* Responsive Anpassungen für die Filterleiste */
@media (max-width: 991.98px) { /* Auf kleineren Bildschirmen unter LG (Tablet/Mobile) */
    .news-filter-bar .filter-controls-row {
        flex-direction: row; /* Immer noch horizontal */
        flex-wrap: wrap; /* Erlaubt Umbruch */
        gap: 0.75rem;
    }
    .news-filter-bar .filter-item {
        flex-basis: calc(50% - 0.375rem); /* Zwei Spalten */
        flex-grow: 1;
    }
    .news-filter-bar .filter-item:nth-child(3) { /* Tags-Feld */
        flex-basis: 100%; /* Tags nehmen volle Breite ein, wenn Platz knapp wird */
    }
    .news-filter-bar .filter-submit-button {
        flex-basis: 100%; /* Button nimmt volle Breite ein */
    }
    .news-filter-bar .btn.btn-sm {
        width: 100%;
    }
}
@media (max-width: 575.98px) { /* Auf sehr kleinen Bildschirmen (Mobile) */
    .news-filter-bar .filter-controls-row {
        flex-direction: column; /* Alle Filter untereinander */
        align-items: stretch;
        gap: 1rem;
    }
    .news-filter-bar .filter-item {
        width: 100%;
        flex-basis: auto;
    }
    .news-filter-bar .filter-submit-button {
        width: 100%;
        flex-basis: auto;
    }
}


.articles-feed-list {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

.article-preview-item {
    background: var(--bg-section);
    border-radius: 0.375rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
    display: flex;
    height: 100%;
    border: 1px solid var(--border-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    align-items: stretch;
    position: relative;
    overflow: hidden;
}
.dark-mode .article-preview-item:hover {
    box-shadow: 0 4px 10px rgba(0,0,0,.2);
}

.preview-column-left {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    width: 338px;
}

.preview-image-container {
    height: 190px;
    position: relative;
    background-color: #212529;
}
.preview-image-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    z-index: 1;
}

.preview-category-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 2;
}
.preview-category-badge a {
    background: var(--primary-color);
    color: white;
    padding: 0.3em 0.7em;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
}
.preview-category-badge a:hover {
    background: var(--primary-color);
}

.preview-content {
    flex: 1;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.preview-content-header {
    margin-bottom: 0.5rem;
}

.preview-title {
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.3;
    margin: 0;
}
.preview-title a {
    color: var(--primary-color); /* Titel ist jetzt standardmäßig grün */
    text-decoration: none;
    transition: color 0.2s ease-in-out; /* Übergang für sanften Farbwechsel */
}
.preview-title a:hover {
    color: var(--primary-color); /* Lila für den Hover-Effekt */
}

/* Dark Mode Anpassung, falls der Kontrast nicht gut genug ist */
.dark-mode .preview-title a {
    color: var(--primary-color); /* Ein helleres Grün für den Dark Mode */
}
.dark-mode .preview-title a:hover {
    color: #c792ea; /* Ein helleres Lila für den Dark Mode */
}

.preview-meta {
    font-size: 0.8rem;
    color: var(--text-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    
    background-color: var(--bg-section);
    padding: 0.5rem 0.75rem;
    border-top: 1px solid var(--border-color);
    flex-grow: 1; 
}
.dark-mode .preview-meta {
    background-color: var(--bg-section);
}

.preview-meta .author a {
    color: inherit;
    text-decoration: none;
}
.preview-meta .author a:hover {
    text-decoration: underline;
}

.preview-excerpt {
    font-size: 0.9rem;
    flex-grow: 1;
    margin-top: 1rem; /* Abstand zur Titel-Zeile */
    margin-bottom: 1rem;
    color: var(--text-main);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;  
    overflow: hidden;
}

.preview-actions {
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.article-link {
    font-weight: 600;
}
.feed-item-interactions {
    color: #6c757d;
}
.dark-mode .feed-item-interactions {
    color: #adb5bd;
}

.comment-count-badge {
    font-size: 0.9rem;
}

/* --- 5. Rechte Sidebar (Filter) - Diese Sektion wird jetzt als Profil-Sidebar genutzt. */
.filter-widget {
    /* Die allgemeine filter-widget Klasse wird von den neuen news-filter-main-column-card Stilen überschrieben,
       wenn sie in diesem Kontext verwendet wird. */
}

/* ==================================================
   Korrekturen für User-Badges auf der News-Seite
   ================================================== */

/* Wir stellen sicher, dass das User-Badge seine eigene Farbe und keinen Unterstrich hat,
   auch wenn es ein Link ist. */
.preview-meta a.user-badge {
    text-decoration: none !important;
    color: initial;
    transition: none;
}

/* Wir stellen sicher, dass der Text im Badge seine definierte Farbe behält
   und nicht die grüne Link-Hover-Farbe annimmt. */
.preview-meta a.user-badge:hover {
    color: initial;
}

.preview-meta a.user-badge:hover .badge-username {
    color: inherit !important;
}

.preview-meta .meta-left .bi,
.preview-meta .meta-right .bi {
    vertical-align: -0.125em; /* Richtet die Icons sauber an der Textlinie aus */
}

/* ==========================================================
   Anpassungen für das Layout der Artikel-Vorschau
   ========================================================== */

.preview-title-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    background-color: rgba(0,0,0,0.02);
    margin: -1.25rem -1.25rem 0 -1.25rem; /* DEIN FIX: margin-bottom ist jetzt 0 */
    padding: 0.75rem 1.25rem;
    border-bottom: none;
}
.dark-mode .preview-title-wrapper {
    background-color: rgba(255,255,255,0.03);
}

.preview-bookmark-action {
    flex-shrink: 0;
    margin-top: 0.25rem;
}

/* --- 7. Responsive Anpassungen --- */
@media (max-width: 1200px) {
    .news-sidebar-left {
        display: none;
    }
}

@media (max-width: 992px) {
    /* Die rechte Sidebar wird jetzt die Profil-Sidebar. Ihr margin-top sollte 0 sein. */
    .sidebar-right {
        margin-top: 0; /* Entfernt den vorherigen margin-top von 2.5rem */
    }
    
    .news-sidebar-left .sticky-sidebar,
    .sidebar-right .sticky-content {
        position: static;
    }
}

@media (max-width: 767px) {
    .article-preview-item {
        flex-direction: column;
    }
    .preview-image-container {
        flex-basis: auto;
        width: 100%;
    }
}

/* RECHTE SIDEBAR: Styling für die Profil-Info-Karte (aus _sidebar_profile_widget.php) */
.profile-sidebar-widget-card {
    padding: 1.25rem;
    background-color: var(--bg-section);
    border-radius: 0.375rem;
    border: 1px solid var(--border-color);
}
.profile-sidebar-widget-card .list-group-item {
    background-color: transparent;
    border-color: var(--border-color);
}

/* ==========================================================
   Article Content Formatting (TinyMCE Output)
   ========================================================== */
.article-content p {
    margin-bottom: 1.25rem;
}
.article-content h1, .article-content h2, .article-content h3, .article-content h4 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 600;
}
.article-content ul, .article-content ol {
    margin-bottom: 1.25rem;
    padding-left: 2rem;
}
.article-content li {
    margin-bottom: 0.5rem;
}
.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin-bottom: 1.25rem;
}
.article-content a {
    color: var(--primary-color);
    text-decoration: underline;
}
.article-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1rem;
    color: var(--text-light);
    font-style: italic;
    margin-bottom: 1.25rem;
}

/* ==========================================================
   Article Detail View
   ========================================================== */
.article-detail-wrapper {
    max-width: 900px;
    margin: 0 auto;
}
.article-detail-back-link {
    display: inline-block;
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: 15px;
    font-size: 0.95rem;
    transition: color 0.2s;
}
.article-detail-back-link:hover {
    color: var(--primary-color);
}
.article-detail-card {
    background: var(--bg-section);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}
.dark-mode .article-detail-card {
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.article-detail-hero {
    width: 100%;
    height: 450px;
    background-size: cover;
    background-position: center;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.25rem;
}

.category-badge-overlay {
    background: var(--primary-color);
    padding: 6px 14px;
    border-radius: 4px;
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}
.category-badge-overlay:hover {
    background: #218838;
    color: white;
}

.hero-bottom {
    margin-top: auto;
}

.article-detail-title-overlay {
    color: #ffffff;
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 2.1rem;
    font-weight: 700;
    line-height: 1.2;
    text-shadow: 0 2px 5px rgba(0,0,0,0.7);
}

.article-detail-meta-overlay {
    color: #e2e8f0;
    font-size: 0.85rem;
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
    text-shadow: 0 1px 4px rgba(0,0,0,0.7);
}
.article-detail-meta-overlay a {
    color: #e2e8f0;
    text-decoration: none;
}
.article-detail-meta-overlay a:hover {
    color: #ffffff;
    text-decoration: underline;
}

.article-detail-body {
    padding: 1.25rem;
}
.article-detail-body > *:first-child {
    margin-top: 0 !important;
}
@media (max-width: 768px) {
    .article-detail-hero {
        height: 350px;
        padding: 1.5rem;
    }
    .article-detail-title-overlay {
        font-size: 1.8rem;
    }
    .article-detail-body {
        padding: 1.5rem;
    }
}

