/* ---------------------------------------------------------------------
 *	Le choix d'un glyphe dans le catalogue (includes/glyphe-choix.tpl.php)
 *
 *	Section outils de css.list : l'administration y choisit l'icône d'une
 *	intrigue. Le script est _scripts/glyphe-choix.js.
 *
 *	Une police par groupe (des <details>, RPG Awesome d'abord), des glyphes
 *	en grille ; chaque glyphe est un bouton (sans les manières des boutons du
 *	site), un seul champ caché porte le choix. Le
 *	titre du groupe montre le glyphe choisi, sa case porte .glyphe-choix--choisi
 *	(le script la suit). Une grille ne montre que 150 cases à la fois.
 * ------------------------------------------------------------------- */

.glyphe-galerie {
	--case: 2.75rem;
}

/* Des filtres compacts : l'intitulé à sa largeur naturelle. */
.glyphe-galerie__filtres {
	display: flex;
	flex-wrap: wrap;
	gap: 0 var(--e-4);
	margin: 0 0 var(--e-3);
}

.glyphe-galerie__filtres label {
	flex-wrap: nowrap;
}

.glyphe-galerie__filtres label > span:first-child {
	flex-basis: auto;
}

.glyphe-galerie__filtres select,
.glyphe-galerie__filtres input {
	flex: 0 1 auto;
	min-width: min(calc(var(--largeur-champ) / 2), 100%);
}

.glyphe-galerie__police {
	padding: var(--e-2) 0;
	border-top: var(--filet) solid var(--bordure-douce);
}

.glyphe-galerie__police > summary {
	color: var(--or-texte);
	font-family: var(--police-titre);
	font-size: var(--taille-l);
	cursor: pointer;
}

.glyphe-galerie__compte {
	color: var(--encre-douce);
	font-family: var(--police-texte);
	font-size: var(--taille-s);
}

.glyphe-galerie__compte::before {
	content: '(';
}

.glyphe-galerie__compte::after {
	content: ')';
}

/* Une vraie grille à deux dimensions, qui défile : Font Awesome en a près de 1 400. */
.glyphe-galerie__grille {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(var(--case), 1fr));
	gap: var(--e-2);
	max-height: calc(8 * (var(--case) + var(--e-2)));
	margin-top: var(--e-2);
	padding: var(--e-1);
	overflow-y: auto;
}

button.glyphe-choix {
	display: flex;
	position: relative;
	min-width: 0;
	min-height: 0;
	padding: 0;
	box-shadow: none;
	font-family: inherit;
	font-weight: normal;
	letter-spacing: normal;
	text-transform: none;
	transition: none;
	justify-content: center;
	align-items: center;
	aspect-ratio: 1;
	margin: 0;
	border: var(--filet) solid var(--bordure);
	border-radius: var(--rayon-s);
	background: var(--parchemin-2);
	color: var(--encre);
	font-size: var(--taille-xl);
	cursor: pointer;
}

button.glyphe-choix:hover {
	border-color: var(--bordure-forte);
	background: var(--parchemin-2);
	color: var(--encre);
	transform: none;
}

button.glyphe-choix.glyphe-choix--choisi {
	outline: calc(3 * var(--filet)) solid var(--or);
	color: var(--or-texte);
}

button.glyphe-choix:focus-visible {
	outline: calc(3 * var(--filet)) dashed var(--focus);
}

/* Les cases suivantes d'une police : une grille n'en montre que 150 à la fois */
.glyphe-galerie__plus {
	margin-top: var(--e-2);
}

.glyphe-choix[hidden],
.glyphe-galerie__police[hidden] {
	display: none;
}

@media (max-width: 640px) {
	.glyphe-galerie__filtres label {
		flex-wrap: wrap;
	}
}
