/* ======================================= */
/* 1. STYLES POUR LA GRILLE D'ARTICLES (BLOG LIST) */
/* ======================================= */

#blog-articles-container {
    /* Forcer l'affichage en bloc (vertical) pour la liste entière */
    display: block; 
    padding: 40px 0;
    /* Centrage du contenu si le conteneur parent est plus large */
    text-align: center; 
}

.blog-card {
    /* Mise en page en Flexbox pour organiser l'image et le contenu côte à côte */
    display: flex;
    flex-direction: row; 
    
    /* Style de la carte */
    background-color: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08); 
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    
    /* Marge entre les cartes et centrage horizontal */
    margin: 0 auto 30px auto; /* Haut/Bas et centré */
    max-width: 900px; 
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.blog-image {
    width: 35%; /* L'image prend 35% de la largeur de la carte sur grand écran */
    min-width: 200px;
    height: 250px;
    object-fit: cover; 
    border-right: 1px solid #eee; /* Séparateur visuel entre l'image et le texte */
}

.card-content {
    padding: 30px;
    flex-grow: 1; 
    display: flex;
    flex-direction: column;
    text-align: left; /* Assurer que le texte est bien aligné à gauche */
    text-transform: none; 
}

.blog-metadata {
    font-size: 0.85rem;
    color: #999;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-content h3 {
    font-size: 1.4rem;
    color: #333;
    margin-bottom: 10px;
    line-height: 1.3;
}

.card-content p {
    font-size: 1rem;
    color: #666;
    margin-bottom: 15px;
    flex-grow: 1; 
}

.read-more-link {
    display: inline-block;
    font-weight: 600;
    color: var(--primary-color, #007bff);
    text-decoration: none;
    transition: color 0.2s ease;
    align-self: flex-start; 
}

.read-more-link:hover {
    color: var(--primary-color-darker, #0056b3);
    text-decoration: underline;
}

#no-articles-message {
    text-align: center;
    font-size: 1.2rem;
    color: #999;
    padding: 60px 0;
}

.hidden {
    display: none;
}

/* --- RESPONSIVE : Pour les petits écrans (tablettes et mobiles) --- */
@media (max-width: 768px) {
    .blog-card {
        /* Les éléments s'empilent verticalement sur mobile */
        flex-direction: column; 
        margin: 0 auto 20px auto; 
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }
    .blog-image {
        width: 100%;
        height: 200px;
        border-right: none;
        border-bottom: 1px solid #eee;
    }
    .card-content {
        padding: 20px;
    }
}

/* ======================================= */
/* 2. STYLES POUR LA PAGE DE DÉTAIL (article-detail.html) */
/* ======================================= */

.article-detail {
    padding: 60px 0;
}

.article-container {
    max-width: 800px;
    margin: 0 auto;
}

/* --- TITRES & METADONNÉES --- */

.article-metadata {
    display: block;
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 5px;
}

.article-detail h1 {
    font-size: 2.5rem;
    margin-top: 10px;
    margin-bottom: 20px;
    
}

.article-summary {
    font-size: 1.25rem;
    color: #4a4a4a;
    font-style: italic;
    margin-bottom: 30px;
}

/* --- IMAGE DE COUVERTURE --- */

.article-cover-image {
    width: 100%;
    max-width: 900px;
    height: auto;
    max-height: 450px;
    object-fit: cover;
    border-radius: 8px;
    margin: 0 auto 30px auto; /* Centrage et marge inférieure */
    display: block; 
}

/* --- CORPS DE L'ARTICLE (TEXTE et TITRES INTERNES) --- */

.article-body p {
    line-height: 1.8;
    margin-bottom: 20px;
    text-align: justify;
}

.article-body h3 {
    margin-top: 40px;
    margin-bottom: 15px;
    font-size: 1.6rem;
    border-bottom: 2px solid var(--primary-color, #007bff);
    padding-bottom: 5px;
}

.numbered-point {
    margin-left: 20px;
    margin-bottom: 10px;
}

/* --- CORRECTIONS POUR LES IMAGES INTÉRIEURES (GALERIE) --- */
/* Conteneur FIGURE pour les images de la galerie */
.article-inner-image {
    margin: 40px 0; 
    padding: 0;
    width: 100%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); 
    border-radius: 8px;
    overflow: hidden;
}

/* L'image elle-même à l'intérieur de la figure */
.article-inner-image img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
    max-height: 400px; 
}

/* Légende sous l'image */
.article-inner-image figcaption {
    font-size: 0.9rem;
    color: #666;
    text-align: center;
    padding: 10px;
    background-color: #f9f9f9;
    border-top: 1px solid #eee;
    font-style: italic;
}

/* --- LIEN RETOUR --- */

.back-link {
    display: inline-block;
    margin-top: 40px;
    font-weight: bold;
    color: var(--primary-color, #007bff);
    text-decoration: none;
}

.back-link:hover {
    text-decoration: underline;
}