/* B-Strong Glossaire : index et colonne latérale des fiches.
   Les couleurs reprennent celles du thème B-Strong, avec des valeurs de secours. */

.bsg-index, .bsg-lateral {
	--bsg-noir: var(--wp--preset--color--noir, #0b0a0f);
	--bsg-violet: var(--wp--preset--color--violet, #8100e8);
	--bsg-pale: var(--wp--preset--color--violet-pale, #f1e6fd);
	--bsg-brume: var(--wp--preset--color--brume, #f5f3f9);
	--bsg-trait: var(--wp--preset--color--trait, #e6e2ee);
	--bsg-doux: var(--wp--preset--color--texte-doux, #55505f);
}

/* Alphabet */
.bsg-alphabet { display: flex; flex-wrap: wrap; gap: .35rem; }
.bsg-alphabet a, .bsg-alphabet span {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 2.25rem; height: 2.25rem; padding: 0 .4rem;
	border-radius: 6px; font-weight: 600; font-size: .9rem; text-decoration: none;
}
.bsg-alphabet a { background: #fff; color: var(--bsg-noir); border: 1px solid var(--bsg-trait); }
.bsg-alphabet a:hover, .bsg-alphabet a:focus-visible, .bsg-alphabet a[aria-current] { background: var(--bsg-violet); border-color: var(--bsg-violet); color: #fff; }
.bsg-alphabet span { color: #b9b4c2; }
.bsg-alphabet-compact a, .bsg-alphabet-compact span { min-width: 1.85rem; height: 1.85rem; font-size: .8rem; }

/* Barre d'outils de l'index */
.bsg-outils {
	position: sticky; top: calc(var(--wp-admin--admin-bar--height, 0px) + 92px); z-index: 5;
	display: grid; gap: .9rem; padding: 1.1rem 0;
	background: var(--wp--preset--color--blanc, #fff); border-bottom: 1px solid var(--bsg-trait);
}
.bsg-recherche { margin: 0; display: grid; gap: .3rem; max-width: 28rem; }
.bsg-recherche label { font-size: .85rem; font-weight: 600; }
.bsg-recherche input {
	font: inherit; padding: .7rem .9rem; border: 1px solid var(--bsg-trait); border-radius: 6px; background: #fff;
}
.bsg-recherche input:focus { outline: 2px solid var(--bsg-violet); outline-offset: 1px; border-color: var(--bsg-violet); }
.bsg-compte { margin: 0; font-size: .85rem; color: var(--bsg-doux); }

/* Groupes et cartes */
.bsg-groupe { scroll-margin-top: 11rem; padding-top: 2rem; }
.bsg-lettre {
	display: flex; align-items: center; gap: 1rem; margin: 0 0 1rem;
	font-size: 2rem; font-weight: 800; color: var(--bsg-violet);
}
.bsg-lettre::after { content: ""; flex: 1; height: 1px; background: var(--bsg-trait); }
.bsg-cartes { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); }
.bsg-carte {
	position: relative; display: flex; flex-direction: column; gap: .4rem;
	padding: 1.2rem 1.25rem; background: #fff; border: 1px solid var(--bsg-trait); border-radius: 12px;
	transition: border-color .15s, box-shadow .15s;
}
.bsg-carte:hover, .bsg-carte:focus-within { border-color: var(--bsg-violet); box-shadow: 0 6px 20px rgba(129, 0, 232, .08); }
.bsg-terme { font-weight: 700; font-size: 1.05rem; line-height: 1.3; color: var(--bsg-noir); text-decoration: none; }
.bsg-terme::after { content: ""; position: absolute; inset: 0; border-radius: 12px; } /* Toute la carte est cliquable. */
.bsg-carte p { margin: 0; font-size: .9rem; line-height: 1.55; color: var(--bsg-doux); }
.bsg-categorie {
	align-self: flex-start; font-size: .7rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
	color: var(--bsg-violet); background: var(--bsg-pale); padding: .15rem .5rem; border-radius: 4px;
}
.bsg-aucun { padding: 2rem 0; }

/* Colonne latérale des fiches */
.bsg-lateral { display: grid; gap: .9rem; }
.bsg-retour { margin: 0; }
.bsg-retour a { font-weight: 600; text-decoration: none; }
.bsg-titre-lateral { margin: .4rem 0 0; font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--bsg-doux); }
.bsg-voisins { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; font-size: .9rem; }
.bsg-voisins a, .bsg-voisins li[aria-current] { display: block; padding: .35rem .5rem; border-radius: 6px; text-decoration: none; color: var(--bsg-noir); }
.bsg-voisins a:hover { background: #fff; color: var(--bsg-violet); }
.bsg-voisins li[aria-current] { background: #fff; font-weight: 600; color: var(--bsg-violet); }

/* Liens automatiques dans les fiches */
.bsg-lien { text-decoration-style: dotted; text-underline-offset: 3px; }

@media (prefers-reduced-motion: reduce) { .bsg-carte { transition: none; } }

/* Téléphone : barre non collante, alphabet sur une seule ligne défilante */
@media (max-width: 781px) {
	.bsg-outils { position: static; }
	.bsg-index .bsg-alphabet { flex-wrap: nowrap; overflow-x: auto; padding-bottom: .3rem; scrollbar-width: thin; }
	.bsg-index .bsg-alphabet a, .bsg-index .bsg-alphabet span { flex: 0 0 auto; }
	.bsg-groupe { scroll-margin-top: 1rem; }
}
