/**
 * Article Content Styles
 * Consistent styling for rendered content from WYSIWYG editor
 * Used on blog posts, guides, and category descriptions
 */

.article-content,
.editorial-content,
.seo-content,
.page-content {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.8;
    font-size: 1rem;
    /* Par défaut, aligner à gauche - l'éditeur peut override */
    text-align: left;
}

/* =============================================
   SUPPORT ALIGNEMENTS QUILL EDITOR
   ============================================= */

/* Classes Quill pour l'alignement */
.article-content .ql-align-center,
.editorial-content .ql-align-center,
.seo-content .ql-align-center,
.page-content .ql-align-center,
[class*="-content"] .ql-align-center {
    text-align: center !important;
}

.article-content .ql-align-right,
.editorial-content .ql-align-right,
.seo-content .ql-align-right,
.page-content .ql-align-right,
[class*="-content"] .ql-align-right {
    text-align: right !important;
}

.article-content .ql-align-justify,
.editorial-content .ql-align-justify,
.seo-content .ql-align-justify,
.page-content .ql-align-justify,
[class*="-content"] .ql-align-justify {
    text-align: justify !important;
}

/* Styles inline pour l'alignement */
[class*="-content"] [style*="text-align: center"] { text-align: center !important; }
[class*="-content"] [style*="text-align: right"] { text-align: right !important; }
[class*="-content"] [style*="text-align: justify"] { text-align: justify !important; }
[class*="-content"] [style*="text-align: left"] { text-align: left !important; }

/* =============================================
   FIN SUPPORT ALIGNEMENTS
   ============================================= */

/* Headings */
.article-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 2rem 0 1rem;
    color: #fff;
    border-bottom: 2px solid #8b5cf6;
    padding-bottom: 0.5rem;
}

.article-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 1.5rem 0 0.75rem;
    color: #e2e8f0;
}

.article-content h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 1.25rem 0 0.5rem;
    color: #cbd5e1;
}

/* Paragraphs */
.article-content p {
    margin-bottom: 1.25rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.8;
}

.article-content p:last-child {
    margin-bottom: 0;
}

/* Links */
.article-content a {
    color: #a78bfa;
    text-decoration: underline;
    transition: color 0.2s;
}

.article-content a:hover {
    color: #c4b5fd;
}

/* Lists */
.article-content ul,
.article-content ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
    color: rgba(255, 255, 255, 0.85);
}

.article-content li {
    margin-bottom: 0.6rem;
    line-height: 1.7;
}

.article-content li::marker {
    color: #a78bfa;
}

/* Blockquote */
.article-content blockquote {
    border-left: 4px solid #8b5cf6;
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    background: rgba(139, 92, 246, 0.15);
    border-radius: 0 8px 8px 0;
    font-style: italic;
}

.article-content blockquote p {
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
}

/* Code */
.article-content code {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #a5b4fc;
}

.article-content pre {
    background: rgba(0, 0, 0, 0.4);
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.article-content pre code {
    background: transparent;
    padding: 0;
    font-size: 0.85rem;
}

/* Images */
.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5rem 0;
    display: block;
}

.article-content img[style*="float: left"],
.article-content img.ql-align-left {
    float: left;
    margin: 0.5rem 1.5rem 1rem 0;
    max-width: 50%;
}

.article-content img[style*="float: right"],
.article-content img.ql-align-right {
    float: right;
    margin: 0.5rem 0 1rem 1.5rem;
    max-width: 50%;
}

.article-content img.ql-align-center {
    margin-left: auto;
    margin-right: auto;
}

/* Tables */
.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    overflow-x: auto;
    display: block;
}

@media (min-width: 768px) {
    .article-content table {
        display: table;
    }
}

.article-content th,
.article-content td {
    border: 1px solid var(--border);
    padding: 0.75rem 1rem;
    text-align: left;
}

.article-content th {
    background: rgba(139, 92, 246, 0.2);
    font-weight: 600;
    color: #fff;
}

.article-content tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.02);
}

.article-content tr:hover td {
    background: rgba(102, 126, 234, 0.05);
}

/* Horizontal Rule */
.article-content hr {
    border: none;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    margin: 2rem 0;
}

/* Strong / Bold */
.article-content strong,
.article-content b {
    font-weight: 700;
    color: #fff;
}

/* Emphasis / Italic */
.article-content em,
.article-content i {
    font-style: italic;
}

/* Strikethrough */
.article-content s,
.article-content del,
.article-content strike {
    text-decoration: line-through;
    opacity: 0.7;
}

/* Underline */
.article-content u {
    text-decoration: underline;
}

/* Text alignment (from Quill) */
.article-content .ql-align-center {
    text-align: center;
}

.article-content .ql-align-right {
    text-align: right;
}

.article-content .ql-align-justify {
    text-align: justify;
}

/* Clearfix for floated images */
.article-content::after {
    content: '';
    display: table;
    clear: both;
}
