/* ============================================================
   betriebs-vorsorge.at · Ratgeber-Stylesheet
   Gemeinsam für alle Pillar-Seiten (Kosten, Steuer, Pensionslücke, ...)
   Brand Book V2.0 — Stand 2026
   ============================================================ */

:root {
  --ow:        #FBFAF7;
  --ow-warm:   #F5F3EE;
  --ow-deep:   #ECE9E1;
  --ink:       #0A0B0D;
  --ink-soft:  #1F2128;
  --stone:     #6B6B70;
  --stone-lt:  #8C8C90;
  --blue:      #2463E8;
  --blue-soft: #EBF1FE;
  --blue-dark: #1c4fb8;
  --border:    rgba(10,11,13,0.10);
  --border-strong: rgba(10,11,13,0.16);
  --max-w:     1240px;
  --narrow:    760px;
  --reading:   720px;
  --pad:       clamp(20px, 5vw, 80px);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter Tight', system-ui, sans-serif;
  font-size: 16px; font-weight: 400; line-height: 1.65;
  letter-spacing: -0.005em;
  color: var(--ink); background: var(--ow);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
em { font-style: normal; font-weight: 600; color: var(--blue); }
strong { font-weight: 600; }

.wrap { max-width: var(--max-w); margin: 0 auto; padding: 0 var(--pad); }
.wrap--narrow { max-width: var(--narrow); margin: 0 auto; padding: 0 var(--pad); }
.wrap--reading { max-width: var(--reading); margin: 0 auto; padding: 0 var(--pad); }

/* ─── Header ─── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--ow);
  border-bottom: 1px solid var(--border);
  height: 60px; display: flex; align-items: center;
}
.nav-inner { display: flex; align-items: center; gap: 12px; width: 100%; }
.wordmark {
  font-family: 'Inter Tight', sans-serif;
  font-size: 17px; font-weight: 600;
  letter-spacing: -0.045em; color: var(--ink);
}
.wordmark .at { color: var(--blue); font-style: normal; font-weight: 600; }
.nav-back {
  margin-left: auto;
  font-family: 'Inter Tight', sans-serif;
  font-size: 14px; font-weight: 400; color: var(--stone);
  padding: 6px 12px; border-radius: 6px;
  transition: color .15s, background .15s;
}
.nav-back:hover { color: var(--ink); background: var(--ow-warm); }
.nav-back--rechner {
  margin-left: auto;
  color: var(--blue); font-weight: 500;
}
.nav-back--rechner + .nav-back--cta { margin-left: 0; }
.nav-back--rechner:hover { color: var(--blue); background: var(--blue-soft); }
.nav-back--cta {
  background: var(--ink); color: var(--ow);
  padding: 8px 16px;
}
.nav-back--cta:hover { background: var(--ink-soft); color: var(--ow); }
@media (max-width: 560px) {
  .nav-back--rechner { display: none; }
}

/* ─── Hero ─── */
.ratgeber-hero {
  padding: clamp(56px, 8vw, 110px) 0 clamp(40px, 6vw, 72px);
  border-bottom: 1px solid var(--border);
}
.eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--stone); margin-bottom: 18px;
}
.ratgeber-hero h1 {
  font-size: clamp(38px, 5vw, 64px);
  font-weight: 600; letter-spacing: -0.035em;
  line-height: 1.05; max-width: 880px;
  margin-bottom: 24px;
}
.ratgeber-hero .lead {
  font-size: clamp(18px, 1.6vw, 22px);
  line-height: 1.55; color: var(--ink-soft);
  max-width: 720px;
}
.ratgeber-hero .lead em { color: var(--blue); font-weight: 600; }

/* ─── TL;DR-Box ─── */
.tldr {
  margin: clamp(40px, 5vw, 56px) auto;
  max-width: var(--narrow);
  padding: 28px 32px;
  background: var(--ow-warm);
  border-left: 3px solid var(--blue);
  border-radius: 8px;
}
.tldr-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--blue); margin-bottom: 12px;
}
.tldr p { font-size: 16px; line-height: 1.65; }
.tldr p + p { margin-top: 10px; }

/* ─── Content ─── */
.content { padding: clamp(40px, 6vw, 72px) 0; }
.content-section { margin-bottom: clamp(40px, 5vw, 64px); }
.content-section:last-of-type { margin-bottom: 0; }
.content h2 {
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 600; letter-spacing: -0.025em;
  line-height: 1.2;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.content h3 {
  font-size: 19px; font-weight: 600;
  letter-spacing: -0.015em;
  margin-top: 28px; margin-bottom: 10px;
}
.content h4 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--stone);
  margin-top: 24px; margin-bottom: 6px;
}
.content p,
.content li {
  font-size: 16px; line-height: 1.7;
  color: var(--ink);
}
.content p + p,
.content p + ul,
.content p + ol,
.content ul + p,
.content ol + p { margin-top: 12px; }
.content ul, .content ol { padding-left: 22px; }
.content li { margin-bottom: 8px; }
.content li::marker { color: var(--stone); }
.content a:not(.btn) { color: var(--blue); transition: opacity .15s; }
.content a:not(.btn):hover { opacity: .7; }

/* ─── KPI / Faktenbox ─── */
.fact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 24px 0;
}
.fact-card {
  padding: 22px 24px;
  background: var(--ow-warm);
  border-radius: 10px;
  border: 1px solid var(--border);
}
.fact-card-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--stone); margin-bottom: 8px;
}
.fact-card-num {
  font-size: 30px; font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--ink); line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.fact-card-num em { color: var(--blue); font-weight: 600; }
.fact-card-sub {
  font-size: 13px; color: var(--stone);
  margin-top: 6px; line-height: 1.5;
}

/* ─── Beispielbox ─── */
.beispiel {
  margin: 28px 0;
  padding: 28px 32px;
  background: var(--ow-warm);
  border-left: 3px solid var(--blue);
  border-radius: 8px;
}
.beispiel-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--blue); margin-bottom: 12px;
}
.beispiel h3 {
  margin-top: 0; margin-bottom: 10px;
  font-size: 18px;
}
.beispiel p, .beispiel li { font-size: 15px; line-height: 1.6; }
.beispiel-table {
  margin-top: 14px; width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.beispiel-table th,
.beispiel-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
.beispiel-table th {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--stone);
}
.beispiel-table tbody tr:last-child td { border-bottom: none; }
.beispiel-table .num {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  text-align: right;
}
.beispiel-table .num.is-positive { color: var(--blue); }

/* ─── Vergleichstabelle ─── */
.compare-table {
  margin: 24px 0; width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}
.compare-table th,
.compare-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
.compare-table thead th {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--stone);
  background: var(--ow-warm);
}
.compare-table tbody tr:last-child td { border-bottom: none; }

/* ─── Pull-Quote / Aufmerksamkeit ─── */
.pull {
  margin: 32px 0;
  padding: 20px 28px;
  font-size: 19px; line-height: 1.55;
  border-left: 3px solid var(--ink);
  color: var(--ink-soft);
}
.pull strong { color: var(--ink); }

/* ─── Hinweis-Box (gelb/blau) ─── */
.note {
  margin: 24px 0;
  padding: 20px 24px;
  background: var(--blue-soft);
  border-left: 3px solid var(--blue);
  border-radius: 8px;
  font-size: 14px; color: var(--ink-soft); line-height: 1.65;
}
.note strong { color: var(--ink); }

/* ─── CTA-Block am Ende ─── */
.cta-block {
  margin: clamp(48px, 6vw, 80px) 0 0;
  padding: clamp(40px, 5vw, 56px);
  background: var(--ink);
  color: var(--ow);
  border-radius: 16px;
}
.cta-block .eyebrow { color: var(--stone-lt); }
.cta-block h2 {
  color: var(--ow); border: none;
  font-size: clamp(28px, 3vw, 38px);
  letter-spacing: -0.025em; line-height: 1.15;
  margin-bottom: 16px;
}
.cta-block .lead {
  color: rgba(251,250,247,0.78);
  font-size: 17px; line-height: 1.6;
  max-width: 600px;
  margin-bottom: 28px;
}
.cta-block-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-block;
  font-family: inherit; font-size: 15px; font-weight: 500;
  padding: 12px 22px;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: background .15s, border-color .15s, color .15s;
  cursor: pointer;
}
.btn--primary {
  background: var(--ow); color: var(--ink);
  border-color: var(--ow);
}
.btn--primary:hover { background: var(--ow-warm); border-color: var(--ow-warm); }
.btn--ghost {
  background: transparent; color: var(--ow);
  border-color: rgba(255,255,255,0.22);
}
.btn--ghost:hover { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.40); }

/* ─── Quellen-Block ─── */
.sources {
  margin-top: clamp(48px, 6vw, 80px);
  padding-top: clamp(32px, 4vw, 48px);
  border-top: 1px solid var(--border);
}
.sources h2 {
  font-size: 22px; border: none; padding: 0;
  margin-bottom: 18px;
}
.sources p, .sources li {
  font-size: 13px; line-height: 1.65;
  color: var(--stone);
}
.sources ul { padding-left: 20px; }
.sources li { margin-bottom: 8px; }
.sources a { color: var(--blue); word-break: break-word; }

/* ─── FAQ ─── */
.faq-section h2 { border-bottom: 1px solid var(--border); }
.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 18px 0;
}
.faq-q {
  cursor: pointer;
  font-size: 17px; font-weight: 600;
  letter-spacing: -0.015em;
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px;
  list-style: none;
}
.faq-q::-webkit-details-marker { display: none; }
.faq-q::after {
  content: '+';
  font-family: 'JetBrains Mono', monospace;
  color: var(--blue); font-weight: 500;
  transition: transform .2s;
}
.faq-item[open] .faq-q::after { transform: rotate(45deg); }
.faq-a {
  font-size: 15px; line-height: 1.65;
  margin-top: 12px;
  color: var(--ink-soft);
}
.faq-a p + p { margin-top: 10px; }

/* ─── Verwandte Ratgeber ─── */
.related {
  margin: clamp(48px, 6vw, 72px) 0 0;
  padding-top: clamp(32px, 4vw, 48px);
  border-top: 1px solid var(--border);
}
.related h2 { font-size: 22px; border: none; padding: 0; margin-bottom: 20px; }
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.related-card {
  display: block;
  padding: 22px 24px;
  background: var(--ow-warm);
  border-radius: 10px;
  border: 1px solid var(--border);
  transition: border-color .15s, background .15s;
}
.related-card:hover { border-color: var(--blue); background: var(--ow); }
.related-card .kicker {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--stone); margin-bottom: 8px;
}
.related-card h3 {
  font-size: 16px; font-weight: 600;
  letter-spacing: -0.015em;
  margin-bottom: 6px;
}
.related-card p {
  font-size: 13px; color: var(--stone);
  line-height: 1.5;
}

/* ─── Footer ─── */
.site-footer {
  background: var(--ow-warm);
  border-top: 1px solid var(--border);
  padding: clamp(40px, 5vw, 56px) 0;
  margin-top: clamp(56px, 6vw, 80px);
}
.footer-inner {
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; flex-wrap: wrap;
}
.footer-legal { font-size: 12px; color: var(--stone); line-height: 1.7; }
.footer-legal a { color: var(--blue); }
.footer-powered {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; color: var(--stone);
  letter-spacing: 0.04em; margin-top: 6px;
}

@media (max-width: 768px) {
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 8px; }
  .ratgeber-hero { padding-top: clamp(40px, 6vw, 56px); }
}

/* ============================================================
   MOBILE FIX 2026-05-24 — schließt das Layout sauber auf < 768px
   ============================================================ */
@media (max-width: 768px) {
  /* Safety: keiner soll horizontal scrollen */
  html, body { overflow-x: hidden; max-width: 100%; }
  *, *::before, *::after { max-width: 100%; }
  h1, h2, h3, h4 { overflow-wrap: break-word; word-wrap: break-word; hyphens: auto; }
  img, video, iframe, svg { max-width: 100%; height: auto; }

  /* Hero: Schrift muss in 390 px passen */
  .ratgeber-hero h1 { font-size: clamp(26px, 7.2vw, 34px); line-height: 1.15; }
  .ratgeber-hero .lead { font-size: 16px; line-height: 1.55; }
  .eyebrow { font-size: 10.5px; margin-bottom: 14px; }

  /* Content-Typografie */
  .content h2 { font-size: clamp(22px, 5.5vw, 28px); padding-bottom: 12px; margin-bottom: 14px; line-height: 1.2; }
  .content h3 { font-size: 17px; margin-top: 22px; }
  .content p, .content li { font-size: 16px; line-height: 1.65; }
  .content { padding: clamp(32px, 6vw, 56px) 0; }
  .content-section { margin-bottom: clamp(32px, 5vw, 48px); }

  /* Boxen kompakter */
  .tldr { padding: 22px 20px; margin: 32px auto; }
  .tldr p { font-size: 15.5px; }
  .beispiel { padding: 22px 20px; margin: 24px 0; }
  .beispiel h3 { font-size: 17px; }
  .beispiel p, .beispiel li { font-size: 14.5px; }
  .note { padding: 16px 18px; font-size: 13.5px; }
  .pull { padding: 16px 20px; font-size: 17px; }

  /* Fact-Cards: 1 Spalte */
  .fact-grid { grid-template-columns: 1fr; gap: 12px; }
  .fact-card { padding: 18px 20px; }
  .fact-card-num { font-size: 26px; }

  /* TABELLEN: das große Problem — horizontal scrollbar wrappen */
  .compare-table, .beispiel-table, .kpi-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    max-width: 100%;
  }
  .compare-table thead, .compare-table tbody, .compare-table tr,
  .beispiel-table thead, .beispiel-table tbody, .beispiel-table tr,
  .kpi-table thead, .kpi-table tbody, .kpi-table tr { display: table-row; }
  .compare-table { display: table; }
  .beispiel-table { display: table; }
  .kpi-table { display: table; }
  /* Wrapper-Trick: Tabelle bekommt scrollbaren Eltern */
  .compare-table-wrap, .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 calc(-1 * var(--pad)) 24px;
    padding: 0 var(--pad);
  }
  .compare-table th, .compare-table td { padding: 10px 12px; font-size: 13.5px; }
  .beispiel-table th, .beispiel-table td { padding: 8px 10px; font-size: 13px; }

  /* CTA-Block: Buttons stacken full-width */
  .cta-block { padding: 28px 22px; border-radius: 14px; }
  .cta-block h2 { font-size: 24px; }
  .cta-block .lead { font-size: 15.5px; }
  .cta-block-actions { flex-direction: column; gap: 10px; }
  .cta-block-actions .btn { width: 100%; text-align: center; }

  /* FAQ */
  .faq-q { font-size: 15.5px; gap: 10px; }
  .faq-a { font-size: 14.5px; }

  /* Verwandte */
  .related-grid { grid-template-columns: 1fr; gap: 12px; }
  .related-card { padding: 18px 20px; }

  /* Quellen */
  .sources h2 { font-size: 19px; }
  .sources p, .sources li { font-size: 12.5px; }
}

@media (max-width: 420px) {
  .ratgeber-hero h1 { font-size: clamp(24px, 7vw, 28px); }
  .content h2 { font-size: 21px; }
  .tldr, .beispiel { padding: 18px 16px; }
}
