/* Styles pour l'affichage du contenu riche des articles */

.article-content {
    line-height: 1.8;
    font-size: 16px;
    max-width: none;
}

/* FORCER ABSOLUMENT les styles inline TinyMCE */
.article-content[style],
.article-content *[style] {
    all: unset !important;
    display: revert !important;
    font-family: inherit !important;
    font-size: inherit !important;
    line-height: inherit !important;
}

/* Préservation spécifique des couleurs */
.article-content span[style*="color"],
.article-content p[style*="color"],
.article-content div[style*="color"] {
    color: revert !important;
}

.article-content span[style*="background-color"],
.article-content p[style*="background-color"],
.article-content div[style*="background-color"] {
    background-color: revert !important;
}

/* Préservation spécifique de l'alignement */
.article-content p[style*="text-align"],
.article-content div[style*="text-align"],
.article-content h1[style*="text-align"],
.article-content h2[style*="text-align"],
.article-content h3[style*="text-align"],
.article-content h4[style*="text-align"],
.article-content h5[style*="text-align"],
.article-content h6[style*="text-align"] {
    text-align: revert !important;
}

/* Support des alignements spécifiques */
.article-content [style*="text-align: left"] {
    text-align: left !important;
}

.article-content [style*="text-align: center"] {
    text-align: center !important;
}

.article-content [style*="text-align: right"] {
    text-align: right !important;
}

.article-content [style*="text-align: justify"] {
    text-align: justify !important;
}

/* Classes d'alignement TinyMCE et de sauvegarde */
.article-content .mce-text-left,
.article-content .text-left {
    text-align: left !important;
}

.article-content .mce-text-center,
.article-content .text-center {
    text-align: center !important;
}

.article-content .mce-text-right,
.article-content .text-right {
    text-align: right !important;
}

.article-content .mce-text-justify,
.article-content .text-justify {
    text-align: justify !important;
}

/* Classes d'alignement CKEditor */
.ck-content .ck-align-left {
    text-align: left !important;
}

.ck-content .ck-align-center {
    text-align: center !important;
}

.ck-content .ck-align-right {
    text-align: right !important;
}

.ck-content .ck-align-justify {
    text-align: justify !important;
}

/* Support pour l'alignement dans l'affichage final */
.contenu-article .ck-align-left,
.article-content .ck-align-left {
    text-align: left !important;
}

.contenu-article .ck-align-center,
.article-content .ck-align-center {
    text-align: center !important;
}

.contenu-article .ck-align-right,
.article-content .ck-align-right {
    text-align: right !important;
}

.contenu-article .ck-align-justify,
.article-content .ck-align-justify {
    text-align: justify !important;
}

/* Styles pour les titres */
.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
    margin: 1.5em 0 0.8em 0;
    font-weight: 600;
    line-height: 1.3;
    color: #2c3e50;
}

.article-content h1 {
    font-size: 2.2em;
    border-bottom: 3px solid #3498db;
    padding-bottom: 10px;
}

.article-content h2 {
    font-size: 1.8em;
    color: #e74c3c;
}

.article-content h3 {
    font-size: 1.5em;
    color: #f39c12;
}

.article-content h4 {
    font-size: 1.3em;
    color: #27ae60;
}

/* Styles pour les paragraphes */
.article-content p {
    margin: 1em 0;
    text-align: justify;
}

/* Styles pour le formatage de texte */
.article-content strong,
.article-content b {
    font-weight: 700;
    color: #2c3e50;
}

.article-content em,
.article-content i {
    font-style: italic;
    color: #7f8c8d;
}

.article-content u {
    text-decoration: underline;
    text-decoration-color: #3498db;
}

.article-content s,
.article-content strike {
    text-decoration: line-through;
    color: #95a5a6;
}

/* Styles pour les listes */
.article-content ul,
.article-content ol {
    margin: 1em 0;
    padding-left: 2em;
}

.article-content li {
    margin: 0.5em 0;
    line-height: 1.6;
}

.article-content ul li {
    list-style-type: disc;
}

.article-content ol li {
    list-style-type: decimal;
}

/* Styles pour les liens */
.article-content a {
    color: #3498db;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
}

.article-content a:hover {
    color: #2980b9;
    border-bottom-color: #2980b9;
}

/* Styles pour les citations */
.article-content blockquote {
    margin: 1.5em 0;
    padding: 1em 1.5em;
    border-left: 4px solid #3498db;
    background: #f8f9fa;
    font-style: italic;
    color: #555;
}

/* Styles pour les tableaux */
.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.article-content table th,
.article-content table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.article-content table th {
    background: #3498db;
    color: white;
    font-weight: 600;
}

.article-content table tr:hover {
    background: #f5f5f5;
}

/* Styles pour les images */
.article-content img {
    max-width: 100%;
    height: auto;
    margin: 1em 0;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.article-content figure {
    margin: 1.5em 0;
    text-align: center;
}

.article-content figcaption {
    margin-top: 0.5em;
    font-style: italic;
    color: #666;
    font-size: 0.9em;
}

/* Styles pour le code */
.article-content code {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #e74c3c;
}

.article-content pre {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 1em;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1em 0;
}

.article-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

/* Styles responsive */
@media (max-width: 768px) {
    .article-content {
        font-size: 14px;
    }
    
    .article-content h1 {
        font-size: 1.8em;
    }
    
    .article-content h2 {
        font-size: 1.5em;
    }
    
    .article-content h3 {
        font-size: 1.3em;
    }
    
    .article-content table {
        font-size: 0.9em;
    }
    
    .article-content table th,
    .article-content table td {
        padding: 8px 10px;
    }
}

/* Styles pour l'impression */
@media print {
    .article-content {
        color: black;
        font-size: 12pt;
    }
    
    .article-content a {
        color: black;
        text-decoration: underline;
    }
    
    .article-content img {
        max-width: 100%;
        box-shadow: none;
    }
}
