/* Tempus Belli Blocks : styles du bloc Table des matières (chargé uniquement quand le bloc est présent). Dépend de style.css. */
/* ===== Table des matières (1.16.0) ===== */

/* Les titres de l'article restent visibles sous un menu fixe quand on clique sur la table (décalage réglable dans le bloc). */
h1[id], h2[id], h3[id], h4[id], h5[id], h6[id] { scroll-margin-top: var(--tbb-toc-off, 90px); }

.tbb.tbb-toc {
	--_bul: var(--toc-bullet-c, var(--tbb-accent, #c4161c));
	--_act: var(--toc-active-c, var(--tbb-accent, #c4161c));
	box-sizing: border-box; width: 100%; max-width: var(--toc-mw, none); margin-block: 1.6em;
	font-size: var(--toc-fs, inherit);
}
.tbb-toc--empty { padding: 20px; text-align: center; border: 2px dashed rgba(127, 127, 127, .4); border-radius: 12px; color: var(--tbb-muted, #5b6270); }
.tbb-toc__box { background: var(--toc-bg, rgba(127, 127, 127, .09)); border-radius: var(--toc-r, 14px); padding: var(--toc-pad, 22px); color: var(--toc-link-c, inherit); }
.tbb-toc--border .tbb-toc__box { border: 1px solid var(--toc-border-c, rgba(127, 127, 127, .35)); }

/* Titre + chevron */
.tbb-toc__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; list-style: none; user-select: none; }
.tbb-toc__head::-webkit-details-marker { display: none; }
.tbb-toc__head::marker { content: none; }
.tbb-toc__head:focus-visible { outline: 3px solid var(--_act); outline-offset: 4px; border-radius: 6px; }
.tbb-toc__title { font-size: 1.28em; font-weight: 500; line-height: 1.25; color: var(--toc-title-c, inherit); }
.tbb-toc__title--static { margin: 0 0 12px; }
.tbb-toc__chev { flex: none; width: 22px; height: 22px; color: var(--toc-title-c, currentColor); transition: transform .35s cubic-bezier(.4, 0, .2, 1); }
.tbb-toc__box:not([open]) .tbb-toc__chev, .tbb-toc__box.is-closing .tbb-toc__chev { transform: rotate(180deg); }
.tbb-toc__body { margin-top: 14px; }
.tbb-toc__title--static + .tbb-toc__body { margin-top: 0; }

/* Liste */
.tbb-toc__l { list-style: none !important; margin: 0 !important; padding: 0 !important; }
.tbb-toc__i { list-style: none !important; position: relative; margin: var(--toc-gap, 6px) 0 0 !important; padding: 0 !important; line-height: 1.4; }
.tbb-toc__i::marker { content: none; }
.tbb-toc__l > .tbb-toc__i:first-child { margin-top: 0 !important; }
.tbb-toc--nested .tbb-toc__l .tbb-toc__l { margin-top: var(--toc-gap, 6px) !important; margin-left: var(--toc-ind, 18px) !important; }
.tbb-toc--nested .tbb-toc__l .tbb-toc__l > .tbb-toc__i:first-child { margin-top: 0 !important; }

/* Puces (rond de couleur, à gauche de chaque ligne) */
.tbb-toc--b .tbb-toc__i { padding-left: 16px !important; }
.tbb-toc--b .tbb-toc__i::before { content: ""; position: absolute; left: 0; top: .62em; width: 6px; height: 6px; border-radius: 50%; background: var(--_bul); }
.tbb-toc--b.tbb-toc--nested .tbb-toc__l .tbb-toc__l { margin-left: max(0px, calc(var(--toc-ind, 18px) - 16px)) !important; }

/* Mode « liste simple » : l'indentation suit le niveau du titre */
.tbb-toc--flat .is-d2 { margin-left: var(--toc-ind, 18px); }
.tbb-toc--flat .is-d3 { margin-left: calc(var(--toc-ind, 18px) * 2); }
.tbb-toc--flat .is-d4 { margin-left: calc(var(--toc-ind, 18px) * 3); }
.tbb-toc--flat .is-d5 { margin-left: calc(var(--toc-ind, 18px) * 4); }
.tbb-toc--flat .is-d6 { margin-left: calc(var(--toc-ind, 18px) * 5); }

/* Liens et numéros */
.tbb .tbb-toc__a { color: var(--toc-link-c, inherit) !important; text-decoration: none !important; border: 0; box-shadow: none; overflow-wrap: anywhere; transition: color .15s ease; }
.tbb .tbb-toc__a:hover, .tbb .tbb-toc__a:focus-visible { color: var(--toc-hover-c, var(--_act)) !important; text-decoration: underline !important; text-underline-offset: 3px; }
.tbb-toc__n { color: var(--toc-num-c, #9aa0a8); font-variant-numeric: tabular-nums; }
.tbb .tbb-toc__a.is-active { color: var(--_act) !important; font-weight: 700; }

/* Collée à l'écran pendant la lecture (idéal dans la barre latérale) */
.tbb-toc--sticky { position: sticky; top: var(--toc-top, 90px); max-height: calc(100vh - var(--toc-top, 90px) - 24px); overflow: auto; align-self: start; border-radius: var(--toc-r, 14px); scrollbar-width: thin; }

@media (max-width: 600px) { .tbb-toc--sticky { position: static; max-height: none; overflow: visible; } }
@media (prefers-reduced-motion: reduce) { .tbb-toc__chev, .tbb .tbb-toc__a { transition: none; } }
