/* =====================================================================
   Makler adé — Wissen-Center Stylesheet
   Ergänzt app.css um eine aufgeräumte, SEO- und lesefreundliche
   Artikel-Typografie (content-first), Inhaltsverzeichnis (TOC),
   Reading-Progress-Bar, FAQ-Accordion und Hub-Grid.
   ===================================================================== */

/* ---------------------------------------------------------------------
   Layout-Gitter: Artikel-Seite (Content + sticky TOC)
   --------------------------------------------------------------------- */
.wissen-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3rem;
  align-items: start;
}
@media (min-width: 1024px) {
  .wissen-layout {
    grid-template-columns: minmax(0, 1fr) 18rem;
  }
}

/* ---------------------------------------------------------------------
   Reading-Progress-Bar (oben fixiert)
   --------------------------------------------------------------------- */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: var(--accent);
  z-index: 60;
  transition: width 0.1s linear;
}

/* ---------------------------------------------------------------------
   Article-Body: wohltuende Lesetypografie
   --------------------------------------------------------------------- */
.article-body {
  font-size: 1.0625rem;          /* 17 px */
  line-height: 1.75;
  color: var(--ink-soft);
}
.article-body p {
  margin: 0 0 1.35em;
}
/* Lead-Absatz: nur der echte Artikel-Einstieg (erstes Element), nicht der
   erste Absatz unter einer Zwischenüberschrift (vgl. /app/ueber-mich.html) */
.article-body > p:first-child {
  font-size: 1.2rem;
  line-height: 1.6;
  color: var(--ink);
}
.article-body h2 {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  font-size: clamp(1.7rem, 3.2vw, 2.25rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 2.6em 0 0.7em;
  scroll-margin-top: 6rem;
}
.article-body h3 {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 1.3rem;
  line-height: 1.3;
  color: var(--ink);
  margin: 2em 0 0.5em;
  scroll-margin-top: 6rem;
}
.article-body h4 {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--ink);
  margin: 1.6em 0 0.4em;
}
.article-body ul,
.article-body ol {
  margin: 0 0 1.35em;
  padding-left: 1.6em;
}
.article-body ul li,
.article-body ol li {
  margin: 0 0 0.55em;
  padding-left: 0;
}
.article-body ul li::marker {
  color: var(--accent);
}
.article-body ol li::marker {
  color: var(--accent);
  font-weight: 600;
}
.article-body strong {
  color: var(--ink);
  font-weight: 600;
}
.article-body a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: rgba(196, 79, 44, 0.35);
  transition: text-decoration-color 0.2s ease;
}
.article-body a:hover {
  text-decoration-color: var(--accent);
}
.article-body blockquote {
  margin: 1.8em 0;
  padding: 0.2em 0 0.2em 1.4em;
  border-left: 3px solid var(--accent);
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: 1.18rem;
  line-height: 1.55;
  color: var(--ink);
}
.article-body hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 3em 0;
}

/* Tabelle (Checklisten / Vergleiche) */
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.8em 0;
  font-size: 0.95rem;
}
.article-body table th,
.article-body table td {
  text-align: left;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.article-body table thead th {
  background: var(--bg-2);
  color: var(--ink);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.article-body table tbody tr:hover {
  background: rgba(196, 79, 44, 0.04);
}
/* Mobil: breite Tabellen horizontal scrollbar statt Content-Absschneiden */
@media (max-width: 640px) {
  .article-body table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* Callout / Hinweis-Boxen */
.callout {
  margin: 1.8em 0;
  padding: 1.25rem 1.5rem 1.25rem 1.4rem;
  border-left: 3px solid var(--accent);
  background: rgba(196, 79, 44, 0.06);
  border-radius: 0 4px 4px 0;
}
.callout--moss {
  border-left-color: var(--moss);
  background: rgba(42, 58, 46, 0.06);
}
.callout--ink {
  border-left-color: var(--ink);
  background: rgba(20, 17, 15, 0.04);
}
.callout__title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.35rem;
  font-size: 0.95rem;
}
.callout p:last-child {
  margin-bottom: 0;
}

/* Nummerierte Schritt-Karten (für HowTo-Abschnitte) */
.steps {
  list-style: none;
  padding: 0;
  margin: 1.8em 0;
  counter-reset: step;
}
.article-body .steps > li {
  position: relative;
  padding: 0 0 1.5em 3.2em;
  margin: 0;
}
.article-body .steps > li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  background: var(--ink);
  color: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 0.95rem;
}
.article-body .steps > li strong:first-child {
  display: block;
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 1.15rem;
  color: var(--ink);
  margin-bottom: 0.25em;
}

/* Checklisten mit Häkchen */
.checklist {
  list-style: none;
  padding: 0;
  margin: 1.4em 0;
}
.article-body .checklist > li {
  position: relative;
  padding-left: 2.4em;
  margin-bottom: 0.6em;
}
.article-body .checklist > li::before {
  content: "\f00c";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  position: absolute;
  left: 0;
  top: 0.2em;
  width: 1.4em;
  color: var(--moss);
  font-size: 0.85em;
  text-align: left;
}

/* ---------------------------------------------------------------------
   Inhaltsverzeichnis (TOC) — sticky rechts
   --------------------------------------------------------------------- */
.toc {
  position: sticky;
  top: 6rem;
  font-size: 0.875rem;
}
.toc__label {
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.9rem;
  font-weight: 500;
}
.toc ol {
  list-style: none;
  padding: 0;
  margin: 0;
  border-left: 1px solid var(--line);
}
.toc li {
  margin: 0;
}
.toc a {
  display: block;
  padding: 0.45rem 0 0.45rem 1rem;
  color: var(--ink-soft);
  text-decoration: none;
  line-height: 1.4;
  transition: color 0.2s ease, border-color 0.2s ease;
  border-left: 2px solid transparent;
  margin-left: -1px;
}
.toc a:hover {
  color: var(--accent);
}
.toc a.is-active {
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 500;
}
.toc a.is-sub {
  padding-left: 1.8rem;
  font-size: 0.82rem;
  color: var(--muted);
}

/* Mobiles TOC (Details/Accordion unter dem Intro) */
.toc-mobile {
  display: none;
}
@media (max-width: 1023px) {
  .toc-desktop {
    display: none;
  }
  .toc-mobile {
    display: block;
    margin: 1.5rem 0 2.5rem;
  }
}
.toc-mobile summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--ink);
  padding: 0.75rem 1rem;
  background: var(--bg-2);
  border-radius: 6px;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.9rem;
}
.toc-mobile summary::-webkit-details-marker {
  display: none;
}
.toc-mobile summary::after {
  content: "\f078";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 0.75rem;
  transition: transform 0.2s ease;
}
.toc-mobile[open] summary::after {
  transform: rotate(180deg);
}
.toc-mobile ol {
  list-style: none;
  padding: 0.75rem 0;
  margin: 0;
}
.toc-mobile li a {
  display: block;
  padding: 0.4rem 1rem;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.9rem;
}
.toc-mobile li a:hover {
  color: var(--accent);
}

/* ---------------------------------------------------------------------
   FAQ-Accordion (strukturierte Daten: FAQPage)
   --------------------------------------------------------------------- */
.faq {
  margin: 1.5em 0;
}
.faq details {
  border-bottom: 1px solid var(--line);
  padding: 0;
}
.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 1.1rem 0;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 1.02rem;
}
.faq summary::-webkit-details-marker {
  display: none;
}
.faq summary::after {
  content: "\f067";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 0.8rem;
  color: var(--accent);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.faq details[open] summary::after {
  content: "\f068";
}
.faq details[open] summary {
  color: var(--accent);
}
.faq-answer {
  padding: 0 2rem 1.25rem 0;
  color: var(--ink-soft);
  line-height: 1.7;
}
.faq-answer p:last-child {
  margin-bottom: 0;
}

/* ---------------------------------------------------------------------
   Hub-Seite: Topic-Cluster-Grid
   --------------------------------------------------------------------- */
.hub-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
@media (min-width: 768px) {
  .hub-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1100px) {
  .hub-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
.hub-card {
  display: flex;
  flex-direction: column;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.75rem;
  text-decoration: none;
  color: inherit;
  transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1),
    box-shadow 0.3s ease, border-color 0.3s ease;
}
.hub-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px -18px rgba(20, 17, 15, 0.18);
  border-color: var(--accent);
}
.hub-card__icon {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: rgba(196, 79, 44, 0.1);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 1.1rem;
}
.hub-card__title {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 1.4rem;
  line-height: 1.2;
  color: var(--ink);
  margin: 0 0 0.5rem;
}
.hub-card__desc {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--ink-soft);
  margin: 0 0 1.25rem;
  flex-grow: 1;
}
.hub-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--muted);
}
.hub-card__cta {
  color: var(--accent);
  font-weight: 500;
}

/* ---------------------------------------------------------------------
   Artikel-Meta (Lesezeit, Datum)
   --------------------------------------------------------------------- */
.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.25rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.article-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

/* Kachel-Grid für Mini-Teaser innerhalb von Artikeln (Querverlinkung) */
.mini-teaser {
  display: grid;
  gap: 1rem;
  margin: 1.8em 0;
}
@media (min-width: 640px) {
  .mini-teaser {
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  }
}
.mini-teaser a {
  display: block;
  padding: 1.2rem 1.4rem;
  background: var(--bg-2);
  border-radius: 6px;
  text-decoration: none;
  color: var(--ink);
  transition: background 0.2s ease, transform 0.2s ease;
}
.mini-teaser a:hover {
  background: rgba(196, 79, 44, 0.1);
  transform: translateY(-2px);
}
.mini-teaser a strong {
  display: block;
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 1.1rem;
  margin-bottom: 0.2rem;
}
.mini-teaser a span {
  font-size: 0.85rem;
  color: var(--ink-soft);
}

/* CTA-Block am Artikelende */
.cta-band {
  margin-top: 3.5rem;
  padding: 2.25rem;
  background: var(--ink);
  color: var(--cream);
  border-radius: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.cta-band h3 {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  font-size: 1.7rem;
  margin: 0;
  color: var(--cream);
}
.cta-band p {
  margin: 0.35rem 0 0;
  color: rgba(251, 248, 241, 0.78);
  font-size: 0.95rem;
}
.cta-band .btn-primary {
  background: var(--accent);
}
.cta-band .btn-primary:hover {
  background: var(--cream);
  color: var(--ink);
}

/* ---------------------------------------------------------------------
   Lexikon-Karte im Wissen-Hub (hervorgehoben, abgesetzt vom Ratgeber)
   --------------------------------------------------------------------- */
.hub-card--lexikon {
  background: var(--ink);
  border-color: var(--ink);
}
.hub-card--lexikon .hub-card__title { color: var(--cream); }
.hub-card--lexikon .hub-card__desc { color: rgba(251,248,241,.82); }
.hub-card--lexikon .hub-card__icon {
  background: rgba(251,248,241,.12);
  color: var(--accent);
}
.hub-card--lexikon .hub-card__cta { color: var(--accent); }
.hub-card--lexikon .hub-card__meta span { color: rgba(251,248,241,.7); }

/* =====================================================================
   Mobile Optimierungen (Wissen-Center)
   ===================================================================== */
@media (max-width: 768px) {
  /* CTA-Band: Button UNTER den Text (statt daneben gequetscht) */
  .cta-band {
    flex-direction: column;
    align-items: stretch;
    text-align: left;
    padding: 1.75rem;
    gap: 1.25rem;
  }
  .cta-band .btn-primary {
    width: 100%;
    justify-content: center;
  }
  .cta-band h3 {
    font-size: 1.4rem;
  }
  .cta-band p {
    font-size: 0.9rem;
  }

  /* Hub-H1: auf Mobil etwas kleiner (48px ist grenzwertig auf 390px) */
  main h1.font-display {
    font-size: clamp(2.25rem, 8vw, 3rem) !important;
  }

  /* Hub-Section-Padding reduziert */
  main section[class*="mb-20"],
  main section[class*="fade-up"] {
    margin-bottom: 2.5rem;
  }

  /* Article-Meta: kompaktes Wrap */
  .article-meta {
    gap: 0.4rem 0.9rem;
    font-size: 0.78rem;
  }

  /* Mini-Teaser: einspaltig */
  .mini-teaser {
    grid-template-columns: 1fr !important;
  }

  /* FAQ-Antwort: weniger Padding rechts (sonst zu schmal) */
  .faq-answer {
    padding-right: 0;
  }

  /* Hub-Card-Padding reduziert */
  .hub-card {
    padding: 1.35rem;
  }
  .hub-card__title {
    font-size: 1.25rem;
  }

  /* Section-Paddings main reduziert (analog zu index.html) */
  main {
    padding-bottom: 4rem;
  }
}

/* Sehr schmale Viewports (<360px, ältere Handys) */
@media (max-width: 380px) {
  .cta-band h3 {
    font-size: 1.25rem;
  }
  main h1.font-display {
    font-size: 2rem !important;
  }
}

