/* ============================================
   NEWS RICH — erweiterte Text-Komponenten fuer Blogartikel
   Nur der Artikel-Body wird angereichert; Kopf, Bild, Meta, Teilen,
   "Weitere Beitraege" bleiben wie auf allen anderen Artikelseiten.
   Einbinden: <link rel="stylesheet" href="../../assets/css/news-rich.css">
   + <script src="../../assets/js/news-rich.js" defer></script>
   Komponenten: .rich-layout (Body + Inhaltsverzeichnis), .rich-summary,
   .rich-quote, .rich-cards, .rich-flow, .rich-compare, .rich-rename,
   .rich-status, .rich-faq, .rich-conclusion
   ============================================ */

/* ---------- Layout: Inhaltsverzeichnis links, Text rechts ---------- */
.rich-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
}
@media (min-width: 1024px) {
  .rich-layout {
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 4rem;
    align-items: start;
  }
}
.rich-layout .news-article__body { max-width: 760px; }

/* Abschnittsanker unter dem fixen Header nicht verstecken */
.rich-layout .news-article__body h2[id] {
  scroll-margin-top: calc(var(--header-height, 72px) + var(--topbar-height, 26px) + 1.5rem);
}

/* ---------- Inhaltsverzeichnis ---------- */
.rich-toc {
  font-size: 14px; line-height: 1.35;
}
@media (min-width: 1024px) {
  .rich-toc {
    position: sticky;
    top: calc(var(--header-height, 72px) + var(--topbar-height, 26px) + 2rem);
  }
}
.rich-toc__details { border: 1px solid rgba(18, 0, 46, 0.1); border-radius: 12px; padding: 0.9rem 1.1rem; }
.rich-toc__summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between;
  font-weight: 450; color: var(--color-dark, #12002E);
}
.rich-toc__summary::-webkit-details-marker { display: none; }
.rich-toc__summary::after {
  content: ""; width: 8px; height: 8px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px); transition: transform 0.2s ease;
}
.rich-toc__details[open] .rich-toc__summary::after { transform: rotate(-135deg) translateY(-2px); }
@media (min-width: 1024px) {
  .rich-toc__details { border: none; padding: 0; }
  .rich-toc__summary { pointer-events: none; margin-bottom: 0.9rem; color: #6b7280; font-weight: 400; }
  .rich-toc__summary::after { display: none; }
}
.rich-toc__list {
  list-style: none; margin: 0.9rem 0 0; padding: 0;
  counter-reset: toc;
}
@media (min-width: 1024px) {
  .rich-toc__list { margin: 0; border-left: 1px solid #e5e7eb; }
}
.rich-toc__list li { counter-increment: toc; }
.rich-toc__list a {
  display: flex; gap: 0.6rem;
  padding: 0.4rem 0 0.4rem 0;
  color: #57606a; text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease;
}
@media (min-width: 1024px) {
  .rich-toc__list a { padding: 0.4rem 0 0.4rem 1rem; margin-left: -1px; border-left: 2px solid transparent; }
}
.rich-toc__list a::before {
  content: counter(toc, decimal-leading-zero);
  color: #9ca3af; font-variant-numeric: tabular-nums; flex-shrink: 0;
}
.rich-toc__list a:hover { color: var(--color-dark, #12002E); }
.rich-toc__list a.is-active { color: var(--color-primary, #4C11FF); border-left-color: var(--color-primary, #4C11FF); }
.rich-toc__list a.is-active::before { color: var(--color-primary, #4C11FF); }

/* ---------- Nummerierte Abschnitte ---------- */
.rich-layout .news-article__body { counter-reset: sec; }
.rich-layout .news-article__body > h2[id],
.rich-conclusion > h2[id] { counter-increment: sec; }
.rich-layout .news-article__body > h2[id]::before,
.rich-conclusion > h2[id]::before {
  content: counter(sec, decimal-leading-zero);
  display: block;
  font-size: 14px; font-weight: 450; line-height: 1.3; letter-spacing: normal;
  color: var(--color-primary, #4C11FF);
  margin-bottom: 0.6rem;
}
.rich-layout .news-article__body > h2[id] {
  margin-top: 4rem; padding-top: 2.5rem; border-top: 1px solid #e5e7eb;
}

/* ---------- Das Wichtigste in Kuerze ---------- */
.rich-summary {
  background: var(--color-greige, #F8F3EF);
  border-radius: 12px;
  padding: 1.5rem 1.75rem;
  margin: 0 0 2.5rem;
}
.rich-summary__title {
  font-size: 14px; font-weight: 450; line-height: 1.3;
  color: var(--color-primary, #4C11FF);
  margin: 0 0 1rem !important;
}
.news-article__body .rich-summary ul { list-style: none; margin: 0; padding: 0; }
.news-article__body .rich-summary li {
  position: relative; padding-left: 1.9rem; margin-bottom: 0.75rem;
  font-size: 16px; line-height: 1.45; color: var(--color-dark, #12002E);
}
.news-article__body .rich-summary li:last-child { margin-bottom: 0; }
.rich-summary li::before {
  content: ""; position: absolute; left: 0; top: 0.2rem;
  width: 1.1rem; height: 1.1rem; border-radius: 50%;
  background: var(--color-primary, #4C11FF);
}
.rich-summary li::after {
  content: ""; position: absolute; left: 0.36rem; top: 0.42rem;
  width: 0.38rem; height: 0.6rem;
  border-right: 2px solid #fff; border-bottom: 2px solid #fff;
  transform: rotate(45deg);
}

/* ---------- Pull-Quote ---------- */
.rich-quote {
  margin: 2.5rem 0;
  padding: 0.25rem 0 0.25rem 1.5rem;
  border-left: 3px solid var(--color-primary, #4C11FF);
}
.news-article__body .rich-quote p {
  font-size: 24px; font-weight: 400; line-height: 1.3; letter-spacing: -0.01em;
  color: var(--color-dark, #12002E); margin: 0;
}
@media (max-width: 639px) {
  .news-article__body .rich-quote p { font-size: 20px; }
}

/* ---------- Karten-Raster ---------- */
.rich-cards {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin: 1.75rem 0 2.25rem;
}
.rich-cards--2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.rich-card {
  border: 1px solid rgba(18, 0, 46, 0.1);
  border-radius: 12px;
  padding: 1.25rem 1.35rem 1.35rem;
  background: #fff;
}
.rich-card__num {
  display: block; font-size: 13px; font-weight: 450; line-height: 1.3;
  color: var(--color-primary, #4C11FF); margin-bottom: 0.75rem;
  font-variant-numeric: tabular-nums;
}
.rich-card__icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--color-soft-light, #EDE5FF); color: var(--color-primary, #4C11FF);
  margin-bottom: 0.9rem;
}
.rich-card__icon svg { width: 18px; height: 18px; }
.rich-card__title {
  display: block; font-size: 17px; font-weight: 450; line-height: 1.3;
  color: #0d1117; margin-bottom: 0.4rem;
}
.news-article__body .rich-card p {
  font-size: 15px; line-height: 1.45; color: #57606a; margin: 0;
}
.news-article__body .rich-card p + p { margin-top: 0.6rem; }

/* ---------- Ablauf / Flow ---------- */
.rich-flow {
  list-style: none; padding: 0; margin: 2rem 0 2.25rem;
  display: flex; flex-direction: column; gap: 1.75rem;
}
@media (min-width: 720px) {
  .rich-flow { flex-direction: row; gap: 2.25rem; }
}
.rich-flow__step {
  position: relative; flex: 1 1 0;
  border-radius: 12px; padding: 1rem 1.1rem;
  background: var(--color-greige, #F8F3EF);
}
.news-article__body .rich-flow__step { margin: 0; }
.rich-flow__step--accent { background: var(--color-dark, #12002E); }
.rich-flow__label {
  display: block; font-size: 13px; line-height: 1.3; color: #6b7280; margin-bottom: 0.3rem;
}
.rich-flow__title {
  display: block; font-size: 16px; font-weight: 450; line-height: 1.3; color: var(--color-dark, #12002E);
}
.rich-flow__text { display: block; font-size: 14px; line-height: 1.4; color: #57606a; margin-top: 0.35rem; }
.rich-flow__step--accent .rich-flow__label { color: var(--color-soft, #CAC2FF); }
.rich-flow__step--accent .rich-flow__title { color: #fff; }
.rich-flow__step--accent .rich-flow__text { color: rgba(255, 255, 255, 0.75); }
/* Pfeile zwischen den Schritten */
.rich-flow__step:not(:last-child)::after {
  content: ""; position: absolute;
  left: 50%; bottom: -1.3rem; width: 9px; height: 9px;
  border-right: 1.5px solid var(--color-primary, #4C11FF);
  border-bottom: 1.5px solid var(--color-primary, #4C11FF);
  transform: translateX(-50%) rotate(45deg);
}
@media (min-width: 720px) {
  .rich-flow__step:not(:last-child)::after {
    left: auto; right: -1.45rem; bottom: auto; top: 50%;
    transform: translateY(-50%) rotate(-45deg);
  }
}

/* ---------- Vergleichstabelle ---------- */
.rich-table-wrap { overflow-x: auto; margin: 1.75rem 0 2.25rem; -webkit-overflow-scrolling: touch; }
.rich-compare {
  width: 100%; min-width: 560px; border-collapse: separate; border-spacing: 0;
  font-size: 15px; line-height: 1.4;
  border: 1px solid rgba(18, 0, 46, 0.1); border-radius: 12px; overflow: hidden;
}
.rich-compare th, .rich-compare td {
  text-align: left; vertical-align: top;
  padding: 0.85rem 1rem; border-bottom: 1px solid #e5e7eb;
}
.rich-compare tr:last-child th, .rich-compare tr:last-child td { border-bottom: none; }
.rich-compare thead th {
  background: var(--color-greige, #F8F3EF);
  font-weight: 450; color: var(--color-dark, #12002E); font-size: 15px;
}
.rich-compare thead th small { display: block; font-size: 13px; font-weight: 400; color: #6b7280; margin-top: 0.15rem; }
.rich-compare tbody th { font-weight: 450; color: #0d1117; width: 26%; }
.rich-compare td { color: #24292f; }
.rich-compare .is-highlight { background: rgba(76, 17, 255, 0.04); }
.rich-compare thead th.is-highlight { background: rgba(76, 17, 255, 0.09); }

/* ---------- Umbenennung alt -> neu ---------- */
.rich-rename { display: grid; gap: 0.75rem; margin: 1.75rem 0 2.25rem; }
.rich-rename__row {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem;
  border: 1px solid rgba(18, 0, 46, 0.1); border-radius: 12px; padding: 1rem 1.25rem;
}
.rich-rename__old, .rich-rename__new { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; overflow-wrap: anywhere; }
.rich-rename__caption { font-size: 13px; line-height: 1.3; color: #6b7280; }
.rich-rename__old strong {
  font-size: 18px; font-weight: 400; color: #6b7280;
  text-decoration: line-through; text-decoration-color: rgba(18, 0, 46, 0.35);
}
.rich-rename__new strong { font-size: 18px; font-weight: 450; color: var(--color-primary, #4C11FF); }
.rich-rename__arrow { color: var(--color-primary, #4C11FF); display: inline-flex; }
.rich-rename__arrow svg { width: 22px; height: 22px; }
.rich-rename__roof {
  text-align: center; font-size: 14px; color: #57606a;
  padding: 0.75rem 1rem; border-radius: 12px; background: var(--color-greige, #F8F3EF);
}
.rich-rename__roof strong { color: var(--color-dark, #12002E); font-weight: 450; }
@media (max-width: 539px) {
  .rich-rename__row { grid-template-columns: 1fr; gap: 0.6rem; }
  .rich-rename__arrow { justify-self: start; width: 22px; height: 22px; transform: rotate(90deg); }
  .rich-rename__old strong, .rich-rename__new strong { font-size: 16px; }
}

/* ---------- Status: verfuegbar / geplant ---------- */
.rich-status { margin: 1.75rem 0 2.25rem; border: 1px solid rgba(18, 0, 46, 0.1); border-radius: 12px; }
.rich-status__row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem; align-items: start;
  padding: 0.9rem 1.15rem; border-bottom: 1px solid #e5e7eb;
}
.rich-status__row:last-child { border-bottom: none; }
.rich-status__name { font-size: 15px; font-weight: 450; line-height: 1.35; color: #0d1117; }
.rich-status__name small { display: block; font-size: 14px; font-weight: 400; color: #6b7280; margin-top: 0.2rem; }
.rich-status__tag {
  display: inline-flex; align-items: center; gap: 0.45rem; white-space: nowrap;
  font-size: 14px; line-height: 1.3; color: #57606a; padding-top: 0.1rem;
}
.rich-status__tag::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  border: 1.5px solid currentColor; box-sizing: border-box;
}
.rich-status__tag--ga { color: var(--color-primary, #4C11FF); }
.rich-status__tag--ga::before { background: currentColor; }
.rich-status__tag--plan { color: #6b7280; }

/* ---------- FAQ ---------- */
.rich-faq { margin: 1.5rem 0 2rem; border-top: 1px solid #e5e7eb; }
.rich-faq details { border-bottom: 1px solid #e5e7eb; }
.rich-faq summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.1rem 0;
  font-size: 18px; font-weight: 450; line-height: 1.3; color: #0d1117;
}
.rich-faq summary::-webkit-details-marker { display: none; }
.rich-faq summary::after {
  content: "+"; flex-shrink: 0;
  width: 28px; height: 28px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid rgba(18, 0, 46, 0.14);
  font-size: 18px; font-weight: 400; color: var(--color-primary, #4C11FF);
  transition: transform 0.2s ease;
}
.rich-faq details[open] summary::after { transform: rotate(45deg); }
.rich-faq__answer { padding: 0 0 1.1rem; }
.news-article__body .rich-faq__answer p:last-child { margin-bottom: 0; }

/* ---------- Fazit-Panel ---------- */
.rich-conclusion {
  margin: 4rem 0 0;
  background: var(--color-dark, #12002E);
  border-radius: 16px;
  padding: 2.5rem 2.25rem;
  color: rgba(255, 255, 255, 0.82);
}
@media (max-width: 639px) { .rich-conclusion { padding: 2rem 1.35rem; } }
.news-article__body .rich-conclusion h2 { color: #fff; margin-top: 0; }
.rich-conclusion > h2[id]::before { color: var(--color-soft, #CAC2FF); }
.news-article__body .rich-conclusion p { color: rgba(255, 255, 255, 0.82); }
.news-article__body .rich-conclusion a { color: #fff; }
.rich-conclusion__step {
  margin: 1.75rem 0;
  padding: 1.1rem 1.25rem; border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.rich-conclusion__step-label {
  display: block; font-size: 13px; line-height: 1.3; color: var(--color-soft, #CAC2FF); margin-bottom: 0.4rem;
}
.news-article__body .rich-conclusion__step p { margin: 0; color: #fff; font-size: 16px; line-height: 1.45; }
.rich-conclusion__cta {
  display: inline-flex; align-items: center; gap: 0.5rem;
  margin-top: 0.5rem; min-height: 44px; padding: 0 20px; border-radius: 4px;
  background: #fff; color: var(--color-dark, #12002E) !important;
  font-size: 15px; font-weight: 450; text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}
.rich-conclusion__cta:hover { background: var(--color-soft, #CAC2FF); }
.rich-conclusion__cta svg { width: 16px; height: 16px; }


/* ============================================
   DARK MODE
   ============================================ */
html.dark-mode .rich-toc__details { border-color: #30363d; }
html.dark-mode .rich-toc__summary { color: #f0f6fc; }
html.dark-mode .rich-toc__list { border-left-color: #30363d; }
html.dark-mode .rich-toc__list a { color: #8b949e; }
html.dark-mode .rich-toc__list a:hover { color: #f0f6fc; }
html.dark-mode .rich-toc__list a.is-active,
html.dark-mode .rich-toc__list a.is-active::before { color: var(--color-soft, #CAC2FF); border-left-color: var(--color-soft, #CAC2FF); }
@media (min-width: 1024px) { html.dark-mode .rich-toc__summary { color: #8b949e; } }

html.dark-mode .rich-layout .news-article__body > h2[id] { border-top-color: #30363d; }
html.dark-mode .rich-layout .news-article__body > h2[id]::before { color: var(--color-soft, #CAC2FF); }

html.dark-mode .rich-summary { background: #161b22; }
html.dark-mode .rich-summary__title { color: var(--color-soft, #CAC2FF); }
html.dark-mode .news-article__body .rich-summary li { color: #c9d1d9; }

html.dark-mode .rich-quote { border-left-color: var(--color-soft, #CAC2FF); }
html.dark-mode .news-article__body .rich-quote p { color: #f0f6fc; }

html.dark-mode .rich-card { background: #161b22; border-color: #30363d; }
html.dark-mode .rich-card__num { color: var(--color-soft, #CAC2FF); }
html.dark-mode .rich-card__icon { background: rgba(76, 17, 255, 0.3); color: var(--color-soft, #CAC2FF); }
html.dark-mode .rich-card__title { color: #f0f6fc; }
html.dark-mode .news-article__body .rich-card p { color: #8b949e; }

html.dark-mode .rich-flow__step { background: #161b22; }
html.dark-mode .rich-flow__step--accent { background: rgba(76, 17, 255, 0.3); }
html.dark-mode .rich-flow__title { color: #f0f6fc; }
html.dark-mode .rich-flow__label, html.dark-mode .rich-flow__text { color: #8b949e; }
html.dark-mode .rich-flow__step--accent .rich-flow__label { color: var(--color-soft, #CAC2FF); }
html.dark-mode .rich-flow__step--accent .rich-flow__text { color: #c9d1d9; }
html.dark-mode .rich-flow__step:not(:last-child)::after { border-color: var(--color-soft, #CAC2FF); }

html.dark-mode .rich-compare { border-color: #30363d; }
html.dark-mode .rich-compare th, html.dark-mode .rich-compare td { border-bottom-color: #30363d; }
html.dark-mode .rich-compare thead th { background: #161b22; color: #f0f6fc; }
html.dark-mode .rich-compare thead th small { color: #8b949e; }
html.dark-mode .rich-compare tbody th { color: #f0f6fc; }
html.dark-mode .rich-compare td { color: #c9d1d9; }
html.dark-mode .rich-compare .is-highlight { background: rgba(76, 17, 255, 0.1); }
html.dark-mode .rich-compare thead th.is-highlight { background: rgba(76, 17, 255, 0.25); }

html.dark-mode .rich-rename__row { border-color: #30363d; }
html.dark-mode .rich-rename__caption, html.dark-mode .rich-rename__old strong { color: #8b949e; }
html.dark-mode .rich-rename__old strong { text-decoration-color: rgba(255, 255, 255, 0.35); }
html.dark-mode .rich-rename__new strong, html.dark-mode .rich-rename__arrow { color: var(--color-soft, #CAC2FF); }
html.dark-mode .rich-rename__roof { background: #161b22; color: #8b949e; }
html.dark-mode .rich-rename__roof strong { color: #f0f6fc; }

html.dark-mode .rich-status { border-color: #30363d; }
html.dark-mode .rich-status__row { border-bottom-color: #30363d; }
html.dark-mode .rich-status__name { color: #f0f6fc; }
html.dark-mode .rich-status__name small, html.dark-mode .rich-status__tag--plan { color: #8b949e; }
html.dark-mode .rich-status__tag--ga { color: var(--color-soft, #CAC2FF); }

html.dark-mode .rich-faq, html.dark-mode .rich-faq details { border-color: #30363d; }
html.dark-mode .rich-faq summary { color: #f0f6fc; }
html.dark-mode .rich-faq summary::after { border-color: #30363d; color: var(--color-soft, #CAC2FF); }

html.dark-mode .rich-conclusion { background: #161b22; border: 1px solid #30363d; }


/* Flow-Variante ohne Pfeile: parallele Elemente statt Abfolge */
.rich-flow--plain { gap: 0.75rem; }
@media (min-width: 720px) { .rich-flow--plain { gap: 0.75rem; } }
.rich-flow--plain .rich-flow__step::after { display: none; }
