/* Einheitliche Inhaltsbreite  ·  2026-09-10
 *
 * Die Seiten mischen zwei Page-Builder (Kadence + GenerateBlocks). Jeder Block
 * brachte eine eigene Breite mit, teils mit negativen Rändern. Seitentitel und
 * Brotkrümel liefen über die volle Fensterbreite, der Inhalt stand zentriert.
 * Beides steckt schon im WordPress-Original.
 *
 * Prinzip hier: GENAU EINE Ebene bestimmt Breite und Seitenrand.
 *   - der Theme-Container gibt seinen eigenen Rand ab (sonst addiert er sich)
 *   - jeder Abschnitts-Container bekommt Breite + Rand
 *   - verschachtelte Container bekommen beides NICHT (sonst doppelt eingerückt)
 *
 * Breite = Theme-Spalte minus beidseitigem Rand. Über Variablen, nie als feste
 * Zahl: eine feste Zahl passt nur bei einer einzigen Fensterbreite.
 *
 * Kürzel: _go = Theme-Seitencontainer   _ay = entry-header   _lu = Brotkrümel
 *         _ce = gb-container   _l0 = gb-grid-wrapper   _j = kt-row-column-wrap
 * Muss als LETZTES Stylesheet geladen werden.
 */

:root {
  --sd-rand:   var(--global-content-edge-padding, 1.2rem);
  --sd-breite: calc(var(--global-content-width, 1337px) - 2 * var(--sd-rand));
}

/* 1. Theme-Container gibt seinen Rand ab */
main ._go {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* 2. Abschnitts-Container: gleiche Breite, gleicher Rand */
main ._ay,
main ._lu,
main ._ce,
main ._l0,
main ._j,
main [class*="kt-tabs-wrap"] {
  max-width: calc(var(--sd-breite) + 2 * var(--sd-rand)) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: var(--sd-rand) !important;
  padding-right: var(--sd-rand) !important;
  box-sizing: border-box;
}

/* 3. verschachtelte Container: weder Breite noch Rand erneut */
main ._ay ._lu,
main ._ay ._ce, main ._ay ._l0, main ._ay ._j,
main ._ce ._ce, main ._ce ._l0, main ._ce ._j,
main ._l0 ._ce, main ._l0 ._l0, main ._l0 ._j,
main ._j  ._ce, main ._j  ._l0, main ._j  ._j {
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* 4. Innenabstände, die den Textanfang zusätzlich verschoben haben */
main ._lt, main ._pp, main ._ds {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* 5. Stadtteil-Karte (sd-naehe): feste 1200px passten nicht zur Theme-Spalte.
 *    Jetzt gleiche Kante wie die Überschriften darüber. */
main .sd-naehe {
  max-width: var(--sd-breite) !important;
  width: auto !important;          /* verschachtelt: Breite des Elternteils;
                                      direkt im Inhalt greift Regel 7 */
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box;
}

/* 6. Handy: die Spalten stehen untereinander, die seitliche Einrückung
 *    von 60–80px blieb aber stehen (Fehler schon im WordPress-Original). */
@media (max-width: 767px) {
  main ._fi {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
}

/* 7. Direkte Kinder des Inhaltsbereichs (Überschriften, Preiszeilen, FAQ,
 *    Beitragsliste) lagen 19 px weiter aussen als die Abschnitte daneben –
 *    bei farbig hinterlegten Überschriften deutlich sichtbar.
 *    Ausgenommen: die Zeilen-Container (._h), die volle Breite brauchen. */
main ._k3 > *:not(._h) {
  max-width: var(--sd-breite) !important;
  width: calc(100% - 2 * var(--sd-rand)) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box;
}

/* 8. Zwei neue Bausteine
 *    .sd-fakten  – Faktenliste auf den Stadtteilseiten (untereinander lesen,
 *                  nicht als zentrierte Pillen wie die Nachbarschaftslinks)
 *    .sd-bezirk  – Ortsverzeichnis auf /einsatzorte/ (Links bleiben Pillen,
 *                  beginnen aber links statt mittig) */
.sd-fakten ul {
  display: block;
  text-align: left;
  margin: 0 0 1rem;
}
.sd-fakten li {
  margin: 0 0 .45rem;
  line-height: 1.5;
}
.sd-fakten .sd-naehe-intro,
.sd-bezirk .sd-naehe-intro {
  text-align: left;
  max-width: none;
  margin: 0 0 .85rem;
}
.sd-fakten h2,
.sd-bezirk h2 {
  text-align: left;
}
.sd-bezirk ul {
  justify-content: flex-start;
}

/* 9. Karten, die direkt unter <main> hängen (z. B. /kontakt/, /leistungen/),
 *    haben keinen Eltern-Container, der den Seitenrand liefert. */
main > .sd-naehe {
  width: calc(100% - 2 * var(--sd-rand)) !important;
}

/* 10. Leistungsboxen auf den Stadtteilseiten */
.sd-leistung-gitter {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 1rem;
  margin-top: .25rem;
}
.sd-leistung {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1rem 1.1rem;
  background: #fff;
  text-align: left;
}
.sd-leistung img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 6px;
  margin: 0 0 .75rem;
  background: #edf2f7;
}
.sd-leistung h3 {
  margin: 0 0 .5rem;
  font-size: 1.05rem;
  line-height: 1.3;
  text-align: left;
}
.sd-leistung p {
  margin: 0 0 .55rem;
  line-height: 1.55;
}
.sd-leistung .sd-leistung-liste {
  margin: 0;
  font-size: .88rem;
  line-height: 1.5;
  color: #4a5568;
}
.sd-leistungen h2 { text-align: left; }
@media (max-width: 600px) {
  .sd-leistung-gitter { grid-template-columns: 1fr; }
}

/* 11. Footer: drei Spalten, Kontakt zuerst.
 *     Unten Luft, damit der schwebende Anruf-Knopf nichts verdeckt. */
.sd-fuss {
  max-width: var(--sd-breite);
  width: calc(100% - 2 * var(--sd-rand));
  margin: 0 auto;
  padding: 2.2rem 0 1.4rem;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2rem;
  box-sizing: border-box;
}
.sd-fuss-titel {
  margin: 0 0 .7rem;
  font-size: 1.05rem;
  line-height: 1.3;
  text-align: left;
}
.sd-fuss ul { list-style: none; margin: 0; padding: 0; }
.sd-fuss li { margin: 0 0 .45rem; }
.sd-fuss a { text-decoration: none; }
.sd-fuss a:hover, .sd-fuss a:focus { text-decoration: underline; }
.sd-fuss-tel { margin: 0 0 .35rem; }
.sd-fuss-tel a {
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}
.sd-fuss-zeiten { margin: .9rem 0 0; }
.sd-fuss-zeiten dt { font-weight: 700; margin: 0; }
.sd-fuss-zeiten dd { margin: 0 0 .5rem; }
.sd-fuss-rabatt { margin: 1.1rem 0 0; }
.sd-fuss-rabatt img {
  display: block;
  width: 100%;
  max-width: 230px;
  height: auto;
  border-radius: 6px;
}
/* Platz für den schwebenden Anruf-Knopf */
footer#colophon { padding-bottom: 92px; }
@media (max-width: 900px) {
  .sd-fuss { grid-template-columns: 1fr 1fr; gap: 1.6rem; }
}
@media (max-width: 600px) {
  .sd-fuss { grid-template-columns: 1fr; gap: 1.4rem; }
}

/* 12. Ratgeber-Kasten auf den Stadtteilseiten (ersetzt die alte Beitragsliste) */
.sd-ratgeber ul {
  display: block;
  text-align: left;
  margin: 0 0 .9rem;
}
.sd-ratgeber li {
  margin: 0 0 .6rem;
  line-height: 1.55;
}
.sd-ratgeber li a { font-weight: 600; }
.sd-ratgeber li span { color: #4a5568; }
.sd-ratgeber h2 { text-align: left; }
.sd-hinweis {
  margin: 0 0 1.2rem;
  padding: .8rem 1rem;
  border-left: 4px solid #217e24;
  background: #f7fafc;
  line-height: 1.55;
}

/* 13. Featured + kleine Grafiken nie auf volle Spaltenbreite aufblasen.
 *     Theme setzt oft width/height:100% – das macht 200px-Bilder riesig. */
main ._cu._qc {
  max-width: 220px !important;
  width: auto !important;
  margin: 0.75rem auto 0.35rem !important;
  height: auto !important;
  padding-bottom: 0 !important;
}
main ._cu._qc ._cv {
  position: static !important;
  height: auto !important;
}
main ._cu._qc img {
  width: auto !important;
  max-width: min(200px, 42vw) !important;
  height: auto !important;
  max-height: 200px !important;
  object-fit: contain !important;
  display: block;
  margin-left: auto;
  margin-right: auto;
}
/* Related-Post-Thumbs: normale Kartenbreite, contain */
main ._qq ._cv img,
main .splide__slide ._cv img {
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: 180px !important;
  object-fit: contain !important;
  display: block !important;
  margin: 0 auto !important;
}
main ._qq ._cv,
main .splide__slide ._cv {
  height: auto !important;
  min-height: 0 !important;
  padding-bottom: 0 !important;
  position: relative !important;
}
@media (max-width: 767px) {
  main ._cu._qc {
    max-width: 150px !important;
  }
  main ._cu._qc img {
    max-width: 140px !important;
    max-height: 150px !important;
  }
  /* Featured-Caption auf Mobile oft nur Alt-Text → ausblenden */
  main ._ra._a4 {
    display: none !important;
  }
}
/* Content-Figuren: contain, zentriert, nicht Crop */
main ._k3 figure._as img,
main ._k3 ._ap img {
  max-width: min(320px, 100%) !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  display: block;
  margin-left: auto;
  margin-right: auto;
}
/* Featured-Caption unter dem Bild (oft Alt-Text) dezent */
main ._ra._a4 {
  text-align: center;
  font-size: 0.85rem;
  color: #64748b;
  max-width: 280px;
  margin: 0 auto 1rem;
}
/* Related-Post-Thumbnails: Schilder nicht verzerren */
main ._qq ._cv img[src*="Festpreis-Garantie"],
main ._qv ._cv img[src*="Festpreis-Garantie"],
main ._qq ._cv img[src*="Rechte-Pflichten"],
main ._qv ._cv img[src*="Rechte-Pflichten"] {
  object-fit: contain !important;
  background: #f7fafc;
}
/* Maps: contain */
main ._k3 figure img._dv,
main ._k3 figure img[src*="Einsatzorte"] {
  max-width: min(520px, 100%) !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  display: block;
  margin-left: auto;
  margin-right: auto;
}


/* 14. Featured-Logos + Float-Bilder (Ratgeber) – nie riesig / nie leere linke Hälfte */
main img[src*="Logo-Schluessel"] {
  max-width: min(160px, 40vw) !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
}
main ._k3 figure._bs,
main ._k3 ._ap figure {
  float: none !important;
  margin-left: auto !important;
  margin-right: auto !important;
  max-width: min(360px, 100%) !important;
}
main ._k3 figure._bs img,
main ._k3 ._ap figure img {
  float: none !important;
  width: 100% !important;
  max-width: min(360px, 92vw) !important;
  height: auto !important;
  object-fit: contain !important;
  display: block !important;
  margin-left: auto !important;
  margin-right: auto !important;
}
/* Featured-Rahmen ohne Bild nicht aufblasen */
main > ._h0 ._cu._qc:empty,
main ._fj > ._cu._qc:not(:has(img)) {
  display: none !important;
}

/* 15. Ratgeber-Figures: Theme display:table/_bs killen */
main ._k3 figure._as,
main ._k3 figure._ap,
main ._k3 ._ap figure {
  display: block !important;
  float: none !important;
  clear: both !important;
  margin: 1rem auto !important;
  width: 100% !important;
  max-width: 360px !important;
  text-align: center !important;
}
main ._k3 figure._as img,
main ._k3 figure._ap img,
main ._k3 ._ap figure img {
  display: block !important;
  float: none !important;
  margin: 0 auto !important;
  width: auto !important;
  max-width: min(300px, 100%) !important;
  height: auto !important;
  object-fit: contain !important;
}

/* 16. figcaption: Theme table-caption + figure block = ~10px Breite → Buchstaben-Stapel */
main ._k3 figure figcaption,
main ._k3 figcaption._cf,
main figure._as > figcaption,
main ._ap figure > figcaption {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  float: none !important;
  clear: both !important;
  caption-side: unset !important;
  text-align: center !important;
  word-break: normal !important;
  overflow-wrap: break-word !important;
  box-sizing: border-box !important;
  margin: 0.5rem 0 0 !important;
  padding: 0 0.25rem !important;
  height: auto !important;
}

/* 17. Ausnahme zu Regel 15.
 *     Regel 15 deckelt alle Figuren im Inhalt auf 360 px (Bild 300 px), damit
 *     Ratgeber-Illustrationen nicht die Spalte sprengen. Die Bilder in
 *     Kadence-Bildblöcken (._aa) sind aber die Seitenmotive – das 550er
 *     Stadtteil-Schild landete dadurch bei 300 px und wirkte verloren.
 *     Hier behalten sie ihre Größe, begrenzt nur durch die Spaltenbreite. */
main ._k3 ._aa figure._as {
  width: 100% !important;
  max-width: 100% !important;
}
main ._k3 ._aa figure._as img {
  width: auto !important;
  max-width: 100% !important;
}
