.lexique-kbs-block {
	margin: 30px 0;
}

/* Recherche */
.lexique-kbs-search {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-bottom: 20px;
}

.lexique-kbs-search-input {
	flex: 1 1 260px;
	min-width: 180px;
	height: 40px;
	padding: 0 12px;
	border: 1px solid #ccc;
	border-radius: 4px;
}

.lexique-kbs-search-submit {
	height: 40px;
	padding: 0 16px;
	border: 1px solid #222;
	border-radius: 4px;
	background-color: #222;
	color: #fff;
	cursor: pointer;
}

.lexique-kbs-search-reset {
	font-size: 0.9rem;
	text-decoration: underline;
}

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

/* Clavier alphabétique */
.lexique-kbs-alphabet {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 25px;
}

.lexique-kbs-letter {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 34px;
	height: 34px;
	padding: 0 8px;
	border: 1px solid #ccc;
	border-radius: 4px;
	text-decoration: none;
	color: inherit;
	font-weight: 600;
	line-height: 1;
}

a.lexique-kbs-letter:hover {
	background-color: #f0f0f0;
}

.lexique-kbs-letter.active {
	background-color: #222;
	border-color: #222;
	color: #fff;
}

span.lexique-kbs-letter.disabled {
	opacity: 0.35;
	border-style: dashed;
}

/* Liste des termes */
.lexique-kbs-empty {
	font-style: italic;
	opacity: 0.7;
}

.lexique-kbs-item {
	border: 1px solid #e0e0e0;
	border-radius: 6px;
	margin-bottom: 10px;
	overflow: hidden;
}

.lexique-kbs-item-terme {
	cursor: pointer;
	list-style: none;
	padding: 14px 18px;
	font-weight: 700;
	background-color: #f7f7f7;
	position: relative;
}

.lexique-kbs-item-terme::-webkit-details-marker {
	display: none;
}

.lexique-kbs-item-terme::after {
	content: '+';
	position: absolute;
	right: 18px;
	top: 50%;
	transform: translateY(-50%) rotate(0deg);
	transition: transform 0.2s ease-out;
	font-weight: 400;
	font-size: 1.2em;
}

.lexique-kbs-item[open] > .lexique-kbs-item-terme::after {
	transform: translateY(-50%) rotate(135deg); /* le "+" devient un "x" à l'ouverture */
}

.lexique-kbs-item[open] > .lexique-kbs-item-terme {
	border-bottom: 1px solid #e0e0e0;
}

.lexique-kbs-item-body {
	padding: 16px 18px;
}

/* Apparition de la liste au chargement (changement de lettre/page = navigation
   classique, donc l'animation se rejoue naturellement à chaque changement). */
@media (prefers-reduced-motion: no-preference) {
	@keyframes lexique-kbs-fade-in {
		from {
			opacity: 0;
			transform: translateY(8px);
		}
		to {
			opacity: 1;
			transform: translateY(0);
		}
	}

	.lexique-kbs-accordion .lexique-kbs-item {
		animation: lexique-kbs-fade-in 0.35s ease-out both;
		animation-delay: min(calc(var(--lexique-kbs-i, 0) * 20ms), 400ms);
	}

	.lexique-kbs-pagination {
		animation: lexique-kbs-fade-in 0.35s ease-out both;
		animation-delay: 300ms;
	}
}

.lexique-kbs-item-body p {
	margin: 0 0 10px;
}

.lexique-kbs-definition {
	margin-top: 10px;
}

/* Pagination */
.lexique-kbs-pagination {
	margin-top: 25px;
}

.lexique-kbs-pagination .pagination {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.lexique-kbs-pagination .page-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 34px;
	height: 34px;
	padding: 0 8px;
	border: 1px solid #ccc;
	border-radius: 4px;
	text-decoration: none;
	color: inherit;
}

.lexique-kbs-pagination .page-item.active .page-link {
	background-color: #222;
	border-color: #222;
	color: #fff;
}

.lexique-kbs-pagination .page-item.disabled .page-link {
	opacity: 0.35;
	pointer-events: none;
}
