/**
 * Espacement uniforme des blocs TechniConcept (racines uniquement).
 *
 * Padding / margin via variables CSS : les toggles is-disable-*
 * (padding-*-start/end = 0) restent prioritaires sur grand/petit.
 * Exclus : project-hero-slider (CAP-3). Hero MVP inclus.
 * Bouton : rythme local always-on (pas le rythme section) — voir fin de fichier.
 * Orthogonal a block-width.css (largeur) — ne touche pas padding-inline.
 */

:is(
		.wp-block-post-content,
		.techniconcept-site-main__content,
		.is-root-container,
		.block-editor-block-list__layout.is-root-container
	)
	> :is(
		.wp-block-techniconcept-title,
		.wp-block-techniconcept-text,
		.wp-block-techniconcept-image,
		.wp-block-techniconcept-columns,
		.wp-block-techniconcept-section-intro,
		.wp-block-techniconcept-text-image,
		.wp-block-techniconcept-gallery,
		.wp-block-techniconcept-brand-logo,
		.wp-block-techniconcept-project-service-columns,
		.wp-block-techniconcept-project-univers-grid,
		.wp-block-techniconcept-project-brand-logos,
		.wp-block-techniconcept-project-advice-banner,
		.wp-block-techniconcept-project-product-selection,
	.wp-block-techniconcept-project-icon-title-text,
	.wp-block-techniconcept-hero
	) {
	box-sizing: border-box;
	--tc-block-pad-block: var(--wp--preset--spacing--home-section-y, 3rem);
	--tc-block-margin-block: var(--wp--preset--spacing--50, 1.5rem);
	/* Longhands : un shorthand padding-block écraserait les toggles disable. */
	padding-block-start: var(--tc-block-pad-block) !important;
	padding-block-end: var(--tc-block-pad-block) !important;
	margin-block-start: var(--tc-block-margin-block) !important;
	margin-block-end: var(--tc-block-margin-block) !important;
}

:is(
		.wp-block-post-content,
		.techniconcept-site-main__content,
		.is-root-container,
		.block-editor-block-list__layout.is-root-container
	)
	> :is(
		.wp-block-techniconcept-title,
		.wp-block-techniconcept-text,
		.wp-block-techniconcept-image,
		.wp-block-techniconcept-columns,
		.wp-block-techniconcept-section-intro,
		.wp-block-techniconcept-text-image,
		.wp-block-techniconcept-gallery,
		.wp-block-techniconcept-brand-logo,
		.wp-block-techniconcept-project-service-columns,
		.wp-block-techniconcept-project-univers-grid,
		.wp-block-techniconcept-project-brand-logos,
		.wp-block-techniconcept-project-advice-banner,
		.wp-block-techniconcept-project-product-selection,
	.wp-block-techniconcept-project-icon-title-text,
	.wp-block-techniconcept-hero
	).is-padding-small {
	--tc-block-pad-block: calc(
		var(--wp--preset--spacing--home-section-y, 3rem) / 2
	);
}

:is(
		.wp-block-post-content,
		.techniconcept-site-main__content,
		.is-root-container,
		.block-editor-block-list__layout.is-root-container
	)
	> :is(
		.wp-block-techniconcept-title,
		.wp-block-techniconcept-text,
		.wp-block-techniconcept-image,
		.wp-block-techniconcept-columns,
		.wp-block-techniconcept-section-intro,
		.wp-block-techniconcept-text-image,
		.wp-block-techniconcept-gallery,
		.wp-block-techniconcept-brand-logo,
		.wp-block-techniconcept-project-service-columns,
		.wp-block-techniconcept-project-univers-grid,
		.wp-block-techniconcept-project-brand-logos,
		.wp-block-techniconcept-project-advice-banner,
		.wp-block-techniconcept-project-product-selection,
	.wp-block-techniconcept-project-icon-title-text,
	.wp-block-techniconcept-hero
	).is-disable-margin-top {
	margin-block-start: 0 !important;
}

:is(
		.wp-block-post-content,
		.techniconcept-site-main__content,
		.is-root-container,
		.block-editor-block-list__layout.is-root-container
	)
	> :is(
		.wp-block-techniconcept-title,
		.wp-block-techniconcept-text,
		.wp-block-techniconcept-image,
		.wp-block-techniconcept-columns,
		.wp-block-techniconcept-section-intro,
		.wp-block-techniconcept-text-image,
		.wp-block-techniconcept-gallery,
		.wp-block-techniconcept-brand-logo,
		.wp-block-techniconcept-project-service-columns,
		.wp-block-techniconcept-project-univers-grid,
		.wp-block-techniconcept-project-brand-logos,
		.wp-block-techniconcept-project-advice-banner,
		.wp-block-techniconcept-project-product-selection,
	.wp-block-techniconcept-project-icon-title-text,
	.wp-block-techniconcept-hero
	).is-disable-margin-bottom {
	margin-block-end: 0 !important;
}

:is(
		.wp-block-post-content,
		.techniconcept-site-main__content,
		.is-root-container,
		.block-editor-block-list__layout.is-root-container
	)
	> :is(
		.wp-block-techniconcept-title,
		.wp-block-techniconcept-text,
		.wp-block-techniconcept-image,
		.wp-block-techniconcept-columns,
		.wp-block-techniconcept-section-intro,
		.wp-block-techniconcept-text-image,
		.wp-block-techniconcept-gallery,
		.wp-block-techniconcept-brand-logo,
		.wp-block-techniconcept-project-service-columns,
		.wp-block-techniconcept-project-univers-grid,
		.wp-block-techniconcept-project-brand-logos,
		.wp-block-techniconcept-project-advice-banner,
		.wp-block-techniconcept-project-product-selection,
	.wp-block-techniconcept-project-icon-title-text,
	.wp-block-techniconcept-hero
	).is-disable-padding-top {
	padding-block-start: 0 !important;
}

:is(
		.wp-block-post-content,
		.techniconcept-site-main__content,
		.is-root-container,
		.block-editor-block-list__layout.is-root-container
	)
	> :is(
		.wp-block-techniconcept-title,
		.wp-block-techniconcept-text,
		.wp-block-techniconcept-image,
		.wp-block-techniconcept-columns,
		.wp-block-techniconcept-section-intro,
		.wp-block-techniconcept-text-image,
		.wp-block-techniconcept-gallery,
		.wp-block-techniconcept-brand-logo,
		.wp-block-techniconcept-project-service-columns,
		.wp-block-techniconcept-project-univers-grid,
		.wp-block-techniconcept-project-brand-logos,
		.wp-block-techniconcept-project-advice-banner,
		.wp-block-techniconcept-project-product-selection,
	.wp-block-techniconcept-project-icon-title-text,
	.wp-block-techniconcept-hero
	).is-disable-padding-bottom {
	padding-block-end: 0 !important;
}

@media (min-width: 768px) {
	:is(
			.wp-block-post-content,
			.techniconcept-site-main__content,
			.is-root-container,
			.block-editor-block-list__layout.is-root-container
		)
		> :is(
			.wp-block-techniconcept-title,
			.wp-block-techniconcept-text,
			.wp-block-techniconcept-image,
			.wp-block-techniconcept-columns,
			.wp-block-techniconcept-section-intro,
			.wp-block-techniconcept-text-image,
			.wp-block-techniconcept-gallery,
			.wp-block-techniconcept-brand-logo,
				.wp-block-techniconcept-project-service-columns,
			.wp-block-techniconcept-project-univers-grid,
			.wp-block-techniconcept-project-brand-logos,
			.wp-block-techniconcept-project-advice-banner,
			.wp-block-techniconcept-project-product-selection,
		.wp-block-techniconcept-project-icon-title-text,
		.wp-block-techniconcept-hero
		) {
		--tc-block-pad-block: var(
			--wp--preset--spacing--home-section-y-md,
			4rem
		);
		--tc-block-margin-block: var(--wp--preset--spacing--60, 2rem);
	}

	:is(
			.wp-block-post-content,
			.techniconcept-site-main__content,
			.is-root-container,
			.block-editor-block-list__layout.is-root-container
		)
		> :is(
			.wp-block-techniconcept-title,
			.wp-block-techniconcept-text,
			.wp-block-techniconcept-image,
			.wp-block-techniconcept-columns,
			.wp-block-techniconcept-section-intro,
			.wp-block-techniconcept-text-image,
			.wp-block-techniconcept-gallery,
			.wp-block-techniconcept-brand-logo,
				.wp-block-techniconcept-project-service-columns,
			.wp-block-techniconcept-project-univers-grid,
			.wp-block-techniconcept-project-brand-logos,
			.wp-block-techniconcept-project-advice-banner,
			.wp-block-techniconcept-project-product-selection,
		.wp-block-techniconcept-project-icon-title-text,
		.wp-block-techniconcept-hero
		).is-padding-small {
		--tc-block-pad-block: calc(
			var(--wp--preset--spacing--home-section-y-md, 4rem) / 2
		);
	}
}

@media (min-width: 1024px) {
	:is(
			.wp-block-post-content,
			.techniconcept-site-main__content,
			.is-root-container,
			.block-editor-block-list__layout.is-root-container
		)
		> :is(
			.wp-block-techniconcept-title,
			.wp-block-techniconcept-text,
			.wp-block-techniconcept-image,
			.wp-block-techniconcept-columns,
			.wp-block-techniconcept-section-intro,
			.wp-block-techniconcept-text-image,
			.wp-block-techniconcept-gallery,
			.wp-block-techniconcept-brand-logo,
				.wp-block-techniconcept-project-service-columns,
			.wp-block-techniconcept-project-univers-grid,
			.wp-block-techniconcept-project-brand-logos,
			.wp-block-techniconcept-project-advice-banner,
			.wp-block-techniconcept-project-product-selection,
		.wp-block-techniconcept-project-icon-title-text,
		.wp-block-techniconcept-hero
		) {
		--tc-block-pad-block: var(
			--wp--preset--spacing--home-section-y-lg,
			5rem
		);
		--tc-block-margin-block: var(--wp--preset--spacing--65, 2.5rem);
	}

	:is(
			.wp-block-post-content,
			.techniconcept-site-main__content,
			.is-root-container,
			.block-editor-block-list__layout.is-root-container
		)
		> :is(
			.wp-block-techniconcept-title,
			.wp-block-techniconcept-text,
			.wp-block-techniconcept-image,
			.wp-block-techniconcept-columns,
			.wp-block-techniconcept-section-intro,
			.wp-block-techniconcept-text-image,
			.wp-block-techniconcept-gallery,
			.wp-block-techniconcept-brand-logo,
				.wp-block-techniconcept-project-service-columns,
			.wp-block-techniconcept-project-univers-grid,
			.wp-block-techniconcept-project-brand-logos,
			.wp-block-techniconcept-project-advice-banner,
			.wp-block-techniconcept-project-product-selection,
		.wp-block-techniconcept-project-icon-title-text,
		.wp-block-techniconcept-hero
		).is-padding-small {
		--tc-block-pad-block: calc(
			var(--wp--preset--spacing--home-section-y-lg, 5rem) / 2
		);
	}
}


/*
 * Hero — filet toggles Espacement (éditeur : classes sur useBlockProps éventuellement
 * imbriqué ; front : render_block). Sans exiger le combinateur enfant direct.
 */
:is(
		.wp-block-post-content,
		.techniconcept-site-main__content,
		.is-root-container,
		.block-editor-block-list__layout.is-root-container
	)
	.wp-block-techniconcept-hero.is-disable-margin-top {
	margin-block-start: 0 !important;
}

:is(
		.wp-block-post-content,
		.techniconcept-site-main__content,
		.is-root-container,
		.block-editor-block-list__layout.is-root-container
	)
	.wp-block-techniconcept-hero.is-disable-margin-bottom {
	margin-block-end: 0 !important;
}

:is(
		.wp-block-post-content,
		.techniconcept-site-main__content,
		.is-root-container,
		.block-editor-block-list__layout.is-root-container
	)
	.wp-block-techniconcept-hero.is-disable-padding-top {
	padding-block-start: 0 !important;
	--tc-hero-bg-inset-start: 0px;
}

:is(
		.wp-block-post-content,
		.techniconcept-site-main__content,
		.is-root-container,
		.block-editor-block-list__layout.is-root-container
	)
	.wp-block-techniconcept-hero.is-disable-padding-bottom {
	padding-block-end: 0 !important;
	--tc-hero-bg-inset-end: 0px;
}

/*
 * Hero Texte + image collé sous la nav : flush haut (pas de rythme section).
 */
:is(
		.wp-block-post-content,
		.techniconcept-site-main__content,
		.is-root-container,
		.block-editor-block-list__layout.is-root-container
	)
	> .wp-block-techniconcept-text-image.hero-special-image {
	padding-block-start: 0 !important;
	padding-block-end: 0 !important;
	margin-block-start: 0 !important;
}

/*
 * Titre / texte / icon-title-text IMBRIQUÉS (pas racine) : espacement local opt-in.
 * ITT dans une colonne : même échelle locale ; défaut petit (is-padding-small).
 * Combinateur `> *` : au moins un ancêtre entre le conteneur de contenu et le
 * bloc (profondeur >= 2). Pas de `.techniconcept-site-main__content` ici :
 * `site-main * .title.is-padding-large` matchait les titres racines sous
 * `.wp-block-post-content` et écrasait le rythme section (éditeur OK, front KO).
 * Opt-in via is-padding-large|small ; toggles disable sur le pad local.
 * Échelle locale (tokens 40/45/50), plus compacte que le rythme section.
 */
:is(
		.wp-block-post-content,
		.is-root-container,
		.block-editor-block-list__layout.is-root-container
	)
	> *
	:is(
		.wp-block-techniconcept-title,
		.wp-block-techniconcept-text,
		.wp-block-techniconcept-project-icon-title-text
	):is(.is-padding-large, .is-padding-small) {
	box-sizing: border-box;
	--tc-local-pad-block: var(--wp--preset--spacing--40, 1rem);
	--tc-local-margin-block: var(--wp--preset--spacing--40, 1rem);
	padding-block-start: var(--tc-local-pad-block) !important;
	padding-block-end: var(--tc-local-pad-block) !important;
	margin-block-start: var(--tc-local-margin-block) !important;
	margin-block-end: var(--tc-local-margin-block) !important;
}

:is(
		.wp-block-post-content,
		.is-root-container,
		.block-editor-block-list__layout.is-root-container
	)
	> *
	:is(
		.wp-block-techniconcept-title,
		.wp-block-techniconcept-text,
		.wp-block-techniconcept-project-icon-title-text
	).is-padding-small {
	--tc-local-pad-block: calc(var(--wp--preset--spacing--40, 1rem) / 2);
}

:is(
		.wp-block-post-content,
		.is-root-container,
		.block-editor-block-list__layout.is-root-container
	)
	> *
	:is(
		.wp-block-techniconcept-title,
		.wp-block-techniconcept-text,
		.wp-block-techniconcept-project-icon-title-text
	).is-disable-padding-top {
	padding-block-start: 0 !important;
}

:is(
		.wp-block-post-content,
		.is-root-container,
		.block-editor-block-list__layout.is-root-container
	)
	> *
	:is(
		.wp-block-techniconcept-title,
		.wp-block-techniconcept-text,
		.wp-block-techniconcept-project-icon-title-text
	).is-disable-padding-bottom {
	padding-block-end: 0 !important;
}

:is(
		.wp-block-post-content,
		.is-root-container,
		.block-editor-block-list__layout.is-root-container
	)
	> *
	:is(
		.wp-block-techniconcept-title,
		.wp-block-techniconcept-text,
		.wp-block-techniconcept-project-icon-title-text
	).is-disable-margin-top {
	margin-block-start: 0 !important;
}

:is(
		.wp-block-post-content,
		.is-root-container,
		.block-editor-block-list__layout.is-root-container
	)
	> *
	:is(
		.wp-block-techniconcept-title,
		.wp-block-techniconcept-text,
		.wp-block-techniconcept-project-icon-title-text
	).is-disable-margin-bottom {
	margin-block-end: 0 !important;
}

@media (min-width: 768px) {
	:is(
			.wp-block-post-content,
			.is-root-container,
			.block-editor-block-list__layout.is-root-container
		)
		> *
		:is(
		.wp-block-techniconcept-title,
		.wp-block-techniconcept-text,
		.wp-block-techniconcept-project-icon-title-text
	):is(.is-padding-large, .is-padding-small) {
		--tc-local-pad-block: var(--wp--preset--spacing--45, 1.25rem);
		--tc-local-margin-block: var(--wp--preset--spacing--45, 1.25rem);
	}

	:is(
			.wp-block-post-content,
			.is-root-container,
			.block-editor-block-list__layout.is-root-container
		)
		> *
		:is(
		.wp-block-techniconcept-title,
		.wp-block-techniconcept-text,
		.wp-block-techniconcept-project-icon-title-text
	).is-padding-small {
		--tc-local-pad-block: calc(var(--wp--preset--spacing--45, 1.25rem) / 2);
	}
}

@media (min-width: 1024px) {
	:is(
			.wp-block-post-content,
			.is-root-container,
			.block-editor-block-list__layout.is-root-container
		)
		> *
		:is(
		.wp-block-techniconcept-title,
		.wp-block-techniconcept-text,
		.wp-block-techniconcept-project-icon-title-text
	):is(.is-padding-large, .is-padding-small) {
		--tc-local-pad-block: var(--wp--preset--spacing--50, 1.5rem);
		--tc-local-margin-block: var(--wp--preset--spacing--50, 1.5rem);
	}

	:is(
			.wp-block-post-content,
			.is-root-container,
			.block-editor-block-list__layout.is-root-container
		)
		> *
		:is(
		.wp-block-techniconcept-title,
		.wp-block-techniconcept-text,
		.wp-block-techniconcept-project-icon-title-text
	).is-padding-small {
		--tc-local-pad-block: calc(var(--wp--preset--spacing--50, 1.5rem) / 2);
	}
}

/*
 * Bouton CTA (`techniconcept/button`) : rythme LOCAL always-on.
 * Jamais le rythme section (3/4/5 rem) — trop large pour un atome.
 * Échelle locale (40/45/50) ; Petit = moitié ; toggles disable = 0.
 * S’applique à toute profondeur (racine ou imbriqué).
 */
.wp-block-techniconcept-button {
	box-sizing: border-box;
	--tc-local-pad-block: var(--wp--preset--spacing--40, 1rem);
	--tc-local-margin-block: var(--wp--preset--spacing--40, 1rem);
	padding-block-start: var(--tc-local-pad-block) !important;
	padding-block-end: var(--tc-local-pad-block) !important;
	margin-block-start: var(--tc-local-margin-block) !important;
	margin-block-end: var(--tc-local-margin-block) !important;
}

.wp-block-techniconcept-button.is-padding-small {
	--tc-local-pad-block: calc(var(--wp--preset--spacing--40, 1rem) / 2);
}

.wp-block-techniconcept-button.is-disable-padding-top {
	padding-block-start: 0 !important;
}

.wp-block-techniconcept-button.is-disable-padding-bottom {
	padding-block-end: 0 !important;
}

.wp-block-techniconcept-button.is-disable-margin-top {
	margin-block-start: 0 !important;
}

.wp-block-techniconcept-button.is-disable-margin-bottom {
	margin-block-end: 0 !important;
}

@media (min-width: 768px) {
	.wp-block-techniconcept-button {
		--tc-local-pad-block: var(--wp--preset--spacing--45, 1.25rem);
		--tc-local-margin-block: var(--wp--preset--spacing--45, 1.25rem);
	}

	.wp-block-techniconcept-button.is-padding-small {
		--tc-local-pad-block: calc(var(--wp--preset--spacing--45, 1.25rem) / 2);
	}
}

@media (min-width: 1024px) {
	.wp-block-techniconcept-button {
		--tc-local-pad-block: var(--wp--preset--spacing--50, 1.5rem);
		--tc-local-margin-block: var(--wp--preset--spacing--50, 1.5rem);
	}

	.wp-block-techniconcept-button.is-padding-small {
		--tc-local-pad-block: calc(var(--wp--preset--spacing--50, 1.5rem) / 2);
	}
}
