/* Spis treści (moduł spis-tresci) */
/* Odstęp pod przyklejonym nagłówkiem: z nagłówkiem Toolkitu liczy go moduł Szablony (scroll-padding-top = wysokość nagłówka + 20 px),
   z innym nagłówkiem – ustawienie „odstęp” tego modułu. */
html:not(:has(.tbt-naglowek)) { scroll-padding-top: var(--tbt-spis-odstep, 100px); }
html:has(.tbt-spis--plynne) { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html:has(.tbt-spis--plynne) { scroll-behavior: auto; } }

.tbt-spis { margin: 0 0 1.75em; font-size: .95em; line-height: 1.45; }
.tbt-spis__tytul { margin: 0; font-weight: 700; font-size: 1.05em; }
.tbt-spis summary.tbt-spis__tytul { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: .75em; }
.tbt-spis summary.tbt-spis__tytul::-webkit-details-marker { display: none; }
.tbt-spis summary.tbt-spis__tytul::after { content: ""; width: .5em; height: .5em; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-.15em); transition: transform .2s; flex: none; opacity: .6; }
.tbt-spis details:not([open]) > summary.tbt-spis__tytul::after { transform: rotate(-45deg); }
.tbt-spis__tytul + .tbt-spis__lista { margin-top: .6em; }

.tbt-spis .tbt-spis__lista { margin: 0; padding: 0 0 0 1.1em; list-style: none; }
.tbt-spis > .tbt-spis__lista, .tbt-spis details > .tbt-spis__lista { padding-left: 0; }
.tbt-spis li { margin: .3em 0; padding: 0; }
.tbt-spis li > .tbt-spis__lista { margin-top: .3em; }
/* Podkreślenie z !important: style linków w treści (motyw, element „Treść wpisu” w Bricks – często z #id) nie podkreślają spisu. */
.tbt-spis a { color: inherit; text-decoration: none !important; }
.tbt-spis a:hover, .tbt-spis a:focus-visible { color: var(--tbt-kolor-akcent, currentColor); text-decoration: underline !important; }

/* Numeracja 1, 1.1, 1.1.1 */
.tbt-spis--num .tbt-spis__lista { counter-reset: tbt-spis; }
.tbt-spis--num li { counter-increment: tbt-spis; }
.tbt-spis--num li > a::before { content: counters(tbt-spis, ".") ". "; opacity: .65; font-variant-numeric: tabular-nums; }

/* Style */
.tbt-spis--ramka { padding: 1em 1.25em; border: 1px solid rgba(0, 0, 0, .1); border-radius: var(--tbt-promien, 8px); background: rgba(0, 0, 0, .025); }
.tbt-spis--akcent { padding: .25em 0 .25em 1.1em; border-left: 3px solid var(--tbt-kolor-akcent, currentColor); }
.tbt-spis--minimalny .tbt-spis__tytul { font-size: .8em; text-transform: uppercase; letter-spacing: .06em; opacity: .75; }
