.portix-content-image {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 1.25rem auto;
    border-radius: 10px;
}

.portix-image-figure {
    display: block;
    max-width: 100%;
    margin: 1.25rem auto;
}

.portix-image-figure > img.portix-content-image {
    width: 100%;
    margin: 0;
}

.portix-image-figure > figcaption {
    margin-top: .45rem;
    color: #667085;
    font-size: .9em;
    line-height: 1.4;
    text-align: center;
}

img.portix-content-image.portix-image-size-25 { width: 25%; }
img.portix-content-image.portix-image-size-33 { width: 33.333%; }
img.portix-content-image.portix-image-size-50 { width: 50%; }
img.portix-content-image.portix-image-size-66 { width: 66.667%; }
img.portix-content-image.portix-image-size-75 { width: 75%; }
img.portix-content-image.portix-image-size-100 { width: 100%; }
.portix-image-figure.portix-image-size-25 { width: 25%; }
.portix-image-figure.portix-image-size-33 { width: 33.333%; }
.portix-image-figure.portix-image-size-50 { width: 50%; }
.portix-image-figure.portix-image-size-66 { width: 66.667%; }
.portix-image-figure.portix-image-size-75 { width: 75%; }
.portix-image-figure.portix-image-size-100 { width: 100%; }

img.portix-content-image.portix-image-align-left {
    float: left;
    margin: .35rem 1.25rem .8rem 0;
}
img.portix-content-image.portix-image-align-right {
    float: right;
    margin: .35rem 0 .8rem 1.25rem;
}
img.portix-content-image.portix-image-align-center {
    float: none;
    margin: 1.25rem auto;
}
.portix-image-figure.portix-image-align-left {
    float: left;
    margin: .35rem 1.25rem .8rem 0;
}
.portix-image-figure.portix-image-align-right {
    float: right;
    margin: .35rem 0 .8rem 1.25rem;
}
.portix-image-figure.portix-image-align-center {
    float: none;
    margin: 1.25rem auto;
}

.news-rich-text {
    display: flow-root;
    font-size: 1rem;
    line-height: 1.65;
    overflow-wrap: normal;
    word-wrap: normal;
    word-break: normal;
    hyphens: none;
}

/*
 * Géométrie de contenu calquée sur Quill Snow.
 *
 * Attention : Portix enregistre quill.getSemanticHTML(). Les listes sauvegardées
 * sont donc de vrais <ul>/<ol>/<li>, alors que Quill affiche ses puces dans
 * l'éditeur avec un élément interne .ql-ui. On reproduit ici cette géométrie
 * avec ::before afin que la puce ET le texte se déplacent ensemble.
 */
.news-rich-text p,
.news-rich-text ol,
.news-rich-text ul,
.news-rich-text pre,
.news-rich-text blockquote,
.news-rich-text h1,
.news-rich-text h2,
.news-rich-text h3,
.news-rich-text h4,
.news-rich-text h5,
.news-rich-text h6 {
    margin: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.news-rich-text li {
    margin: 0 !important;
    position: relative;
}

/* Même distinction que dans l’éditeur : espace entre deux paragraphes,
 * aucun espace supplémentaire autour d’un simple saut de ligne <br>. */
.news-rich-text p + p {
    margin-top: .65em !important;
}

/* Quill : conteneur de liste 1.5em + élément de liste 1.5em. */
.news-rich-text ol,
.news-rich-text ul {
    padding-left: 1.5em !important;
    list-style: none !important;
}

.news-rich-text ol > li,
.news-rich-text ul > li {
    padding-left: 1.5em !important;
    list-style: none !important;
}

/*
 * Quill place le marqueur dans une boîte de 1.2em, puis laisse .3em avant
 * le texte. Cette version sémantique reproduit exactement ce placement.
 */
.news-rich-text ol > li::before,
.news-rich-text ul > li::before {
    position: absolute;
    left: 0;
    display: inline-block;
    width: 1.2em;
    white-space: nowrap;
    text-align: right;
}

.news-rich-text ul > li::before {
    content: "\2022";
}

/* Numérotation sémantique équivalente aux niveaux Quill. */
.news-rich-text ol {
    counter-reset: portix-list;
}
.news-rich-text ol > li {
    counter-increment: portix-list;
}
.news-rich-text ol > li::before {
    content: counter(portix-list, decimal) ". ";
}
.news-rich-text ol ol > li::before {
    content: counter(portix-list, lower-alpha) ". ";
}
.news-rich-text ol ol ol > li::before {
    content: counter(portix-list, lower-roman) ". ";
}
.news-rich-text ol ol ol ol > li::before {
    content: counter(portix-list, decimal) ". ";
}
.news-rich-text ol ol ol ol ol > li::before {
    content: counter(portix-list, lower-alpha) ". ";
}
.news-rich-text ol ol ol ol ol ol > li::before {
    content: counter(portix-list, lower-roman) ". ";
}

/* Check-list éventuelle produite par Quill. */
.news-rich-text li[data-list="checked"]::before {
    content: "\2611";
}
.news-rich-text li[data-list="unchecked"]::before {
    content: "\2610";
}

/* Titres Quill Snow. */
.news-rich-text h1 { font-size: 2em; }
.news-rich-text h2 { font-size: 1.5em; }
.news-rich-text h3 { font-size: 1.17em; }
.news-rich-text h4 { font-size: 1em; }
.news-rich-text h5 { font-size: .83em; }
.news-rich-text h6 { font-size: .67em; }

.news-rich-text a {
    overflow-wrap: anywhere;
    text-decoration: underline;
}

.news-rich-text blockquote {
    border-left: 4px solid #ccc;
    margin-top: 5px !important;
    margin-bottom: 5px !important;
    padding-left: 16px !important;
}

.news-rich-text code {
    border-radius: 3px;
    font-size: 85%;
    padding: 2px 4px;
}

.news-rich-text pre {
    margin-top: 5px !important;
    margin-bottom: 5px !important;
    padding: 5px 10px !important;
}

/* Alignements Quill. */
.news-rich-text .ql-align-center { text-align: center; }
.news-rich-text .ql-align-right { text-align: right; }
.news-rich-text .ql-align-justify { text-align: justify; }
.news-rich-text .ql-direction-rtl { direction: rtl; text-align: inherit; }
.news-rich-text .ql-size-small { font-size: .75em; }

/* Retraits Quill hors listes. */
.news-rich-text .ql-indent-1:not(.ql-direction-rtl) { padding-left: 3em !important; }
.news-rich-text .ql-indent-2:not(.ql-direction-rtl) { padding-left: 6em !important; }
.news-rich-text .ql-indent-3:not(.ql-direction-rtl) { padding-left: 9em !important; }
.news-rich-text .ql-indent-4:not(.ql-direction-rtl) { padding-left: 12em !important; }
.news-rich-text .ql-indent-5:not(.ql-direction-rtl) { padding-left: 15em !important; }
.news-rich-text .ql-indent-6:not(.ql-direction-rtl) { padding-left: 18em !important; }
.news-rich-text .ql-indent-7:not(.ql-direction-rtl) { padding-left: 21em !important; }
.news-rich-text .ql-indent-8:not(.ql-direction-rtl) { padding-left: 24em !important; }
.news-rich-text .ql-indent-9:not(.ql-direction-rtl) { padding-left: 27em !important; }

.news-rich-text > :first-child { margin-top: 0 !important; }
.news-rich-text > :last-child { margin-bottom: 0 !important; }
.news-rich-text .ql-align-center > img.portix-content-image:not([class*="portix-image-align-"]) {
    margin-right: auto;
    margin-left: auto;
}
.news-rich-text .ql-align-right > img.portix-content-image:not([class*="portix-image-align-"]) {
    margin-right: 0;
    margin-left: auto;
}

@media (max-width: 640px) {
    img.portix-content-image.portix-image-align-left,
    img.portix-content-image.portix-image-align-right,
    .portix-image-figure.portix-image-align-left,
    .portix-image-figure.portix-image-align-right {
        float: none;
        width: auto;
        margin: 1.25rem auto;
    }
}

/* --------------------------------------------------------------------------
   Liste publique des actualités
   --------------------------------------------------------------------------
   Deux actualités par rangée sur écran suffisamment large. Le module News
   limite déjà la pagination à 10 actualités : cela donne au maximum 5 rangées.
   Sur petit écran, la liste repasse naturellement sur une seule colonne.
*/
.news-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.news-card {
    min-width: 0;
}

@media (max-width: 760px) {
    .news-list {
        grid-template-columns: minmax(0, 1fr);
    }
}
