/**
 * Equilibre les espaces visuels autour des separateurs Gutenberg.
 *
 * Chaque page conserve la marge propre de ses traits. Les marges parasites
 * des contenus voisins et les doubles blocs d'espacement sont neutralises
 * afin d'obtenir la meme distance avant et apres chaque trait.
 */

/* Un double trait strictement consecutif n'apporte aucune information. */
body.page #primary .post-content hr.wp-block-separator + hr.wp-block-separator {
	display: none !important;
}

/* Un seul bloc d'espacement est conserve lorsqu'il y en a deux avant le trait. */
body.page #primary .post-content .wp-block-spacer:has(+ .wp-block-spacer + hr.wp-block-separator) {
	display: none !important;
	height: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
}

/* Neutralise la marge du dernier contenu avant le trait. */
body.page #primary .post-content :not(.wp-block-spacer):has(+ hr.wp-block-separator),
body.page #primary .post-content :not(.wp-block-spacer):has(+ .wp-block-spacer + hr.wp-block-separator),
body.page #primary .post-content :not(.wp-block-spacer):has(+ .wp-block-spacer + .wp-block-spacer + hr.wp-block-separator) {
	margin-bottom: 0 !important;
}

/* Neutralise la marge du premier contenu apres le trait. */
body.page #primary .post-content hr.wp-block-separator + :not(.wp-block-spacer),
body.page #primary .post-content hr.wp-block-separator + .wp-block-spacer + :not(.wp-block-spacer) {
	margin-top: 0 !important;
}

/*
 * Si un trait possede un espace avant mais aucun apres, sa transition vers le
 * bloc suivant reprend les 68 px utilises par les sections editoriales.
 */
body.page #primary .post-content .wp-block-spacer + hr.wp-block-separator:not(:has(+ .wp-block-spacer)) {
	margin-bottom: 68px !important;
}

/*
 * Deux pages historiques combinaient un espace de 20 px avant le trait et un
 * espace de 10 px apres. Leur rythme est harmonise sans modifier les autres
 * pages legales ou editoriales deja equilibrees.
 */
body.page #post-10002 .wp-block-spacer:has(+ hr.wp-block-separator),
body.page #post-10002 hr.wp-block-separator + .wp-block-spacer,
body.page #post-11807 .wp-block-spacer:has(+ hr.wp-block-separator),
body.page #post-11807 hr.wp-block-separator + .wp-block-spacer {
	height: 20px !important;
	min-height: 20px !important;
	margin: 0 !important;
	padding: 0 !important;
}

/* La feuille de la page Transports imposait encore 54 px au titre suivant. */
body.page.oasis-guide-page:not(.oasis-editorial-hub) #primary #post-9880 .post-content > hr.wp-block-separator + h2.wp-block-heading:not(.oasis-establishment-title):not(.oasis-place-title) {
	margin-top: 0 !important;
}

/* La page Douceurs applique la meme marge de titre historique. */
body.page.oasis-guide-page:not(.oasis-editorial-hub) #primary #post-11047 .post-content > hr.wp-block-separator + h2.wp-block-heading:not(.oasis-establishment-title):not(.oasis-place-title) {
	margin-top: 0 !important;
}

/* Un paragraphe vide ajoutait encore 16 px apres le premier trait de Contact. */
body.page #post-9869 .post-content hr.wp-block-separator + .wp-block-spacer + p.wp-block-paragraph {
	margin: 0 !important;
}

/* Garde-fou pour un ancien motif : trait, paragraphe vide, second trait. */
body.page #primary .post-content hr.wp-block-separator:has(+ p:empty + hr.wp-block-separator) + p:empty + hr.wp-block-separator {
	display: none !important;
}
