/* ══ Layout — the house/Divi responsive conventions for core blocks ═════════
   Core blocks have no per-breakpoint settings, so the house rules that Divi
   expressed per breakpoint live here, once, for every page:

   1. Columns stack at 980px (Divi's tablet break), not core's 781px.
   2. Columns → "bt-reverse-mobile": stacked order flips (image above text).
   3. Stacked text columns drop their side padding (an inset band's 10% inner
      padding is a desktop-only gutter). Cards, coloured columns and columns
      marked "bt-keep-pad" keep theirs.
   4. "bt-center-mobile": centre the text of a block and its children ≤980px.
   5. Spacing that differs by device is authored as clamp() in the block
      (exact at 390px and 1440px) — nothing to add here.
   ════════════════════════════════════════════════════════════════════════ */

@media (max-width: 980px) {
  .wp-block-columns:not(.is-not-stacked-on-mobile) { flex-wrap: wrap !important; }
  .wp-block-columns:not(.is-not-stacked-on-mobile) > .wp-block-column { flex-basis: 100% !important; }
  .wp-block-columns.bt-reverse-mobile { flex-direction: column-reverse; }

  .wp-block-columns > .wp-block-column:not(.has-background):not(.has-border-color):not([class*="is-style-card"]):not([class*="is-style-section"]):not(.bt-keep-pad) {
    padding-left  : 0 !important;
    padding-right : 0 !important;
  }

  .bt-center-mobile,
  .bt-center-mobile :is(h1, h2, h3, h4, h5, h6, p) { text-align: center; }
  .bt-center-mobile.is-layout-flex { justify-content: center; }
}

/* Mobile image (Image/Cover → "Mobile image" panel): the <picture> wrapper
   must not change layout. */
.wp-block-image picture,
.wp-block-cover picture { display: contents; }

/* Columns size like Divi columns: padding sits INSIDE the column's width, so a
   50/50 split with 10% inner padding stays 50/50 (core leaves content-box). */
.wp-block-column { box-sizing: border-box; }

/* Page bands sit flush, like Divi sections: no root block gap between the
   header, the page's full-width sections, the closing CTA and the footer. */
.wp-site-blocks > *,
.wp-site-blocks main > *,
.wp-block-post-content > .alignfull { margin-block-start: 0 !important; margin-block-end: 0 !important; }
