/**
 * Global rules theme.json can't express.
 * (Ported from prototype base/reset.css + base/typography.css + card.css accents.)
 */
html {
	scroll-behavior: smooth;
	scroll-padding-top: calc(var(--wp-admin--admin-bar--height, 0px) + 8.5rem);
}

body {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	overscroll-behavior-y: none;
}

::selection {
	background: var(--wp--preset--color--cta);
	color: var(--wp--preset--color--on-dark);
}

/* Focus indicator (WCAG 2.4.7 / 1.4.11): one solid outline everywhere, never
   overridden. Primary colour on light surfaces (≥ 11:1 on white for both
   brands), white inside dark surfaces. Components only set --sefina-focus. */
:root {
	--sefina-focus: var(--wp--preset--color--primary);
}

:where(
	.has-on-dark-color,
	.has-primary-background-color,
	.has-primary-dark-background-color,
	.has-tertiary-background-color,
	.is-style-card-dark,
	.sefina-mosaic__featured,
	.wp-block-sefina-simulator__header,
	.wp-block-sefina-simulator__step.is-style-result,
	.wp-block-sefina-callback-form.is-style-on-dark
) {
	--sefina-focus: var(--wp--preset--color--on-dark);
}

:focus-visible {
	outline: 2px solid var(--sefina-focus);
	outline-offset: 2px;
}

:where(h1, h2, h3, h4, h5, h6) {
	text-wrap: balance;
}

:where(p) {
	text-wrap: pretty;
}

/* Inline icons (sefina/inline-icon format) sit on the text baseline */
:where(p, h1, h2, h3, h4, li, cite, summary, figcaption) > .material-symbols-outlined {
	font-size: 1.15em;
	vertical-align: -0.2em;
}

/* Money / rates */
.has-tabular-nums {
	font-variant-numeric: tabular-nums;
}

/* Dark surfaces: kicker switches to lime */
:is(.has-primary-background-color, .has-tertiary-background-color, .is-style-card-dark, .is-style-duotone-navy, .is-style-testimonial-glass) p.is-style-kicker {
	color: var(--wp--preset--color--brand-green);
}

/* ---------- Product category accents (Additional CSS class on any block) ---------- */
.has-cat-personnel-accent    { --accent: var(--wp--preset--color--cat-personnel);    --accent-bright: var(--wp--preset--color--cat-personnel-bright);    --accent-soft: var(--wp--preset--color--cat-personnel-soft); }
.has-cat-renovation-accent   { --accent: var(--wp--preset--color--cat-renovation);   --accent-bright: var(--wp--preset--color--cat-renovation-bright);   --accent-soft: var(--wp--preset--color--cat-renovation-soft); }
.has-cat-vehicule-accent     { --accent: var(--wp--preset--color--cat-vehicule);     --accent-bright: var(--wp--preset--color--cat-vehicule-bright);     --accent-soft: var(--wp--preset--color--cat-vehicule-soft); }
.has-cat-regroupement-accent { --accent: var(--wp--preset--color--cat-regroupement); --accent-bright: var(--wp--preset--color--cat-regroupement-bright); --accent-soft: var(--wp--preset--color--cat-regroupement-soft); }
.has-cat-hypothecaire-accent { --accent: var(--wp--preset--color--cat-hypothecaire); --accent-bright: var(--wp--preset--color--cat-hypothecaire-bright); --accent-soft: var(--wp--preset--color--cat-hypothecaire-soft); }
.has-cat-assurances-accent   { --accent: var(--wp--preset--color--cat-assurances);   --accent-bright: var(--wp--preset--color--cat-assurances-bright);   --accent-soft: var(--wp--preset--color--cat-assurances-soft); }

/* Visibility helpers (Additional CSS class) */
@media (max-width: 767px) {
	.is-hidden-mobile { display: none !important; }
}

@media (max-width: 1024px) {
	.is-hidden-below-desktop { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

/* Visually hidden, still announced by screen readers */
.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
