/* ══ Beitragsseite: Navigation, Tabellen, Grafiken, Kästen (16.09.2026) ══
   Lädt mit der Komponente „Beitrags-Pillen“, also auf jeder Beitragsseite,
   und zwar nach dem Customizer-CSS. Deshalb reichen hier gleich starke
   Selektoren, um Bestandsregeln zu überschreiben. */

/* Sprungziele landen unter dem klebenden Kopf. */
.single-post .post-content h2[id] { scroll-margin-top: 110px; }

/* ── 1. Inhaltsverzeichnis: einklappbar, solange es nicht als Randspalte klebt ── */
.toc .toc-schalter {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; margin: 0; padding: 0; border: 0; background: none; cursor: pointer;
  font: inherit; color: inherit; text-align: left;
}
.toc .toc-schalter:focus-visible { outline: 2px solid var(--signal); outline-offset: 4px; border-radius: 4px; }
.toc .toc-anzahl { margin-left: 8px; font-weight: 500; color: var(--grey); }
.toc .toc-schalter::after {
  content: ""; flex: none; width: 9px; height: 9px; margin: -4px 4px 0 0;
  border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink);
  transform: rotate(45deg); transition: transform .25s var(--ease-premium);
}
.toc.ist-offen .toc-schalter::after { transform: rotate(-135deg); margin-top: 4px; }
.toc:not(.ist-klappbar) .toc-schalter { cursor: default; }
.toc:not(.ist-klappbar) .toc-schalter::after,
.toc:not(.ist-klappbar) .toc-anzahl { display: none; }
.toc.ist-klappbar:not(.ist-offen) nav { display: none; }
.toc.ist-klappbar.ist-offen nav { margin-top: 14px; }
@media (max-width: 1599px) {
  .toc .toc-list a { padding-block: 8px; }
}

/* ── 1b. Leseleiste unten und Inhaltsblatt, nur auf langen Beiträgen ── */
.lese-leiste {
  position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 80;
  display: flex; align-items: center; gap: 10px;
  min-height: 48px; margin: 0; padding: 0 16px; overflow: hidden;
  border: 0; border-radius: var(--r-m); background: var(--ink); color: var(--paper);
  font-family: var(--display); font-size: .9rem; text-align: left; cursor: pointer;
  box-shadow: 0 12px 30px -12px rgba(11, 28, 48, .5);
  transform: translateY(150%); visibility: hidden;
  transition: transform .3s var(--ease-premium), visibility 0s linear .3s;
}
.lese-leiste.ist-sichtbar { transform: none; visibility: visible; transition: transform .3s var(--ease-premium), visibility 0s; }
.lese-leiste:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }
.lese-leiste__nr { flex: none; color: rgba(248, 249, 255, .7); font-weight: 500; white-space: nowrap; }
.lese-leiste__titel { flex: 1; min-width: 0; text-align: left; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 600; }
.lese-leiste__pfeil {
  flex: none; width: 8px; height: 8px; margin-top: 4px;
  border-left: 2px solid var(--paper); border-top: 2px solid var(--paper); transform: rotate(45deg);
}
.lese-leiste__fortschritt { position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: var(--signal); }
@media (min-width: 721px) {
  .lese-leiste { left: 50%; right: auto; width: min(680px, calc(100% - 24px)); transform: translate(-50%, 150%); }
  .lese-leiste.ist-sichtbar { transform: translateX(-50%); }
  dialog.lese-blatt { left: 50%; right: auto; width: min(680px, 100%); transform: translateX(-50%); }
}
@media (min-width: 1600px) { .lese-leiste, .lese-blatt { display: none !important; } }

/* Fortschrittslinie an der Unterkante des klebenden Kopfs. Auf dem Telefon
   trägt die Leseleiste den Fortschritt, deshalb dort ausgeblendet und
   umgekehrt ab 721px der Streifen in der Leiste. */
.mh .lese-linie {
  position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: var(--signal); transform: scaleX(0); transform-origin: left center;
  pointer-events: none;
}
@media (max-width: 720px) { .mh .lese-linie { display: none; } }
@media (min-width: 721px) { .lese-leiste__fortschritt { display: none; } }
@media (prefers-reduced-motion: reduce) { .lese-leiste, .lese-leiste.ist-sichtbar { transition: none; } }

dialog.lese-blatt {
  position: fixed; inset: auto 0 0 0; width: 100%; max-width: none; max-height: 78vh;
  margin: 0; padding: 0; border: 0; border-radius: 16px 16px 0 0;
  background: #fff; color: var(--ink); box-shadow: 0 -12px 40px rgba(11, 28, 48, .25);
}
dialog.lese-blatt[open] { display: flex; flex-direction: column; }
dialog.lese-blatt::backdrop { background: rgba(11, 28, 48, .45); }
.lese-blatt__kopf {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 8px 6px 20px; border-bottom: 1px solid var(--hair);
  font-family: var(--display); font-weight: 600; font-size: 1rem;
}
.lese-blatt__zu {
  display: grid; place-items: center; width: 44px; height: 44px; margin: 0; padding: 0;
  border: 0; background: none; color: var(--ink); font-size: 1.6rem; line-height: 1; cursor: pointer;
}
.lese-blatt__liste { margin: 0; padding: 4px 20px calc(16px + env(safe-area-inset-bottom, 0px)); overflow-y: auto; list-style: none; }
.lese-blatt__liste li { margin: 0; padding: 0; }
.lese-blatt__liste li::before { content: none; }
dialog.lese-blatt .lese-blatt__liste a,
dialog.lese-blatt .lese-blatt__liste a:visited {
  display: block; padding: 12px 0; border-bottom: 1px solid var(--hair);
  color: var(--ink); text-decoration: none; font-family: var(--display); font-size: 1rem; line-height: 1.35;
}
.lese-blatt__liste li:last-child a { border-bottom: 0; }
dialog.lese-blatt .lese-blatt__liste a.is-current { color: var(--signal); font-weight: 600; }
dialog.lese-blatt .lese-blatt__liste a:hover { color: var(--signal); }

/* ── 2. Tabellen auf dem Telefon als gestapelte Zeilen ── */
@media (max-width: 600px) {
  .single-post .post-content .preis-tabelle { overflow: visible; }
  .single-post .post-content .preis-tabelle table { display: block; min-width: 0; width: 100%; }
  .single-post .post-content .preis-tabelle thead {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
  .single-post .post-content .preis-tabelle tbody,
  .single-post .post-content .preis-tabelle tr { display: block; }
  .single-post .post-content .preis-tabelle tr { padding: 14px 0; border-bottom: 1px solid var(--hair); }
  .single-post .post-content .preis-tabelle tr:last-child { border-bottom: 0; }
  .single-post .post-content .preis-tabelle td {
    display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
    padding: 3px 0; border: 0; text-align: right; white-space: normal !important;
  }
  .single-post .post-content .preis-tabelle td::before {
    content: attr(data-label); flex: none; max-width: 55%;
    color: var(--grey); font-size: .85rem; font-weight: 500; text-align: left;
  }
  .single-post .post-content .preis-tabelle td:first-child {
    display: block; padding-bottom: 6px; text-align: left;
    font-family: var(--display); font-weight: 600; color: var(--ink);
  }
  .single-post .post-content .preis-tabelle td:first-child::before { content: none; }
  /* Rangspalte: Nummer und Name in einer Zeile */
  .single-post .post-content .preis-tabelle td.ist-rang { display: inline-block; padding: 0 8px 6px 0; }
  .single-post .post-content .preis-tabelle td.ist-rang + td {
    display: inline-block; padding: 0 0 6px; text-align: left;
    font-family: var(--display); font-weight: 600; color: var(--ink);
  }
  .single-post .post-content .preis-tabelle td.ist-rang + td::before { content: none; }
}

/* ── 3. Grafiken: Download unter jeder Grafik ── */
.bklp .post-content .grafik-download { margin: -12px 0 36px; font-size: .88rem; color: var(--grey); }
.bklp .post-content .grafik-download a { color: var(--grey); }
.single-post .post-content figure picture { display: block; }

/* ── 4. „Was das für Ihr Budget heißt“ als Kasten ── */
.bklp .post-content .budget-kasten {
  margin: 32px 0; padding: 22px 24px;
  background: #fff; border: 1px solid var(--hair); border-radius: var(--r-m);
  box-shadow: inset 3px 0 0 var(--ink);
}
.bklp .post-content .budget-kasten p { margin-bottom: 0; }
.bklp .post-content .budget-kasten .budget-kasten__label {
  margin: 0 0 8px; font-family: var(--display); font-weight: 600; font-size: .78rem;
  letter-spacing: .08em; text-transform: uppercase; color: var(--grey); line-height: 1.3;
}

/* ── 5. Download-Karte ── */
.bklp .post-content .download-karte {
  margin: 32px 0; padding: 24px; background: #fff; border: 1px solid var(--hair); border-radius: var(--r-m);
}
.bklp .post-content .download-karte .download-karte__titel {
  margin: 0 0 6px; font-family: var(--display); font-weight: 700; font-size: 1.2rem; line-height: 1.3; color: var(--ink);
}
.bklp .post-content .download-karte .download-karte__text { margin: 0 0 18px; font-size: .95rem; color: var(--grey); }
.bklp .post-content .download-karte__knoepfe { display: flex; flex-wrap: wrap; gap: 10px; }
.bklp .post-content a.download-knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border: 1px solid var(--ink); border-radius: var(--r-s);
  background: #fff; color: var(--ink); text-decoration: none;
  font-family: var(--display); font-weight: 600; font-size: .95rem;
  transition: background-color .2s var(--ease-premium), border-color .2s var(--ease-premium);
}
.bklp .post-content a.download-knopf .download-knopf__groesse { font-weight: 500; opacity: .75; }
.bklp .post-content a.download-knopf:hover { border-color: var(--signal); }
.bklp .post-content a.download-knopf--primaer { background: var(--signal); border-color: var(--signal); color: #fff; }
.bklp .post-content a.download-knopf--primaer:hover { background: #003ec7; border-color: #003ec7; }
.bklp .post-content a.download-knopf:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }
@media (max-width: 600px) {
  .bklp .post-content a.download-knopf { flex: 1 1 100%; }
}

/* ── 6. Farbflächen auf dem Telefon randlos ── */
@media (max-width: 720px) {
  .single-post .post-content .tb2b-flaeche {
    width: auto; max-width: none; border-radius: 0;
    margin-inline: calc(50% - 50vw);
    padding: 36px calc(50vw - 50%);
  }
}
