/* Ratgeber-Übersicht (/ratgeber/, views/ratgeber.tsx).
   Eigene Datei statt Erweiterung von blog-post.css: dort steht die Typografie
   der Einzelbeiträge, hier die Kartenliste der Übersicht. */

.ratgeber-main {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 var(--seitenrand) 3rem;
}

/* ----- Kopfbereich ----- */
.ratgeber-hero {
  padding: 0.5rem 0 1.6rem;
}
.ratgeber-hero h1 {
  margin: 0 0 0.6rem;
  color: var(--dunkelblau);
}
.ratgeber-hero-intro {
  max-width: 62ch;
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.6;
  color: #4a616b;
}

/* Sprungmarken zu den Rubriken — auf dem Handy waagerecht scrollbar, damit
   die Leiste nicht vier Zeilen hoch wird. */
.ratgeber-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.3rem;
}
.ratgeber-jump a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.85rem;
  border: 1px solid #e2eaf0;
  border-radius: 999px;
  background: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--dunkelblau);
  text-decoration: none;
  transition:
    background 0.16s ease,
    border-color 0.16s ease;
}
.ratgeber-jump a:hover,
.ratgeber-jump a:focus-visible {
  background: var(--hellblau);
  border-color: #cfe0ef;
}
.ratgeber-jump a span {
  padding: 0 0.4rem;
  border-radius: 999px;
  background: #f1f5f8;
  font-size: 0.78rem;
  font-weight: 700;
  color: #6b7f89;
  font-variant-numeric: tabular-nums;
}

/* ----- Rubriken ----- */
.ratgeber-section {
  /* Sprungziel unter dem Sticky-Header freihalten */
  scroll-margin-top: 6rem;
  padding-top: 1.8rem;
}
.ratgeber-section-head {
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid var(--horange);
}
.ratgeber-section-head h2 {
  margin: 0;
  font-size: 1.45rem;
  color: var(--dunkelblau);
}
.ratgeber-section-count {
  flex: none;
  margin-left: auto;
  font-size: 0.85rem;
  color: #7b8b93;
  font-variant-numeric: tabular-nums;
}
.ratgeber-section-intro {
  max-width: 68ch;
  margin: 0.8rem 0 0;
  font-size: 0.98rem;
  line-height: 1.55;
  color: #4a616b;
}

/* ----- Kartenraster ----- */
.ratgeber-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.4rem;
  margin-top: 1.3rem;
}
.ratgeber-card {
  display: flex;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 0 18px rgba(193, 193, 193, 0.42);
  overflow: hidden;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
}
.ratgeber-card:hover,
.ratgeber-card:focus-within {
  transform: translateY(-3px);
  box-shadow: 0 10px 26px -10px rgba(25, 51, 63, 0.4);
}
.ratgeber-card-link {
  display: flex;
  flex-direction: column;
  width: 100%;
  color: inherit;
  text-decoration: none;
}
.ratgeber-card-media {
  aspect-ratio: 16 / 9;
  background: var(--hellblau);
  overflow: hidden;
}
.ratgeber-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}
.ratgeber-card:hover .ratgeber-card-media img {
  transform: scale(1.04);
}
.ratgeber-card-placeholder {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--hellblau) 0%, var(--horange) 100%);
}
.ratgeber-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1rem 1.1rem 1.1rem;
}
.ratgeber-card-title {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  line-height: 1.35;
  color: var(--dunkelblau);
}
.ratgeber-card-text {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.5;
  color: #4a616b;
}
.ratgeber-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin: 0.9rem 0 0;
  padding-top: 0.7rem;
  border-top: 1px solid #eef2f6;
  font-size: 0.82rem;
  color: #7b8b93;
}
.ratgeber-card-more {
  font-weight: 700;
  color: var(--dorange);
}

/* ----- Abschluss-Box ----- */
.ratgeber-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  margin-top: 2.6rem;
  padding: 1.5rem 1.7rem;
  border-radius: 16px;
  background: linear-gradient(140deg, var(--horange) 0%, var(--hellblau) 100%);
}
.ratgeber-cta h2 {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
  color: var(--dunkelblau);
}
.ratgeber-cta p {
  max-width: 58ch;
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #3d5865;
}
.ratgeber-cta-button {
  flex: none;
  padding: 0.75rem 1.4rem;
  border-radius: 999px;
  background: var(--dunkelblau);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.16s ease;
}
.ratgeber-cta-button:hover,
.ratgeber-cta-button:focus-visible {
  background: var(--dorange);
  color: #fff;
}

@media (max-width: 719px) {
  .ratgeber-hero h1 {
    font-size: 1.9rem;
  }
  .ratgeber-section-head {
    flex-wrap: wrap;
  }
  .ratgeber-cta {
    padding: 1.2rem;
  }
  .ratgeber-cta-button {
    width: 100%;
    text-align: center;
  }
}

/* ----- Beitragsseite der Supabase-Beiträge (/ratgeber/<slug>/) -----
   Der Text selbst erbt die Typografie aus blog-post.css (dieselbe
   .entry-content-html-Hülle wie die migrierten WP-Beiträge); hier stehen nur
   die Bausteine, die diese Beiträge zusätzlich haben. */
.ratgeber-post-table {
  overflow-x: auto;
  margin: 1.4rem 0;
}
.ratgeber-post-table table {
  width: 100%;
  border-collapse: collapse;
}
.ratgeber-post-table th,
.ratgeber-post-table td {
  padding: 0.6rem 0.8rem;
  border: 1px solid #e2eaf0;
  text-align: left;
  vertical-align: top;
}
.ratgeber-post-table th {
  background: var(--hellblau);
  color: var(--dunkelblau);
}

.ratgeber-post-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin: 2.4rem 0 0;
  padding-top: 1.2rem;
  border-top: 1px solid #eef2f6;
  font-size: 0.85rem;
}
.ratgeber-post-tags-label {
  font-weight: 700;
  color: var(--dunkelblau);
}
.ratgeber-post-tag {
  padding: 0.25rem 0.7rem;
  border: 1px solid #e2eaf0;
  border-radius: 999px;
  background: #fff;
  color: #4a616b;
}

.ratgeber-post-back {
  margin: 1.4rem 0 0;
}
.ratgeber-post-back a {
  font-weight: 700;
  color: var(--dorange);
  text-decoration: none;
}
.ratgeber-post-back a:hover,
.ratgeber-post-back a:focus-visible {
  text-decoration: underline;
}

/* ----- Anreißer und Sprungziele der Beitragsseite ----- */
/* Der Satz unter der Kopfzeile ist derselbe wie die Meta-Description: kurz
   sagen, worum es geht, bevor das Inhaltsverzeichnis kommt. */
.entry-lead {
  margin: 0 0 1.5em;
  font-size: 1.12rem;
  font-weight: 500;
  line-height: 1.65;
  color: #3d5865;
}

/* Bei den migrierten Beiträgen sitzt die Anker-Id auf einem eigenen
   <span class="ez-toc-section"> (Offset in eztoc-custom.css). Hier trägt die
   Überschrift die Id selbst, also braucht sie denselben Abstand zum
   Sticky-Header, sonst rutscht das Kapitel beim Sprung darunter. */
.ratgeber-post-body h2[id],
.ratgeber-post-body h3[id] {
  scroll-margin-top: 130px;
}
@media (max-width: 767px) {
  .ratgeber-post-body h2[id],
  .ratgeber-post-body h3[id] {
    scroll-margin-top: 10px;
  }
}

/* Das Inhaltsverzeichnis im Textfluss steht direkt unter dem Anreißer und
   braucht darunter Luft zum ersten Kapitel. */
.ratgeber-post-body > h2:first-child {
  margin-top: 0;
}
