/* Ratgeber (/ratgeber/) – kleine Ergänzung zu style.css, nutzt dessen Variablen und Muster.
   Lesespalte + Inhaltsverzeichnis, Hinweis-Kästen, Vergleichstabelle, Checklisten. Keine externen Ressourcen. */

/* Brotkrümel (gleich wie /branchen/) */
.crumbs { margin: -10px 0 14px; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; align-items: center; font-size: 0.92rem; color: var(--muted); }
.crumbs li { display: inline-flex; align-items: center; }
.crumbs li + li::before { content: '/'; padding: 0 8px; color: var(--muted); }
.crumbs a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; color: var(--muted); font-weight: 600; text-decoration: none; }
.crumbs a:hover { color: var(--brand); text-decoration: underline; }
.crumbs [aria-current] { color: var(--text); font-weight: 600; }

/* Kopf */
.rg-head h1 { max-width: 920px; font-size: clamp(1.95rem, 4.2vw, 3.1rem); }
.rg-head .lead { max-width: 720px; }
.rg-meta { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 0; margin-top: 22px; font-size: 0.92rem; font-weight: 600; color: var(--muted); }
.rg-meta li:not(:last-child)::after { content: '·'; margin: 0 12px; }

/* Aufbau: Lesespalte links, Inhaltsverzeichnis rechts (mitlaufend) */
.rg-wrap { padding: 56px 0 96px; }
.rg-layout { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 64px; align-items: start; }
.rg-article { grid-column: 1; grid-row: 1; min-width: 0; max-width: 720px; font-size: 1.05rem; line-height: 1.75; }
.rg-toc { grid-column: 2; grid-row: 1; position: sticky; top: calc(var(--cmd-h) + 28px); padding: 20px 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--soft); }
.rg-toc-title { margin-bottom: 6px; font-size: 0.78rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.rg-toc ol { list-style: none; counter-reset: toc; }
.rg-toc li { counter-increment: toc; }
.rg-toc a { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 4px 0; color: var(--text); font-size: 0.95rem; font-weight: 600; line-height: 1.35; text-decoration: none; }
.rg-toc a::before { content: counter(toc); flex-shrink: 0; width: 24px; font-size: 0.82rem; font-weight: 800; color: var(--brand-dark); }
.rg-toc a:hover { color: var(--brand); text-decoration: underline; }
.rg-toc-extra { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); }
.rg-toc .rg-toc-extra a::before { content: '→'; color: var(--brand-dark); }

/* Fließtext */
.rg-article p, .rg-article li { color: var(--text); }
.rg-article p { margin: 0 0 1.05em; }
.rg-article h2 { font-size: clamp(1.5rem, 2.6vw, 1.95rem); margin: 64px 0 16px; }
.rg-article h3 { font-size: 1.18rem; margin: 32px 0 8px; }
.rg-article ul:not([class]), .rg-article ol:not([class]) { margin: 0 0 1.2em; padding-left: 1.35em; }
.rg-article ul:not([class]) li, .rg-article ol:not([class]) li { margin-bottom: 0.45em; padding-left: 0.2em; }
.rg-article .rg-more ul, .rg-article .rg-calc ul { margin: 0; padding-left: 0; }
.rg-article .rg-more ul li { margin: 0; padding-left: 0; }
.rg-article .rg-calc ul li { margin: 0; padding: 4px 0 4px 22px; }
.rg-article a:not(.btn) { text-decoration-thickness: 1px; text-underline-offset: 3px; }
.rg-article strong { color: inherit; }
.rg-article :focus-visible, .rg-toc :focus-visible, .rg-cards :focus-visible, .crumbs a:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

/* „Kurz gesagt“ */
.rg-summary { margin: 0 0 28px; padding: 24px 28px; border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: var(--radius); background: var(--soft); }
.rg-article .rg-summary h2 { margin: 0 0 4px; font-size: 1.12rem; letter-spacing: 0; }
.rg-summary .feature-list { margin-top: 8px; }
.rg-summary .feature-list li { font-size: 1rem; line-height: 1.6; padding-top: 6px; padding-bottom: 6px; }

/* Hinweis (keine Rechtsberatung u. Ä.) */
.rg-note { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; margin: 0 0 36px; padding: 16px 20px; border: 1px solid #FDE68A; border-radius: 12px; background: #FFFBEB; }
.rg-note-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #FDE68A; color: #78350F; font-weight: 800; font-size: 0.95rem; line-height: 1; }
.rg-article .rg-note p { margin: 0; color: #78350F; font-size: 0.95rem; line-height: 1.6; }

/* Kasten „So machen wir es bei RexCom“ */
.rg-box { margin: 48px 0; padding: 26px 28px; border: 1px solid #C7D2FE; border-radius: var(--radius); background: #EEF2FF; }
.rg-box .eyebrow { margin-bottom: 8px; color: var(--brand-dark); }
.rg-article .rg-box h2, .rg-article .rg-box h3 { margin: 0 0 10px; font-size: 1.3rem; }
.rg-article .rg-box p:last-child { margin-bottom: 0; }
.rg-box .feature-list { margin: 4px 0 16px; }
.rg-box .feature-list li { font-size: 1rem; line-height: 1.6; }

/* Auslöser-Liste (Problem → ohne Banner) */
.rg-items { list-style: none; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin: 24px 0 32px; }
.rg-item { padding: 22px 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow); }
.rg-article .rg-item h3 { margin: 0 0 8px; font-size: 1.12rem; }
.rg-article .rg-item p { margin: 0 0 8px; }
.rg-article .rg-item p:last-child { margin-bottom: 0; }
.rg-article .rg-fix { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.rg-fix-label { display: block; font-size: 0.78rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brand-dark); }

/* Nummerierte Schritte */
.rg-steps { list-style: none; counter-reset: rg-step; display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; margin: 26px 0 36px; }
.rg-steps > li { position: relative; min-height: 42px; padding-left: 60px; counter-increment: rg-step; }
.rg-steps > li::before { content: counter(rg-step); position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--grad); color: #fff; font-weight: 800; font-size: 1.1rem; }
.rg-article .rg-steps h3 { margin: 6px 0 6px; font-size: 1.12rem; }
.rg-article .rg-steps p { margin: 0; }

/* Vergleichstabelle – auf dem Handy als gestapelte Karten */
.rg-table { width: 100%; margin: 24px 0 36px; border: 1px solid var(--line); border-radius: var(--radius); border-collapse: separate; border-spacing: 0; overflow: hidden; font-size: 0.97rem; line-height: 1.55; }
.rg-table caption { padding: 0 0 10px; text-align: left; font-size: 0.92rem; color: var(--muted); }
.rg-table th, .rg-table td { padding: 14px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.rg-table thead th { background: var(--soft); font-size: 0.8rem; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }
.rg-table thead th.rg-col-main { color: var(--brand-dark); }
.rg-table tbody th { width: 28%; font-weight: 700; color: var(--ink); }
.rg-table td { color: var(--text); }
.rg-table tbody tr:last-child > * { border-bottom: 0; }

/* Formel-Kästen „Gesamtkosten“ */
.rg-calc { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 20px 0 28px; }
.rg-calc > div { padding: 20px 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow); }
.rg-article .rg-calc h3 { margin: 0 0 10px; font-size: 1.08rem; }
.rg-calc ul { list-style: none; }
.rg-calc li { position: relative; padding: 4px 0 4px 22px; font-size: 0.98rem; line-height: 1.5; }
.rg-calc li::before { content: '+'; position: absolute; left: 2px; top: 4px; font-weight: 800; color: var(--brand-dark); }
.rg-calc li:first-child::before { content: '='; }

/* Checkliste / Fragenliste */
.rg-check { list-style: none; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin: 20px 0 32px; }
.rg-check li { position: relative; padding: 14px 18px 14px 54px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); line-height: 1.55; }
.rg-check li::before { content: ''; position: absolute; left: 18px; top: 16px; width: 20px; height: 20px; border: 2px solid var(--brand); border-radius: 5px; }
.rg-check.rg-q li::before { content: '?'; display: grid; place-items: center; border: 0; border-radius: 50%; background: #EEF2FF; color: var(--brand-dark); font-weight: 800; font-size: 0.9rem; line-height: 1; }

/* Selbsttest je Punkt */
.rg-article .rg-test { margin: 16px 0 0; padding: 14px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); font-size: 0.98rem; line-height: 1.6; }
.rg-test-label { display: block; font-size: 0.78rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brand-dark); }
.rg-num { display: inline-grid; place-items: center; width: 1.6em; height: 1.6em; margin-right: 0.35em; border-radius: 0.4em; background: var(--grad); color: #fff; font-size: 0.8em; vertical-align: 0.08em; letter-spacing: 0; }

/* Häufige Fragen innerhalb des Artikels */
.rg-article .faq { max-width: none; margin: 8px 0 0; }
.rg-article .faq details { padding: 14px 0; }
.rg-article .faq summary { font-size: 1.04rem; }
.rg-article .faq details p { margin: 10px 0 4px; }

/* Dezenter Hinweis aufs Erstgespräch */
.rg-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 28px; margin: 64px 0 0; padding: 26px 28px; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(135deg, rgba(37, 99, 235, 0.06), rgba(124, 58, 237, 0.07)); }
.rg-cta-text { flex: 1 1 340px; }
.rg-article .rg-cta h2 { margin: 0 0 6px; font-size: 1.3rem; }
.rg-article .rg-cta p { margin: 0; }
.rg-cta-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; }
.rg-article .rg-cta-actions a:not(.btn) { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; text-decoration: none; }
.rg-article .rg-cta-actions a:not(.btn):hover { text-decoration: underline; }
/* „Fragen dazu?“ – Kasten am Artikelende führt zur Online-Terminbuchung (/termin/) */
.rg-article .rg-cta .rg-cta-kicker { margin: 0 0 6px; font-size: 0.8rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brand-dark); }
.rg-cta-actions .btn { text-align: center; text-wrap: balance; }

/* Weitere Ratgeber */
.rg-more { margin-top: 48px; }
.rg-article .rg-more h2 { margin: 0 0 14px; font-size: 1.2rem; }
.rg-more ul { list-style: none; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.rg-article .rg-more a { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 52px; padding: 12px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); color: var(--text); font-weight: 700; line-height: 1.4; text-decoration: none; transition: border-color 0.15s, color 0.15s; }
.rg-more a::after { content: '→'; flex-shrink: 0; color: var(--brand); }
.rg-article .rg-more a:hover { border-color: #A5B4FC; color: var(--brand); }

/* Übersicht /ratgeber/ */
.rg-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.card.rg-card { position: relative; display: flex; flex-direction: column; }
.card.rg-card:focus-within { border-color: var(--brand); }
.rg-card .icon svg { width: 26px; height: 26px; fill: none; stroke: var(--brand-dark); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.rg-card .eyebrow { margin: 18px 0 8px; font-size: 0.78rem; }
.rg-card h2 { margin: 0 0 10px; font-size: 1.3rem; line-height: 1.25; }
.rg-card h2 a { color: inherit; text-decoration: none; }
.rg-card h2 a::after { content: ''; position: absolute; inset: 0; border-radius: var(--radius); }
.rg-card h2 a:focus-visible { outline: none; }
.rg-card h2 a:focus-visible::after { outline: 3px solid var(--brand); outline-offset: 2px; }
.card.rg-card p { color: var(--text); }
.rg-card-meta { margin-top: auto; padding-top: 18px; font-size: 0.9rem; font-weight: 600; color: var(--muted) !important; }
.rg-card .card-link { margin-top: 6px; color: var(--brand); }
.rg-disclaimer { max-width: 720px; margin-top: 36px; font-size: 0.95rem; }
.rg-index-cta { margin-top: 56px; }

/* ---------- Tablet & Handy ---------- */
@media (max-width: 1024px) {
    .rg-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .rg-toc { grid-column: 1; grid-row: auto; position: static; max-width: 740px; margin-bottom: 40px; }
    .rg-article { grid-row: auto; }
    .rg-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
    .rg-wrap { padding: 40px 0 72px; }
    .rg-article { font-size: 1rem; }
    .rg-article h2 { margin-top: 52px; }
}
@media (max-width: 700px) {
    .rg-cards, .rg-calc { grid-template-columns: minmax(0, 1fr); }
    /* Tabelle stapeln: jede Zeile wird eine Karte, die Spaltennamen stehen über den Werten */
    .rg-table { border: 0; border-radius: 0; overflow: visible; }
    .rg-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
    .rg-table tbody, .rg-table tr, .rg-table th, .rg-table td { display: block; width: 100%; }
    .rg-table tbody tr { margin-bottom: 12px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
    .rg-table tbody th { width: 100%; background: var(--soft); }
    .rg-table td { border-bottom: 1px solid var(--line); }
    .rg-table tbody tr > :last-child, .rg-table tbody tr:last-child > * { border-bottom: 0; }
    .rg-table tbody tr:last-child > th { border-bottom: 1px solid var(--line); }
    .rg-table td::before { content: attr(data-label); display: block; margin-bottom: 2px; font-size: 0.76rem; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; color: var(--brand-dark); }
}
@media (max-width: 560px) {
    .rg-summary, .rg-box, .rg-cta { padding: 20px; }
    .rg-item { padding: 18px 20px; }
    .rg-note { padding: 14px 16px; gap: 12px; }
    .rg-cta-actions, .rg-cta-actions .btn { width: 100%; }
    .rg-cta-actions .btn { padding-left: 16px; padding-right: 16px; }
    .rg-steps > li { padding-left: 54px; }
}

/* ---------- Dunkelmodus (folgt der Systemeinstellung wie style.css) ---------- */
@media (prefers-color-scheme: dark) {
    .rg-toc { background: #0F1829; }
    .rg-toc a::before, .rg-toc .rg-toc-extra a::before, .rg-fix-label, .rg-test-label, .rg-table thead th.rg-col-main, .rg-box .eyebrow, .rg-calc li::before, .rg-article .rg-cta .rg-cta-kicker { color: #93C5FD; }
    .rg-table tbody th { color: #F1F5F9; }
    .rg-note { background: rgba(251, 191, 36, 0.08); border-color: rgba(251, 191, 36, 0.32); }
    .rg-note-icon { background: rgba(251, 191, 36, 0.22); color: #FDE68A; }
    .rg-article .rg-note p { color: #FDE68A; }
    .rg-box { background: rgba(96, 165, 250, 0.08); border-color: #3B4B7A; }
    .rg-item, .rg-calc > div, .rg-check li, .rg-article .rg-more a { background: #0F1829; }
    .rg-check.rg-q li::before { background: rgba(96, 165, 250, 0.16); color: #BFDBFE; }
    .rg-cta { background: linear-gradient(135deg, rgba(96, 165, 250, 0.08), rgba(167, 139, 250, 0.1)); }
    .rg-article .rg-more a:hover { border-color: #6366F1; color: #BFDBFE; }
    .rg-card .icon svg { stroke: #93C5FD; }
}
@media (prefers-color-scheme: dark) and (max-width: 700px) {
    .rg-table tbody th { background: #0F1829; }
    .rg-table td::before { color: #93C5FD; }
}

/* ---------- Drucken (z. B. die Checkliste) ---------- */
@media print {
    .site-header, .cmd-scrim, .qj, .site-footer, .crumbs, .rg-toc, .rg-cta, .rg-more { display: none !important; }
    body { display: block; font-size: 11pt; background: #fff; color: #000; }
    .page-head { padding: 0 0 12pt !important; background: none; border: 0; }
    .rg-wrap { padding: 0; }
    .rg-layout { display: block; }
    .rg-article { max-width: none; }
    .rg-article a { color: inherit; }
    .rg-item, .rg-calc > div, .rg-check li { box-shadow: none; break-inside: avoid; }
    .rg-article h2 { break-after: avoid; }
}
