/**
 * Custom Taxonomy Block — styles front-office (minimaux).
 *
 * Tous les sélecteurs sont préfixés par .custom-taxonomy-block.
 *
 * Le style de base ne touche PAS aux puces ni à l'indentation des listes :
 * en preset « none », l'apparence des listes reste 100 % gérée par le thème
 * (« on ne fait rien »). Seuls les presets « dashes » et « flat » remettent
 * les listes à zéro.
 */

/* ---- Structure fonctionnelle (indispensable, quel que soit le preset) ---- */

/* Ligne : lien + bouton alignés. */
.custom-taxonomy-block .taxonomy-term-row {
	display: flex;
	align-items: center;
	gap: 0.25em;
}

.custom-taxonomy-block .taxonomy-term-link {
	flex: 1 1 auto;
}

.custom-taxonomy-block .taxonomy-term-count {
	opacity: 0.7;
	font-size: 0.85em;
}

/* Bouton d'ouverture / fermeture. */
.custom-taxonomy-block .taxonomy-term-toggle {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.6em;
	height: 1.6em;
	padding: 0;
	line-height: 1;
	font-size: 1em;
	cursor: pointer;
	background: transparent;
	border: 1px solid currentColor;
	border-radius: 3px;
	color: inherit;
}

.custom-taxonomy-block .taxonomy-term-toggle:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 1px;
}

/* Masquage des branches fermées. */
.custom-taxonomy-block ul.taxonomy-level[hidden] {
	display: none;
}

/* État courant. */
.custom-taxonomy-block .is-current > .taxonomy-term-row > .taxonomy-term-link {
	font-weight: 700;
}

/* =========================================================================
 * Styles prédéfinis (paramètre « style_preset »)
 * « none » n'ajoute volontairement aucune règle.
 * ========================================================================= */

/* Remise à zéro commune aux presets « dashes » et « flat ».
 * !important est nécessaire pour l'emporter sur les listes du thème. */
.custom-taxonomy-block.ctb-preset-dashes ul.taxonomy-level,
.custom-taxonomy-block.ctb-preset-flat ul.taxonomy-level {
	margin: 0 !important;
	padding: 0 !important;
	list-style: none !important;
}

.custom-taxonomy-block.ctb-preset-dashes li.taxonomy-term-item,
.custom-taxonomy-block.ctb-preset-flat li.taxonomy-term-item {
	margin: 0 !important;
	padding: 0 !important;
	list-style: none !important;
	list-style-type: none !important;
}

/* Preset « dashes » : la profondeur est indiquée par des tirets. */
.custom-taxonomy-block.ctb-preset-dashes .taxonomy-term-name::before {
	white-space: pre;
}

.custom-taxonomy-block.ctb-preset-dashes ul.categories-n2 > .taxonomy-term-item > .taxonomy-term-row .taxonomy-term-name::before {
	content: "- ";
}
.custom-taxonomy-block.ctb-preset-dashes ul.categories-n3 > .taxonomy-term-item > .taxonomy-term-row .taxonomy-term-name::before {
	content: "-- ";
}
.custom-taxonomy-block.ctb-preset-dashes ul.categories-n4 > .taxonomy-term-item > .taxonomy-term-row .taxonomy-term-name::before {
	content: "--- ";
}
.custom-taxonomy-block.ctb-preset-dashes ul.categories-n5 > .taxonomy-term-item > .taxonomy-term-row .taxonomy-term-name::before {
	content: "---- ";
}
.custom-taxonomy-block.ctb-preset-dashes ul.categories-n6 > .taxonomy-term-item > .taxonomy-term-row .taxonomy-term-name::before {
	content: "----- ";
}
.custom-taxonomy-block.ctb-preset-dashes ul.categories-n7 > .taxonomy-term-item > .taxonomy-term-row .taxonomy-term-name::before {
	content: "------ ";
}
.custom-taxonomy-block.ctb-preset-dashes ul.categories-n8 > .taxonomy-term-item > .taxonomy-term-row .taxonomy-term-name::before {
	content: "------- ";
}

/* Preset « flat » : aucune puce, tout aligné au même niveau (déjà remis à zéro ci-dessus). */
