/* =========================================================================
   MDJAMO LTD — mitlaufendes Inhaltsverzeichnis auf AGB, Datenschutz, Impressum

   Der Text bleibt exakt dort, wo er ohne Verzeichnis steht (mittig, 78ch).
   Das Verzeichnis sitzt im freien Rand links daneben und erscheint nur,
   wenn dort genug Platz ist und recht-verzeichnis.js es befüllt hat.
   Ohne JavaScript oder auf schmalen Bildschirmen bleibt alles wie bisher.
   ========================================================================= */
.recht .legal h2 { scroll-margin-top: calc(var(--kopf-h) + 1.5rem); }

.recht-raster { position: relative; }
.recht-verzeichnis[hidden] { display: none; }
.recht-verzeichnis { display: none; }

@media (min-width: 1240px) {
  .verzeichnis-an .recht-verzeichnis {
    display: block;
    position: absolute;
    top: 0;
    bottom: 0;
    right: calc(50% + min(50% - var(--rand), 39ch) + 2.75rem);
    width: clamp(170px, calc(50% - 39ch - 2.75rem - var(--rand)), 260px);
  }
  .verzeichnis-an .terms-contents { display: none; }
}

.verz-liste {
  position: sticky;
  top: calc(var(--kopf-h) + 2.5rem);
  max-height: calc(100vh - var(--kopf-h) - 4rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  padding: 0 .25rem 1rem 0;
  font-size: .875rem;
  line-height: 1.4;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .6s ease, transform .6s cubic-bezier(.22, .7, .2, 1);
}
.verz-liste.ist-da { opacity: 1; transform: none; }

.verz-titel {
  display: block;
  margin: 0 0 .9rem;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--rost);
}

.verz-spur { position: relative; }
.verz-spur a {
  display: grid;
  grid-template-columns: 1.9em minmax(0, 1fr);
  column-gap: .35rem;
  padding: .42rem .6rem .42rem .9rem;
  border-left: 2px solid var(--linie);
  border-radius: 0 6px 6px 0;
  color: var(--grau);
  text-decoration: none;
  transition: color .25s ease, background-color .25s ease;
}
.verz-spur a.ohne-nr { grid-template-columns: minmax(0, 1fr); }
.verz-spur a.ist-anlage { margin-top: .9rem; grid-template-columns: minmax(0, 1fr); }
.verz-spur a:hover { color: var(--navy); background: rgba(173, 66, 31, .05); }
.verz-spur a:focus-visible { outline: 2px solid var(--rost); outline-offset: 2px; }
.verz-spur a[aria-current="location"] { color: var(--navy); background: rgba(173, 66, 31, .07); }
.verz-nr { color: #8a7f74; font-variant-numeric: tabular-nums; }
.verz-spur a[aria-current="location"] .verz-nr { color: var(--rost); }

.verz-marke {
  position: absolute;
  left: 0;
  top: 0;
  width: 2px;
  height: 0;
  border-radius: 2px;
  background: var(--rost);
  opacity: 0;
  pointer-events: none;
  transition: transform .4s cubic-bezier(.22, .7, .2, 1), height .4s cubic-bezier(.22, .7, .2, 1), opacity .25s ease;
}
.verz-marke.ist-an { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .verz-liste, .verz-spur a, .verz-marke { transition: none; }
  .verz-liste { transform: none; }
}
@media print { .recht-verzeichnis { display: none !important; } }
