/*
 * PICMAN : socle typographique et comportements globaux (docs/UI.md § 3.3 et § 9).
 * Inter variable auto-hébergée (OFL, resources/fonts/OFL.txt), mêmes fichiers et mêmes
 * déclarations que forums.cvvm.fr.
 */

@font-face {
	font-family: "Inter";
	font-style: normal;
	font-weight: 100 900;
	font-display: optional;
	src: url("../fonts/inter-latin.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
	font-family: "Inter";
	font-style: normal;
	font-weight: 100 900;
	font-display: optional;
	src: url("../fonts/inter-latin-ext.woff2") format("woff2");
	unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
	font-family: "Inter Fallback";
	src: local("Arial"), local("Helvetica Neue"), local("Liberation Sans");
	size-adjust: 107%;
	ascent-override: 90%;
	descent-override: 22%;
	line-gap-override: 0%;
}

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

html {
	background: var(--ground);
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	overscroll-behavior-x: none;
	font-feature-settings: "liga" 1, "calt" 1, "cv05" 1;
}

body {
	margin: 0;
	background: var(--ground);
	color: var(--ink);
	font-family: var(--font);
	font-size: var(--text-size);
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
	color: var(--navy);
	line-height: 1.25;
	text-wrap: balance;
}

a {
	color: var(--blue);
	text-underline-offset: 2px;
}
a:hover {
	color: var(--blue-deep);
}

::selection {
	background: var(--selection);
}

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

input::placeholder,
textarea::placeholder {
	color: var(--muted);
	opacity: 1;
}

/* Chiffres alignés : colonnes de nombres, horaires, durées, montants. Pas sur un tableau entier :
   en chiffres tabulaires, Inter élargit le trait d'union (« F - CHTV », « Jean - Pierre ») */
.num,
.ui-datatable td,
.ui-paginator,
.tabular-nums,
time {
	font-variant-numeric: tabular-nums;
}

/* Repère vide de p:focus (span à identifiant, sans classe) : il ne prend jamais une case de grille */
span[id]:empty:not([class]) {
	display: none;
}

.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.skip-link {
	position: absolute;
	left: 8px;
	top: -100px;
	z-index: var(--z-skiplink);
	padding: 10px 16px;
	border-radius: var(--radius-sm);
	background: var(--fill-primary);
	color: var(--on-accent);
	font-weight: 600;
	text-decoration: none;
}
.skip-link:focus {
	top: calc(8px + env(safe-area-inset-top, 0px));
	color: var(--on-accent);
}

/* Impression : print.css (media="print") porte le reste, voir docs/PRINT.md */
@media screen {
	.print-only {
		display: none !important;
	}
}

/* Champs à 16 px sur téléphone : en dessous, Safari agrandit la page au focus d'un champ */
@media screen and (max-width: 767.98px) {
	input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
	textarea,
	select,
	.ui-inputfield,
	.ui-inputtext {
		font-size: 16px !important;
	}
}

/* Application installée : le fond de la fenêtre suit la carte, sans bande blanche au rebond */
@media (display-mode: standalone), (display-mode: fullscreen) {
	html {
		background: var(--paper);
	}
}

@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;
	}
}

/* Mises en relief stockées dans les libellés de facturation (HtmlHelper) : couleurs de la charte */
font[color="red"] {
	color: var(--red);
}
font[color="green"] {
	color: var(--green-deep);
}
