/*
 * base.css - FormaSources
 * Role : reset leger et styles des elements HTML nus (typographie, liens,
 *        focus clavier, medias, accessibilite). A charger apres tokens.css.
 * Dependances : tokens.css (variables de design).
 */

*,
*::before,
*::after
{
	box-sizing: border-box;
}

html
{
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
	scroll-padding-top: calc(var(--header-height) + var(--space-md));
}

body
{
	margin: 0;
	background-color: var(--color-bg);
	color: var(--color-text);
	font-family: var(--font-body);
	font-size: var(--text-body);
	font-weight: 400;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

/* Titres */
h1,
h2,
h3,
h4
{
	margin: 0 0 var(--space-md);
	font-family: var(--font-heading);
	font-weight: 600;
	line-height: 1.2;
	color: var(--color-text);
}

h1
{
	font-size: var(--text-h1);
	line-height: 1.15;
	letter-spacing: -0.01em;
}

h2
{
	font-size: var(--text-h2);
}

h3
{
	font-size: var(--text-h3);
	line-height: 1.3;
}

p
{
	margin: 0 0 var(--space-md);
}

/* Liens */
a
{
	color: var(--color-primary);
	text-decoration: underline;
	text-underline-offset: 2px;
	transition: var(--transition);
}

a:hover
{
	color: var(--color-primary-dark);
}

/* Focus clavier visible (WCAG) */
:focus-visible
{
	outline: var(--focus-ring);
	outline-offset: var(--focus-offset);
	border-radius: var(--radius-sm);
}

/* Neutraliser l'outline uniquement quand le focus vient de la souris */
:focus:not(:focus-visible)
{
	outline: none;
}

/* Medias */
img,
svg,
picture
{
	max-width: 100%;
	height: auto;
	display: block;
}

/* Formulaires : heriter de la typographie */
button,
input,
select,
textarea
{
	font: inherit;
	color: inherit;
}

/* Listes de contenu */
ul,
ol
{
	margin: 0 0 var(--space-md);
	padding-left: var(--space-lg);
}

/* Selection */
::selection
{
	background-color: var(--color-secondary-subtle);
	color: var(--color-text);
}

hr
{
	border: 0;
	border-top: 1px solid var(--color-border);
	margin: var(--space-2xl) 0;
}

/* Respect des preferences de mouvement reduit */
@media (prefers-reduced-motion: reduce)
{
	html
	{
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after
	{
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}
