/**
 * Vertical rhythm of blocks inside columns, matching WPBakery's.
 *
 * TEMPORARY: this is site-wide content styling, not part of any block. It
 * lives here until the new FSE theme exists, then moves to the theme
 * (theme.json / theme stylesheet) and this file and its enqueue in
 * bw-blocks.php are deleted — see wpbakery-gutenberg-research.md.
 *
 * WPBakery gives every content element 35px below it (.wpb_content_element:
 * text, image, carousel, separator, video, map, raw HTML such as the stats
 * line; the interactive map too, always placed in a text block), buttons and tabs 21.74px
 * (.vc_btn3-container, .vc_tta-container), and nothing to headings (theme
 * margin), spacers, inner rows and the site's own bw_* elements. Inside a
 * text block the paragraphs keep the theme's margin and the last one has
 * none (.wpb_text_column :last-child). Converted text blocks are loose
 * paragraphs in the column, so a run of paragraphs/lists counts as one text
 * block: its last item gets the 35px. Rows get their bottom space from the
 * last element in their columns, never from a margin of their own.
 *
 * A column's content sits either directly in the column or, when the
 * column had design options core/column can't hold, in a .bw-column-inner
 * group (the converter's stand-in for WPBakery's .vc_column-inner; on the
 * front end its blocks are inside .wp-block-group__inner-container). That
 * wrapper gets none of a text block's spacing.
 */

:is(.wp-block-column, .bw-column-inner, .bw-column-inner > .wp-block-group__inner-container) > :is(p, ul, ol):not(:has(+ :is(p, ul, ol))),
:is(.wp-block-column, .bw-column-inner, .bw-column-inner > .wp-block-group__inner-container) > .wp-block-group:not(.bw-column-inner),
:is(.wp-block-column, .bw-column-inner, .bw-column-inner > .wp-block-group__inner-container) > :is(.wp-block-image, .wp-block-bw-image, .wp-block-embed, .wp-block-bw-image-carousel, .wp-block-bw-separator, .wp-block-bw-google-map, .wp-block-bw-stats, .wp-block-bw-interactive-map) {
	margin-bottom: 35px;
}

:is(.wp-block-column, .bw-column-inner, .bw-column-inner > .wp-block-group__inner-container) > .wp-block-bw-button.bw-button,
:is(.wp-block-column, .bw-column-inner, .bw-column-inner > .wp-block-group__inner-container) > :is(.wp-block-bw-tabs, .wp-block-bw-accordion) {
	margin-bottom: 22px;
}

/* A text block's own last item (WPBakery .wpb_text_column :last-child). */
:is(.wp-block-column, .bw-column-inner > .wp-block-group__inner-container) > .wp-block-group:not(.bw-column-inner) > :last-child,
:is(.wp-block-column, .bw-column-inner > .wp-block-group__inner-container) > .wp-block-group:not(.bw-column-inner) > .wp-block-group__inner-container > :last-child {
	margin-bottom: 0;
}

.entry-content .wp-block-columns,
:is(.wp-block-column, .bw-column-inner, .bw-column-inner > .wp-block-group__inner-container) > .wp-block-spacer {
	margin-bottom: 0;
}

/* The wrapper itself: only the margins its design options give it. */
.wp-block-column > .bw-column-inner {
	margin-top: 0;
	margin-bottom: 0;
}

/*
 * The theme's own exception (css/main.css:
 * `.home-register-interest .wpb_text_column.wpb_content_element
 * { margin-bottom: 0 }`) — the text above the register-interest form sits
 * right on top of it — for converted content.
 */
:is(.wp-block-column.home-register-interest, .home-register-interest > .bw-column-inner, .home-register-interest > .bw-column-inner > .wp-block-group__inner-container) > :is(p, ul, ol):not(:has(+ :is(p, ul, ol))),
:is(.wp-block-column.home-register-interest, .home-register-interest > .bw-column-inner, .home-register-interest > .bw-column-inner > .wp-block-group__inner-container) > .wp-block-group:not(.bw-column-inner) {
	margin-bottom: 0;
}
