/*
 * Shared, opt-in editorial hierarchy. See docs/HEADINGS.md.
 * Card headings, the home slider and pages outside the draft are untouched.
 */
body.integplan-editorial-page {
  --ip-heading-ink: #3e3f41;
  --ip-heading-orange: #d76117;
  --ip-page-title-size: clamp(30px, 3.2vw, 42px);
  --ip-section-title-size: 20px;
}

body.integplan-editorial-page .widget.gsc-heading.ip-heading {
  --ip-heading-size: var(--ip-section-title-size);
  padding: 5px 0 25px;
}

body.integplan-editorial-page .widget.gsc-heading.ip-heading--page {
  --ip-heading-size: var(--ip-page-title-size);
  padding: 0 0 36px;
  text-align: left;
}

body.integplan-editorial-page .widget.gsc-heading.ip-heading--subsection {
  --ip-heading-size: 18px;
}

body.integplan-editorial-page .widget.gsc-heading.ip-heading--detail {
  --ip-heading-size: 16px;
}

body.integplan-editorial-page .widget.gsc-heading.ip-heading > :is(.title, .sub-title),
body.integplan-editorial-page .ip-text-subheading {
  margin: 0;
  padding: 0;
  color: var(--ip-heading-ink);
  font-family: Arial, Helvetica, sans-serif;
  /* Required by custom.css's legacy !important global/mobile heading scale. */
  font-size: var(--ip-heading-size) !important;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.3 !important;
  text-transform: none;
}

/* Existing E-Learning rich-text subsections retain their text-widget editor. */
body.integplan-editorial-page .ip-text-subheading {
  --ip-heading-size: 18px;
  margin: 20px 0 12px;
  text-align: left;
}

body.integplan-editorial-page .widget.gsc-heading.ip-heading--page > .title {
  letter-spacing: -0.025em;
  line-height: 1.15 !important;
  text-wrap: balance;
}

body.integplan-editorial-page .widget.gsc-heading.ip-heading > .sub-title {
  color: var(--ip-heading-orange);
}

body.integplan-editorial-page .widget.gsc-heading.ip-heading > .heading-line {
  display: block;
  float: none;
  clear: both;
  width: 50px;
  height: 2px;
  margin: 10px auto 0;
  background: var(--ip-heading-orange);
}

body.integplan-editorial-page .widget.gsc-heading.ip-heading.align-left > .heading-line {
  margin-right: 0;
  margin-left: 0;
}

body.integplan-editorial-page .widget.gsc-heading.ip-heading--page > .heading-line {
  margin-top: 18px;
}

/* Leave breathing room between a main title's rule and its following copy. */
body.integplan-training-page .widget.gsc-heading.ip-heading--section {
  margin-bottom: 12px;
}

body.integplan-editorial-page .widget.gsc-heading.ip-heading > .title-desc {
  max-width: 720px;
  margin: 18px 0 0;
  padding: 0;
  text-align: left;
}

body.integplan-editorial-page .widget.gsc-heading.ip-heading.align-center > .title-desc {
  margin-right: auto;
  margin-left: auto;
  text-align: center;
}

body.integplan-editorial-page .widget.gsc-heading.ip-heading > .title-desc p:last-child {
  margin-bottom: 0;
}

/* Title-only rows use the existing page content track, including the TOC rail. */
body.integplan-editorial-page .ip-page-title-row > .bb-inner {
  padding-top: 24px;
  padding-bottom: 0;
}

body.integplan-editorial-page .gbb-row-wrapper:has(> .ip-page-title-row)
  + .gbb-row-wrapper > .gbb-row > .bb-inner,
body.integplan-editorial-page .ip-section-mobile
  + .gbb-row-wrapper > .gbb-row > .bb-inner {
  padding-top: 0;
}

/* Beratungshilfen retains its existing cards, category toggles and shell. */
body.integplan-help-page .widget.gsc-heading.ip-help-intro-heading {
  padding-bottom: 0;
}

body.integplan-help-page .ip-help-intro-heading .ip-help-lead {
  max-width: 68ch;
  margin: 0;
  color: #58595b;
  /* Body paragraphs also have a sitewide !important scale. */
  font-size: 18px !important;
  line-height: 1.75 !important;
  text-align: left;
}

@media (max-width: 767px) {
  body.integplan-editorial-page .ip-page-title-row > .bb-inner {
    padding-top: 8px;
  }

  body.integplan-editorial-page .widget.gsc-heading.ip-heading--subsection,
  body.integplan-editorial-page .ip-text-subheading {
    --ip-heading-size: 17px;
  }

  body.integplan-editorial-page .widget.gsc-heading.ip-heading--page {
    padding-bottom: 28px;
  }

  body.integplan-help-page .widget.gsc-heading.ip-help-intro-heading {
    padding-bottom: 0;
  }

  body.integplan-help-page .ip-help-intro-heading .ip-help-lead {
    font-size: 16px !important;
  }
}
