/*
 * REALPRO_BRAND_SERVICES_MOBILE_SPACING_V43
 * Hotfix for the Anointed One image -> first service-list item overlap.
 * Scope: /services/, #brand-services, widths <= 900px only.
 * Depends on V42 moving the ORIGINAL <figure> immediately after <h2>.
 */
@media screen and (max-width:900px) {

  /* The image must contribute its real height to document flow. */
  body.rp-page-services section#brand-services.rp-services-client-service
  .rp-services-client-service__copy > figure.rp-services-client-service__media {
    display:flow-root !important;
    position:relative !important;
    inset:auto !important;
    float:none !important;
    clear:both !important;
    height:auto !important;
    min-height:0 !important;
    aspect-ratio:auto !important;
    margin:0 0 clamp(26px,5vw,36px) !important;
    padding:0 !important;
    isolation:isolate !important;
    overflow:hidden !important;
  }

  /* Legacy absolute-position rules must not remove the picture from flow. */
  body.rp-page-services section#brand-services.rp-services-client-service
  .rp-services-client-service__copy > figure.rp-services-client-service__media > picture {
    position:static !important;
    display:block !important;
    inset:auto !important;
    width:100% !important;
    height:auto !important;
    min-height:0 !important;
    transform:none !important;
  }

  body.rp-page-services section#brand-services.rp-services-client-service
  .rp-services-client-service__copy > figure.rp-services-client-service__media img {
    position:static !important;
    display:block !important;
    inset:auto !important;
    float:none !important;
    width:100% !important;
    height:auto !important;
    max-height:min(76svh,590px) !important;
    object-fit:contain !important;
    object-position:center !important;
    margin:0 auto !important;
    transform:none !important;
  }

  /* The service list begins only AFTER the complete photo plus spacing. */
  body.rp-page-services section#brand-services.rp-services-client-service
  .rp-services-client-service__copy > figure.rp-services-client-service__media + * {
    position:relative !important;
    top:auto !important;
    bottom:auto !important;
    clear:both !important;
    transform:none !important;
    margin-top:0 !important;
    z-index:1 !important;
  }
}
