:root {
    --bg: #f8f8f8;
    --header-bg: #0099ff;
    --card-bg: #ffffff;
    --text-primary: #111111;
    --text-meta: #888888;
    --text-desc: #555555;
    --shadow: rgba(0,0,0,0.1);
    --shadow-header: rgba(0,0,0,0.2);
}

:root[data-theme="dark"] {
    --bg: #2b2b2b;
    --header-bg: #005fa3;
    --card-bg: #3a3a3a;
    --text-primary: #e0e0e0;
    --text-meta: #aaaaaa;
    --text-desc: #bbbbbb;
    --shadow: rgba(0,0,0,0.4);
    --shadow-header: rgba(0,0,0,0.5);
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    background: var(--bg);
    color: var(--text-primary);
    padding-top: 70px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.header {
    background: var(--header-bg);
    color: white;
    padding: 10px;
    font-size: 1.5em;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 5px var(--shadow-header);
    transition: all 0.3s ease;
}

.header.shrink {
    font-size: 1em;
    height: 20px;
}

.news-container {
    display: flex;
    flex-direction: column;
}

@media (min-width: 800px) {
    .news-container {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 0 10px;
    }

    .news-item {
        margin: 0;
    }
}

.news-item {
    background: var(--card-bg);
    margin: 10px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px var(--shadow);
    position: relative;
    transition: background-color 0.3s ease;
}

.new-article {
    background-color: red;
    transition: background-color 1s ease-out;
}

.news-image-container {
    position: relative;
}

.news-item img {
    width: 100%;
    height: 200px;
    max-height: 200px;
    object-fit: cover;
    display: block;
}

.overlay-title {
    position: absolute;
    bottom: 0px;
    left: 0px;
    color: white;
    background: rgba(0, 0, 0, 0.6);
    padding: 6px 10px;
    font-size: 1em;
    width: 100%;
    line-height: 1.3em;
}

.overlay-title span {
    display: block;
}

.news-content {
    padding: 10px;
}

.news-meta {
    font-size: 0.8em;
    color: var(--text-meta);
    margin-bottom: 5px;
}

.news-desc {
    font-size: 0.95em;
    color: var(--text-desc);
}

.news-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.news-title {
    display: none;
}

.material-symbols-outlined {
    font-variation-settings:
    'FILL' 0,
    'wght' 400,
    'GRAD' 0,
    'opsz' 24
}

/* ===== MODE LISTE ===== */

:root[data-layout="list"] .news-container {
    display: flex !important;
    flex-direction: column;
    padding: 0 5px;
}

:root[data-layout="list"] .news-item {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    height: 110px;
    margin: 5px 0;
}

:root[data-layout="list"] .news-image-container {
    flex: 0 0 130px;
    overflow: hidden;
}

:root[data-layout="list"] .news-item img {
    width: 130px;
    height: 110px;
    max-height: 110px;
    object-fit: cover;
}

:root[data-layout="list"] .overlay-title {
    display: none;
}

:root[data-layout="list"] .news-content {
    flex: 1;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

:root[data-layout="list"] .news-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.9em;
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1.3;
}

:root[data-layout="list"] .news-title span {
    color: var(--text-desc);
    font-weight: normal;
}

:root[data-layout="list"] .news-desc {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.8em;
    margin: 0;
}
