/*
 * Sanoo : compléments globaux que theme.json ne sait pas exprimer.
 * Largeur de fonte (axe wdth d'Archivo), focus visible, lien d'évitement, mouvements réduits.
 */

/* Titres d'enseigne : Archivo étroit (70 %). Titres d'interface : largeur normale. */
h1, h2,
.wp-block-site-title,
.has-4-xl-font-size,
.has-3-xl-font-size {
	font-stretch: var(--wp--custom--font-stretch--enseigne, 70%);
}

/* Boutons : Archivo à 80 %, cible tactile de 44 px minimum (WCAG 2.5.8). */
.wp-element-button,
.wp-block-button__link,
button,
input[type="submit"] {
	font-stretch: var(--wp--custom--font-stretch--bouton, 80%);
	min-height: var(--wp--custom--target--min, 44px);
}

/* Chiffres qui comptent : prix, montants, codes, étiquettes. */
.sanoo-mono,
.wc-block-components-product-price,
.woocommerce-Price-amount {
	font-family: var(--wp--preset--font-family--mono);
	font-variant-numeric: tabular-nums;
}

.sanoo-etiquette {
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--xs);
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

/* Focus visible partout, épais et contrasté (WCAG 2.4.7, 2.4.11, 2.4.13). */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: var(--wp--custom--focus--width, 3px) solid var(--wp--custom--focus--color, #1d2a36);
	outline-offset: var(--wp--custom--focus--offset, 2px);
}

/* Sur fond sombre (vert, encre, rouge), le focus passe au jaune. */
:where(.has-vert-background-color, .has-vert-fonce-background-color, .has-encre-background-color, .has-rouge-background-color, .has-rouge-fonce-background-color)
	:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline-color: var(--wp--custom--focus--color-on-dark, #e99c2f);
}

/* Lien d'évitement ajouté par WordPress (skip link des thèmes blocs). */
.skip-link.screen-reader-text:focus,
.sanoo-evitement a:focus {
	background: var(--wp--preset--color--encre);
	color: var(--wp--preset--color--blanc);
	font-weight: 700;
	padding: 12px 20px;
	z-index: 100000;
	outline: var(--wp--custom--focus--width, 3px) solid var(--wp--custom--focus--color-on-dark, #e99c2f);
}

/* Les champs ont une bordure visible à 3:1 minimum (WCAG 1.4.11) : encre méta, pas le filet. */
:where(input:not([type="submit"], [type="button"], [type="checkbox"], [type="radio"]), select, textarea) {
	border: 1px solid var(--wp--preset--color--encre-3);
	border-radius: var(--wp--custom--radius--controle, 6px);
	min-height: var(--wp--custom--target--min, 44px);
}

/* Le texte peut être agrandi à 200 % sans perte : pas de hauteur figée, césure des mots longs. */
body {
	overflow-wrap: break-word;
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

@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;
	}
}

/*
 * WooCommerce · mini-panier : fermé, le tiroir est hors écran mais ses boutons restaient atteignables
 * au clavier (aria-hidden + focusable, WCAG 2.4.3 et 4.1.2). On le retire de l'ordre de tabulation
 * une fois l'animation de fermeture terminée.
 */
.wc-block-components-drawer__screen-overlay--is-hidden .wc-block-mini-cart__drawer {
	visibility: hidden;
	transition: visibility 0s linear 0.3s;
}
