/*
 * Vousfinancer - Lexique : blocs alphabet, recherche, sommaire, définitions.
 * Maquette « Page · Lexique » (Figma Refonte 2026). Couleurs surchargeables par
 * le thème via les variables --vfl-* ; la police est celle du thème.
 */

:where(.vfl-alphabet, .vfl-recherche, .vfl-sommaire, .vfl-definitions) {
	--vfl-rouge: #b91211;
	--vfl-rouge-fonce: #98110a;
	--vfl-texte: #181716;
	--vfl-texte-secondaire: #666;
	--vfl-filet: rgba(24, 23, 22, 0.2);
	--vfl-filet-sommaire: #d2d2d2;
	--vfl-sur-rouge: #fff;
	--vfl-sur-rouge-filet: rgba(255, 255, 255, 0.35);
	--vfl-rayon-champ: 8px;
	--vfl-decalage-ancre: 120px;
}

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

/* Alphabet (sur fond rouge) ------------------------------------------------ */

.vfl-alphabet__liste {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.vfl-alphabet__liste li {
	margin: 0;
}

.vfl-alphabet__lettre {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 999px;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.5;
	letter-spacing: -0.01em;
	color: var(--vfl-sur-rouge);
	text-decoration: none;
}

a.vfl-alphabet__lettre {
	border: 1px solid var(--vfl-sur-rouge-filet);
	transition: background-color 0.2s, border-color 0.2s;
}

a.vfl-alphabet__lettre:hover {
	border-color: var(--vfl-sur-rouge);
	background-color: rgba(255, 255, 255, 0.12);
	color: var(--vfl-sur-rouge);
}

a.vfl-alphabet__lettre:focus-visible {
	outline: 2px solid var(--vfl-sur-rouge);
	outline-offset: 2px;
}

a.vfl-alphabet__lettre.is-active {
	border-color: var(--vfl-sur-rouge);
	background-color: var(--vfl-sur-rouge);
	color: var(--vfl-rouge);
}

.vfl-alphabet__lettre.is-indisponible {
	color: var(--vfl-sur-rouge-filet);
	cursor: default;
}

@media (max-width: 767px) {
	.vfl-alphabet__liste {
		justify-content: flex-start;
		gap: 6px;
	}
}

/* Recherche ----------------------------------------------------------------- */

.vfl-recherche {
	position: relative;
	width: 100%;
}

.vfl-recherche__champ {
	display: flex;
	align-items: center;
	gap: 12px;
	height: 48px;
	padding: 0 16px;
	border-radius: var(--vfl-rayon-champ);
	background: #fff;
	color: var(--vfl-texte-secondaire);
}

.vfl-recherche__champ:focus-within {
	outline: 2px solid var(--vfl-sur-rouge);
	outline-offset: 2px;
}

.vfl-recherche__loupe {
	flex-shrink: 0;
}

.vfl-recherche .vfl-recherche__saisie {
	flex: 1;
	min-width: 0;
	height: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	box-shadow: none;
	font: inherit;
	font-size: 16px;
	letter-spacing: -0.01em;
	color: var(--vfl-texte);
	outline: none;
	-webkit-appearance: none;
	appearance: none;
}

.vfl-recherche__saisie::placeholder {
	color: var(--vfl-texte-secondaire);
	opacity: 1;
}

.vfl-recherche__resultats {
	position: absolute;
	z-index: 50;
	top: calc(100% + 6px);
	right: 0;
	left: 0;
	max-height: 360px;
	margin: 0;
	padding: 6px;
	overflow-y: auto;
	list-style: none;
	border: 1px solid var(--vfl-filet);
	border-radius: var(--vfl-rayon-champ);
	background: #fff;
	box-shadow: 0 12px 32px rgba(24, 23, 22, 0.16);
}

.vfl-recherche__option,
.vfl-recherche__vide {
	display: flex;
	flex-direction: column;
	margin: 0;
	padding: 8px 10px;
	border-radius: 6px;
	font-size: 15px;
	line-height: 1.35;
	color: var(--vfl-texte);
}

.vfl-recherche__option {
	cursor: pointer;
}

.vfl-recherche__option:hover,
.vfl-recherche__option[aria-selected="true"] {
	background: rgba(185, 18, 17, 0.08);
}

.vfl-recherche__titre {
	font-weight: 600;
}

.vfl-recherche__developpe,
.vfl-recherche__vide {
	font-size: 13px;
	color: var(--vfl-texte-secondaire);
}

/* Sommaire ------------------------------------------------------------------ */

.vfl-sommaire__titre {
	margin: 0 0 14px;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.5;
	letter-spacing: 0.025em;
	text-transform: uppercase;
	color: var(--vfl-texte);
}

.vfl-sommaire__liste {
	margin: 0;
	padding: 0;
	list-style: none;
}

.vfl-sommaire__liste li {
	margin: 0;
}

.vfl-sommaire__lien {
	display: block;
	padding: 10px 0 10px 16px;
	border-left: 1px solid var(--vfl-filet-sommaire);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.5;
	letter-spacing: -0.01em;
	color: var(--vfl-texte-secondaire);
	text-decoration: none;
	transition: color 0.2s;
}

.vfl-sommaire__lien:hover {
	color: var(--vfl-texte);
}

.vfl-sommaire__lien[aria-current="true"] {
	padding-left: 14px;
	border-left: 3px solid var(--vfl-rouge);
	color: var(--vfl-texte);
}

/* Définitions --------------------------------------------------------------- */

.vfl-definitions {
	display: flex;
	flex-direction: column;
	gap: 56px;
}

.vfl-definitions__liste {
	display: flex;
	flex-direction: column;
	gap: 56px;
	margin: 0;
}

.vfl-terme {
	display: flex;
	flex-direction: column;
	gap: 16px;
	scroll-margin-top: var(--vfl-decalage-ancre);
}

.vfl-terme:focus {
	outline: none;
}

.vfl-terme__titre,
.vfl-terme__definition {
	margin: 0;
	border-left: 1px solid var(--vfl-filet);
}

.vfl-terme__titre {
	padding-top: 28px;
	font-size: 24px;
	line-height: 1.23;
	letter-spacing: -0.015em;
	color: var(--vfl-texte);
}

.vfl-terme__libelle {
	display: inline-block;
	margin-left: -1px;
	padding: 2px 0 2px 21px;
	border-left: 3px solid var(--vfl-rouge);
}

.vfl-terme__sigle {
	font-weight: 600;
	text-decoration: none;
}

abbr.vfl-terme__sigle {
	cursor: inherit;
}

.vfl-terme__developpe {
	margin-left: 10px;
	font-weight: 300;
}

.vfl-terme__definition {
	margin-top: -6px;
	padding-left: 24px;
	font-size: 16px;
	line-height: 1.5;
	letter-spacing: -0.01em;
	color: var(--vfl-texte);
}

.vfl-terme__definition > * {
	margin-top: 0;
	margin-bottom: 0;
}

.vfl-terme__definition > * + * {
	margin-top: 12px;
}

.vfl-terme__definition ul {
	padding-left: 1.25em;
}

.vfl-terme__definition img {
	max-width: 100%;
	height: auto;
}

.vfl-terme__definition a {
	color: inherit;
	text-decoration: underline;
	text-decoration-color: rgba(185, 18, 17, 0.55);
	text-decoration-thickness: 3px;
	text-underline-offset: 2px;
}

.vfl-terme__voir-aussi {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 4px 16px;
	margin: 0;
}

.vfl-terme__voir-aussi-libelle {
	font-size: 14px;
	letter-spacing: -0.01em;
	color: var(--vfl-texte-secondaire);
}

/* Lien maison : soulignement 3 px rouge à 40 %, rempli au survol. */
.vfl-lien {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 4px 0;
	font-size: 15px;
	font-weight: 500;
	line-height: 1.5;
	letter-spacing: -0.01em;
	color: var(--vfl-texte);
	text-decoration: none;
	background-image: linear-gradient(rgba(185, 18, 17, 0.4), rgba(185, 18, 17, 0.4)), linear-gradient(var(--vfl-rouge), var(--vfl-rouge));
	background-repeat: no-repeat;
	background-position: 0 calc(100% - 4px), 0 calc(100% - 4px);
	background-size: 100% 3px, 0 3px;
	transition: background-size 0.25s ease;
}

.vfl-lien:hover,
.vfl-lien:focus-visible {
	color: var(--vfl-texte);
	background-size: 100% 3px, 100% 3px;
}

.vfl-lien:focus-visible {
	outline: 2px solid var(--vfl-rouge);
	outline-offset: 2px;
	border-radius: 2px;
}

.vfl-lien--fleche {
	background-size: 0 3px, 0 3px;
}

.vfl-lien--fleche svg {
	color: var(--vfl-rouge);
	transition: transform 0.25s ease;
}

.vfl-lien--fleche:hover svg,
.vfl-lien--fleche:focus-visible svg {
	transform: translateX(4px);
}

.vfl-definitions__suite {
	margin: 0;
}

@media (prefers-reduced-motion: reduce) {
	.vfl-lien,
	.vfl-lien--fleche svg,
	.vfl-sommaire__lien {
		transition: none;
	}
}

@media (max-width: 767px) {
	.vfl-definitions,
	.vfl-definitions__liste {
		gap: 40px;
	}

	.vfl-terme__titre {
		font-size: 21px;
	}

	.vfl-terme__developpe {
		display: block;
		margin: 4px 0 0;
		font-size: 17px;
	}
}
