/**
 * Chrome boutons partagé — rayon pill (HUG) + hover fill-from-bottom (HealthPlus).
 * Couleurs = tokens thème / --tc-button-hover-* (pas de couleurs des sites de référence).
 * Consommé via @import + enqueue global (front + éditeur) pour ne pas dépendre du build webpack.
 */

.wp-block-techniconcept-button,
.ff-default .ff-btn-primary:not(.ff_btn_no_style),
.fluentform .ff-btn-primary:not(.ff_btn_no_style),
.ff-default .ff-btn-submit:not(.ff_btn_no_style),
.fluentform .ff-btn-submit:not(.ff_btn_no_style),

.techniconcept-doctor-directory__submit,
.techniconcept-site-header-search__submit,
.techniconcept-site-primary-nav__intro-cta,
.tc-linked-topic__link {
	/* Hover fill = primary Daler ; repos = outline (feuilles locales). */
	--tc-button-fill: var(--wp--preset--color--primary, #008476);
	--tc-button-fill-fg: var(--wp--preset--color--on-primary, #ffffff);
	position: relative;
	overflow: hidden;
	isolation: isolate;
	border-radius: var(--wp--custom--radius--pill, 100px);
	/* Form controls (<button>) n'héritent pas la police : forcer Barlow + corps. */
	font-family: var(--wp--preset--font-family--barlow), Barlow, system-ui, sans-serif;
	font-size: var(--wp--preset--font-size--body, 1rem);
	/* Graisse normale sur tous les boutons du site. */
	font-weight: 400;
	line-height: 1.25;
	letter-spacing: 0.02em;
	/* Casse libre : respecter le libelle edite. */
	text-transform: none;
	transition:
		color 0.75s ease,
		background-color 0.75s ease,
		border-color 0.75s ease,
		box-shadow 0.75s ease,
		filter 0.75s ease;
	/* Texte / contenu au-dessus du disque ::before (boutons natifs inclus). */
	z-index: 0;
}

/*
 * CTA natifs / liens texte : inline-block pour padding + alignement stables.
 */
.ff-default .ff-btn-primary:not(.ff_btn_no_style),
.fluentform .ff-btn-primary:not(.ff_btn_no_style),
.ff-default .ff-btn-submit:not(.ff_btn_no_style),
.fluentform .ff-btn-submit:not(.ff_btn_no_style),
.techniconcept-doctor-directory__submit,
.techniconcept-site-header-search__submit,
.techniconcept-site-primary-nav__intro-cta,
.techniconcept-site-primary-nav__list a.techniconcept-site-primary-nav__intro-cta,
.tc-linked-topic__link,
.wp-block-techniconcept-latest-posts__more,
.tc-post-teaser__more {
	display: inline-block;
	text-align: center;
	vertical-align: middle;
	box-sizing: border-box;
}

/*
 * Outline site au repos (fond blanc, texte + bordure primary).
 * Spécificité >= build webpack (`:not(.has-background)`) pour gagner sans recompile.
 * Mega intro-cta : reste géré dans site-primary-nav (panneau coloré).
 */
.wp-block-techniconcept-button:not(.has-background),
.wp-block-techniconcept-button.has-primary-background-color,
.ff-default .ff-btn-primary:not(.ff_btn_no_style),
.fluentform .ff-btn-primary:not(.ff_btn_no_style),
.ff-default .ff-btn-submit:not(.ff_btn_no_style),
.fluentform .ff-btn-submit:not(.ff_btn_no_style),
.techniconcept-doctor-directory__submit,
.techniconcept-site-header-search__submit {
	background-color: var(--wp--preset--color--surface, #ffffff);
	color: var(--wp--preset--color--primary, #008476);
	border: 1px solid var(--wp--preset--color--primary, #008476);
	box-shadow: none;
}

/*
 * CTA paves rubriques / actualites : fond = fond zone texte carte
 * (ex. surface-muted), pas blanc force — sinon écart visible entre les deux.
 */
.tc-linked-topic__link,
.wp-block-techniconcept-latest-posts__more {
	background-color: var(
		--tc-linked-topic-card-bg,
		var(
			--tc-latest-posts-card-bg,
			var(--wp--preset--color--surface, #ffffff)
		)
	);
	color: var(--wp--preset--color--primary, #008476);
	border: 1px solid var(--wp--preset--color--primary, #008476);
	box-shadow: none;
	/* Ecrase font-size body 1rem du chrome partage → parite __more 0.875rem. */
	font-size: 0.875rem;
	line-height: 1.2;
}

.wp-block-techniconcept-button:not(.has-text-color),
.wp-block-techniconcept-button.has-on-primary-color {
	color: var(--wp--preset--color--primary, #008476);
}

/* Couleurs hover custom (éditeur) → fill + texte, avec repli tokens. */
.wp-block-techniconcept-button.has-hover-styles {
	--tc-button-fill: var(
		--tc-button-hover-bg,
		var(--wp--preset--color--secondary, #008476)
	);
	--tc-button-fill-fg: var(
		--tc-button-hover-color,
		var(--wp--preset--color--on-secondary, #ffffff)
	);
}

/*
 * Cercle sous le bas du bouton ; au hover/focus-visible il remonte et remplit le pill.
 * z-index -1 dans le contexte d'isolation pour rester sous le label.
 */
.wp-block-techniconcept-button::before,
.ff-default .ff-btn-primary:not(.ff_btn_no_style)::before,
.fluentform .ff-btn-primary:not(.ff_btn_no_style)::before,
.ff-default .ff-btn-submit:not(.ff_btn_no_style)::before,
.fluentform .ff-btn-submit:not(.ff_btn_no_style)::before,
.techniconcept-doctor-directory__submit::before,
.techniconcept-site-header-search__submit::before,
.techniconcept-site-primary-nav__intro-cta::before,
.tc-linked-topic__link::before {
	content: '';
	position: absolute;
	left: 50%;
	top: 100%;
	z-index: -1;
	/* Largeur généreuse pour couvrir aussi les boutons hauts / pleine largeur. */
	width: 220%;
	aspect-ratio: 1 / 1;
	border-radius: 50%;
	background-color: var(--tc-button-fill);
	transform: translate3d(-50%, 0, 0);
	/* Remontée du disque volontairement lente (UX). */
	transition: top 0.85s cubic-bezier(0.22, 1, 0.36, 1);
	pointer-events: none;
}

/* Clavier : même fill que le hover. */
.wp-block-techniconcept-button:focus-within::before,
.ff-default .ff-btn-primary:not(.ff_btn_no_style):focus-visible::before,
.fluentform .ff-btn-primary:not(.ff_btn_no_style):focus-visible::before,
.ff-default .ff-btn-submit:not(.ff_btn_no_style):focus-visible::before,
.fluentform .ff-btn-submit:not(.ff_btn_no_style):focus-visible::before,

.techniconcept-doctor-directory__submit:focus-visible::before,
.techniconcept-site-header-search__submit:focus-visible::before,
.techniconcept-site-primary-nav__intro-cta:focus-visible::before,
.tc-linked-topic__link:not(.tc-linked-topic__link-preview):focus-visible::before {
	top: -160%;
}

.wp-block-techniconcept-button:focus-within:not(.is-disabled):not(:disabled):not(
		:has(a[aria-disabled='true'])
	),
.ff-default .ff-btn-primary:not(.ff_btn_no_style):focus-visible,
.fluentform .ff-btn-primary:not(.ff_btn_no_style):focus-visible,
.ff-default .ff-btn-submit:not(.ff_btn_no_style):focus-visible,
.fluentform .ff-btn-submit:not(.ff_btn_no_style):focus-visible,
.techniconcept-doctor-directory__submit:focus-visible:not(:disabled),
.techniconcept-site-header-search__submit:focus-visible:not(:disabled),
.techniconcept-site-primary-nav__intro-cta:focus-visible,
.techniconcept-site-primary-nav__list a.techniconcept-site-primary-nav__intro-cta:focus-visible,
.tc-linked-topic__link:not(.tc-linked-topic__link-preview):focus-visible {
	color: var(--tc-button-fill-fg);
	filter: none;
	box-shadow: none;
}

/* Souris fine uniquement — évite le sticky :hover tactile. */
@media (hover: hover) and (pointer: fine) {
	.wp-block-techniconcept-button:hover::before,
	.ff-default .ff-btn-primary:not(.ff_btn_no_style):hover::before,
	.fluentform .ff-btn-primary:not(.ff_btn_no_style):hover::before,
	.ff-default .ff-btn-submit:not(.ff_btn_no_style):hover::before,
	.fluentform .ff-btn-submit:not(.ff_btn_no_style):hover::before,
	.techniconcept-doctor-directory__submit:hover::before,
	.techniconcept-site-header-search__submit:hover::before,
	.techniconcept-site-primary-nav__intro-cta:hover::before,
	.techniconcept-site-primary-nav__list a.techniconcept-site-primary-nav__intro-cta:hover::before,
	.tc-linked-topic__link:not(.tc-linked-topic__link-preview):hover::before {
		top: -160%;
	}

	.wp-block-techniconcept-button:hover:not(.is-disabled):not(:disabled):not(
			:has(a[aria-disabled='true'])
		),
	.ff-default .ff-btn-primary:not(.ff_btn_no_style):hover,
	.fluentform .ff-btn-primary:not(.ff_btn_no_style):hover,
	.ff-default .ff-btn-submit:not(.ff_btn_no_style):hover,
	.fluentform .ff-btn-submit:not(.ff_btn_no_style):hover,
	.techniconcept-doctor-directory__submit:hover:not(:disabled),
	.techniconcept-site-header-search__submit:hover:not(:disabled),
	.techniconcept-site-primary-nav__intro-cta:hover,
	.techniconcept-site-primary-nav__list a.techniconcept-site-primary-nav__intro-cta:hover,
	.tc-linked-topic__link:not(.tc-linked-topic__link-preview):hover {
		color: var(--tc-button-fill-fg);
		filter: none;
		box-shadow: none;
	}
}

/*
 * Skin Fluent Forms : fond bleu et opacity .8 au hover/focus.
 * Sélecteur élément + classes pour passer devant le plugin.
 * Le disque ::before des autres boutons n'est pas touché.
 */
.ff-default button.ff-btn-primary:not(.ff_btn_no_style):not(:disabled):hover,
.ff-default button.ff-btn-primary:not(.ff_btn_no_style):not(:disabled):focus,
.fluentform button.ff-btn-primary:not(.ff_btn_no_style):not(:disabled):hover,
.fluentform button.ff-btn-primary:not(.ff_btn_no_style):not(:disabled):focus,
.ff-default button.ff-btn-submit:not(.ff_btn_no_style):not(:disabled):hover,
.ff-default button.ff-btn-submit:not(.ff_btn_no_style):not(:disabled):focus,
.fluentform button.ff-btn-submit:not(.ff_btn_no_style):not(:disabled):hover,
.fluentform button.ff-btn-submit:not(.ff_btn_no_style):not(:disabled):focus,
.ff-default input.ff-btn-primary:not(.ff_btn_no_style):not(:disabled):hover,
.ff-default input.ff-btn-primary:not(.ff_btn_no_style):not(:disabled):focus,
.fluentform input.ff-btn-primary:not(.ff_btn_no_style):not(:disabled):hover,
.fluentform input.ff-btn-primary:not(.ff_btn_no_style):not(:disabled):focus,
.ff-default input.ff-btn-submit:not(.ff_btn_no_style):not(:disabled):hover,
.ff-default input.ff-btn-submit:not(.ff_btn_no_style):not(:disabled):focus,
.fluentform input.ff-btn-submit:not(.ff_btn_no_style):not(:disabled):hover,
.fluentform input.ff-btn-submit:not(.ff_btn_no_style):not(:disabled):focus {
	background-color: var(--wp--preset--color--primary, #008476);
	border-color: var(--wp--preset--color--primary, #008476);
	color: var(--wp--preset--color--on-primary, #ffffff);
	opacity: 1;
}

/*
 * Padding site pour tous les boutons (blocs + FF + header + nav + annuaire).
 * Intro CTA : `.…__list a.…` bat `.…__list a { padding: 0.25rem 0 }`.
 */
.wp-block-techniconcept-button a,
.ff-default .ff-btn-primary:not(.ff_btn_no_style),
.fluentform .ff-btn-primary:not(.ff_btn_no_style),
.ff-default .ff-btn-submit:not(.ff_btn_no_style),
.fluentform .ff-btn-submit:not(.ff_btn_no_style),
.techniconcept-doctor-directory__submit,
.techniconcept-site-header-search__submit,
.techniconcept-site-primary-nav__intro-cta,
.techniconcept-site-primary-nav__list a.techniconcept-site-primary-nav__intro-cta,
.tc-linked-topic__link {
	padding: 0.45rem 0.9rem;
}

/* Rubriques + Actualites : padding compact (parite __more). */
.tc-linked-topic__link,
.wp-block-techniconcept-latest-posts__more {
	padding-top: 0.2rem;
	padding-right: 0.65rem;
	padding-bottom: 0.2rem;
	padding-left: 0.65rem;
}

/* Label au-dessus du fill (lien bloc bouton). */
.wp-block-techniconcept-button a {
	position: relative;
	z-index: 1;
}

/* Disabled : pas de fill, pas d’inversion (bloc + FF + submits). */
.wp-block-techniconcept-button:disabled:hover::before,
.wp-block-techniconcept-button:disabled:focus-within::before,
.wp-block-techniconcept-button.is-disabled:hover::before,
.wp-block-techniconcept-button.is-disabled:focus-within::before,
.wp-block-techniconcept-button:has(a[aria-disabled='true']):hover::before,
.wp-block-techniconcept-button:has(a[aria-disabled='true']):focus-within::before,
.ff-default .ff-btn-primary:not(.ff_btn_no_style):disabled:hover::before,
.ff-default .ff-btn-primary:not(.ff_btn_no_style):disabled:focus-visible::before,
.fluentform .ff-btn-primary:not(.ff_btn_no_style):disabled:hover::before,
.fluentform .ff-btn-primary:not(.ff_btn_no_style):disabled:focus-visible::before,
.ff-default .ff-btn-submit:not(.ff_btn_no_style):disabled:hover::before,
.ff-default .ff-btn-submit:not(.ff_btn_no_style):disabled:focus-visible::before,
.fluentform .ff-btn-submit:not(.ff_btn_no_style):disabled:hover::before,
.fluentform .ff-btn-submit:not(.ff_btn_no_style):disabled:focus-visible::before,
.techniconcept-doctor-directory__submit:disabled:hover::before,
.techniconcept-doctor-directory__submit:disabled:focus-visible::before,
.techniconcept-site-header-search__submit:disabled:hover::before,
.techniconcept-site-header-search__submit:disabled:focus-visible::before {
	top: 100%;
}

.wp-block-techniconcept-button:disabled:hover,
.wp-block-techniconcept-button:disabled:focus-within,
.wp-block-techniconcept-button.is-disabled:hover,
.wp-block-techniconcept-button.is-disabled:focus-within,
.wp-block-techniconcept-button:has(a[aria-disabled='true']):hover,
.wp-block-techniconcept-button:has(a[aria-disabled='true']):focus-within,
.ff-default .ff-btn-primary:not(.ff_btn_no_style):disabled:hover,
.fluentform .ff-btn-primary:not(.ff_btn_no_style):disabled:hover,
.ff-default .ff-btn-submit:not(.ff_btn_no_style):disabled:hover,
.fluentform .ff-btn-submit:not(.ff_btn_no_style):disabled:hover,

/* Forced colors : pas de disque décoratif — contour système. */
@media (forced-colors: active) {
	.wp-block-techniconcept-button::before,
	.ff-default .ff-btn-primary:not(.ff_btn_no_style)::before,
	.fluentform .ff-btn-primary:not(.ff_btn_no_style)::before,
	.ff-default .ff-btn-submit:not(.ff_btn_no_style)::before,
	.fluentform .ff-btn-submit:not(.ff_btn_no_style)::before,
		.techniconcept-doctor-directory__submit::before,
	.techniconcept-site-header-search__submit::before,
	.techniconcept-site-primary-nav__intro-cta::before,
	.tc-linked-topic__link::before {
		display: none;
	}
}

/* Reduced motion : pas d’anim fill — swap couleur immédiat. */
@media (prefers-reduced-motion: reduce) {
	.wp-block-techniconcept-button::before,
	.ff-default .ff-btn-primary:not(.ff_btn_no_style)::before,
	.fluentform .ff-btn-primary:not(.ff_btn_no_style)::before,
	.ff-default .ff-btn-submit:not(.ff_btn_no_style)::before,
	.fluentform .ff-btn-submit:not(.ff_btn_no_style)::before,
		.techniconcept-doctor-directory__submit::before,
	.techniconcept-site-header-search__submit::before,
	.techniconcept-site-primary-nav__intro-cta::before,
	.tc-linked-topic__link::before {
		display: none;
		transition: none;
	}

	.wp-block-techniconcept-button:hover:not(.is-disabled):not(:disabled):not(
			:has(a[aria-disabled='true'])
		),
	.wp-block-techniconcept-button:focus-within:not(.is-disabled):not(
			:disabled
		):not(:has(a[aria-disabled='true'])),
	.ff-default .ff-btn-primary:not(.ff_btn_no_style):hover:not(:disabled),
	.fluentform .ff-btn-primary:not(.ff_btn_no_style):hover:not(:disabled),
	.ff-default .ff-btn-submit:not(.ff_btn_no_style):hover:not(:disabled),
	.fluentform .ff-btn-submit:not(.ff_btn_no_style):hover:not(:disabled),
	.ff-default .ff-btn-primary:not(.ff_btn_no_style):focus-visible:not(:disabled),
	.fluentform .ff-btn-primary:not(.ff_btn_no_style):focus-visible:not(:disabled),
	.ff-default .ff-btn-submit:not(.ff_btn_no_style):focus-visible:not(:disabled),
	.fluentform .ff-btn-submit:not(.ff_btn_no_style):focus-visible:not(:disabled),
		.techniconcept-doctor-directory__submit:hover:not(:disabled),
	.techniconcept-doctor-directory__submit:focus-visible:not(:disabled),
	.techniconcept-site-header-search__submit:hover:not(:disabled),
	.techniconcept-site-header-search__submit:focus-visible:not(:disabled),
	.techniconcept-site-primary-nav__intro-cta:hover,
	.techniconcept-site-primary-nav__intro-cta:focus-visible,
	.tc-linked-topic__link:not(.tc-linked-topic__link-preview):hover,
	.tc-linked-topic__link:not(.tc-linked-topic__link-preview):focus-visible {
		background-color: var(--tc-button-fill);
		color: var(--tc-button-fill-fg);
		transition: none;
	}

	.wp-block-techniconcept-button.has-hover-styles:hover:not(.is-disabled):not(
			:disabled
		):not(:has(a[aria-disabled='true'])),
	.wp-block-techniconcept-button.has-hover-styles:focus-within:not(
			.is-disabled
		):not(:disabled):not(:has(a[aria-disabled='true'])) {
		background-color: var(
			--tc-button-hover-bg,
			var(--wp--preset--color--secondary, #008476)
		);
		color: var(
			--tc-button-hover-color,
			var(--wp--preset--color--on-secondary, #ffffff)
		);
	}
}
