/* Reset de base */
* {
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

header {
    background-color: #1a1a1a;
    color: #fff;
    padding: 20px;
    text-align: center;
}

header h1 {
    font-size: 2rem;
}

footer {
    background-color: #1a1a1a;
    color: #fff;
    padding: 15px;
    text-align: center;
    margin-top: 30px;
}

/* Liste des articles */
.article-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    padding: 20px;
    gap: 20px;
}

/* Article individuel */
.article-item {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    flex: 1 1 calc(25% - 20px); /* 4 articles par ligne sur PC */
    display: flex;
    flex-direction: column;
    transition: transform 0.3s, box-shadow 0.3s;
}

.article-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

/* Image */
.article-illustration {
    width: 100%;
    height: 200px; /* même taille pour toutes */
    object-fit: cover;
}

/* Titre et meta */
.article-item h2 {
    font-size: 1.2rem;
    margin: 10px;
}

.article-item h2 a {
    color: #1a1a1a;
    text-decoration: none;
}

.article-item h2 a:hover {
    text-decoration: underline;
}

.meta {
    font-size: 0.9rem;
    color: #777;
    margin: 0 10px 10px;
}

/* Extrait */
.article-item p {
    font-size: 1rem;
    margin: 0 10px 15px;
}

/* Responsive */
@media (max-width: 1024px) {
    .article-item {
        flex: 1 1 calc(50% - 20px); /* 2 articles par ligne sur tablettes */
    }
}

@media (max-width: 600px) {
    .article-list {
        flex-direction: column;
        padding: 10px;
        gap: 15px;
    }

    .article-item {
        flex: 1 1 100%; /* 1 article par ligne sur téléphone */
    }

    .article-illustration {
        height: 180px;
    }

    .article-item h2 {
        font-size: 1.5rem; /* titre plus grand */
        line-height: 1.3;
    }

    .article-item p {
        font-size: 1.15rem; /* extrait plus lisible */
        line-height: 1.6;
    }

    .meta {
        font-size: 1rem;
    }
}

/* ===== Page article : marges de lecture ===== */

.article-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 30px; /* marges gauche/droite desktop */
}

/* Mobile : marges confortables */
@media (max-width: 600px) {
    .article-content {
        padding-left: 18px;
        padding-right: 18px;
    }
}

/* ================================================= */
/* =============== SOMMAIRE ARTICLE ================= */
/* ================================================= */

.article-toc {
    background-color: #ffffff;
    border-left: 4px solid #1a1a1a;
    border-radius: 6px;
    padding: 15px 20px;
    margin: 30px auto;
    max-width: 900px;
}

.article-toc strong {
    display: block;
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: #1a1a1a;
}

.article-toc ul {
    list-style: none;
    padding-left: 0;
}

.article-toc li {
    margin-bottom: 6px;
    font-size: 1rem;
}

.article-toc li.h3 {
    margin-left: 18px;
    font-size: 0.95rem;
}

.article-toc a {
    color: #1a1a1a;
    text-decoration: none;
}

.article-toc a:hover {
    text-decoration: underline;
}

/* Mobile : sommaire plus lisible */
@media (max-width: 600px) {
    .article-toc {
        padding: 15px;
        margin: 25px 18px;
    }

    .article-toc li {
        font-size: 1.05rem;
    }
}
