/* Base : reset léger, typographie, liens, focus, utilitaires d'accessibilité. */

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

/* Le canevas prolonge le footer bleu nuit sous les pages courtes (body garde le fond de page, --color-bg). */
html {
	background: var(--color-blue-900);
	scrollbar-color: var(--color-gray-500) var(--color-ivory-100);
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	scroll-padding-top: calc(var(--header-height) + var(--space-4));
}

@media (prefers-reduced-motion: no-preference) {
	html {
		scroll-behavior: smooth;
	}
}

body {
	margin: 0;
	background: var(--color-bg);
	color: var(--color-text);
	font-family: var(--font-sans);
	font-size: var(--text-body);
	line-height: var(--leading-body);
	font-feature-settings: "kern", "liga", "calt";
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

img,
svg,
video {
	display: block;
	max-width: 100%;
	height: auto;
}

/* Titres */

h1,
h2,
h3,
h4,
h5,
h6 {
	margin: 0;
	color: var(--color-heading);
	font-family: var(--font-serif);
	font-optical-sizing: auto;
	font-weight: var(--weight-heading);
	line-height: var(--leading-tight);
	letter-spacing: var(--tracking-heading);
	text-wrap: balance;
	overflow-wrap: break-word;
	hyphens: manual;
}

h1,
.h1 {
	font-size: var(--text-h1);
	font-weight: var(--weight-display);
	line-height: 1.1;
}

h2,
.h2 {
	font-size: var(--text-h2);
	line-height: 1.18;
}

h3,
.h3 {
	font-size: var(--text-h3);
	line-height: var(--leading-tight);
}

h4,
.h4 {
	font-size: var(--text-h4);
	line-height: var(--leading-snug);
}

h5,
h6 {
	font-family: var(--font-sans);
	font-size: var(--text-body);
	font-weight: var(--weight-semibold);
	letter-spacing: 0;
	line-height: var(--leading-snug);
}

p {
	margin: 0;
	text-wrap: pretty;
}

.lead {
	color: var(--color-text-muted);
	font-size: var(--text-lead);
	line-height: 1.55;
}

small,
.text-small {
	font-size: var(--text-small);
}

strong,
b {
	font-weight: var(--weight-semibold);
}

/* Liens */

a {
	color: var(--color-link);
	text-decoration-line: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
	transition: color var(--duration-fast) ease, text-decoration-color var(--duration-fast) ease;
}

a:hover {
	color: var(--color-link-hover);
	text-decoration-thickness: 2px;
}

/* Focus : visible au clavier uniquement */

:focus {
	outline: none;
}

:focus-visible {
	outline: var(--focus-ring);
	outline-offset: var(--focus-offset);
	border-radius: 2px;
}

::selection {
	background: var(--color-gold-100);
	color: var(--color-blue-900);
}

hr {
	height: 0;
	margin: var(--space-7) 0;
	border: 0;
	border-top: 1px solid var(--color-border-strong);
}

/* Accessibilité */

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.skip-link {
	position: absolute;
	top: var(--space-2);
	left: var(--space-2);
	z-index: calc(var(--z-header) + 1);
	padding: var(--space-3) var(--space-4);
	border-radius: var(--radius-sm);
	background: var(--color-blue-900);
	color: var(--color-white);
	font-weight: var(--weight-semibold);
	text-decoration: none;
	transform: translateY(-200%);
}

.skip-link:focus-visible {
	transform: none;
	outline-color: var(--color-focus-on-dark);
}
