/* ============================================================================
   MyInvest24 Design System v1 (mi24-system.css)
   ----------------------------------------------------------------------------
   EINE kanonische Quelle fuer Tokens + Komponenten. Laedt als LETZTES
   Stylesheet auf jeder Seite (direkt nach myinvest-signature.css) und
   gewinnt damit die Kaskade gegen seitenlokale Inline-<style>-Drift.

   Vertrag:
   - Inline-<style>-Bloecke enthalten nur noch Seiten-Spezifika.
   - Token-/Komponenten-Redefinitionen (--accent, .btn-primary, Badges …)
     im Inline-CSS sind verboten — sie gehoeren hierher.
   - Widget-Inseln (.mi24-calc, .mi24-calculator, .bf24-calculator) und
     Funnel-Klassen (.funnel-*) werden hier bewusst NICHT angefasst.

   Sprache: Editorial Real-Estate — Weiss/Soft-Flaechen, Georgia-Serif-
   Headlines (via signature), Zinc-Schwarz #18181b als Primaer-Aktion,
   Navy #0f172a als dunkle Flaeche, EIN Akzentblau, Gruen nur fuer Erfolg.
   ============================================================================ */

:root {
  /* Ink / Flaechen */
  --m24-ink: #020a0f;
  --m24-navy: #0f172a;
  --m24-slate: #1e293b;
  --m24-paper: #ffffff;
  --m24-soft: #f8fafc;
  --m24-soft-2: #eef3f6;
  --m24-line: rgba(15, 23, 42, 0.1);
  --m24-line-strong: rgba(15, 23, 42, 0.16);

  /* Primaer-Aktion (de-facto Standard der Site) */
  --m24-action: #18181b;
  --m24-action-hover: #2d2d30;
  --m24-action-deep: #09090b;
  --m24-action-soft: rgba(24, 24, 27, 0.06);
  --m24-action-line: rgba(24, 24, 27, 0.14);

  /* Text */
  --m24-text: #47474f;
  --m24-muted: #5d6470;
  --m24-faint: #71717a;

  /* Akzentblau (eine Skala) */
  --m24-blue: #0369a1;
  --m24-blue-light: #0284c7;
  --m24-blue-deep: #075985;
  --m24-blue-soft: rgba(3, 105, 161, 0.08);

  /* Semantik */
  --m24-success: #10b981;
  --m24-success-deep: #0e7a62;
  --m24-success-soft: rgba(16, 185, 129, 0.1);
  --m24-warning: #f59e0b;
  --m24-warning-soft: #fffbeb;
  --m24-danger: #ef4444;

  /* Geometrie */
  --m24-radius-s: 8px;
  --m24-radius-m: 12px;
  --m24-radius-l: 16px;
  --m24-radius-pill: 999px;

  /* Schatten */
  --m24-shadow-s: 0 2px 8px rgba(2, 10, 15, 0.05);
  --m24-shadow-m: 0 8px 24px rgba(2, 10, 15, 0.07);
  --m24-shadow-l: 0 16px 40px rgba(2, 10, 15, 0.1);

  /* Typo */
  --m24-font-display: Georgia, "Times New Roman", serif;
  --m24-font-body: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* ============================================================================
   1 · BUTTONS — ein System, alle historischen Klassennamen als Aliasse
   ============================================================================ */

.btn,
.btn-primary,
.btn-secondary,
.btn-outline,
.btn-white,
.btn-ghost,
.btn-small,
.btn-lg,
.btn-primary-large,
.btn-primary-small,
.btn-secondary-large,
.cta-section__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 12px 26px;
  border: 1px solid transparent;
  border-radius: var(--m24-radius-pill);
  font-family: var(--m24-font-body);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease,
    transform 0.2s ease, box-shadow 0.2s ease;
}

/* Primaer: Zinc-Schwarz */
.btn-primary,
.btn-primary-large,
.btn-primary-small {
  background: var(--m24-action);
  color: #ffffff;
}

.btn-primary:hover,
.btn-primary-large:hover,
.btn-primary-small:hover {
  background: var(--m24-action-hover);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: var(--m24-shadow-m);
}

/* Sekundaer: weisse Flaeche + Hairline (funktioniert auf hell UND dunkel) */
.btn-secondary,
.btn-outline,
.btn-secondary-large {
  background: rgba(255, 255, 255, 0.86);
  border-color: var(--m24-line-strong);
  color: var(--m24-ink);
}

.btn-secondary:hover,
.btn-outline:hover,
.btn-secondary-large:hover {
  background: #ffffff;
  border-color: var(--m24-ink);
  color: var(--m24-ink);
}

/* Weiss (auf dunklen Flaechen) */
.btn-white,
.cta-section__btn {
  background: #ffffff;
  color: var(--m24-action);
}

.btn-white:hover,
.cta-section__btn:hover {
  background: var(--m24-soft);
  color: var(--m24-action-deep);
  transform: translateY(-1px);
}

/* Ghost (auf dunklen Flaechen) */
.btn-ghost {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

/* Groessen */
.btn-small,
.btn-primary-small {
  min-height: 38px;
  padding: 8px 18px;
  font-size: 13.5px;
}

.btn-lg,
.btn-primary-large,
.btn-secondary-large {
  min-height: 50px;
  padding: 15px 32px;
  font-size: 16px;
}

/* Kontext: Buttons in dunklen CTA-Baendern werden hell */
.cta-section .btn-primary,
.cta-section .btn-primary-large {
  background: #ffffff;
  color: var(--m24-action);
}

.cta-section .btn-primary:hover,
.cta-section .btn-primary-large:hover {
  background: var(--m24-soft);
  color: var(--m24-action-deep);
}

.cta-section .btn-secondary-large,
.cta-section .btn-outline {
  border-color: rgba(255, 255, 255, 0.35);
  color: #ffffff;
}

.cta-section .btn-secondary-large:hover,
.cta-section .btn-outline:hover {
  border-color: #ffffff;
  color: #ffffff;
}

/* ============================================================================
   2 · BADGES & PILLS — ein Boxed-Pill-Primitiv + ein Text-Label-Primitiv
   ============================================================================ */

/* Boxed Pill auf hellen Flaechen — DAS eine Pill-Primitiv */
.badge,
.pill,
.section-badge,
.hero__badge,
.eyebrow,
.hero-eyebrow,
.article-hero__category {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--m24-action-soft);
  border: 1px solid var(--m24-action-line);
  border-radius: var(--m24-radius-pill);
  font-family: var(--m24-font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #3f3f46;
}

/* Boxed Pill auf dunklen Heroes */
.hero-badge,
.mi24-standort-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--m24-radius-pill);
  font-family: var(--m24-font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.82);
}

/* ============================================================================
   3 · KARTE & SIDEBAR-WIDGETS (fixt die Ratgeber-Hub-Sidebar)
   ============================================================================ */

.sidebar-box {
  background: var(--m24-paper);
  border: 1px solid var(--m24-line);
  border-radius: var(--m24-radius-s);
  padding: 22px;
  box-shadow: var(--m24-shadow-s);
}

.sidebar-box h4 {
  margin: 0 0 12px;
  font-family: var(--m24-font-body);
  font-size: 15px;
  font-weight: 600;
  color: var(--m24-ink);
}

.sidebar-box p {
  margin: 0 0 14px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--m24-muted);
}

/* Dunkle Beratungs-Box */
.sidebar-box.cta {
  background: linear-gradient(160deg, var(--m24-navy), var(--m24-slate));
  border-color: rgba(255, 255, 255, 0.08);
}

.sidebar-box.cta h4 {
  color: #ffffff;
}

.sidebar-box.cta p {
  color: rgba(255, 255, 255, 0.72);
}

.sidebar-box.cta .btn-primary-small,
.sidebar-box.cta .btn-primary {
  width: 100%;
  background: #ffffff;
  color: var(--m24-action);
}

.sidebar-box.cta .btn-primary-small:hover,
.sidebar-box.cta .btn-primary:hover {
  background: var(--m24-soft);
  transform: none;
  box-shadow: none;
}

.quick-links,
.popular-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.quick-links li,
.popular-list li {
  border-bottom: 1px solid var(--m24-line);
}

.quick-links li:last-child,
.popular-list li:last-child {
  border-bottom: none;
}

.quick-links a,
.popular-list a {
  display: block;
  padding: 9px 0;
  font-size: 13.5px;
  color: var(--m24-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.quick-links a:hover,
.popular-list a:hover {
  color: var(--m24-ink);
}

/* ============================================================================
   4 · HUB-LAYOUT — .content-grid--toc hatte NIRGENDS eine Grid-Definition
   ============================================================================ */

.content-grid {
  display: grid;
  gap: 40px;
}

.content-grid--toc {
  grid-template-columns: 220px minmax(0, 1fr) 280px;
  align-items: start;
}

.main-article {
  min-width: 0;
}

.toc-sidebar .toc-sticky,
.toc-sidebar .toc-wrapper {
  position: sticky;
  top: 96px;
}

.toc-sidebar .toc-wrapper {
  background: var(--m24-paper);
  border: 1px solid var(--m24-line);
  border-radius: var(--m24-radius-m);
  padding: 16px;
}

.toc-sidebar .toc a {
  display: block;
  padding: 6px 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--m24-muted);
  text-decoration: none;
}

.toc-sidebar .toc a:hover,
.toc-sidebar .toc a.active {
  color: var(--m24-ink);
}

.right-sidebar .sidebar-sticky {
  position: sticky;
  top: 96px;
  display: grid;
  gap: 18px;
}

@media (max-width: 1180px) {
  .content-grid--toc {
    grid-template-columns: minmax(0, 1fr) 280px;
  }

  .toc-sidebar {
    display: none;
  }
}

@media (max-width: 900px) {
  .content-grid--toc {
    grid-template-columns: 1fr;
  }

  .right-sidebar {
    order: 2;
  }

  .right-sidebar .sidebar-sticky {
    position: static;
  }
}

/* ============================================================================
   5 · PROSE — Artikel- UND Hub-Vokabular vereinheitlicht
   (Tabellen, Listen, Blockquotes fehlten in Hubs komplett)
   ============================================================================ */

.article-content,
.main-article {
  font-size: 16.5px;
  line-height: 1.75;
  color: var(--m24-text);
}

.article-content h2,
.main-article h2 {
  margin: 2em 0 0.7em;
}

.article-content h3,
.main-article h3 {
  margin: 1.6em 0 0.55em;
}

.article-content p,
.main-article p {
  margin: 0 0 1.1em;
}

.article-content ul,
.article-content ol,
.main-article ul,
.main-article ol {
  margin: 0 0 1.2em;
  padding-left: 1.35em;
}

.article-content li,
.main-article li {
  margin-bottom: 0.45em;
}

.article-content li::marker,
.main-article li::marker {
  color: var(--m24-action);
}

.article-content blockquote,
.main-article blockquote {
  margin: 1.4em 0;
  padding: 16px 22px;
  background: var(--m24-soft);
  border-left: 3px solid var(--m24-action);
  border-radius: 0 var(--m24-radius-m) var(--m24-radius-m) 0;
  color: var(--m24-muted);
}

/* Tabellen — kanonisch fuer .data-table UND nackte Tabellen im Prose-Bereich */
.data-table,
.article-content table,
.main-article table {
  width: 100%;
  margin: 1.4em 0;
  border-collapse: collapse;
  font-size: 14.5px;
  line-height: 1.5;
  background: var(--m24-paper);
  border: 1px solid var(--m24-line);
  border-radius: var(--m24-radius-m);
  overflow: hidden;
}

.data-table th,
.article-content table th,
.main-article table th {
  padding: 11px 14px;
  background: var(--m24-navy);
  color: #ffffff;
  font-weight: 600;
  text-align: left;
}

.data-table td,
.article-content table td,
.main-article table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--m24-line);
  color: var(--m24-text);
}

.data-table tbody tr:last-child td,
.article-content table tbody tr:last-child td,
.main-article table tbody tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr:nth-child(even) td,
.article-content table tbody tr:nth-child(even) td,
.main-article table tbody tr:nth-child(even) td {
  background: var(--m24-soft);
}

.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.4em 0;
}

.table-wrapper > .data-table,
.table-wrapper > table {
  margin: 0;
}

@media (max-width: 760px) {
  .article-content table,
  .main-article table,
  .data-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--m24-radius-s);
  }
}

/* Spezial-Listen der Hubs (waren nie definiert) */
.checklist,
.takeaways {
  list-style: none;
  margin: 0 0 1.3em;
  padding: 18px 22px;
  background: var(--m24-soft);
  border: 1px solid var(--m24-line);
  border-radius: var(--m24-radius-m);
}

.checklist li,
.takeaways li {
  position: relative;
  margin: 0;
  padding: 5px 0 5px 26px;
}

.checklist li::before,
.takeaways li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 5px;
  font-weight: 700;
  color: var(--m24-success-deep);
}

/* ============================================================================
   6 · CONTENT-BOXEN — kanonische Definitionen (fuellen Luecken in Hubs
   und normalisieren die 32 Artikel-Varianten)
   ============================================================================ */

.key-facts {
  margin: 1.5em 0;
  padding: 22px 26px;
  background: var(--m24-soft);
  border: 1px solid var(--m24-line);
  border-radius: var(--m24-radius-l);
}

.key-facts__title {
  margin: 0 0 12px;
  font-family: var(--m24-font-body);
  font-size: 15px;
  font-weight: 600;
  color: var(--m24-ink);
}

.key-facts ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.key-facts li {
  position: relative;
  padding: 5px 0 5px 26px;
  margin: 0;
}

.key-facts li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 5px;
  font-weight: 700;
  color: var(--m24-success-deep);
}

.highlight-box {
  margin: 1.5em 0;
  padding: 18px 24px;
  background: var(--m24-blue-soft);
  border: 1px solid rgba(3, 105, 161, 0.18);
  border-radius: var(--m24-radius-m);
}

.highlight-box--warning {
  background: var(--m24-warning-soft);
  border-color: rgba(245, 158, 11, 0.3);
}

.highlight-box__title {
  margin: 0 0 8px;
  font-family: var(--m24-font-body);
  font-size: 14.5px;
  font-weight: 600;
  color: var(--m24-ink);
}

.expert-tip {
  position: relative;
  margin: 1.5em 0;
  padding: 20px 24px;
  background: var(--m24-success-soft);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--m24-radius-m);
}

.expert-tip__title {
  margin: 0 0 8px;
  font-family: var(--m24-font-body);
  font-size: 14.5px;
  font-weight: 600;
  color: var(--m24-success-deep);
}

.calc-box {
  margin: 1.5em 0;
  padding: 22px 26px;
  background: linear-gradient(160deg, var(--m24-navy), var(--m24-slate));
  border-radius: var(--m24-radius-l);
  color: rgba(255, 255, 255, 0.85);
}

.calc-box__title {
  margin: 0 0 14px;
  font-family: var(--m24-font-body);
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
}

.calc-box__row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 14px;
}

.calc-box__row:last-child {
  border-bottom: none;
}

.calc-box__label {
  color: rgba(255, 255, 255, 0.65);
}

.calc-box__value {
  font-variant-numeric: tabular-nums;
  color: #ffffff;
}

.calc-box__total {
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  font-weight: 700;
  color: #ffffff;
}

/* ============================================================================
   7 · CTA-BAND — eine kanonische dunkle Flaeche (Hub + Artikel)
   ============================================================================ */

/* Hintergrund (Ink-Gradient + Dot-Textur) liefert myinvest-signature.css */
.cta-section {
  border-radius: var(--m24-radius-l);
  padding: 48px 32px;
  text-align: center;
}

.cta-section .cta-content {
  max-width: 620px;
  margin: 0 auto;
}

.cta-section h2,
.cta-section__title {
  color: #ffffff;
  margin: 0 0 12px;
}

.cta-section p,
.cta-section__text {
  color: rgba(255, 255, 255, 0.75);
  margin: 0 0 22px;
}

.cta-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.cta-section__trust {
  margin-top: 16px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
}

/* ============================================================================
   8 · NORMALISIERUNG — gezielte Drift-Korrekturen
   ============================================================================ */

/* Standorte: Blau→Gruen-Topbars der Karten → ruhige Navy-Linie */
.mi24-standort-vorteil::after,
.mi24-standort-detail-card::before {
  background: linear-gradient(90deg, var(--m24-navy), #47556966);
}

/* ============================================================================
   9 · A11Y & MOTION
   ============================================================================ */

@media (prefers-reduced-motion: reduce) {
  .btn,
  .btn-primary,
  .btn-primary-large,
  .btn-primary-small,
  .btn-secondary,
  .btn-secondary-large,
  .btn-outline,
  .btn-white,
  .btn-ghost,
  .cta-section__btn {
    transition: none;
  }
}

@media (max-width: 480px) {
  .btn-lg,
  .btn-primary-large,
  .btn-secondary-large {
    width: 100%;
  }

  .cta-section {
    padding: 36px 20px;
  }
}
