/* ================================================================
   KS Hausbau — modern long-form content page (TOC, tinted sections,
   author box, FAQ accordion). Framework-independent, mobile-first.
   Scoped under .ks-article so it never leaks into the rest of the site.
   ================================================================ */

.ks-article {
  max-width: 860px;
  margin: 0 auto;
  padding: 36px 0 60px;
  color: #444;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.7;
}
.ks-article--wide {
  max-width: 1170px;
}
/* Modifier for pages where several .ks-article blocks are stacked back-to-back
   from separate content slices (e.g. /ks/) — the default top/bottom padding
   plus the .pgl-intro reset below compounds into a huge gap between sections. */
.ks-article--stacked {
  padding: 20px 0;
}
.pgl-intro:has(.ks-article--stacked) {
  padding-top: 0;
  margin-bottom: 0;
}
/* The tinted-section's own margin is redundant on top of --stacked padding
   and was doubling the gap between stacked modules (KS+, homepage). */
.ks-article--stacked .ks-section-tinted {
  margin: 0;
}
.ks-article--stacked .ks-card-grid {
  margin-top: 0;
}

/* ---------- Card grid (used on the homepage) ---------- */
.ks-card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin: 24px 0 40px;
}
.ks-card {
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 8px;
  padding: 24px;
  overflow: hidden;
}
.ks-card img {
  display: block;
  width: calc(100% + 48px);
  max-width: calc(100% + 48px);
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  margin: -24px -24px 16px;
  border-radius: 8px 8px 0 0;
}
.ks-card h3 {
  margin: 0 0 10px;
  font-size: 18px;
  color: #1a1a1a;
}
.ks-card p {
  margin: 0 0 10px;
  font-size: 15px;
  line-height: 1.6;
}
.ks-card a {
  color: #0063af;
  font-weight: 600;
  text-decoration: none;
}
.ks-card a:hover,
.ks-card a:focus {
  text-decoration: underline;
}
.ks-card-tinted-blue {
  background: #eef5fb;
  border-color: transparent;
}
.ks-card-tinted-orange {
  background: #fdf3e7;
  border-color: transparent;
}

@media (min-width: 600px) {
  .ks-card-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (min-width: 992px) {
  .ks-card-grid--3 {
    grid-template-columns: repeat(3, 1fr);
  }
  .ks-card-grid--5 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* .pgl-intro / .lead (legacy theme wrapper) add ~115px of top padding —
   collapse that down, scoped only to pages using this new article layout. */
.pgl-intro:has(.ks-article) {
  padding-top: 24px;
  margin-bottom: 0;
}
.pgl-intro .lead:has(.ks-article) {
  padding-top: 0;
}
/* Overview pages (Infos, Ratgeber) stack the dynamic Themenseite card grid
   (<section class="portfoilo-area ...">, sic - typo in the base theme) right
   after the .ks-article intro. That section is NOT a .pgl-intro (an earlier
   fix here wrongly assumed it was, so it never applied) and keeps its own
   pt-30 padding, stacking on top of .ks-articles bottom padding. */
.pgl-intro:has(.ks-article) + .portfoilo-area {
  padding-top: 0;
}

/* The Themenseite card grid uses Bootstrap 4/5-style .col-xl-4 classes that
   don't exist in this Bootstrap 3 theme, and has no .col-xs-*/.col-sm-*
   fallback. Below the 992px breakpoint (.col-lg-4) the cards get NO width
   from the grid at all and float at their image's intrinsic size instead of
   scaling down - on mobile this looks like fixed-size, non-responsive tiles. */
@media (max-width: 991px) {
  .portfoilo-area .grid-item {
    float: none;
    width: 100%;
  }
}

/* ---------- Headings inside the article ---------- */
.ks-article h1 {
  font-size: 28px;
  line-height: 1.25;
  margin: 0 0 16px;
  color: #1a1a1a;
}
.ks-article h2 {
  font-size: 22px;
  line-height: 1.3;
  margin: 40px 0 14px;
  padding-top: 4px;
  color: #1a1a1a;
}
.ks-article h3 {
  font-size: 18px;
  line-height: 1.35;
  margin: 24px 0 10px;
  color: #1a1a1a;
}
.ks-article > .ks-toc + h2,
.ks-article-body > h2:first-child {
  margin-top: 0;
}
.ks-article p {
  margin: 0 0 16px;
}
.ks-article ul {
  margin: 0 0 20px;
  padding-left: 0;
  list-style: none;
}

/* ---------- Lead + hero CTA row ---------- */
.ks-article-lead {
  font-size: 18px;
  line-height: 1.6;
  color: #555;
}
.ks-hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 24px 0 36px;
}
.ks-hero-cta .btn {
  margin: 0;
}

/* ---------- Table of contents ---------- */
.ks-toc {
  background: #f7f7f7;
  border: 1px solid #e6e6e6;
  border-radius: 6px;
  padding: 20px 24px;
  margin: 0 0 40px;
}
.ks-toc-title {
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #666;
  margin: 0 0 12px;
}
.ks-toc ol {
  margin: 0;
  padding-left: 0;
  list-style: none;
  counter-reset: ks-toc-counter;
}
.ks-toc li {
  counter-increment: ks-toc-counter;
  margin-bottom: 8px;
}
.ks-toc li::before {
  content: counter(ks-toc-counter) ".";
  display: inline-block;
  width: 22px;
  color: #0063af;
  font-weight: 700;
}
.ks-toc a {
  color: #444;
  text-decoration: none;
}
.ks-toc a:hover,
.ks-toc a:focus {
  color: #0063af;
  text-decoration: underline;
}

/* ---------- Checklist (Vorteile etc.) ---------- */
.ks-check-list li {
  position: relative;
  padding-left: 32px;
  margin-bottom: 12px;
}
.ks-check-list li::before {
  content: "\f00c";
  font-family: "FontAwesome";
  position: absolute;
  left: 0;
  top: 1px;
  color: #0063af;
  font-size: 14px;
}
.ks-criteria-list li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 10px;
}
.ks-criteria-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #0063af;
}

/* ---------- Tinted sections ---------- */
.ks-section-tinted {
  border-radius: 8px;
  padding: 28px 28px 8px;
  margin: 40px 0;
}
.ks-section-tinted > h2:first-child,
.ks-section-tinted > h3:first-child {
  margin-top: 0;
}
.ks-section-blue {
  background: #eef5fb;
}
.ks-section-orange {
  background: #fdf3e7;
}
.ks-section-gray {
  background: #f4f4f4;
}

/* ---------- Author box ---------- */
.ks-author-box {
  display: flex;
  align-items: center;
  gap: 18px;
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 8px;
  padding: 20px 24px;
  margin: 40px 0;
}
.ks-author-box img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.ks-author-name {
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 2px;
}
.ks-author-role {
  color: #666;
  font-size: 14px;
  margin: 0 0 6px;
}
.ks-author-note {
  font-size: 13px;
  color: #888;
  margin: 0;
}

/* ---------- FAQ accordion ---------- */
.ks-faq {
  border-top: 1px solid #e6e6e6;
}
.ks-faq-item {
  border-bottom: 1px solid #e6e6e6;
}
.ks-faq-question-wrap {
  margin: 0;
  font-size: inherit;
}
.ks-faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  padding: 18px 4px;
  font-size: 17px;
  font-weight: 600;
  color: #1a1a1a;
}
.ks-faq-icon {
  flex-shrink: 0;
  color: #0063af;
  transition: transform 0.2s ease;
}
.ks-faq-question[aria-expanded="true"] .ks-faq-icon {
  transform: rotate(180deg);
}
.ks-faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}
.ks-faq-answer-inner {
  padding: 0 4px 18px;
  color: #555;
}
.ks-faq-answer-inner p {
  margin: 0;
}

/* ---------- CTA banner ---------- */
.ks-cta-banner {
  background: #0063af;
  color: #fff;
  border-radius: 8px;
  padding: 36px 28px;
  margin: 48px 0 0;
  text-align: center;
}
.ks-cta-banner h2 {
  color: #fff;
  margin-top: 0;
}
.ks-cta-banner p {
  color: #eaf2fa;
}
.ks-cta-banner .btn-primary {
  background-color: #fff;
  border-color: #fff;
  color: #0063af;
}
.ks-cta-banner .btn-primary:hover,
.ks-cta-banner .btn-primary:focus {
  background-color: #eaf2fa;
  border-color: #eaf2fa;
  color: #0063af;
}
.ks-cta-banner a.ks-cta-phone {
  color: #fff;
  text-decoration: underline;
}

@media (min-width: 768px) {
  .ks-article {
    padding: 56px 0 80px;
  }
  .ks-article--stacked {
    padding: 28px 0;
  }
  .ks-article h1 {
    font-size: 36px;
  }
  .ks-article h2 {
    font-size: 26px;
  }
  .ks-article h3 {
    font-size: 20px;
  }
}

/* ---------- Aktionsbanner (Startseite) ---------- */
.ks-aktion-banner {
  background: linear-gradient(135deg, #0063af 0%, #004f8c 100%);
  color: #fff;
  border-radius: 8px;
  padding: 36px 28px;
  margin: 8px 0 16px;
  text-align: center;
}
.ks-article .ks-aktion-banner h2 {
  color: #fff;
  margin-top: 14px;
}
.ks-aktion-banner p {
  color: #eaf2fa;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}
.ks-aktion-badge {
  display: inline-block;
  background: #f39207;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 6px 16px;
  border-radius: 999px;
}
.ks-aktion-banner .btn-primary {
  background-color: #fff;
  border-color: #fff;
  color: #0063af;
}
.ks-aktion-banner .btn-primary:hover,
.ks-aktion-banner .btn-primary:focus {
  background-color: #eaf2fa;
  border-color: #eaf2fa;
  color: #0063af;
}
.ks-aktion-banner a.ks-cta-phone {
  color: #fff;
  text-decoration: underline;
}
.ks-aktion-banner .ks-aktion-fineprint {
  font-size: 12px;
  line-height: 1.5;
  color: #b9d3e8;
  margin: 18px auto 0;
}
