/* ============================================================
   article.css — corps des actus
   Partage : page publique (.article-body) + iframe TinyMCE
   (content_css, body.mce-content-body) => rendu identique.
   Couleurs en dur : l'iframe ne charge pas app.css.
============================================================ */

/* Iframe editeur seule (en public, Nunito vient de app.css) */
@font-face {
    font-family: 'Nunito';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('fonts/nunito/nunito-v32-latin-regular.woff2') format('woff2');
}
@font-face {
    font-family: 'Nunito';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('fonts/nunito/nunito-v32-latin-700.woff2') format('woff2');
}

body.mce-content-body {
    max-width: 820px;
    margin: 1rem auto;
    padding: 0 1rem;
    font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 1.0625rem;
    line-height: 1.7;
    color: #1a1a1a;
}

.article-body,
.mce-content-body {
    overflow-wrap: break-word;
}

/* Rythme */
.article-body > :last-child { margin-bottom: 0; }

.article-body :is(h2, h3, h4),
.mce-content-body :is(h2, h3, h4) {
    margin: 2rem 0 .75rem;
    font-weight: 700;
    line-height: 1.3;
    color: #1a5276;
}
.article-body h2, .mce-content-body h2 { font-size: 1.6rem; }
.article-body h3, .mce-content-body h3 { font-size: 1.35rem; }
.article-body h4, .mce-content-body h4 { font-size: 1.15rem; }

.article-body :is(p, ul, ol, blockquote, figure, pre, table),
.mce-content-body :is(p, ul, ol, blockquote, figure, pre, table) {
    margin: 0 0 1.25rem;
}

.article-body a, .mce-content-body a { color: #1a6696; text-underline-offset: 2px; }
.article-body a:hover { color: #e85d26; }

.article-body hr, .mce-content-body hr {
    margin: 2rem 0;
    border: 0;
    border-top: 1px solid #dee2e6;
}

/* Images : jamais plus larges que la colonne */
.article-body img,
.mce-content-body img {
    max-width: 100%;
    height: auto;
    border-radius: .375rem;
}

.article-img-center { display: block; margin-inline: auto; }
.article-img-left   { float: left;  margin: .25rem 1.25rem 1rem 0; max-width: 50% !important; }
.article-img-right  { float: right; margin: .25rem 0 1rem 1.25rem; max-width: 50% !important; }

.article-body::after { content: ''; display: table; clear: both; }

/* Video MP4 : pleine largeur, ratio conserve */
.article-body video,
.mce-content-body video {
    display: block;
    width: 100%;
    height: auto;
    background: #000;
    border-radius: .375rem;
}

/* Legende (image_caption) */
.article-body figure.image,
.mce-content-body figure.image {
    display: table;
    margin-inline: auto;
}
.article-body figcaption,
.mce-content-body figcaption {
    display: table-caption;
    caption-side: bottom;
    padding-top: .4rem;
    font-size: .9rem;
    color: #6c757d;
    text-align: center;
}

/* Citation */
.article-body blockquote,
.mce-content-body blockquote {
    padding: .75rem 1.25rem;
    border-left: 4px solid #e85d26;
    background: #e8f3fa;
    border-radius: 0 .375rem .375rem 0;
    font-style: italic;
}
.article-body blockquote > :last-child,
.mce-content-body blockquote > :last-child { margin-bottom: 0; }

/* Code */
.article-body code, .mce-content-body code {
    padding: .1rem .3rem;
    font-size: .9em;
    background: #f1f3f5;
    border-radius: .25rem;
}
.article-body pre, .mce-content-body pre {
    padding: 1rem;
    overflow-x: auto;
    background: #f1f3f5;
    border-radius: .375rem;
}
.article-body pre code, .mce-content-body pre code { padding: 0; background: none; }

/* Tableaux : styles de l'editeur retires par le sanitizer => style ici */
.article-body table,
.mce-content-body table {
    width: 100%;
    border-collapse: collapse;
    font-size: .95rem;
}
.article-body :is(th, td),
.mce-content-body :is(th, td) {
    padding: .5rem .75rem;
    border: 1px solid #dee2e6;
    vertical-align: top;
}
.article-body th, .mce-content-body th { background: #e8f3fa; font-weight: 700; }
.article-body caption, .mce-content-body caption { caption-side: top; color: #6c757d; }

@media (max-width: 575.98px) {
    /* Defilement horizontal plutot que debordement de page */
    .article-body table { display: block; overflow-x: auto; }
    .article-img-left,
    .article-img-right { float: none; display: block; margin: 0 auto 1rem; max-width: 100% !important; }
}
