/*
 * Intro (cis/intro, cis/intro-left, cis/intro-right). Loaded with the blocks, front end and editor canvas.
 *
 * Moved here from the Etch styles of the Intro component: .bw-intro, .bw-intro__left, .bw-intro__right.
 * Etch still prints those styles for any page that has the class names in its markup, so every rule here is
 * written with two classes (.bw-intro first) to win on its own and to match the old look exactly. Plain
 * stylesheet, not compiled by Etch, so:
 *   - the Etch @custom-media token is written out:
 *       --block-query-large = inline-size >= 800px  (50rem)
 *   - lengths are ACSS variables as they were.
 * The section-specific rule `.bw-experiences .bw-intro` and the per-page classes (.bw-be-part__intro and so
 * on, attached through the row's `classes`) stay Etch styles.
 *
 * The container queries need an ancestor with container-type: inline-size. On the page that is the Etch
 * container (or, later, the section block); in the editor it is the block wrapper, set below.
 *
 * Mobile first: the columns stack; from 50rem of container width they sit side by side, the left column at its
 * chosen width and the right column taking the rest.
 */

.bw-intro {
	display: flex;
	flex-direction: column;
	gap: var(--space-m);
	justify-content: space-between;

	@container (inline-size >= 50rem) {
		flex-direction: row;
		align-items: flex-start;
	}
}

.bw-intro .bw-intro__left {
	flex: 0 0 auto;

	@container (inline-size >= 50rem) {
		flex: 0 0 var(--bw-intro-left-preset, 40%);
	}

	&[data-width-preset='custom'] {
		@container (inline-size >= 50rem) {
			flex-basis: var(--bw-intro-left-custom, 40%);
		}
	}

	&[data-width-preset='auto'] {
		@container (inline-size >= 50rem) {
			flex-basis: auto;
		}
	}
}

.bw-intro .bw-intro__right {
	@container (inline-size >= 50rem) {
		flex: 1;
	}

	&[data-width-preset='auto'] {
		@container (inline-size >= 50rem) {
			flex: 0 0 auto;
		}
	}
}

/* ---- Editor canvas only ---------------------------------------------------------------------------
 * The wrapper is the container for the queries above. It is given the full width: a size container has no
 * width of its own and would collapse inside a shrink-to-fit parent (the Logo row bug). The editor puts its own
 * margins on the column blocks, and the canvas needs the column to show its settings. */
.bw-intro-editor {
	container-type: inline-size;
	inline-size: 100%;
}

.bw-intro > .wp-block {
	margin: 0;
	max-inline-size: none;
}

.bw-intro .bw-intro__left.wp-block,
.bw-intro .bw-intro__right.wp-block {
	min-inline-size: 0;
}
