/* ========================================
   DESIGN MODERNE ARTICLES BLOG
   Optimisé pour une expérience de lecture premium
   IMPORTANT: Ne s'applique QUE si body a la classe 'blog' ou si dans catégorie blog
   ======================================== */

/* ========================================
   1. CONTAINER PRINCIPAL ARTICLE
   ======================================== */
body.view-article.catid-8 .com-content-article,
body.view-article.catid-8 .item-page,
body[class*="blog"] .com-content-article,
body[class*="blog"] .item-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 4rem 1.5rem;
}

/* Bouton retour au blog */
body.view-article.catid-8 .back-to-blog,
body[class*="blog"] .back-to-blog {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: #f1f5f9;
    color: #475569;
    text-decoration: none;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.9375rem;
    transition: all 0.3s ease;
    margin-bottom: 2rem;
    border: 2px solid #e2e8f0;
}

body.view-article.catid-8 .back-to-blog:hover,
body[class*="blog"] .back-to-blog:hover {
    background: #3b82f6;
    color: #ffffff;
    border-color: #3b82f6;
    transform: translateX(-3px);
}

body.view-article.catid-8 .back-to-blog::before,
body[class*="blog"] .back-to-blog::before {
    content: "←";
    font-size: 1.2rem;
}

/* En-tête de l'article */
body.view-article.catid-8 .com-content-article .page-header,
body.view-article.catid-8 .item-page .page-header,
body[class*="blog"] .com-content-article .page-header,
body[class*="blog"] .item-page .page-header {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

/* Titre principal de l'article */
body.view-article.catid-8 .com-content-article h1,
body.view-article.catid-8 .item-page h1,
body.view-article.catid-8 .com-content-article .page-header h1,
body.view-article.catid-8 .item-page .page-header h1,
body[class*="blog"] .com-content-article h1,
body[class*="blog"] .item-page h1,
body[class*="blog"] .com-content-article .page-header h1,
body[class*="blog"] .item-page .page-header h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    line-height: 1.2;
    color: #0f172a;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

/* Métadonnées de l'article */
.article-info,
.com-content-article .article-info,
.item-page .article-info {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: center;
    margin-top: 1.5rem;
    padding: 1rem 0;
    font-size: 0.9rem;
    color: #64748b;
}

.article-info dd,
.article-info dt {
    display: inline;
    margin: 0;
    padding: 0;
}

/* Masquer le label "Détails" et le texte descriptif, garder juste la date */
.article-info dt,
.article-info .visually-hidden {
    display: none !important;
}

.article-info dd:first-of-type {
    font-size: 0 !important;
}

.article-info dd:first-of-type time {
    font-size: 0.9rem !important;
}

.article-info .published,
.article-info .create,
.article-info .modified {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.article-info .published::before,
.article-info .create::before,
.article-info .modified::before {
    content: "📅";
    font-size: 1rem;
}

.article-info .category-name {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border-radius: 2rem;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.article-info .category-name:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* ========================================
   2. IMAGE PRINCIPALE
   ======================================== */
.article-image,
.item-page > img:first-of-type,
.com-content-article .item-image {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 1rem;
    margin: 2rem 0 3rem 0;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.article-image:hover,
.item-page > img:first-of-type:hover {
    transform: scale(1.01);
}

/* ========================================
   3. CONTENU DE L'ARTICLE - TYPOGRAPHIE
   ======================================== */
.item-page p,
.com-content-article p,
.article-body p {
    font-size: 1.125rem;
    line-height: 1.8;
    color: #334155;
    margin-bottom: 1.5rem;
    font-weight: 400;
    letter-spacing: 0.01em;
}

/* Premier paragraphe - Lead */
.item-page p:first-of-type,
.article-body > p:first-of-type {
    font-size: 1.25rem;
    line-height: 1.7;
    color: #475569;
    font-weight: 500;
    margin-bottom: 2rem;
}

/* Sous-titres dans l'article */
.item-page h2,
.com-content-article h2,
.article-body h2 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 700;
    line-height: 1.3;
    color: #1e293b;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    letter-spacing: -0.01em;
    position: relative;
    padding-bottom: 0.5rem;
}

.item-page h2::after,
.article-body h2::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    border-radius: 2px;
}

.item-page h3,
.com-content-article h3,
.article-body h3 {
    font-size: clamp(1.25rem, 3vw, 1.5rem);
    font-weight: 600;
    line-height: 1.4;
    color: #334155;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.item-page h4,
.com-content-article h4,
.article-body h4 {
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.5;
    color: #475569;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

/* ========================================
   4. LISTES
   ======================================== */
.item-page ul,
.item-page ol,
.article-body ul,
.article-body ol {
    margin: 1.5rem 0 1.5rem 1.5rem;
    padding-left: 1rem;
}

.item-page ul li,
.article-body ul li {
    list-style-type: none;
    position: relative;
    padding-left: 1.75rem;
    margin-bottom: 1rem;
    line-height: 1.7;
    font-size: 1.0625rem;
    color: #334155;
}

.item-page ul li::before,
.article-body ul li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: #3b82f6;
    font-weight: bold;
    font-size: 1.2rem;
}

.item-page ol li,
.article-body ol li {
    padding-left: 0.5rem;
    margin-bottom: 1rem;
    line-height: 1.7;
    font-size: 1.0625rem;
    color: #334155;
}

.item-page ol li::marker,
.article-body ol li::marker {
    color: #3b82f6;
    font-weight: 700;
}

/* ========================================
   5. LIENS
   ======================================== */
.item-page a,
.article-body a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.item-page a:hover,
.article-body a:hover {
    color: #2563eb;
    border-bottom-color: #3b82f6;
}

/* ========================================
   6. BLOCKQUOTES & CITATIONS
   ======================================== */
.item-page blockquote,
.article-body blockquote {
    margin: 2.5rem 0;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-left: 5px solid #3b82f6;
    border-radius: 0.5rem;
    font-size: 1.125rem;
    line-height: 1.7;
    color: #1e293b;
    font-style: italic;
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.1);
}

.item-page blockquote p,
.article-body blockquote p {
    margin-bottom: 0.5rem;
}

.item-page blockquote p:last-child,
.article-body blockquote p:last-child {
    margin-bottom: 0;
}

/* ========================================
   7. CODE & PRE
   ======================================== */
.item-page pre,
.article-body pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1.5rem;
    border-radius: 0.75rem;
    overflow-x: auto;
    margin: 2rem 0;
    font-size: 0.9375rem;
    line-height: 1.6;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.item-page code,
.article-body code {
    background: #f1f5f9;
    color: #e11d48;
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.9em;
    font-family: 'Monaco', 'Courier New', monospace;
}

.item-page pre code,
.article-body pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

/* ========================================
   8. IMAGES DANS LE CONTENU
   ======================================== */
.item-page img,
.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: 0.75rem;
    margin: 2rem auto;
    display: block;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.item-page figure,
.article-body figure {
    margin: 2.5rem 0;
    text-align: center;
}

.item-page figcaption,
.article-body figcaption {
    margin-top: 1rem;
    font-size: 0.9375rem;
    color: #64748b;
    font-style: italic;
}

/* ========================================
   9. TABLEAUX
   ======================================== */
.item-page table,
.article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    background: #ffffff;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.item-page table th,
.article-body table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.95rem;
}

.item-page table td,
.article-body table td {
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
    color: #334155;
    font-size: 0.95rem;
}

.item-page table tr:last-child td,
.article-body table tr:last-child td {
    border-bottom: none;
}

.item-page table tr:hover,
.article-body table tr:hover {
    background: #f8fafc;
}

/* ========================================
   10. BOÎTES D'ALERTE / CALLOUTS
   ======================================== */
.alert,
.callout,
.notice {
    padding: 1.25rem 1.5rem;
    border-radius: 0.75rem;
    margin: 2rem 0;
    border-left: 5px solid;
    font-size: 1rem;
    line-height: 1.6;
}

.alert-info,
.callout-info {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #1e40af;
}

.alert-success,
.callout-success {
    background: #f0fdf4;
    border-color: #22c55e;
    color: #15803d;
}

.alert-warning,
.callout-warning {
    background: #fffbeb;
    border-color: #f59e0b;
    color: #92400e;
}

.alert-danger,
.callout-danger {
    background: #fef2f2;
    border-color: #ef4444;
    color: #991b1b;
}

/* ========================================
   11. NAVIGATION ARTICLE (Précédent/Suivant)
   ======================================== */
.article-navigation,
.pager,
.pagination-article {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin: 4rem 0 2rem 0;
    padding-top: 2rem;
    border-top: 2px solid #e2e8f0;
}

.article-navigation a,
.pager a {
    flex: 1;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    text-decoration: none;
    border-radius: 0.75rem;
    font-weight: 600;
    transition: all 0.3s ease;
    text-align: center;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.article-navigation a:hover,
.pager a:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.35);
}

.article-navigation .prev::before {
    content: "← ";
}

.article-navigation .next::after {
    content: " →";
}

/* ========================================
   12. TAGS / ÉTIQUETTES
   ======================================== */
.article-tags,
.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 2rem 0;
    padding: 1.5rem 0;
    border-top: 1px solid #e2e8f0;
}

.article-tags a,
.tags-list a,
.tag {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: #f1f5f9;
    color: #475569;
    text-decoration: none;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.article-tags a:hover,
.tags-list a:hover,
.tag:hover {
    background: #3b82f6;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.article-tags a::before,
.tags-list a::before,
.tag::before {
    content: "#";
    margin-right: 0.25rem;
    opacity: 0.7;
}

/* ========================================
   13. SECTION AUTEUR
   ======================================== */
.author-box,
.article-author {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 2rem;
    border-radius: 1rem;
    margin: 3rem 0;
    border: 1px solid #e2e8f0;
}

.author-box h3,
.article-author h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: #1e293b;
}

.author-box p,
.article-author p {
    color: #475569;
    line-height: 1.7;
}

/* ========================================
   14. PARTAGE SOCIAL
   ======================================== */
.social-share,
.share-buttons {
    display: flex;
    gap: 1rem;
    margin: 2rem 0;
    padding: 1.5rem 0;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
}

.social-share a,
.share-buttons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    color: #ffffff;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.social-share a:hover,
.share-buttons a:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.social-share .facebook { background: #1877f2; }
.social-share .twitter { background: #1da1f2; }
.social-share .linkedin { background: #0077b5; }
.social-share .whatsapp { background: #25d366; }
.social-share .email { background: #ea4335; }

/* ========================================
   15. RESPONSIVE DESIGN
   ======================================== */
@media (max-width: 768px) {
    .com-content-article,
    .item-page {
        padding: 1.5rem 1rem;
    }
    
    .com-content-article h1,
    .item-page h1 {
        font-size: 1.75rem;
    }
    
    .item-page p,
    .article-body p {
        font-size: 1rem;
    }
    
    .item-page p:first-of-type,
    .article-body > p:first-of-type {
        font-size: 1.125rem;
    }
    
    .article-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .item-page blockquote,
    .article-body blockquote {
        padding: 1rem 1.25rem;
        margin: 1.5rem 0;
    }
    
    .article-navigation {
        flex-direction: column;
    }
    
    .item-page pre,
    .article-body pre {
        padding: 1rem;
        font-size: 0.875rem;
    }
    
    /* Masquer les breadcrumbs sur mobile pour articles blog */
    body.view-article.catid-8 .breadcrumb,
    body.view-article.catid-8 .mod-breadcrumbs,
    body.view-article.catid-8 nav[aria-label="breadcrumb"],
    body.view-article.catid-8 nav[aria-label="Fil de navigation"],
    body.view-article.catid-8 .breadcrumbs-wrapper,
    body[class*="blog"] .breadcrumb,
    body[class*="blog"] .mod-breadcrumbs,
    body[class*="blog"] nav[aria-label="breadcrumb"],
    body[class*="blog"] nav[aria-label="Fil de navigation"],
    body[class*="blog"] .breadcrumbs-wrapper {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .com-content-article h1,
    .item-page h1 {
        font-size: 1.5rem;
    }
    
    .item-page h2,
    .article-body h2 {
        font-size: 1.375rem;
        margin-top: 2rem;
    }
    
    .social-share a,
    .share-buttons a {
        width: 40px;
        height: 40px;
    }
}

/* ========================================
   16. ANIMATIONS D'ENTRÉE
   ======================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.item-page,
.com-content-article {
    animation: fadeInUp 0.6s ease-out;
}

/* ========================================
   17. PRINT STYLES
   ======================================== */
@media print {
    .article-navigation,
    .social-share,
    .share-buttons,
    .article-tags {
        display: none;
    }
    
    .item-page,
    .com-content-article {
        max-width: 100%;
        padding: 0;
    }
    
    .item-page a,
    .article-body a {
        color: #000000;
        text-decoration: underline;
    }
}

/* ========================================
   18. FONCTIONNALITÉS JS - STYLES
   ======================================== */

/* Bouton Copier le lien */
.copy-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #f1f5f9;
    color: #475569;
    border: 2px solid #e2e8f0;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.copy-link-btn:hover {
    background: #3b82f6;
    color: #ffffff;
    border-color: #3b82f6;
    transform: translateY(-2px);
}

/* Temps de lecture */
.reading-time {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    background: #fef3c7;
    color: #92400e;
    border-radius: 2rem;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Barre de progression de lecture */
.reading-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(0, 0, 0, 0.05);
    z-index: 9999;
}

.reading-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6 0%, #8b5cf6 100%);
    width: 0%;
    transition: width 0.2s ease;
}

/* Table des matières */
.article-toc {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 2px solid #e2e8f0;
    border-radius: 1rem;
    padding: 1.5rem;
    margin: 2rem 0;
}

.article-toc h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 1rem 0;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-item {
    margin-bottom: 0.75rem;
}

.toc-item.toc-sub {
    margin-left: 1.5rem;
    font-size: 0.9375rem;
}

.toc-item a {
    color: #475569;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    display: block;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
}

.toc-item a:hover {
    color: #3b82f6;
    padding-left: 0.5rem;
}

/* Wrapper responsive pour tableaux */
.table-wrapper {
    overflow-x: auto;
    margin: 2rem 0;
    border-radius: 0.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* Icône liens externes */
.external-icon {
    display: inline-block;
    font-size: 0.85em;
    margin-left: 0.25rem;
    opacity: 0.6;
}

/* Animation au scroll */
.blog-item,
.article-card {
    opacity: 0;
    transform: translateY(30px);
}

.blog-item.animate-in,
.article-card.animate-in {
    animation: fadeInUp 0.6s ease-out forwards;
}

