/* TOC für herrmontag.de
 *
 * Wird vom Hugo-Template nur auf längeren, gegliederten Artikeln geladen.
 * Die Einbindung erfolgt automatisch über layouts/partials/toc-enabled.html.
 */

.toc-inline,
.hm-toc {
  font-size: 0.8125rem;
  line-height: 1.4;
}

.toc-inline {
  margin: 2.5rem 0;
  padding-top: 0.9rem;
  border-top: 1px solid var(--rule-strong, #d9d9dd);
}

.toc-inline .toc-inline__title,
.hm-toc .hm-toc__title {
  margin: 0 0 0.6rem;
  font-family: var(--font-mono, monospace);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--fg-faint, #767676);
}

.toc-inline .hm-toc__list,
.hm-toc .hm-toc__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.toc-inline .hm-toc__item,
.hm-toc .hm-toc__item {
  margin: 0;
}

.toc-inline .hm-toc__item--sub,
.hm-toc .hm-toc__item--sub {
  padding-left: 0.9rem;
}

.toc-inline .hm-toc__item a,
.hm-toc .hm-toc__item a {
  display: block;
  padding: 0.2rem 0;
  color: var(--fg-muted, #666);
  text-decoration: none;
  border-bottom: 0;
  transition: color 0.12s ease;
}

.toc-inline .hm-toc__item a:hover,
.toc-inline .hm-toc__item a:focus-visible,
.toc-inline .hm-toc__item a[aria-current="true"],
.hm-toc .hm-toc__item a:hover,
.hm-toc .hm-toc__item a:focus-visible,
.hm-toc .hm-toc__item a[aria-current="true"] {
  color: var(--fg, #000);
}

.toc-inline .hm-toc__item a[aria-current="true"],
.hm-toc .hm-toc__item a[aria-current="true"] {
  font-weight: 600;
}

.hm-toc {
  position: fixed;
  top: calc(var(--masthead-h, 4rem) + 2.5rem);
  left: calc(50% + 364px);
  width: 208px;
  max-height: calc(100vh - var(--masthead-h, 4rem) - 5rem);
  max-height: calc(100dvh - var(--masthead-h, 4rem) - 5rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-left: 1rem;
  border-left: 1px solid var(--rule-strong, #d9d9dd);
  z-index: 10;
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
  scrollbar-width: thin;
}

.hm-toc.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
}

@media (max-width: 1199.98px) {
  .hm-toc {
    display: none;
  }
}

@media (min-width: 1200px) {
  .toc-inline {
    display: none;
  }
}

@media (min-width: 560px) {
  .toc-inline .hm-toc__list {
    columns: 2;
    column-gap: 2rem;
  }

  .toc-inline .hm-toc__item {
    break-inside: avoid;
  }
}

@media print {
  .hm-toc,
  .toc-inline {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hm-toc {
    transition: none;
  }
}
