/* ========================================
   ARCHIVE BLOG - STYLES COMPLETS
   Prêt à copier-coller dans archive.css
   ======================================== */

/* ===================================
   STRUCTURE GLOBALE
   =================================== */

/* Layout global pour single post */
body.single {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body.single main {
    flex: 1;
}

/* Main Blog */
main.background {
    padding-top: 0 !important;
    background: #fff;
}

body.single main.background {
    min-height: auto;
}

/* ✅ NEUTRALISER le bloc - Ne plus forcer de max-width */
main.background .bloc {
    width: 100% !important;
    max-width: none !important;
    padding-top: clamp(5rem, 3.5rem + 6vw, 8rem) !important;
    padding-bottom: 0 !important;
}

/* Conteneur général de l'article */
.single-post {
    width: 100%;
}

article {
    background: #fff;
}

/* ===================================
   CONTENEURS DE LARGEUR VARIABLE
   =================================== */

/* Conteneur le plus large - Pour titre, breadcrumb, intro */
.container-large {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* Conteneur moyen - Pour image, meta, contenu */
.container-medium {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* Conteneur extra-large - Pour articles similaires */
.container-xlarge {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* ===================================
   HEADER FIXE POUR SINGLE POST
   =================================== */

body.single header.header,
body.single header#navigation,
body.single header.fixed-top,
body.single header.scroll-menu,
body.single nav.scroll-menu {
    background: var(--blue) !important;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    width: 100%;
    transition: none !important;
}

/* Désactiver toutes les animations du header sur single */
body.single header,
body.single header *,
body.single nav {
    transition: none !important;
}

/* ===================================
   BREADCRUMB (FIL D'ARIANE)
   =================================== */

.breadcrumb-wrapper {
    padding: 1.5rem 0;
    margin-bottom: 2rem;
}

.breadcrumb-single {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    flex-wrap: wrap;
    color: #666;
}

.breadcrumb-single a {
    color: var(--blue);
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb-single a:hover {
    color: var(--green);
    text-decoration: underline;
}

.breadcrumb-single span {
    color: #999;
}

/* ===================================
   TITRE DE L'ARTICLE (H1)
   =================================== */

.article-header-wrapper {
    margin-bottom: 2rem;
}

.entry-header {

}

.entry-title {
    font-size: clamp(2rem, 1.5rem + 2vw, 2.5rem);
    font-weight: 700;
    line-height: 1.2;
    color: #1a1a1a;
    margin: 0;
    text-align: left;
}

/* ===================================
   IMAGE FEATURED
   =================================== */

.featured-image-wrapper {
    margin-bottom: 1.5rem;
}

.featured-image {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.featured-image:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.2);
}

.featured-image img {
    width: 100%;
    height: auto;
    max-height: 550px;
    object-fit: cover;
    display: block;
}

/* ===================================
   META INFORMATIONS (Date + Catégorie)
   ✅ Sous l'image dans le HTML
   =================================== */

.meta-wrapper {
    margin-bottom: 2rem;
}

.entry-meta {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    color: #666;
    font-size: 0.9rem;
    flex-wrap: wrap;
}

.entry-meta span {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.entry-meta svg {
    flex-shrink: 0;
}

.post-date {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.post-category {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.post-category a {
    color: var(--blue);
    text-decoration: none;
    transition: color 0.3s ease;
}

.post-category a:hover {
    color: var(--green);
    text-decoration: underline;
}

/* ===================================
   INTRODUCTION
   =================================== */

.intro-wrapper {
    margin-bottom: 3rem;
}

.article-intro {
    font-size: 1.2rem;
    line-height: 1.8;
    color: #555;
    padding: 35px 40px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-left: 5px solid var(--green);
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.article-intro p {
    margin: 0;
}

/* ===================================
   CONTENU DES SECTIONS
   =================================== */

.content-wrapper {
    margin-bottom: 4rem;
}

.article-sections {
    margin: 0;
}

.content-section {
    margin-bottom: 60px;
    padding-bottom: 50px;
    border-bottom: 2px solid #f0f0f0;
}

.content-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

/* Sous-titres H2 */
.section-title {
    font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.2rem);
    font-weight: 700;
    color: var(--blue);
    margin-bottom: 25px;
    line-height: 1.3;
    position: relative;
    padding-bottom: 15px;
}

.section-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--green) 0%, transparent 100%);
    border-radius: 2px;
}

/* Texte WYSIWYG */
.section-text {
    font-size: 1.1rem;
    line-height: 1.9;
    color: #444;
    margin-bottom: 30px;
}

.section-text p {
    margin-bottom: 1.4em;
}

.section-text p:last-child {
    margin-bottom: 0;
}

.section-text ul,
.section-text ol {
    margin: 1.5em 0;
    padding-left: 2em;
}

.section-text li {
    line-height: 1.8;
}

.section-text strong {
    font-weight: 700;
    color: var(--blue);
}

.section-text em {
    font-style: italic;
}

.section-text a {
    color: var(--green);
    text-decoration: underline;
    transition: color 0.3s ease;
}

.section-text a:hover {
    color: var(--blue);
}

.section-text img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 1.5em 0;
}

.section-text blockquote {
    border-left: 4px solid var(--blue);
    padding-left: 20px;
    margin: 1.5em 0;
    font-style: italic;
    color: #555;
}

.section-text h3 {
    font-size: 1.4rem;
    font-weight: 600;
    margin: 1.5em 0 1em;
    color: #2c3e50;
}

.section-text h4 {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 1.3em 0 0.8em;
    color: #2c3e50;
}

.section-text code {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.section-text pre {
    background: #f5f5f5;
    padding: 20px;
    border-radius: 4px;
    overflow-x: auto;
    margin: 20px 0;
}

.section-text pre code {
    padding: 0;
    background: none;
}

/* Lien externe */
.section-link {
    margin-top: 25px;
}

.external-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background: var(--blue);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(47, 54, 83, 0.2);
}

.external-link:hover {
    background: var(--green);
    box-shadow: 0 6px 20px rgba(0, 222, 181, 0.3);
    transform: translateY(-3px);
}

.external-link svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.external-link:hover svg {
    transform: translate(3px, -3px);
}

/* ===================================
   ARTICLES SIMILAIRES (Plus large)
   =================================== */

.related-posts-wrapper {
    width: 100% !important;
    padding: 3rem 0 3rem;
    margin-top: 4rem;
    margin-bottom: 0 !important;
    background: #f8f9fa;
    border-top: 2px solid #e5e5e5;
}

.related-posts {
    margin: 0;
    padding: 0;
}

.related-posts h2 {
    font-size: clamp(1.75rem, 1.5rem + 1vw, 2rem);
    font-weight: 700;
    color: var(--blue);
    margin-bottom: 2rem;
    text-align: center;
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 320px));
    gap: 2rem;
    justify-content: center;
    grid-auto-rows: 1fr;
}

.related-post-card {
    background: white;
    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;
    display: flex;
    flex-direction: column;
    max-width: 360px;
    margin: 0 auto;
    height: 100%;
    box-sizing: border-box;
}

.related-post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.related-post-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.related-post-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.related-post-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--blue);
    margin-bottom: 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.related-post-excerpt {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.5;
    margin-bottom: 0;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.related-post-meta {
    font-size: 0.8rem; /* Aligné sur archive */
    color: #999;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
}

/* Message "Aucun article récent" */
.no-related-posts {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    grid-column: 1 / -1;
}

.no-related-posts p {
    font-size: 1.1rem;
    color: #666;
    margin: 0;
    line-height: 1.6;
}

/* ===================================
   FOOTER (Pleine largeur)
   =================================== */

body.single footer,
body.single footer.footer,
.single footer,
.single footer.footer {
    width: 100% !important;
    max-width: 100% !important;
    background: var(--white) !important;
    margin: 0 !important;
    margin-top: 0 !important;
    padding: 35px 0 !important;
    border-top: 2px solid #e5e5e5 !important;
}

body.single footer .container,
body.single footer.footer .container,
.single footer .container {
    max-width: 1140px !important;
    width: 100% !important;
    margin: 0 auto !important;
    padding-left: 15px !important;
    padding-right: 15px !important;
}

/* ===================================
   HEADER BLOG (Page Archive)
   =================================== */

.header-blog {
    background: var(--blue);
    padding: clamp(4rem, 3rem + 4vw, 7rem) 0 clamp(3rem, 2rem + 3vw, 5rem);
    text-align: center;
}

/* ===================================
   FILTRES BLOG (Page Archive)
   =================================== */

.blog-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: clamp(2.5rem, 2rem + 2vw, 4rem);
}

.filter-btn {
    padding: 10px 20px;
    background: transparent;
    color: var(--blue);
    border: 2px solid var(--blue);
    border-radius: 100px;
    font-weight: 700;
    font-size: clamp(0.625rem, 0.55rem + 0.32vw, 0.75rem);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-btn:hover {
    background: var(--blue);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(47, 54, 83, 0.3);
}

.filter-btn.active {
    background: var(--blue);
    color: #fff;
    box-shadow: 0 4px 12px rgba(47, 54, 83, 0.3);
}

/* ===================================
   GRILLE D'ARTICLES (Page Archive)
   =================================== */

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 360px));
    gap: clamp(1.5rem, 1.2rem + 1vw, 2.5rem);
    margin-bottom: clamp(3rem, 2.5rem + 2vw, 5rem);
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    justify-content: center;
}

.article-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.article-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15);
}

.article-card.pinned {
    border: 2px solid var(--green);
}

.pinned-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--green);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 5px;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 222, 181, 0.3);
}


.article-card > a {
    display: block;
    width: 100%;
    line-height: 0;
    overflow: hidden;
}

.article-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    transition: transform 0.4s ease;
    flex-shrink: 0;
    display: block;
}

.article-card:hover .article-image {
    transform: scale(1.05);
}

.article-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.article-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 0.8rem;
    color: #999;
    margin-bottom: 12px;
    flex-shrink: 0;
}

.article-title {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 10px;
    flex-shrink: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.article-title a {
    color: var(--blue);
    text-decoration: none;
    transition: color 0.3s ease;
}

.article-title a:hover {
    color: var(--green);
}

.article-excerpt {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #666;
    margin-bottom: auto;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.read-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--green);
    font-weight: 600;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    margin-top: 15px;
    align-self: flex-start;
}

.read-more:hover {
    color: var(--blue);
    gap: 12px;
}

.no-filter-results,
.no-articles {
    grid-column: 1 / -1; /* ✅ Prend toute la largeur de la grille */
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    color: #666;
    font-size: 1.1rem;
    line-height: 1.6;
    margin: 0; /* ✅ Pas de marge supplémentaire */
}

/* ===================================
   PAGINATION (Page Archive)
   =================================== */

.blog-pagination {
    margin-top: clamp(3rem, 2.5rem + 2vw, 5rem);
    display: flex;
    justify-content: center;
}

.blog-pagination ul.page-numbers { /* ✅ Ciblage plus précis */
    display: flex;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
    justify-content: center;
}

.blog-pagination li {
    display: inline-block;
}

.blog-pagination a.page-numbers,
.blog-pagination span.page-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    height: 48px;
    padding: 0 16px;
    background: #fff;
    color: var(--blue);
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    border: 2px solid #e5e5e5;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.blog-pagination a.page-numbers:hover {
    background: var(--blue);
    color: #fff;
    border-color: var(--blue);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(47, 54, 83, 0.25);
}

.blog-pagination span.page-numbers.current {
    background: var(--green);
    color: #fff;
    border-color: var(--green);
    box-shadow: 0 4px 15px rgba(0, 222, 181, 0.3);
}

/* Boutons Précédent/Suivant */
.blog-pagination a.prev,
.blog-pagination a.next {
    font-weight: 700;
    gap: 8px;
    padding: 0 20px;
}

.blog-pagination a.prev:hover,
.blog-pagination a.next:hover {
    gap: 12px;
}

/* Points de suspension */
.blog-pagination span.dots {
    border: none;
    background: transparent;
    color: #999;
    box-shadow: none;
    min-width: auto;
    padding: 0 8px;
}

/* ===================================
   LOADER (Page Archive - AJAX)
   =================================== */

.blog-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    min-height: 400px;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loader-text {
    margin-top: 20px;
    color: #666;
    font-size: 1rem;
}

/* ===================================
   RESPONSIVE DESIGN
   =================================== */

@media (max-width: 1024px) {
    .container-large {
        max-width: 900px;
    }

    .container-medium {
        max-width: 700px;
    }

    .container-xlarge {
        max-width: 1000px;
    }

    /* ✅ 2 cartes par ligne sur tablette */
    .blog-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 340px)); /* ✅ Adapté pour tablette */
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    /* Conteneurs */
    .container-large,
    .container-medium,
    .container-xlarge {
        padding: 0 15px;
    }

    /* Single Post */
    .entry-title {
        font-size: 1.8rem;
    }

    .article-intro {
        font-size: 1.05rem;
        padding: 25px 20px;
        margin: 30px 0;
    }

    .section-text {
        font-size: 1.05rem;
    }

    .external-link {
        padding: 12px 24px;
        font-size: 0.95rem;
        width: 100%;
        justify-content: center;
    }

    /* Featured Image */
    .featured-image-wrapper {
        margin: 30px 0;
    }

    .featured-image {
        border-radius: 12px;
    }

    .featured-image img {
        max-height: 300px;
    }

    /* Meta */
    .entry-meta {
        gap: 1rem;
        font-size: 0.85rem;
    }

    /* Articles similaires */
    .related-posts-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .related-posts-wrapper {
        margin-top: 3rem;
        margin-bottom: 0 !important; /* ✅ Pas de marge basse en mobile */
        padding: 2rem 0 2rem; /* Padding uniforme */
    }

    /* Archive */
    .blog-grid {
        grid-template-columns: 1fr; /* ✅ 1 carte par ligne sur mobile */
        gap: 1.5rem;
        justify-content: stretch; /* Prend toute la largeur sur mobile */
    }

    /* Pagination mobile */
    .blog-pagination ul.page-numbers {
        gap: 6px;
    }

    .blog-pagination a.page-numbers,
    .blog-pagination span.page-numbers {
        min-width: 40px;
        height: 40px;
        padding: 0 12px;
        font-size: 0.85rem;
    }

    .blog-pagination a.prev,
    .blog-pagination a.next {
        padding: 0 16px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .entry-title {
        font-size: 1.5rem;

    }

    .breadcrumb-single {
        font-size: 0.8rem;
        gap: 0.3rem;
    }

    .entry-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .article-intro {
        padding: 20px 15px;
    }

}

/* ===================================
   FIN DU FICHIER CSS
   =================================== */