/* MADA-ANNUAIRE - base.
   La couleur des titres est posée sur le sélecteur d'élément, jamais sur une
   classe : une classe de titre gagnait contre les utilitaires de couleur et
   rendait le texte invisible sur les fonds sombres. */

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

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
}

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

body {
	margin: 0;
	background: var(--surface);
	color: var(--ink);
	font-family: var(--police-texte);
	font-size: var(--t-base);
	line-height: var(--interligne-texte);
	-webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
	margin: 0 0 var(--e-3);
	font-family: var(--police-titre);
	font-weight: 600;
	line-height: var(--interligne-titre);
	letter-spacing: -0.01em;
	color: var(--deep);
	text-wrap: balance;
}

h1 { font-size: var(--t-3xl); }
h2 { font-size: var(--t-2xl); }
h3 { font-size: var(--t-xl); }
h4 { font-size: var(--t-lg); }

p { margin: 0 0 var(--e-4); text-wrap: pretty; }

a {
	color: var(--accent-600);
	text-underline-offset: 2px;
	transition: color var(--transition);
}

a:hover { color: var(--accent-700); }

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

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

/* Les vignettes sont en 1/1 : c'est ce qui empêche les logos de se déformer
   d'une entreprise à l'autre. */
.mada-vignette,
.mada-fiche-logo img {
	aspect-ratio: 1 / 1;
	object-fit: cover;
}

strong { font-weight: 600; }

/* Les chiffres s'alignent en colonne : indispensable dans les compteurs et les
   tableaux de classement. */
.mada-chiffre,
table td,
table th { font-variant-numeric: tabular-nums; }

address { font-style: normal; }

.mada-conteneur {
	width: 100%;
	max-width: var(--largeur-contenu);
	margin-inline: auto;
	padding-inline: var(--gouttiere);
}

.mada-principal { display: block; min-height: 40vh; }

.mada-visuellement-cache {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

.mada-evitement {
	position: absolute;
	top: -60px;
	left: var(--e-4);
	z-index: 999;
	padding: var(--e-2) var(--e-4);
	background: var(--deep);
	color: var(--on-deep);
	border-radius: 0 0 var(--rayon) var(--rayon);
	transition: top var(--transition);
}

.mada-evitement:focus { top: 0; color: var(--on-deep); }

/* Grilles et listes, partagées par tous les widgets. */
.mada-grille {
	display: grid;
	grid-template-columns: repeat(var(--colonnes), minmax(0, 1fr));
	gap: var(--grille-ecart);
}

/* Deux paliers seulement entre le plein ecran et le telephone : a trois paliers
   les colonnes changeaient de largeur sans que rien ne s'aligne. */
@media (max-width: 1099px) {
	.mada-grille { grid-template-columns: repeat(min(var(--colonnes), 2), minmax(0, 1fr)); }
}

.mada-liste {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--e-4);
}

.mada-panneau {
	padding: var(--e-6);
	margin-bottom: var(--e-5);
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--rayon-lg);
}

.mada-panneau-etroit { max-width: 480px; margin-inline: auto; }

.mada-collant { position: sticky; top: calc(var(--entete-hauteur) + var(--e-4)); }

.mada-titre-section { margin-bottom: var(--e-6); }
.mada-titre-section.est-centre { text-align: center; }

.mada-surtitre {
	margin: 0 0 var(--e-2);
	font-family: var(--police-titre);
	font-size: var(--t-xs);
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--accent);
}

.mada-intro { color: var(--muted); font-size: var(--t-md); max-width: 62ch; }
.mada-titre-section.est-centre .mada-intro { margin-inline: auto; }

.mada-bloc-titre { font-size: var(--t-lg); margin-bottom: var(--e-4); }

@media (max-width: 899px) {
	.mada-grille { grid-template-columns: 1fr; }
	.mada-panneau { padding: var(--e-4); }
	.mada-collant { position: static; }
}
