/**
 * Styles pour le contenu des articles
 * Applique une mise en forme aux éléments HTML dans le contenu généré par TinyMCE
 */

.article-content {
    color: #374151;
    line-height: 1.75;
    font-size: 1.125rem;
}

/* Titres */
.article-content h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #111827;
    margin-top: 2.5rem;
    margin-bottom: 1.25rem;
    line-height: 1.25;
    scroll-margin-top: 100px; /* Évite que le titre soit caché par le header sticky */
    padding: 0.5rem 0;
    border-radius: 0.375rem;
    transition: background-color 0.3s ease;
}

.article-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #111827;
    margin-top: 2rem;
    margin-bottom: 1rem;
    line-height: 1.375;
    scroll-margin-top: 100px; /* Évite que le titre soit caché par le header sticky */
    padding: 0.5rem 0;
    border-radius: 0.375rem;
    transition: background-color 0.3s ease;
}

.article-content h4 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

/* Paragraphes */
.article-content p {
    margin-bottom: 1.5rem;
}

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

/* Listes */
.article-content ul,
.article-content ol {
    margin-bottom: 1.5rem;
    padding-left: 1.75rem;
}

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

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

.article-content li {
    margin-bottom: 0.5rem;
    padding-left: 0.25rem;
}

.article-content li > p {
    margin-bottom: 0.5rem;
}

/* Listes imbriquées */
.article-content ul ul,
.article-content ol ul {
    list-style-type: circle;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.article-content ol ol,
.article-content ul ol {
    list-style-type: lower-roman;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Liens */
.article-content a {
    color: #2563eb;
    text-decoration: underline;
    font-weight: 500;
    transition: color 0.2s;
}

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

/* Images */
.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin-top: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Images responsive (classe appliquée automatiquement) */
.article-content img.img-responsive {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* Citations */
.article-content blockquote {
    border-left: 4px solid #3b82f6;
    padding-left: 1.5rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: #4b5563;
    background-color: #f3f4f6;
    border-radius: 0 0.375rem 0.375rem 0;
}

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

/* Code inline */
.article-content code {
    background-color: #f3f4f6;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.875em;
    color: #dc2626;
}

/* Blocs de code */
.article-content pre {
    background-color: #1f2937;
    color: #f3f4f6;
    padding: 1.5rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 2rem 0;
    font-size: 0.875rem;
    line-height: 1.7;
}

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

/* Tableaux */
.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    font-size: 1rem;
}

.article-content thead {
    background-color: #f9fafb;
    border-bottom: 2px solid #e5e7eb;
}

.article-content th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    color: #111827;
}

.article-content td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.article-content tbody tr:hover {
    background-color: #f9fafb;
}

/* Ligne horizontale */
.article-content hr {
    border: 0;
    height: 1px;
    background-color: #e5e7eb;
    margin: 3rem 0;
}

/* Texte en gras et italique */
.article-content strong {
    font-weight: 600;
    color: #111827;
}

.article-content em {
    font-style: italic;
}

/* Premiers paragraphes après titre */
.article-content h2 + p,
.article-content h3 + p {
    margin-top: 0;
}

/* Espacement spécial pour le premier paragraphe */
.article-content > p:first-child::first-letter {
    font-size: 3.5rem;
    font-weight: 700;
    float: left;
    line-height: 1;
    margin-right: 0.5rem;
    margin-top: 0.1rem;
    color: #3b82f6;
}

/* Section articles relatifs (générée par PHP) */
.article-content .related-articles-inline {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2rem;
    border-radius: 0.75rem;
    margin: 3rem 0;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.article-content .related-articles-inline h3 {
    color: white;
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.article-content .related-articles-inline .related-article-card {
    background: white;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.article-content .related-articles-inline .related-article-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.article-content .related-articles-inline .related-article-card:last-child {
    margin-bottom: 0;
}

.article-content .related-articles-inline a {
    color: #111827;
    text-decoration: none;
    font-weight: 600;
}

.article-content .related-articles-inline a:hover {
    color: #3b82f6;
}

/* Responsive */
@media (max-width: 640px) {
    .article-content {
        font-size: 1rem;
    }

    .article-content h2 {
        font-size: 1.5rem;
        margin-top: 2rem;
    }

    .article-content h3 {
        font-size: 1.25rem;
        margin-top: 1.5rem;
    }

    .article-content > p:first-child::first-letter {
        font-size: 2.5rem;
    }
}
