
/* --- Add support for ACF/CPT pages that use is-layout-flex + is-nowrap --- */
@media (max-width: 782px) {
  /* let flex groups wrap instead of staying side-by-side */
  .wp-block-post-content .is-layout-flex.is-nowrap,
  .entry-content .is-layout-flex.is-nowrap {
    flex-wrap: wrap !important;
  }

  /* when a group is used like two columns, make children full-width on mobile */
  .wp-block-post-content .wp-block-group.is-layout-flex > *,
  .entry-content .wp-block-group.is-layout-flex > * {
    flex: 1 1 100% !important;
    max-width: 100% !important;
  }

  /* common “feature/value” rows */
  .wp-block-post-content .value-block.is-layout-flex,
  .entry-content .value-block.is-layout-flex {
    flex-direction: column !important;
    row-gap: var(--wp--style--block-gap, 1.25rem);
  }

  /* images inside those rows: ensure they drop below text and scale */
  .wp-block-post-content .wp-block-group.is-layout-flex .wp-block-image,
  .entry-content .wp-block-group.is-layout-flex .wp-block-image {
    order: 2;
    width: 100% !important;
  }
  .wp-block-post-content .wp-block-group.is-layout-flex .wp-block-image img,
  .entry-content .wp-block-group.is-layout-flex .wp-block-image img {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
  }
}

/* ===== Feature page: widen testimonial quote block on mobile ===== */
@media (max-width: 782px) {
  body.single-feature 
  .has-primary-background-color.has-background.has-global-padding.is-layout-constrained {
    width: 100vw !important;          /* use full viewport width */
    max-width: 100vw !important;
    margin-left: -5vw !important;     /* pull outward slightly to offset global padding */
    margin-right: -5vw !important;
    border-radius: 12px !important;   /* soften corners so it still looks balanced */
    box-sizing: border-box;
  }

  /* tighten internal padding a little to keep text readable edge-to-edge */
  body.single-feature 
  .has-primary-background-color.has-background.has-global-padding.is-layout-constrained blockquote {
    padding-left: 1.25rem !important;
    padding-right: 1.25rem !important;
  }
}
