/* =========================================
   1. VARIABLES & UTILITAIRES DE BASE
========================================= */
:root {
    --clr-primary: #10B981;
    --clr-primary-hover: #059669;
}

.text-primary { color: var(--clr-primary); }
.text-white { color: #ffffff; }
.text-gray-300 { color: #d1d5db; }
.text-gray-400 { color: #9ca3af; }
.text-gray-600 { color: #4b5563; }
.bg-light-gray { background-color: #ffffff; }
.bg-gradient-dark { background: linear-gradient(to bottom right, #000000, #111827); }

.section-padding { padding: 5rem 0; }
.text-center { text-align: center; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.icon-xs { width: 1rem; height: 1rem; }

/* =========================================
   2. HERO SECTION
========================================= */
.page-hero {
    padding: 10rem 1rem 5rem 1rem;
    background-color: #000;
}
.page-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    margin-bottom: 1.5rem;
}
.page-subtitle {
    font-size: 1.25rem;
    max-width: 48rem;
    margin: 0 auto;
    line-height: 1.6;
}

/* =========================================
   3. BLOG GRID & CARDS
========================================= */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.blog-card {
    background-color: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

.blog-card:hover {
    border-color: var(--clr-primary);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.blog-link-wrapper {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

/* Container de l'image (Format paysage 16:9) */
.blog-image-container {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background-color: #f3f4f6;
}

.blog-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.blog-card:hover .blog-img {
    transform: scale(1.1); /* L'image zoome au survol */
}

/* Contenu textuel de la carte */
.blog-content {
    padding: 1.5rem;
}

.blog-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #000000;
    margin-bottom: 0.75rem;
    transition: color 0.3s ease;
    
    /* Coupe le texte après 2 lignes (...) */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card:hover .blog-title {
    color: var(--clr-primary);
}

.blog-excerpt {
    color: #4b5563;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    
    /* Coupe le texte après 3 lignes (...) */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Metadata (Date et Vues) */
.blog-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 1rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Bas de la carte (Auteur et Bouton Read More) */
.blog-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid #f3f4f6;
}

.blog-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #4b5563;
}

.read-more {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--clr-primary);
    font-weight: 600;
    font-size: 0.9rem;
}

/* Conteneur principal de la grille */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Crée 3 colonnes identiques */
    gap: 20px; /* Espace entre les articles */
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Style individuel pour chaque article de blog */
.blog-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    background-color: #ffffff;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: transform 0.2s ease-in-out;
}

.blog-card:hover {
    transform: translateY(-5px); /* Petit effet de survol */
}

.blog-card h3 {
    margin-top: 0;
    color: #333;
}

/* Rendre la grille responsive pour les petits écrans */
@media (max-width: 900px) {
    .blog-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 colonnes sur tablette */
    }
}

@media (max-width: 600px) {
    .blog-grid {
        grid-template-columns: 1fr; /* 1 colonne sur mobile */
    }
}


/* =========================================
   PAGE ARTICLE SEUL
   ========================================= */
.article-container {
    max-width: 800px; /* Plus étroit que la grille pour une meilleure lisibilité */
    margin: 0 auto;
    background: #ffffff;
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #6b7280;
    text-decoration: none;
    font-weight: 500;
    margin-bottom: 2rem;
    transition: color 0.2s ease;
}

.back-link:hover {
    color: #10B981;
}

.icon-sm {
    width: 1.25rem;
    height: 1.25rem;
}

.article-header {
    margin-bottom: 2rem;
    text-align: center;
}

.article-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: #111827;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.article-meta {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    color: #4b5563;
    font-size: 0.95rem;
}

.text-primary {
    color: #10B981;
}

.article-hero-image {
    width: 100%;
    height: 400px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 3rem;
}

.article-hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-content {
    font-size: 1.125rem;
    line-height: 1.8;
    color: #374151;
}

/* Style pour le texte généré depuis la base de données */
.article-content h2 {
    font-size: 1.75rem;
    color: #111827;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.article-content p {
    margin-bottom: 1.5rem;
}

.article-content ul {
    list-style-type: disc;
    padding-left: 1.5rem;
    margin-bottom: 1.5rem;
    color: #4b5563;
}

.article-content li {
    margin-bottom: 0.5rem;
}

.article-footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.btn-share {
    background-color: #f3f4f6;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-share:hover {
    background-color: #e5e7eb;
}

/* Responsive pour mobile */
@media (max-width: 768px) {
    .article-container {
        padding: 1.5rem;
    }
    .article-title {
        font-size: 1.75rem;
    }
    .article-hero-image {
        height: 250px;
    }
}

/* =========================================
   4. ANIMATIONS AU SCROLL
========================================= */
.animate-on-scroll { opacity: 0; }
.fade-in-up { transform: translateY(30px); transition: all 0.8s ease-out; }
.is-visible { opacity: 1 !important; transform: translate(0) !important; }