
/* IAM / service detail layout fix:
   Prevent right sidebar height from pushing the next narrative section too far down. */
.service-detail-grid,
.detail-layout,
.service-layout,
.two-column,
.content-grid {
  align-items: start !important;
}

/* Reduce the gap after the two-column intro/sidebar area */
.service-detail-grid,
.detail-layout,
.service-layout {
  margin-bottom: 28px !important;
}

/* Keep the section following the sidebar close to the preceding content */
.service-detail-grid + section,
.detail-layout + section,
.service-layout + section,
.two-column + section,
.content-grid + section {
  margin-top: 28px !important;
  padding-top: 28px !important;
  clear: none !important;
}

/* Specific correction for the IAM page section that was dropping below the sidebar */
body.iam-page .seo-section,
body.iam-page .local-seo,
body.iam-page section h2 {
  margin-top: 0 !important;
}

body.iam-page section {
  scroll-margin-top: 120px;
}

/* On wide screens, allow the main text and sidebar to sit independently without creating a large visual canyon */
@media (min-width: 900px) {
  body.iam-page .service-detail-grid,
  body.iam-page .detail-layout,
  body.iam-page .service-layout {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px) !important;
    column-gap: 36px !important;
    align-items: start !important;
  }
}

/* On smaller screens, stack normally with no excessive gap */
@media (max-width: 899px) {
  .service-detail-grid,
  .detail-layout,
  .service-layout,
  .two-column,
  .content-grid {
    display: block !important;
  }
  .service-detail-grid + section,
  .detail-layout + section,
  .service-layout + section {
    margin-top: 20px !important;
    padding-top: 20px !important;
  }
}
