/**
 * CMS Help Docs – Hilfe-Site.
 * Nutzt die Design-Tokens des PHINIT-Themes (inkl. Dark-Mode über body.dark-mode), hat eine
 * eigene Anpassung an das Theme „365CMS Showcase“ (body.cms-showcase, Abschnitt unten) und fällt
 * bei anderen Themes auf neutrale Werte zurück.
 */

.hd-page {
    --hd-surface: var(--bg-primary, #ffffff);
    --hd-surface-2: var(--bg-tertiary, #f1f5f9);
    --hd-text: var(--text-primary, #1e293b);
    --hd-text-2: var(--text-secondary, #334155);
    --hd-muted: var(--text-muted, #64748b);
    --hd-border: var(--border-color, #dbe4ef);
    --hd-accent: var(--accent-color, var(--primary-color, #1e3a5f));
    --hd-primary: var(--primary-color, #1e3a5f);
    --hd-link: var(--link-color, #1d4ed8);
    --hd-link-hover: var(--link-hover, #1e40af);
    --hd-radius: var(--radius, 10px);
    --hd-radius-lg: var(--radius-lg, 14px);
    --hd-shadow: var(--shadow-sm, 0 1px 3px rgba(15, 23, 42, .08));
    --hd-code-bg: #f6f8fa;
    --hd-inline-code-bg: rgba(175, 184, 193, .2);
    --hd-sidebar-w: 300px;
    --hd-sticky-top: calc(var(--header-h, 64px) + 16px);

    box-sizing: border-box;
    color: var(--hd-text);
    font-family: var(--font-ui, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif);
    margin-inline: auto;
    max-width: var(--hd-max-w, var(--container-max, 1280px));
    padding: var(--hd-space-top, 24px) 16px var(--hd-space-bottom, 56px);
    width: 100%;
}

body.dark-mode .hd-page,
html.dark-mode body .hd-page {
    --hd-code-bg: #0d1117;
    --hd-inline-code-bg: rgba(110, 118, 129, .4);
    --hd-shadow: 0 1px 3px rgba(0, 0, 0, .4);
}

.hd-page *,
.hd-page *::before,
.hd-page *::after {
    box-sizing: border-box;
}

.hd-sr-only {
    border: 0;
    clip: rect(0 0 0 0);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}

/* ── Layout: Inhalt links, Menü rechts ─────────────────────────────────── */
.hd-layout {
    align-items: start;
    display: grid;
    gap: calc(var(--hd-gap, 24px) + 4px);
    grid-template-columns: minmax(0, 1fr) var(--hd-sidebar-w);
}

.hd-main {
    display: grid;
    gap: var(--hd-gap, 24px);
    min-width: 0;
}

/* ── Breadcrumbs ───────────────────────────────────────────────────────── */
.hd-breadcrumbs ol {
    display: flex;
    flex-wrap: wrap;
    font-size: .875rem;
    gap: 6px;
    list-style: none;
    margin: 0 0 16px;
    padding: 0;
}

.hd-breadcrumbs li + li::before {
    color: var(--hd-muted);
    content: "›";
    margin-right: 6px;
}

.hd-breadcrumbs a {
    color: var(--hd-muted);
    text-decoration: none;
}

.hd-breadcrumbs a:hover {
    color: var(--hd-link);
    text-decoration: underline;
}

/* ── Bereiche / Startseite ─────────────────────────────────────────────────
 * Das Plugin gestaltet nur seine eigenen Bereiche (Kasten mit dem Markdown-Inhalt, Sidebar,
 * Widgets/Kacheln). Flächen kommen ausschließlich aus der Design-Vorlage (--hd-box-bg,
 * --hd-tile-bg); ohne Vorlage („Theme“) bleiben sie transparent auf dem Theme-Hintergrund. */
.hd-hero,
.hd-article {
    background: var(--hd-box-bg, transparent);
    box-shadow: var(--hd-box-shadow, none);
    border: 1px solid var(--hd-border);
    border-radius: var(--hd-radius-lg);
    min-width: 0;
    padding: clamp(18px, 3vw, 32px);
}

.hd-overline {
    color: var(--hd-accent);
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .08em;
    margin: 0 0 6px;
    text-transform: uppercase;
}

.hd-hero h1,
.hd-article__header h1,
.hd-article--notice h1 {
    color: var(--hd-text);
    font-size: clamp(1.6rem, 2.6vw, 2.1rem);
    line-height: 1.2;
    margin: 0 0 10px;
}

.hd-hero__intro,
.hd-lead {
    color: var(--hd-text-2);
    font-size: 1.05rem;
    line-height: 1.6;
    margin: 0 0 18px;
    max-width: 75ch;
}

.hd-facts {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
    margin: 18px 0 0;
}

.hd-fact {
    background: var(--hd-tile-bg, transparent);
    border: 1px solid var(--hd-border);
    border-radius: var(--hd-radius);
    padding: 12px 14px;
}

.hd-fact--primary {
    border-color: var(--hd-accent);
    box-shadow: inset 3px 0 0 var(--hd-accent);
}

.hd-fact dt {
    color: var(--hd-muted);
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .03em;
    margin: 0 0 4px;
    text-transform: uppercase;
}

.hd-fact dd {
    color: var(--hd-text);
    display: grid;
    font-size: 1.05rem;
    font-weight: 600;
    gap: 2px;
    margin: 0;
}

.hd-fact--primary dd strong {
    color: var(--hd-accent);
    font-size: 1.5rem;
    line-height: 1.1;
}

.hd-fact small {
    color: var(--hd-muted);
    font-size: .75rem;
    font-weight: 500;
}

.hd-fact small.hd-ok { color: #15803d; }
.hd-fact small.hd-warn { color: #b45309; }
body.dark-mode .hd-fact small.hd-ok { color: #4ade80; }
body.dark-mode .hd-fact small.hd-warn { color: #fbbf24; }
.hd-scheme-dark .hd-fact small.hd-ok { color: #4ade80; }
.hd-scheme-dark .hd-fact small.hd-warn { color: #fbbf24; }
body.dark-mode .hd-scheme-light .hd-fact small.hd-ok { color: #15803d; }
body.dark-mode .hd-scheme-light .hd-fact small.hd-warn { color: #b45309; }

.hd-badge {
    background: color-mix(in srgb, var(--hd-accent) 14%, transparent);
    border-radius: 999px;
    color: var(--hd-accent);
    display: inline-block;
    font-size: .85rem;
    padding: 2px 10px;
    width: fit-content;
}

.hd-note {
    background: color-mix(in srgb, var(--hd-accent) 8%, transparent);
    border-left: 4px solid var(--hd-accent);
    border-radius: 0 var(--hd-radius) var(--hd-radius) 0;
    color: var(--hd-text-2);
    line-height: 1.6;
    margin-top: 16px;
    padding: 12px 16px;
}

.hd-deviating {
    color: var(--hd-muted);
    font-size: .875rem;
    margin-top: 12px;
}

.hd-deviating summary { cursor: pointer; }
.hd-deviating ul { margin: 8px 0 0 1.25rem; list-style: disc; }

.hd-areas__title {
    color: var(--hd-text);
    font-size: 1rem;
    margin: 24px 0 10px;
}

.hd-areas,
.hd-cards {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    list-style: none;
    margin: 0;
    padding: 0;
}

.hd-areas a,
.hd-card {
    background: var(--hd-tile-bg, transparent);
    border: 1px solid var(--hd-border);
    border-radius: var(--hd-radius);
    color: var(--hd-text);
    display: grid;
    gap: 2px;
    height: 100%;
    padding: 12px 14px;
    text-decoration: none;
    transition: border-color .15s ease, transform .15s ease;
}

.hd-areas a:hover,
.hd-card:hover {
    border-color: var(--hd-accent);
    transform: translateY(-1px);
}

.hd-areas span,
.hd-card span {
    color: var(--hd-muted);
    font-size: .8rem;
    overflow-wrap: anywhere;
}

.hd-card--folder strong::before {
    content: "📁 ";
}

/* ── Artikel ───────────────────────────────────────────────────────────── */
.hd-article__header {
    border-bottom: 1px solid var(--hd-border);
    margin-bottom: 20px;
    padding-bottom: 14px;
}

.hd-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 12px;
}

.hd-article--readme > .hd-meta {
    border-bottom: 1px solid var(--hd-border);
    padding-bottom: 14px;
}

.hd-chip {
    background: var(--hd-surface-2);
    border: 1px solid var(--hd-border);
    border-radius: 999px;
    color: var(--hd-text-2);
    font-size: .78rem;
    padding: 3px 10px;
}

.hd-chip__key {
    color: var(--hd-muted);
    font-weight: 600;
}

.hd-toc {
    background: var(--hd-tile-bg, transparent);
    border: 1px solid var(--hd-border);
    border-radius: var(--hd-radius);
    margin: 0 0 22px;
    padding: 12px 16px;
}

.hd-toc summary {
    color: var(--hd-text);
    cursor: pointer;
    font-weight: 700;
}

.hd-toc ol {
    columns: 2 260px;
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
}

.hd-toc li {
    break-inside: avoid;
    font-size: .9rem;
    line-height: 1.5;
    padding: 1px 0;
}

.hd-toc__l3 { padding-left: 14px !important; }

.hd-toc a {
    color: var(--hd-link);
    text-decoration: none;
}

.hd-toc a:hover { text-decoration: underline; }

.hd-article__footer {
    border-top: 1px solid var(--hd-border);
    color: var(--hd-muted);
    display: flex;
    flex-wrap: wrap;
    font-size: .8rem;
    gap: 6px 20px;
    margin-top: 28px;
    padding-top: 12px;
}

.hd-pager {
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr 1fr;
    margin-top: 18px;
}

.hd-pager__link {
    background: var(--hd-tile-bg, transparent);
    border: 1px solid var(--hd-border);
    border-radius: var(--hd-radius);
    color: var(--hd-text);
    display: grid;
    gap: 2px;
    padding: 10px 14px;
    text-decoration: none;
}

.hd-pager__link span { color: var(--hd-muted); font-size: .8rem; }
.hd-pager__link--next { grid-column: 2; text-align: right; }
.hd-pager__link:hover { border-color: var(--hd-accent); }

.hd-listing { margin-top: 28px; }
.hd-listing h2 { font-size: 1.15rem; margin: 0 0 12px; }

.hd-results {
    display: grid;
    gap: 16px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.hd-results li {
    border-bottom: 1px solid var(--hd-border);
    padding-bottom: 14px;
}

.hd-results a {
    color: var(--hd-link);
    font-size: 1.05rem;
    font-weight: 600;
    text-decoration: none;
}

.hd-results__path {
    color: var(--hd-muted);
    display: block;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .75rem;
    margin: 2px 0 4px;
}

.hd-results p,
.hd-empty {
    color: var(--hd-text-2);
    line-height: 1.55;
    margin: 0;
}

.hd-button {
    background: var(--hd-primary);
    border-radius: var(--hd-radius);
    color: #fff !important;
    display: inline-block;
    padding: 8px 16px;
    text-decoration: none;
}

/* ── Sidebar ───────────────────────────────────────────────────────────── */
.hd-sidebar {
    position: sticky;
    top: var(--hd-sticky-top);
}

.hd-sidebar__panel {
    background: var(--hd-box-bg, transparent);
    box-shadow: var(--hd-box-shadow, none);
    border: 1px solid var(--hd-border);
    border-radius: var(--hd-radius-lg);
}

.hd-sidebar__toggle {
    color: var(--hd-text);
    cursor: pointer;
    font-weight: 700;
    list-style: none;
    padding: 14px 16px;
}

.hd-sidebar__toggle::-webkit-details-marker { display: none; }

@media (min-width: 961px) {
    .hd-sidebar__toggle { display: none; }
}

/* Suche fest oben, nur der Menübaum scrollt – so braucht die Suche keine deckende Fläche. */
.hd-sidebar__inner {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - var(--hd-sticky-top) - 24px);
    padding: 14px;
}

.hd-sidebar__scroll {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    position: relative;
    scrollbar-width: thin;
}

.hd-search {
    display: flex;
    flex: 0 0 auto;
    margin: 0 0 12px;
    position: relative;
}

.hd-search input {
    background: var(--hd-tile-bg, transparent);
    border: 1px solid var(--hd-border);
    border-radius: var(--hd-radius);
    color: var(--hd-text);
    font: inherit;
    font-size: .9rem;
    padding: 8px 38px 8px 12px;
    width: 100%;
}

.hd-search input:focus {
    border-color: var(--hd-accent);
    outline: 2px solid color-mix(in srgb, var(--hd-accent) 30%, transparent);
}

.hd-search__btn {
    background: transparent;
    border: 0;
    color: var(--hd-muted);
    cursor: pointer;
    font-size: 1.15rem;
    bottom: 0;
    right: 4px;
    top: 0;
    padding: 0 8px;
    position: absolute;
}

.hd-nav {
    display: grid;
    gap: 2px;
    margin-top: 8px;
}

.hd-cat {
    border-top: 1px solid var(--hd-border);
    padding: 4px 0;
}

.hd-cat__title,
.hd-tree__group > summary {
    align-items: center;
    cursor: pointer;
    display: flex;
    gap: 4px;
    list-style: none;
}

.hd-cat__title::-webkit-details-marker,
.hd-tree__group > summary::-webkit-details-marker { display: none; }

.hd-cat__title::before,
.hd-tree__group > summary::before {
    color: var(--hd-muted);
    content: "▸";
    flex: 0 0 auto;
    font-size: .75rem;
    transition: transform .15s ease;
    width: 14px;
}

.hd-cat[open] > .hd-cat__title::before,
.hd-tree__group[open] > summary::before {
    transform: rotate(90deg);
}

.hd-cat__title > a,
.hd-cat__title > span {
    color: var(--hd-text);
    font-size: .92rem;
    font-weight: 700;
    padding: 6px 0;
    text-decoration: none;
}

.hd-cat__title > a.is-active,
.hd-cat__title > a:hover { color: var(--hd-accent); }

.hd-tree {
    list-style: none;
    margin: 0 0 4px;
    padding: 0 0 0 14px;
}

.hd-tree--l1 { border-left: 1px solid var(--hd-border); margin-left: 6px; padding-left: 8px; }

.hd-tree__link {
    border-radius: 6px;
    color: var(--hd-text-2);
    display: block;
    font-size: .875rem;
    line-height: 1.35;
    padding: 5px 8px;
    text-decoration: none;
}

.hd-tree__link:hover {
    background: var(--hd-surface-2);
    color: var(--hd-text);
}

.hd-tree__link.is-active {
    background: color-mix(in srgb, var(--hd-accent) 12%, transparent);
    color: var(--hd-accent);
    font-weight: 600;
}

.hd-tree__link--folder { font-weight: 600; padding-left: 2px; }

.hd-tree__home {
    font-weight: 600;
    margin-bottom: 4px;
}

.hd-page [data-hd-hidden] { display: none !important; }

/* ── Markdown-Inhalt ───────────────────────────────────────────────────── */
.hd-md {
    color: var(--hd-text);
    font-size: var(--hd-font-size, 1rem);
    line-height: var(--hd-line-height, 1.7);
    overflow-wrap: break-word;
}

.hd-md > *:first-child { margin-top: 0 !important; }
.hd-md > *:last-child { margin-bottom: 0 !important; }

.hd-md h1,
.hd-md h2,
.hd-md h3,
.hd-md h4,
.hd-md h5,
.hd-md h6 {
    color: var(--hd-text);
    font-weight: 700;
    line-height: 1.3;
    margin: 1.8em 0 .6em;
    position: relative;
    scroll-margin-top: var(--hd-sticky-top);
}

.hd-md h1 { font-size: 1.75rem; }
.hd-md h2 { border-bottom: 1px solid var(--hd-border); font-size: 1.45rem; padding-bottom: .3em; }
.hd-md h3 { font-size: 1.2rem; }
.hd-md h4 { font-size: 1.05rem; }
.hd-md h5,
.hd-md h6 { font-size: .95rem; color: var(--hd-text-2); }

.hd-anchor {
    color: var(--hd-muted) !important;
    font-weight: 400;
    margin-left: .35em;
    opacity: 0;
    text-decoration: none !important;
    transition: opacity .15s ease;
}

.hd-md h2:hover .hd-anchor,
.hd-md h3:hover .hd-anchor,
.hd-md h4:hover .hd-anchor { opacity: 1; }

.hd-md p,
.hd-md ul,
.hd-md ol,
.hd-md dl,
.hd-md blockquote,
.hd-md pre,
.hd-md .hd-table-wrap,
.hd-md details {
    margin: 0 0 1em;
}

.hd-md ul,
.hd-md ol { padding-left: 1.6em; }
.hd-md ul { list-style: disc; }
.hd-md ol { list-style: decimal; }
.hd-md ul ul { list-style: circle; }
.hd-md li { margin: .25em 0; }
.hd-md li > ul,
.hd-md li > ol { margin: .25em 0 0; }
.hd-md li > p { margin: 0 0 .4em; }

.hd-md li input[type="checkbox"] { margin-right: .4em; }

.hd-md a {
    color: var(--hd-link);
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, var(--hd-link) 40%, transparent);
    text-underline-offset: 2px;
}

.hd-md a:hover {
    color: var(--hd-link-hover);
    text-decoration-color: currentColor;
}

.hd-md a.hd-external::after {
    content: "↗";
    font-size: .75em;
    margin-left: .15em;
    vertical-align: super;
}

.hd-md .hd-unlinked {
    border-bottom: 1px dotted var(--hd-muted);
}

.hd-md strong { font-weight: 700; }
.hd-md em { font-style: italic; }
.hd-md del { text-decoration: line-through; }

.hd-md hr {
    border: 0;
    border-top: 1px solid var(--hd-border);
    margin: 2em 0;
}

.hd-md blockquote {
    background: var(--hd-surface-2);
    border-left: 4px solid var(--hd-accent);
    border-radius: 0 var(--hd-radius) var(--hd-radius) 0;
    color: var(--hd-text-2);
    padding: .75em 1em;
}

.hd-md blockquote > :last-child { margin-bottom: 0; }

.hd-md code {
    background: var(--hd-inline-code-bg);
    border-radius: 5px;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
    font-size: .86em;
    padding: .15em .4em;
}

.hd-md pre {
    background: var(--hd-code-bg);
    border: 1px solid var(--hd-border);
    border-radius: var(--hd-radius);
    line-height: 1.5;
    overflow: auto;
    padding: 14px 16px;
    position: relative;
}

.hd-md pre code,
.hd-md pre code.hljs {
    background: transparent;
    border-radius: 0;
    display: block;
    font-size: .85rem;
    padding: 0;
    white-space: pre;
}

.hd-copy {
    background: var(--hd-code-bg);
    border: 1px solid var(--hd-border);
    border-radius: 6px;
    color: var(--hd-muted);
    cursor: pointer;
    font: 600 .72rem/1 var(--font-ui, system-ui, sans-serif);
    opacity: 0;
    padding: 5px 8px;
    position: absolute;
    right: 8px;
    top: 8px;
    transition: opacity .15s ease;
}

.hd-md pre:hover .hd-copy,
.hd-copy:focus-visible { opacity: 1; }

.hd-table-wrap {
    border: 1px solid var(--hd-border);
    border-radius: var(--hd-radius);
    max-width: 100%;
    overflow-x: auto;
}

.hd-md table {
    border-collapse: collapse;
    font-size: .92rem;
    min-width: 100%;
}

.hd-md th,
.hd-md td {
    border-bottom: 1px solid var(--hd-border);
    padding: 8px 12px;
    text-align: left;
    vertical-align: top;
}

.hd-md th + th,
.hd-md td + td { border-left: 1px solid var(--hd-border); }

.hd-md thead th {
    background: var(--hd-surface-2);
    font-weight: 700;
    white-space: nowrap;
}

.hd-md tbody tr:last-child td { border-bottom: 0; }
.hd-md tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--hd-surface-2) 50%, transparent); }

.hd-md img {
    border-radius: var(--hd-radius);
    height: auto;
    max-width: 100%;
}

.hd-md dt { font-weight: 700; margin-top: .6em; }
.hd-md dd { margin: 0 0 .4em 1.2em; }

.hd-md .footnotes {
    border-top: 1px solid var(--hd-border);
    color: var(--hd-muted);
    font-size: .875rem;
    margin-top: 2em;
}

/* ── Layout-Varianten (Admin → Anzeige) ────────────────────────────────── */
.hd-layout--left {
    grid-template-columns: var(--hd-sidebar-w) minmax(0, 1fr);
}

.hd-layout--left .hd-sidebar {
    order: -1;
}

.hd-layout--static .hd-sidebar {
    position: static;
}

.hd-layout--static .hd-sidebar__inner {
    max-height: none;
}

.hd-layout--static .hd-sidebar__scroll {
    overflow: visible;
}

.hd-page--flat .hd-hero,
.hd-page--flat .hd-article,
.hd-page--flat .hd-sidebar__panel {
    border-color: transparent;
}

/* Ohne Fläche darf der Text bis an den Rand laufen; mit Fläche (Vorlage) bleibt der Innenabstand. */
.hd-page--flat:not(.hd-has-box) .hd-hero,
.hd-page--flat:not(.hd-has-box) .hd-article {
    padding-inline: 0;
}

/* Vorlage „Akzent Petrol“: farbige Kopflinie an Kästen und Menü */
.hd-preset-accent .hd-hero,
.hd-preset-accent .hd-article,
.hd-preset-accent .hd-sidebar__panel {
    border-top: 3px solid var(--hd-accent);
}

.hd-page--flat:not(.hd-has-box) .hd-sidebar__panel {
    border-left: 1px solid var(--hd-border);
    border-radius: 0;
}

/* ── Theme „365CMS Showcase“ (cms-showcase) ────────────────────────────────
 * Das Showcase-Theme legt Plugin-Seiten in eine zentrierte Inhaltsfläche
 * (.sc-plugin-area, Breite im Customizer) mit Seitenbalken bis zum Fensterrand.
 * Die Hilfe-Site füllt diese Fläche und übernimmt Palette und Schriften des Themes;
 * einen eigenen Hintergrund bringt sie nicht mit. Werte aus Admin → Anzeige
 * (Farben, Breiten, Radius, Schriftgröße) haben weiterhin Vorrang.
 */
body.cms-showcase .hd-page {
    --hd-surface: var(--sc-paper, #ffffff);
    --hd-surface-2: var(--sc-surface, #f5f7fb);
    --hd-text: var(--sc-text, #0f172a);
    --hd-text-2: color-mix(in srgb, var(--sc-text, #0f172a) 78%, var(--sc-muted, #475569));
    --hd-muted: var(--sc-muted, #475569);
    --hd-border: var(--sc-border, #e2e8f0);
    --hd-accent: var(--sc-primary, #2563eb);
    --hd-primary: var(--sc-primary, #2563eb);
    --hd-link: var(--sc-primary, #2563eb);
    --hd-link-hover: var(--sc-primary-hover, #1d4ed8);
    --hd-sticky-top: calc(var(--header-h, 4.25rem) + 16px);

    font-family: var(--sc-font-body, inherit);
}

/* In der Inhaltsfläche setzt das Theme Breite und Innenabstand; die maximale Inhaltsbreite
   aus Admin → Anzeige gilt weiterhin, ist aber durch die Fläche begrenzt. */
body.cms-showcase .sc-plugin-area > .hd-page {
    padding: 0;
}

body.cms-showcase .hd-page h1,
body.cms-showcase .hd-page h2,
body.cms-showcase .hd-page h3,
body.cms-showcase .hd-sidebar__toggle,
body.cms-showcase .hd-cat__title {
    font-family: var(--sc-font-head, inherit);
}

body.cms-showcase .hd-md code,
body.cms-showcase .hd-md pre,
body.cms-showcase .hd-results__path,
body.cms-showcase .hd-article__footer code {
    font-family: var(--sc-font-mono, ui-monospace, monospace);
}

body.cms-showcase .hd-md pre {
    border-color: var(--hd-border);
}

/* Sidebar im Stil des Themes (ohne eigene Fläche) */
/* Theme-Markierung nur ohne eigene Design-Vorlage – sonst gilt die Akzentfarbe der Vorlage. */
body.cms-showcase .hd-preset-theme .hd-tree__link.is-active {
    background: var(--sc-primary-soft, color-mix(in srgb, var(--hd-accent) 10%, transparent));
    color: var(--hd-accent);
}

body.cms-showcase .hd-button {
    border-radius: 999px;
    font-weight: 700;
}

body.cms-showcase .hd-button:hover {
    background: var(--sc-primary-hover, var(--hd-link-hover));
    color: #fff;
}

/* ── Responsive: Menü oberhalb des Inhalts, einklappbar ───────────────── */
@media (max-width: 960px) {
    .hd-layout,
    .hd-layout--left { grid-template-columns: minmax(0, 1fr); }
    .hd-sidebar { order: -1; position: static; }
    .hd-sidebar__inner { max-height: none; padding-top: 0; }
    .hd-pager { grid-template-columns: 1fr; }
    .hd-pager__link--next { grid-column: 1; }
}

@media (max-width: 520px) {
    .hd-page { padding-inline: 12px; }
    .hd-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hd-md { font-size: .97rem; }
}

@media print {
    .hd-sidebar,
    .hd-pager,
    .hd-breadcrumbs,
    .hd-copy,
    .hd-anchor { display: none !important; }
    .hd-layout { display: block; }
    .hd-hero,
    .hd-article { border: 0; box-shadow: none; padding: 0; }
    body.cms-showcase .hd-hero { background: none; color: #000; }
    body.cms-showcase .hd-hero::after { display: none; }
    body.cms-showcase .hd-hero h1,
    body.cms-showcase .hd-hero .hd-fact dd { color: #000; }
}
