/*
 * Stili non esprimibili in theme.json. Solo token: niente valori di colore/font hardcoded.
 */

/* Interlinea associata a ogni dimensione della scala tipografica (Figma: size/line-height). */
.has-display-l-font-size { line-height: var(--wp--custom--line-height--display-l); }
.has-display-m-font-size { line-height: var(--wp--custom--line-height--display-m); }
.has-display-s-font-size { line-height: var(--wp--custom--line-height--display-s); }
.has-headline-m-font-size { line-height: var(--wp--custom--line-height--headline-m); }
.has-headline-s-font-size { line-height: var(--wp--custom--line-height--headline-s); }
.has-headline-xs-font-size { line-height: var(--wp--custom--line-height--headline-xs); }
.has-title-l-font-size { line-height: var(--wp--custom--line-height--title-l); }
.has-title-m-font-size { line-height: var(--wp--custom--line-height--title-m); }
.has-body-m-font-size,
.has-body-s-font-size { line-height: var(--wp--custom--line-height--ui); }

/* Etichette / occhielli (label-*): maiuscolo spaziato, Montserrat semibold. */
.has-label-l-font-size,
.has-label-m-font-size,
.has-label-s-font-size {
	font-family: var(--wp--preset--font-family--sans);
	font-weight: 600;
	letter-spacing: var(--wp--custom--letter-spacing--label);
	line-height: var(--wp--custom--line-height--ui);
	text-transform: uppercase;
}

/*
 * Focus visibile (WCAG 2.4.7 / 2.4.11). Il design Figma indica il focus solo con un leggero
 * cambio di sfondo: qui aggiungiamo un anello ben visibile, bianco sulle sezioni scure.
 */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: var(--wp--custom--focus--width) solid var(--wp--custom--focus--color);
	outline-offset: var(--wp--custom--focus--offset);
}

:where(.has-contrast-background-color, .has-primary-background-color, .has-blu-cidas-gradient-background, .is-style-dark)
	:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline-color: var(--wp--custom--focus--color-on-dark);
}

/* Skip link generato da WordPress per i block theme. */
.skip-link.screen-reader-text:focus {
	background: var(--wp--preset--color--base);
	border-radius: var(--wp--custom--radius--s);
	color: var(--wp--preset--color--contrast);
	font-weight: 600;
	outline: var(--wp--custom--focus--width) solid var(--wp--custom--focus--color);
	padding: var(--wp--preset--spacing--30) var(--wp--preset--spacing--50);
}

/* Pulsanti: stato disabilitato e focus coerenti con il design system. */
.wp-element-button:disabled,
.wp-block-button__link[aria-disabled="true"] {
	background-color: var(--wp--preset--color--surface-variant);
	color: var(--wp--preset--color--outline);
	cursor: not-allowed;
}

/* Rispetto della preferenza di movimento ridotto. */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		scroll-behavior: auto !important;
		transition-duration: 0.01ms !important;
	}
}
