/* ==========================================================================
   Table of contents on blog posts (2026-09-22) - variant B (collapsible).

   Own file: loaded on blog posts only (inc/include/toc.php), so the
   per-page dynamic CSS does not have to be regenerated for it, and it is
   excluded from WP Rocket's "Remove Unused CSS" (which would strip the
   state rules). Markup: inc/include/toc.php, behaviour: assets/js/toc.js.
   Colours are the theme's CI variables from mixing.css.
   ========================================================================== */

/* smooth scrolling for anchors without JS (class is set by assets/js/toc.js) */
html.cb-toc-smooth {
    scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
    html.cb-toc-smooth {
        scroll-behavior: auto;
    }
}

/* jump target below the fixed header (JS corrects the exact position) */
.single-post h2[id] {
    scroll-margin-top: 124px;
}

/* standalone block between the hero banner and the first content section */
.cb-toc-block {
    position: relative;
    display: block;
    width: 100%;
    padding-top: 60px;
}

.cb-toc {
    box-sizing: border-box;
    margin: 0 0 8px;
    padding: 16px 22px 20px;
    background-color: var(--sk-skeen, #f5f6fb);
    border-radius: 15px;
    color: var(--sk-primary, #011b3b);
    font-family: 'Manrope', 'Manrope Fallback', Arial, sans-serif;
    text-align: left;
}
.cb-toc *,
.cb-toc *::before,
.cb-toc *::after {
    box-sizing: border-box;
}

/* --- head row ------------------------------------------------------------ */
.cb-toc__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--sk-border, #EBEBF1);
}
.cb-toc--closed .cb-toc__head {
    padding-bottom: 0;
    border-bottom: 0;
}

.cb-toc .cb-toc__label {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0;
    padding: 0;
    font-size: 16px;
    line-height: 1.4;
    font-weight: 700;
    color: var(--sk-primary, #011b3b);
}
.cb-toc__icon {
    flex: 0 0 auto;
    color: var(--sk-secondary, #faac01);
}
.cb-toc__count {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 4px;
    background-color: var(--sk-white, #ffffff);
    color: var(--sk-primary, #011b3b);
    font-size: 12px;
    line-height: 1.3;
    font-weight: 700;
    white-space: nowrap;
}

.cb-toc .cb-toc__toggle {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: -8px -8px -8px 0;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background-color: transparent;
    color: var(--sk-primary, #011b3b);
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}
/* hover only where there is a real pointer - after a tap a touch device
   keeps the hover state until something else is tapped (2026-09-22) */
@media (hover: hover) {
    .cb-toc .cb-toc__toggle:hover {
        background-color: var(--sk-white, #ffffff);
        color: var(--sk-secondary, #faac01);
    }
}
.cb-toc .cb-toc__toggle:focus-visible {
    outline: 2px solid var(--sk-secondary, #faac01);
    outline-offset: 2px;
}
.cb-toc .cb-toc__toggle[aria-expanded="false"] .cb-toc__chevron {
    transform: rotate(180deg);
}
.cb-toc__chevron {
    transition: transform 0.25s ease;
}
@media (prefers-reduced-motion: reduce) {
    .cb-toc__chevron,
    .cb-toc .cb-toc__toggle {
        transition: none;
    }
}

/* --- list ------------------------------------------------------------------
   The theme decorates list items in content areas (gold check circle via
   li:before plus left padding) - switched off here with !important, the
   theme rules are more specific on some pages.                             */
.cb-toc .cb-toc__list {
    margin: 12px 0 0 !important;
    padding: 0 !important;
    list-style: none !important;
    counter-reset: cb-toc;
    background: none !important;
    border: 0 !important;
}
.cb-toc .cb-toc__list[hidden] {
    display: none !important;
}
/* phones before the JS runs: closed (toc.js then sets hidden + data-toc-ready) */
@media (max-width: 767.98px) {
    .cb-toc:not([data-toc-ready]) .cb-toc__list {
        display: none;
    }
    .cb-toc:not([data-toc-ready]) .cb-toc__head {
        padding-bottom: 0;
        border-bottom: 0;
    }
    .cb-toc:not([data-toc-ready]) .cb-toc__chevron {
        transform: rotate(180deg);
    }
}

.cb-toc .cb-toc__item {
    position: static !important;
    display: flex !important;
    align-items: flex-start;
    gap: 12px;
    margin: 0 !important;
    padding: 5px 0 !important;
    counter-increment: cb-toc;
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    font-size: 16px;
    line-height: 1.45;
    font-weight: 500;
    color: var(--sk-primary, #011b3b);
    background: none !important;
    border: 0 !important;
    list-style: none !important;
}
.cb-toc .cb-toc__item::before {
    content: counter(cb-toc, decimal-leading-zero) !important;
    position: static !important;
    display: block !important;
    flex: 0 0 24px;
    width: 24px !important;
    height: auto !important;
    left: auto !important;
    top: auto !important;
    margin: 0 !important;
    padding: 3px 0 0 !important;
    background: none !important;
    border: 0 !important;
    border-radius: 0 !important;
    transform: none !important;
    color: var(--sk-secondary, #faac01);
    font-size: 12px;
    line-height: 1.4;
    font-weight: 800;
    letter-spacing: 0.02em;
    font-variant-numeric: tabular-nums;
}
.cb-toc .cb-toc__item::after {
    content: none !important;
}

/* links: the theme's content link styling is switched off in here */
.cb-toc .cb-toc__link {
    color: var(--sk-primary, #011b3b) !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    padding: 0 !important;
    background: none !important;
    overflow-wrap: anywhere;
    hyphens: auto;
    transition: color 0.2s ease;
}
.cb-toc .cb-toc__link:focus-visible {
    color: var(--sk-secondary, #faac01) !important;
    text-decoration: underline !important;
    text-underline-offset: 3px;
}
@media (hover: hover) {
    .cb-toc .cb-toc__link:hover {
        color: var(--sk-secondary, #faac01) !important;
        text-decoration: underline !important;
        text-underline-offset: 3px;
    }
}
.cb-toc .cb-toc__link:focus-visible {
    outline: 2px solid var(--sk-secondary, #faac01);
    outline-offset: 2px;
    border-radius: 3px;
}
.cb-toc .cb-toc__link.is-active {
    color: var(--sk-secondary, #faac01) !important;
    font-weight: 700 !important;
}

/* --- desktop: two columns -------------------------------------------------- */
@media (min-width: 768px) {
    .cb-toc .cb-toc__list {
        column-count: 2;
        column-gap: 32px;
    }
}

/* --- phone: one column, rows at least 44px --------------------------------- */
@media (max-width: 767.98px) {
    .cb-toc-block {
        padding-top: 40px;
    }
    .cb-toc {
        padding: 12px 16px 14px;
    }
    .cb-toc .cb-toc__label {
        font-size: 15px;
    }
    .cb-toc .cb-toc__toggle {
        margin-right: -6px;
    }
    .cb-toc .cb-toc__list {
        margin-top: 8px !important;
    }
    .cb-toc .cb-toc__item {
        min-height: 44px;
        align-items: center;
        padding: 6px 0 !important;
        font-size: 15.5px;
        line-height: 1.4;
    }
    .cb-toc .cb-toc__item::before {
        padding-top: 0 !important;
    }
}

/* ==========================================================================
   "In Kuerze" box (2026-10-06): HTML from the editor, same markup as on
   seoagents.de, e.g.
     <div class="sa-kuerze" role="note" aria-label="Das Wichtigste in Kürze">
       <span class="sa-kuerze__label">In Kürze</span>
       <p class="sa-kuerze__title">optional title</p>
       <ul><li><strong>Lead word</strong> text</li> ...</ul>
       <p class="sa-kuerze__stand">optional: Stand ...</p>
     </div>
   single.php places the editor content of posts with an H1 section between
   the banner and the table of contents (.cb-intro-block).
   ========================================================================== */
.cb-intro-block {
    position: relative;
    display: block;
    width: 100%;
    padding-top: 60px;
}
.cb-intro-block + .cb-toc-block {
    padding-top: 32px;
}

.sa-kuerze {
    box-sizing: border-box;
    position: relative;
    margin: 0;
    padding: 22px 28px 22px 24px;
    background-color: #f3f3f3;
    border-left: 3px solid var(--sk-secondary, #faac01);
    border-radius: 4px;
    color: var(--sk-primary, #011b3b);
    font-family: inherit;
}
.sa-kuerze p {
    margin: 0;
}
.sa-kuerze p:empty {
    display: none;
}
.sa-kuerze .sa-kuerze__label {
    display: block;
    margin: 0 0 14px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--sk-primary, #011b3b);
}
.sa-kuerze .sa-kuerze__title {
    margin: 0 0 12px;
    font-size: 19px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--sk-primary, #011b3b);
}
.sa-kuerze ul {
    margin: 0;
    padding: 0;
    list-style: none;
}
.sa-kuerze ul li {
    position: relative;
    margin: 0 0 10px;
    padding: 0 0 0 20px;
    list-style: none;
    font-size: 15.5px;
    font-weight: 400;
    line-height: 1.6;
    color: var(--sk-primary, #011b3b);
}
.sa-kuerze ul li:last-child {
    margin-bottom: 0;
}
.sa-kuerze ul li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.62em;
    width: 7px;
    height: 7px;
    border-radius: 1px;
    background-color: var(--sk-secondary, #faac01);
}
.sa-kuerze ul li strong {
    font-weight: 700;
    color: var(--sk-primary, #011b3b);
}
.sa-kuerze .sa-kuerze__stand {
    margin: 16px 0 0;
    padding: 12px 0 0;
    border-top: 1px solid #e1e1e1;
    font-size: 13px;
    line-height: 1.5;
    color: #5b6475;
}

@media (max-width: 767.98px) {
    .cb-intro-block {
        padding-top: 40px;
    }
    .cb-intro-block + .cb-toc-block {
        padding-top: 24px;
    }
    .sa-kuerze {
        padding: 18px 18px 18px 16px;
    }
    .sa-kuerze ul li {
        margin-bottom: 12px;
        padding-left: 18px;
        font-size: 15px;
    }
}
