/* pp-banner.css v1.0.0 (Release-Kandidat PP/Banner) - Slots, Sidebar-Verzeichnis, Anker-Versatz.
   Eigene Datei (wird nach style.css eingebunden); nutzt nur vorhandene Variablen (--bg-card, --border, --radius-sm, --font-mono, --accent ...), keine neuen Farbwerte.
   Rollback = Datei und den <link> in includes/header.php entfernen. */

/* ── Werbe-Slots ───────────────────────────────────────────────────────────────────────────────── */
.pp-slot {
    display: block;
    box-sizing: border-box;
    width: 100%;
    max-width: 340px;
    margin: 24px auto;
    padding: 10px 12px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-align: center;
    color: var(--text-muted);
    overflow: hidden;
}
/* In der Sidebar rahmt schon .sidebar-box: kein zweiter Rahmen (kein "Kasten im Kasten") */
.sidebar-box .pp-slot { margin: 0 auto; padding: 0; background: transparent; border: 0; border-radius: 0; }
.pp-slot .pp-label {
    display: inline-block;
    margin: 0 0 8px;
    padding: 2px 9px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.5;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text);
    background: var(--accent-dim);
    border: 1px solid var(--border-hover);
    border-radius: 999px;
}
.pp-slot a { display: block; color: var(--accent); text-decoration: none; }
.pp-slot a:hover, .pp-slot a:focus-visible { color: var(--accent-hover); }
.pp-slot a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* "a > img": hoehere Spezifitaet als die Artikelregel .artikel-inhalt img (setzt margin) - sonst sitzt das Bild links statt mittig */
.pp-slot a > img { display: block; max-width: 100%; height: auto; margin: 0 auto; border-radius: 4px; }
.pp-slot strong { display: block; color: var(--text); font-size: 0.95rem; }
.pp-slot .pp-text { display: block; margin-top: 4px; font-size: 0.82rem; }
/* Hinweistext des Consent-Gates: --text-muted statt --text-dim */
.pp-slot .pp-gate-hint { margin: 0; font-size: 0.8rem; color: var(--text-muted); }
.pp-slot .pp-gate-hint[hidden] { display: none; }

/* ── Sidebar auf Artikelseiten: Werbebox oben, Inhaltsverzeichnis sticky darunter ──────────────────
   Ursache der frueheren Ueberlappung: .sidebar ist eine Flex-Spalte, .sidebar-toc war position:sticky VOR weiteren Boxen; ein sticky Element
   behaelt seinen Platz im Fluss und lag beim Scrollen ueber den Boxen darunter. Loesung: das Verzeichnis liegt in .sidebar-stack, das den ganzen
   freien Platz der Sidebar einnimmt (flex:1); alle weiteren Boxen stehen NACH dem Wrapper. Das sticky Element kann den Wrapper nicht verlassen
   -> keine Ueberlappung. Werbung steht im normalen Fluss (nicht mitlaufend). Nur ab 901 px (darunter ist das Verzeichnis ausgeblendet). */
.sidebar-stack { flex: 1 1 auto; min-height: 0; }
.sidebar-stack-inner { display: flex; flex-direction: column; gap: 18px; }
@media (max-width: 900px) {
    .sidebar-stack { display: none; }   /* das Verzeichnis ist dort ausgeblendet: leerer Wrapper wuerde nur Abstand erzeugen */
}
@media (min-width: 901px) {
    .sidebar-stack-inner { position: sticky; top: calc(var(--nav-h) + 16px); max-height: calc(100vh - var(--nav-h) - 32px); }
    .sidebar-stack .sidebar-toc { position: static; flex: 1 1 auto; min-height: 0; overflow-y: auto; }
}

/* ── Artikelbild: das Template setzt width/height (Platz reservieren, keine Layout-Verschiebung); height:auto erhaelt die bisherige Darstellung ── */
.artikel-img img { height: auto; }

/* ── Anker-Ziele nicht unter der Sticky-Navigation verstecken (TOC-Klick, URL-#Hash, Zurueck-Taste) ─── */
html { scroll-padding-top: calc(var(--nav-h) + 16px); }

@media (max-width: 600px) {
    .pp-slot { margin: 20px auto; max-width: 100%; }
    .sidebar-box .pp-slot { margin: 0 auto; }
}
