/*
 * Weiterbildung wide layout pilot.
 *
 * Builder 19 already sits inside the shared 1404px section-content track,
 * but its normal Gavias "Box" rows fall back to Bootstrap's 1200px cap on
 * large screens. This page-only variant lets those rows use that existing
 * track without changing global Bootstrap containers, Builder data, or the
 * responsive course/filter components.
 */
body.integplan-training-page {
  --ip-training-shell-max: 1404px;
}

@media (min-width: 1100px) {
  body.integplan-training-page
    .gavias-blockbuilder-content > .gbb-row-wrapper
    > .gbb-row > .bb-inner > .bb-container.container {
    width: 100%;
    max-width: var(--ip-training-shell-max);
    margin-right: auto;
    margin-left: auto;
  }

  /* Keep the table of contents readable above rows and within its own rail. */
  body.integplan-training-page .ip-section-sidebar {
    z-index: 20;
  }

  body.integplan-training-page .ip-section-sidebar > .ip-section-nav {
    background-color: rgba(255, 255, 255, 0.96);
    opacity: 1;
    visibility: visible;
  }
}

/* Let the sticky rail clear the final section before the page footer. */
@media (min-width: 1100px) and (max-width: 1599px) {
  body.integplan-training-page .ip-section-sidebar {
    height: calc(100% + 48px);
  }
}

/*
 * On large screens, center the main track and float the 176px rail in the
 * white margin beside it. This is the established About-page TOC placement.
 */
@media (min-width: 1600px) {
  body.integplan-training-page .ip-section-layout {
    position: relative;
    grid-template-columns: minmax(0, var(--ip-training-shell-max));
    gap: 0;
    width: min(calc(100% - 220px), var(--ip-training-shell-max));
    max-width: none;
    margin-right: 0;
    margin-left: max(208px, calc(50% - 702px));
  }

  body.integplan-training-page .ip-section-sidebar {
    position: absolute;
    inset-block: 0;
    inset-inline-start: min(-192px, calc(263px - 25vw));
    width: 176px;
  }

  body.integplan-training-page .ip-section-sidebar > .ip-section-nav {
    width: 176px;
    margin-left: 0;
  }
}
