/* =========================================================================
   BK Base — Surfaces
   Miroir de la collection Figma « Surface » (design-only) :
   le fond d'une section (base / base-2 / secondary / primary) fixe
   les couleurs des titres, textes, eyebrows et bordures.
   Uniquement des tokens theme.json (var(--wp--preset--color--*)).
   ========================================================================= */

:root,
.has-base-background-color,
.has-base-2-background-color {
	--bk-bg: var(--wp--preset--color--base);
	--bk-heading: var(--wp--preset--color--secondary);
	--bk-text: var(--wp--preset--color--contrast);
	--bk-muted: var(--wp--preset--color--contrast-2);
	--bk-eyebrow: var(--wp--preset--color--primary);
	--bk-border: var(--wp--preset--color--border);
}

.has-base-2-background-color {
	--bk-bg: var(--wp--preset--color--base-2);
}

.has-secondary-background-color {
	--bk-bg: var(--wp--preset--color--secondary);
	--bk-heading: var(--wp--preset--color--base);
	--bk-text: var(--wp--preset--color--base);
	--bk-muted: var(--wp--preset--color--border);
	--bk-eyebrow: var(--wp--preset--color--accent);
	--bk-border: var(--wp--preset--color--contrast-2);
}

.has-primary-background-color {
	--bk-bg: var(--wp--preset--color--primary);
	--bk-heading: var(--wp--preset--color--base);
	--bk-text: var(--wp--preset--color--base);
	--bk-muted: var(--wp--preset--color--border);
	--bk-eyebrow: var(--wp--preset--color--base);
	--bk-border: var(--wp--preset--color--primary-hover);
}

:where(.bk-section, .bk-part, .bk-cta-card, .bk-topbar) {
	color: var(--bk-text);
}

:where(.bk-section, .bk-part, .bk-cta-card) :is(h1, h2, h3, h4, h5, h6) {
	color: var(--bk-heading);
}

:where(.bk-section, .bk-part, .bk-cta-card) p {
	color: var(--bk-muted);
}

:where(.bk-section, .bk-part, .bk-cta-card) .bk-strong {
	color: var(--bk-text);
	font-weight: 600;
}

:where(.bk-section, .bk-part, .bk-cta-card) a:not(.wp-element-button) {
	color: inherit;
}

/* Liens et site-title restent lisibles sur fonds sombres */
:where(.has-secondary-background-color, .has-primary-background-color) :is(a:not(.wp-element-button), .wp-block-site-title a, .wp-block-navigation) {
	color: var(--bk-text);
}

/* Bouton outline = style core "is-style-outline" : suit la surface */
.wp-block-button.is-style-outline > .wp-block-button__link {
	color: var(--bk-heading);
	border-color: currentColor;
	background: transparent;
}

.wp-block-button.is-style-outline > .wp-block-button__link:hover {
	color: var(--bk-bg);
	background: var(--bk-heading);
	border-color: var(--bk-heading);
}

/* Sur fond primary, le bouton plein (primary) deviendrait invisible : il passe en outline */
.has-primary-background-color .wp-block-button:not(.is-style-outline) > .wp-block-button__link {
	color: var(--wp--preset--color--base);
	background: transparent;
	border: var(--wp--custom--border-width) solid currentColor;
}

/* =========================================================================
   Styles de blocs (register_block_style) — tokens theme.json uniquement
   ========================================================================= */

/* Paragraphe avec l'apparence d'un titre (balise <p>) */
:is(p, div).is-style-title-h2,
:is(p, div).is-style-title-h3 {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 700;
	line-height: var(--wp--custom--line-height--heading);
	color: var(--bk-heading, var(--wp--preset--color--secondary)) !important;
}
.is-style-title-h2 { font-size: var(--wp--preset--font-size--xxx-large) !important; }
.is-style-title-h3 { font-size: var(--wp--preset--font-size--xx-large) !important; }

p.is-style-eyebrow {
	font-size: var(--wp--preset--font-size--small) !important;
	font-weight: 600;
	color: var(--bk-eyebrow, var(--wp--preset--color--primary)) !important;
}

p.is-style-lead {
	font-size: var(--wp--preset--font-size--large) !important;
	line-height: var(--wp--custom--line-height--body);
	color: var(--bk-text, var(--wp--preset--color--contrast)) !important;
}

p.is-style-badge {
	width: fit-content;
	font-size: var(--wp--preset--font-size--small) !important;
	font-weight: 600;
	line-height: var(--wp--custom--line-height--body);
	color: var(--bk-heading, var(--wp--preset--color--secondary)) !important;
	background: var(--wp--preset--color--base-2);
	border-radius: var(--wp--custom--radius--full);
	padding: var(--wp--preset--spacing--20) var(--wp--preset--spacing--30);
}
.has-text-align-center.is-style-badge { margin-inline: auto; }
.has-text-align-right.is-style-badge { margin-inline-start: auto; }

p.is-style-stat {
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--xxx-large) !important;
	font-weight: 700;
	line-height: var(--wp--custom--line-height--tight);
	color: var(--bk-eyebrow, var(--wp--preset--color--primary)) !important;
}

p.is-style-link-arrow { font-weight: 600; }
p.is-style-link-arrow a {
	color: var(--wp--preset--color--primary) !important;
	text-decoration: none;
}
p.is-style-link-arrow a::after { content: " →"; }
p.is-style-link-arrow a:hover { color: var(--wp--preset--color--primary-hover) !important; }

/* Group « Card » : la justification (toolbar) aligne aussi le texte */
.wp-block-group.is-style-card {
	background-color: var(--bk-bg, var(--wp--preset--color--base));
	border: var(--wp--custom--border-width) solid var(--bk-border, var(--wp--preset--color--border));
	border-radius: var(--wp--custom--radius--l);
	padding: var(--wp--preset--spacing--50);
	box-sizing: border-box;
	height: 100%;
}
.wp-block-group.is-style-card.is-content-justification-center { text-align: center; }
.wp-block-group.is-style-card.is-content-justification-right { text-align: right; }
.wp-block-group.is-style-card .wp-block-image:not(.bk-icon),
.wp-block-group.is-style-card .wp-block-image:not(.bk-icon) img { width: 100%; }
.wp-block-group.is-style-card .wp-block-image:not(.bk-icon) img {
	aspect-ratio: 16 / 9;
	object-fit: cover;
	border-radius: var(--wp--custom--radius--m);
}

/* Liste « Checklist » */
ul.is-style-checklist {
	list-style: none;
	padding-left: 0;
	display: grid;
	gap: var(--wp--preset--spacing--30);
}
ul.is-style-checklist li {
	position: relative;
	padding-left: calc(var(--wp--preset--spacing--40) + var(--wp--preset--spacing--20));
	text-align: left;
}
ul.is-style-checklist li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.15em;
	width: var(--wp--preset--spacing--40);
	height: var(--wp--preset--spacing--40);
	border-radius: var(--wp--custom--radius--full);
	background-color: var(--wp--preset--color--primary);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22'%3E%3Cpath d='M6.5 11.3l3 2.9 6-6.2' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-size: 100% 100%;
}
.is-content-justification-center ul.is-style-checklist { justify-content: center; }

/* Boutons « Ghost » et « Lien » */
.wp-block-button.is-style-ghost > .wp-block-button__link {
	background: transparent;
	color: var(--bk-heading, var(--wp--preset--color--secondary));
}
.wp-block-button.is-style-ghost > .wp-block-button__link:hover {
	background: var(--wp--preset--color--base-2);
	color: var(--wp--preset--color--secondary);
}
.wp-block-button.is-style-link > .wp-block-button__link {
	background: transparent;
	padding: 0;
	color: var(--wp--preset--color--primary);
}
.wp-block-button.is-style-link > .wp-block-button__link::after { content: " →"; }
.wp-block-button.is-style-link > .wp-block-button__link:hover { color: var(--wp--preset--color--primary-hover); }
