/* SATISFORM — rythme des contenus éditoriaux, 28/10/2026.
   Une seule séparation de référence ; les espaces internes des cartes,
   formulaires, menus et réponses de FAQ conservent leurs règles propres. */
:root {
    --site-space: 40px;
    --site-paragraph-space: 15px;
}

@media (max-width: 767px) {
    :root {
        --site-space: 30px;
        --site-paragraph-space: 12px;
    }
}

/* H1/H2 : séparation franche sous le titre, H3 et suivants inchangés. */
.c-layout-page h1,
.c-layout-page h2 {
    margin-bottom: var(--site-space, 40px);
}

/* À l'intérieur d'un texte, un nouveau H2 est aussi séparé de ce qui précède.
   Les marges verticales des éléments de texte se fusionnent sans s'additionner. */
.c-layout-page .satisform-richtext h2,
.c-layout-page .textimg .contenu h2 {
    margin-top: var(--site-space, 40px);
}

.c-layout-page .satisform-richtext h2:first-child,
.c-layout-page .textimg .contenu h2:first-child {
    margin-top: 0;
}

.c-layout-page .satisform-richtext p {
    margin-top: 0;
    margin-bottom: var(--site-paragraph-space, 15px);
}

/* Seul le dernier paragraphe direct du texte reçoit la grande séparation.
   Une liste ou un autre bloc final reprend cette séparation quand nécessaire. */
.c-layout-page .satisform-richtext > p:last-of-type,
.c-layout-page .satisform-richtext > ul:last-child,
.c-layout-page .satisform-richtext > ol:last-child,
.c-layout-page .satisform-richtext > blockquote:last-child,
.c-layout-page .satisform-richtext > table:last-child,
.c-layout-page .satisform-richtext > div:last-child {
    margin-bottom: var(--site-space, 40px);
}

.c-layout-page .satisform-richtext:empty {
    display: none;
}

/* Dans le bandeau d'introduction, le padding extérieur porte déjà l'espace
   final. Le texte conserve sa séparation lorsqu'un bouton le suit. */
.c-layout-page #bloc_H1_contenu .satisform-richtext p {
    margin-bottom: var(--site-paragraph-space, 15px);
}

.c-layout-page #bloc_H1_contenu .satisform-richtext > p:last-of-type {
    margin-bottom: var(--site-space, 40px);
}

.c-layout-page #bloc_H1_contenu .satisform-richtext:last-child > p:last-of-type {
    margin-bottom: 0;
}

/* Les titres centrés et les boutons natifs possèdent leur propre espace bas. */
.c-layout-page .satisform-content-heading,
.c-layout-page .satisform-content-actions {
    margin-bottom: var(--site-space, 40px);
}

.c-layout-page .satisform-content-heading h1,
.c-layout-page .satisform-content-heading h2,
.c-layout-page .satisform-content-actions .bouton_unique {
    margin-bottom: 0;
}

/* Retirer seulement les anciens espaces déjà remplacés par la règle commune. */
.c-layout-page h2 + .xs-margin,
.c-layout-page h2 + .sm-margin,
.c-layout-page h2 + .md-margin,
.c-layout-page h2 + .lg-margin,
.c-layout-page .satisform-content-heading + .sm-margin,
.c-layout-page .satisform-content-heading + .md-margin,
.c-layout-page .satisform-content-actions + .sm-margin,
.c-layout-page .satisform-content-actions + .md-margin,
.c-layout-page .satisform-content-actions + .lg-margin,
.c-layout-page .satisform-editorial-block > .sm-margin:last-child,
.c-layout-page #article_default + .md-margin {
    display: none;
}

/* Le texte précédent porte déjà la séparation haute du bandeau à bouton. */
.c-layout-page #article_default .cadre_info {
    margin-top: 0;
    margin-bottom: var(--site-space, 40px);
}

/* Les paragraphes de réponse de FAQ restent compacts. */
.c-layout-page .faq .satisform-richtext > p:last-of-type {
    margin-bottom: 0;
}
