/* M2 (Handoff V.3) — Lesebausteine für Blog-Artikel und Rechtsseiten: Inhaltsverzeichnis (Components §15),
   Sprungmenü mobil, Lesefortschritt, Zurück-Link (§20). Verhalten in js/unterseiten/20-lesen.js. */

/* ---------- Zurück-Link (§20): Tertiär-Button mit Pfeil links ---------- */
.u-zurueck { display: inline-flex; align-items: center; gap: 8px; color: var(--brand); text-decoration: none; }
.u-zurueck svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: translate 0.15s var(--ease-out-cubic); }
.u-zurueck:hover svg { translate: -3px 0; }
.u-zurueck:focus-visible { outline: 2px solid var(--brand); outline-offset: 4px; border-radius: 8px; }

/* ---------- Lesefortschritt: 2px unter der Kopfzeile ---------- */
.u-fortschritt { position: fixed; left: 0; right: 0; top: 0; height: 2px; z-index: 60; pointer-events: none; }
.u-fortschritt__bar { height: 100%; background: var(--color-primary-600); transform-origin: 0 50%; transform: scaleX(0); }

/* ---------- Inhaltsverzeichnis (Desktop, sticky) ---------- */
.u-toc { position: sticky; top: 104px; display: flex; flex-direction: column; gap: 12px; }
.u-toc__titel { color: var(--text-primary); }
.u-toc__liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.u-toc__link { display: flex; align-items: center; min-height: 36px; padding: 6px 0 6px 14px; color: var(--color-primary-900);
  text-decoration: none; box-shadow: inset 2px 0 0 var(--color-primary-100); transition: color 0.15s, box-shadow 0.15s; }
.u-toc__link:hover { color: var(--brand); }
.u-toc__link.is-aktiv { color: var(--color-primary-600); font-weight: 600; box-shadow: inset 2px 0 0 var(--color-primary-600); }
.u-toc__link:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }

/* Variante Rechtsseiten: Panel mit Teil-Labels, Links als Pillen */
.u-toc--panel { width: 100%; max-width: 400px; background: var(--color-primary-25); border-radius: 24px; padding: 28px 24px;
  max-height: calc(100vh - 128px); overflow: auto; overscroll-behavior: contain; }
.u-toc__teil { color: var(--color-primary-900); margin: 12px 0 4px; }
.u-toc--panel .u-toc__link { min-height: 40px; padding: 10px 14px; border-radius: 12px; box-shadow: none; }
.u-toc--panel .u-toc__link.is-aktiv { background: var(--color-white); box-shadow: none; }

/* ---------- Sprungmenü (mobil) ---------- */
.u-sprung { display: none; background: var(--color-primary-50); border-radius: 24px; padding: 20px 16px 16px; flex-direction: column; gap: 12px; }
.u-sprung__label { color: var(--text-primary); }
.u-sprung__select { appearance: none; -webkit-appearance: none; width: 100%; height: 56px; padding: 0 44px 0 16px; border: 0; border-radius: 16px;
  background: var(--color-white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%235b3fa8' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M5 8l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 16px center / 20px;
  font: inherit; color: var(--text-primary); text-overflow: ellipsis; }
.u-sprung__select:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

@media (max-width: 1023px) {
  .u-toc { display: none; }
  .u-sprung { display: flex; }
}

/* Anker-Ziele nicht unter die feste Kopfzeile scrollen */
[data-toc-ziel] { scroll-margin-top: 104px; }

@media print {
  .nav, .u-toc, .u-sprung, .u-fortschritt, footer, .s17, .u-zurueck { display: none !important; }
  [data-druck-url] a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.85em; }
}
