
/* --- BARRE D'ADMIN ------------------------------------------------------------------------------------------------------------------- */

/* Masque certains boutons de la barre d'admin */
#wp-admin-bar-site-editor,
#wp-admin-bar-customize,
#wp-admin-bar-comments,
#wp-admin-bar-new-post,
#wp-admin-bar-new-media,
#wp-admin-bar-appearance,
#wp-admin-bar-search{
	display: none !important;
}

/* définit une variable globale contenant la hauteur de la barre d'admin (facilite l'adaptation de certains blocks : header, menu, content, ...) */
body{
	--admin-bar-height: 0px;
}
body.admin-bar{
	--admin-bar-height: 32px;
}
@media (max-width: 782px) {

	body.admin-bar{
		--admin-bar-height: 46px;
	}

}

/* Maintient la barre d'admin en position fixed au format mobile */
@media (max-width: 600px) {

    #wpadminbar {
        position: fixed !important;
    }

}


/* --- CORRECTION DE BUGS -------------------------------------------------------------------------------------------------------------- */

/*

	SUPPRESSION DES PADDINGS SUR LES BLOCKS SE TROUVANT DANS DES CONTENEURS FULLWIDTH EN LAYOUT FLOW [~BUG]

	- Reproduction du problème :

		1/	Activer useRootPaddingAwareAlignments dans theme.json
		2/	Créer l'arborescence suivante : groupe (G1) > groupe (G2) > paragraphe (P)
			Avec :	G1 : fullwidth + layout flow (= "Les blocs intérieurs utilisent la largeur du contenu")
					G2 : fullwidth

		Des paddings sont ajoutés au paragraphe alors qu'il ne devrait pas en avoir.

*/

:not(.has-global-padding) > .has-global-padding > .alignfull {
	margin-right: calc(var(--wp--style--root--padding-right) * -1) !important;
	margin-left: calc(var(--wp--style--root--padding-left) * -1) !important;
	padding-right: var(--wp--style--root--padding-right) !important;
	padding-left: var(--wp--style--root--padding-left) !important;
}
:not(.has-global-padding) > .has-global-padding > .alignfull:where(:not(.is-layout-constrained)) {
	padding-left: 0 !important;
	padding-right: 0 !important;
}
:not(.has-global-padding) > .has-global-padding > .alignfull:where(:not(.has-global-padding)) > :where([class*="wp-block-"]:not(.alignfull):not([class*="__"]), p, h1, h2, h3, h4, h5, h6, ul, ol) {
	padding-left: 0 !important;
	padding-right: 0 !important;
}

@media (max-width: 1024px) {

	:not(.has-global-padding) > .has-global-padding > .alignfull {
		margin-right: calc(30px * -1) !important;
		margin-left: calc(30px * -1) !important;
		/* padding-right: 30px !important; */
		/* padding-left: 30px !important; */
	}
	:not(.has-global-padding) > .has-global-padding{
		padding-right: 30px;
		padding-left: 30px;
	}

}


/* --- RÉINITIALISATION DES FONT-SIZES DÉCLARÉES PAR DEFAUT ---------------------------------------------------------------------------- */

/* WordPress déclare des font-size par défaut qu'il est impossible de supprimer depuis le theme.json. */
.has-small-font-size,
.has-normal-font-size,
.has-medium-font-size,
.has-large-font-size,
.has-huge-font-size {
    font-size: initial !important;
}


/* --- SUPPRESSION DES MARGES PAR DÉFAUT ENTRE LES ÉLÉMENTS DE PREMIER NIVEAU ---------------------------------------------------------- */

/* WordPress ajoute 24px entre les éléments de premier niveau mais il est préférable de les gérer au niveau des éléments eux-mêmes (footer notamment). */
:where(.wp-site-blocks) > * {
    margin-block-start: 0 !important;
}