/* ==========================================================================
   Contenu éditorial (CKEditor 5) — pages et actualités
   Chargé sur le front (base.html.twig) ET dans l'éditeur de l'admin
   (admin/posts/new|edit) : ce que l'on voit en rédigeant = ce qui est publié.
   Toutes les règles sont rattachées à .post-content.
   ========================================================================== */

/* ===== Images ===== */
.post-content .image { display: table; clear: both; margin: .9em auto; min-width: 50px; text-align: center; }
.post-content .image img { display: block; margin: 0 auto; max-width: 100%; min-width: 100%; height: auto; }
.post-content .image > figcaption { display: table-caption; caption-side: bottom; padding: .6em; font-size: .75em; background: #f7f7f7; color: #333; }
.post-content .image.image_resized { display: block; box-sizing: border-box; max-width: 100%; }
.post-content .image.image_resized img { width: 100%; }
.post-content .image.image_resized > figcaption { display: block; }
.post-content img.image_resized { height: auto; }

/* Image habillée par le texte (bouton « wrapText ») */
.post-content .image-style-align-left  { float: left;  margin-right: 1.5em; }
.post-content .image-style-align-right { float: right; margin-left: 1.5em; }
.post-content .image.image-style-align-left,
.post-content .image.image-style-align-right { clear: none; }
.post-content .image-style-side { float: right; margin-left: 1.5em; max-width: 50%; }
.post-content p + .image.image-style-align-left,
.post-content p + .image.image-style-align-right,
.post-content p + .image.image-style-side { margin-top: 0; }

/* Image en bloc, sans habillage (bouton « breakText ») */
.post-content .image.image-style-block-align-left  { margin-left: 0; margin-right: auto; max-width: calc(100% - 1.5em); }
.post-content .image.image-style-block-align-right { margin-left: auto; margin-right: 0; max-width: calc(100% - 1.5em); }
.post-content .image-style-align-center { margin-left: auto; margin-right: auto; }

/* Images dans le fil du texte */
.post-content .image-inline { display: inline-flex; align-items: flex-start; max-width: 100%; }
.post-content .image-inline img { flex: 1 1 auto; max-width: 100%; }

/* Les images flottantes ne débordent pas sous le bloc de contenu */
.post-content::after { content: ""; display: table; clear: both; }

/* Sur mobile, les images habillées repassent en pleine largeur */
@media (max-width: 576px) {
    .post-content .image-style-align-left,
    .post-content .image-style-align-right,
    .post-content .image-style-side { float: none; margin: .9em auto; max-width: 100%; }
}

/* ===== Styles du menu « Styles » de CKEditor =====
   Chaque classe ici correspond à une entrée de style.definitions
   dans assets/js/ckeditor5-init.js. Couleurs : charte du site (styles.css). */

/* Chapô : paragraphe d'introduction */
.post-content .chapo { font-size: 1.15em; font-weight: 500; line-height: 1.5; color: #0c4b7c; }

/* Encadrés */
.post-content .encadre { margin: 1.25em 0; padding: 1em 1.25em; border-left: 5px solid; border-radius: 4px; }
.post-content .encadre--info   { background: #eaf5fc; border-color: #5bb4ea; }
.post-content .encadre--alerte { background: #fbf0e4; border-color: #d57919; }
.post-content .encadre--astuce { background: #f1f6e4; border-color: #97bb39; }

/* Encadré du plugin (titre + contenu) : assets/js/ckeditor5/plugins/encadre/ */
.post-content .encadre__titre { margin-bottom: .4em; font-weight: 700; font-size: 1.05em; }
.post-content .encadre--info   .encadre__titre { color: #1f6a9c; }
.post-content .encadre--alerte .encadre__titre { color: #a0520b; }
.post-content .encadre--astuce .encadre__titre { color: #5c7a1c; }
.post-content .encadre__titre--vide { display: none; }
.post-content .encadre__contenu > :first-child { margin-top: 0; }
.post-content .encadre__contenu > :last-child { margin-bottom: 0; }
.post-content .encadre::after { content: ""; display: table; clear: both; }

/* Boutons (appliqués à un lien) */
.post-content a.btn-smictom {
    display: inline-block;
    padding: .55em 1.3em;
    border: 2px solid #0c4b7c;
    border-radius: 4px;
    background: #0c4b7c;
    color: #fff;
    font-weight: 600;
    text-decoration: none;
}
.post-content a.btn-smictom:hover,
.post-content a.btn-smictom:focus { background: #08355a; border-color: #08355a; color: #fff; }
.post-content a.btn-smictom--secondaire { background: transparent; color: #0c4b7c; }
.post-content a.btn-smictom--secondaire:hover,
.post-content a.btn-smictom--secondaire:focus { background: #0c4b7c; border-color: #0c4b7c; color: #fff; }
