/* Ensure block gap is applied to all child elements */
.wp-block-media-text__content > * {
	margin-top: var(--wp--style--block-gap);
}

/* Ensure block uses flex gap instead of padding for spacing */
.wp-block-media-text {
	gap: var(--wp--preset--spacing--60);

	@media screen and (min-width: 768px) {
		gap: var(--wp--preset--spacing--80);
		grid-template-columns: 1fr 1fr;
		min-height: 500px;
	}
}

/* Ensure content padding is set correctly */
.wp-block-media-text .wp-block-media-text__content {
	padding: 0;

	& > :first-child {
		margin-top: 0;
	}

	& > :last-child {
		margin-bottom: 0;
	}
}

@media screen and (min-width: 768px) {
	.wp-block-media-text.is-image-fill-element .wp-block-media-text__content {
		padding: var(--wp--custom--global--spacing--padding--background) 0;
	}
}

/* Apply base border radius */
.wp-block-media-text.has-background,
.wp-block-media-text__media,
.wp-block-media-text__media img {
	border-radius: var(--wp--preset--border-radius--md);
}

/* Media Stretched */
/* .wp-block-media-text.is-style-image-stretched {
	padding-top: var(--wp--custom--global--spacing--padding--section);
	padding-bottom: var(--wp--custom--global--spacing--padding--section);
} */
@media screen and (min-width: 768px) {
	.wp-block-media-text.is-style-image-stretched .wp-block-media-text__media {
		display: flex;
	}

	.wp-block-media-text.is-style-image-stretched .wp-block-media-text__media img {
		width: 50vw;
		max-width: none;
	}

	/* Image right */
	.wp-block-media-text.is-style-image-stretched.has-media-on-the-right .wp-block-media-text__media {
		justify-content: flex-start;
	}

	.wp-block-media-text.is-style-image-stretched.has-media-on-the-right .wp-block-media-text__media img {
		border-top-right-radius: 0;
		border-bottom-right-radius: 0;
	}

	/* Image left */
	.wp-block-media-text.is-style-image-stretched:not(.has-media-on-the-right) .wp-block-media-text__media {
		justify-content: flex-end;
	}

	.wp-block-media-text.is-style-image-stretched:not(.has-media-on-the-right) .wp-block-media-text__media img {
		border-top-left-radius: 0;
		border-bottom-left-radius: 0;
	}
}
