/* assets/css/news.css */

.articles-feed-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
}

/* Die Karte als Grid */
.article-preview-item {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    
    /* Grid Layout: Bild (fest 300px) | Inhalt (flexibel) | Meta (fest 200px) */
    display: grid;
    grid-template-columns: 300px 1fr 200px;
    
    /* WICHTIG: Harte Fixierung der Höhe auf exakt 168px */
    height: 168px;
    min-height: 168px;
    max-height: 168px;
    
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.article-preview-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
    border-color: var(--accent-color);
}

/* --- SPALTE 1: Bild --- */
.col-image {
    width: 300px;
    height: 168px; /* Exakt die Höhe der Karte */
    padding: 0;
    border-right: 1px solid var(--border-color);
    flex-shrink: 0;
}

.preview-image-container {
    width: 300px;
    height: 168px;
    position: relative;
    overflow: hidden;
    /* Radius nur links, passend zur Karte */
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.preview-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.article-preview-item:hover .preview-image-container img {
    transform: scale(1.05);
}

.preview-category-badge {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 2;
    background: var(--accent-color);
    color: #000;
    padding: 0.2em 0.6em;
    border-radius: 2px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

/* --- SPALTE 2: Hauptinhalt --- */
.col-content {
    /* Muss exakt 168px hoch sein */
    height: 168px;
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    overflow: hidden; /* Wichtig, falls Text zu lang ist */
}

.preview-title {
    font-size: 1.3rem; /* Leicht angepasst für die geringere Höhe */
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 0.5rem 0;
    
    /* Titel darf max 2 Zeilen sein, sonst wird es zu eng */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.preview-title a {
    color: var(--text-main);
    text-decoration: none;
    transition: color 0.2s ease;
}

.preview-title a:hover {
    color: var(--accent-color);
}

.preview-excerpt {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 0.5rem;
    
    /* Text streng begrenzen, damit er in die 168px passt */
    display: -webkit-box;
    -webkit-line-clamp: 2; 
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.read-more-link {
    margin-top: auto; /* Schiebt den Link an den unteren Rand des Contents */
    color: var(--accent-color);
    font-weight: 600;
    text-decoration: none;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    align-self: flex-start;
}

.read-more-link:hover {
    text-decoration: underline;
    gap: 8px;
}

/* --- SPALTE 3: Meta (Rechts) --- */
.col-meta {
    padding: 1.25rem;
    /* Standard-Hintergrund (Light Mode) */
    background-color: var(--bg-body); 
    border-left: 1px solid var(--border-color);
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

/* Spezifischer Hintergrund für Dark Mode (#211c34) */
[data-theme="dark"] .col-meta {
    background-color: #211c34;
    /* Optional: Border entfernen, wenn der Kontrast durch die Farbe reicht */
    /* border-left: none; */ 
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.meta-item i {
    color: var(--accent-color);
    width: 16px;
    text-align: center;
}

/* --- RESPONSIVE --- */

/* Tablet: Layout ändert sich, fixe Höhe muss aufgehoben werden */
@media (max-width: 1100px) {
    .article-preview-item {
        /* Höhe automatisch machen, da Elemente stapeln */
        height: auto;
        min-height: auto;
        max-height: none;
        
        grid-template-columns: 300px 1fr; 
        grid-template-rows: 168px auto; /* Bildreihe fix, Meta drunter */
    }
    
    .col-image {
        /* Bild bleibt fix 300x168 */
        height: 168px;
        border-bottom: 1px solid var(--border-color); /* Trennlinie nach unten */
    }
    
    .col-content {
        height: 168px; /* Content neben dem Bild auch 168px */
        border-bottom: 1px solid var(--border-color);
    }
    
    .preview-image-container {
        border-radius: var(--radius-md) 0 0 0; /* Unten eckig */
    }
    
    .col-meta {
        width: 100%;
        height: auto; /* Auto Höhe */
        grid-column: 1 / span 2;
        flex-direction: row;
        border-left: none;
        border-radius: 0 0 var(--radius-md) var(--radius-md);
        justify-content: flex-start;
        gap: 2rem;
    }
}

/* Mobile: Alles untereinander */
@media (max-width: 768px) {
    .article-preview-item {
        display: flex;
        flex-direction: column;
        height: auto;
        max-height: none;
    }

    .col-image {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .preview-image-container {
        width: 100%;
        height: 200px; /* Größeres Bild auf Mobile */
        border-radius: var(--radius-md) var(--radius-md) 0 0;
    }

    .col-content {
        height: auto; /* Auto Höhe für Text */
        padding: 1.5rem;
    }
    
    .preview-excerpt {
        -webkit-line-clamp: 4; /* Mehr Text erlaubt auf Mobile */
    }

    .col-meta {
        width: 100%;
        background-color: transparent;
        padding: 1rem 1.5rem;
        justify-content: space-between;
    }
    
    [data-theme="dark"] .col-meta {
        background-color: transparent; /* Auf Mobile kein dunkler Kasten */
    }
}