/**
 * Critical Gutenberg block styles for the classic Linia theme.
 * Loaded last so Bootstrap / theme resets cannot kill columns & backgrounds.
 */

/* Layout helpers from Global Styles */
.is-layout-flex {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5em;
}

.is-layout-flex > :is(*, div) {
	margin: 0;
}

.is-layout-grid {
	display: grid;
	gap: 0.5em;
}

.is-layout-grid > :is(*, div) {
	margin: 0;
}

/* Columns */
.wp-block-columns {
	align-items: normal !important;
	box-sizing: border-box;
	display: flex !important;
	flex-wrap: wrap !important;
	gap: 2em;
}

@media (min-width: 782px) {
	.wp-block-columns {
		flex-wrap: nowrap !important;
	}

	.wp-block-columns:not(.is-not-stacked-on-mobile) > .wp-block-column {
		flex-basis: 0;
		flex-grow: 1;
	}

	.wp-block-columns:not(.is-not-stacked-on-mobile) > .wp-block-column[style*="flex-basis"] {
		flex-grow: 0;
	}
}

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

.wp-block-columns.is-not-stacked-on-mobile {
	flex-wrap: nowrap !important;
}

.wp-block-columns.is-not-stacked-on-mobile > .wp-block-column {
	flex-basis: 0;
	flex-grow: 1;
}

.wp-block-columns.is-not-stacked-on-mobile > .wp-block-column[style*="flex-basis"] {
	flex-grow: 0;
}

.wp-block-columns.are-vertically-aligned-top {
	align-items: flex-start;
}

.wp-block-columns.are-vertically-aligned-center {
	align-items: center;
}

.wp-block-columns.are-vertically-aligned-bottom {
	align-items: flex-end;
}

.wp-block-column {
	flex-grow: 1;
	min-width: 0;
	overflow-wrap: break-word;
	word-break: break-word;
	box-sizing: border-box;
}

.wp-block-column.is-vertically-aligned-top {
	align-self: flex-start;
}

.wp-block-column.is-vertically-aligned-center {
	align-self: center;
}

.wp-block-column.is-vertically-aligned-bottom {
	align-self: flex-end;
}

.wp-block-column.is-vertically-aligned-stretch {
	align-self: stretch;
}

:where(.wp-block-columns.has-background) {
	padding: 1.25em 2.375em;
}

:where(.wp-block-column.has-background) {
	padding: 1.25em 1.25em;
}

/* Background / text color utilities rely on CSS variables from global-styles.
   Keep box model sane when a background is present. */
.has-background {
	background-clip: padding-box;
}

.wp-block-group.has-background,
.wp-block-columns.has-background,
.wp-block-column.has-background,
.wp-block-cover.has-background {
	box-sizing: border-box;
}

/* Alignments */
.alignwide {
	max-width: 1140px;
}

.alignfull {
	max-width: none;
	width: 100%;
}

.wp-block-image img,
.wp-block-gallery img {
	height: auto;
	max-width: 100%;
}
