/********************************************************/
/*
/*      Block CSS
/*
/********************************************************/
.wp-block-post-content {
	&:not(.is-root-container) {
		margin-block-start: calc(var(--wp--custom--header-height) * -1) !important;
	}

	/* Gutenberg style override */
	:root &:where(.is-layout-constrained) > * {
		margin-block-start: 0;
	}
	
	/* Full-width background support */
	& > .has-background:not(.alignfull) {
		position: relative;
		
		&::before {
			content: '';
			position: absolute;
			top: 0;
			left: calc((var(--wp--custom--viewport-width) - 100%) / 2 * -1);
			width: var(--wp--custom--viewport-width);
			height: 100%;
			background-color: inherit;
			z-index: -1;
		}
	}
}

/************************************************************/
/* Gutenberg blocks
/************************************************************/
/******************************/
/* Columns
/******************************/
.wp-block-columns {
	&.flex.wrap > .wp-block-column {
		flex-basis: auto;
	}
	
	/******************************/
	/* Responsive
	/******************************/
	@media (width <= 1000px) {
		&.responsive-adjust {
			display: grid;
			grid-template-columns: 100%;
			/* grid-auto-rows: 100svh; */
			row-gap: var(--wp--preset--spacing--3);
			/* margin-block: unset !important; */
			
			/* &:has(> :nth-child(4):last-child) {
				grid-row: span 4;
				height: calc(100svh * 4) !important;	
				max-height: calc(100svh * 4) !important;	
			}
			
			&:has(> :nth-child(3):last-child) {
				grid-row: span 3;
				height: calc(100svh * 3) !important;	
				max-height: calc(100svh * 3) !important;	
			}
			
			&:has(> :nth-child(2):last-child) {
				grid-row: span 2;
				height: calc(100svh * 2) !important;	
				max-height: calc(100svh * 2) !important;	
			} */
			
			& > .wp-block-column {
				align-self: center;
				
				&.responsive-hide {
					display: none !important;
				}
				
				& > .wp-block-image:only-child {
					/* position: relative;
					height: calc(100svh - (var(--wp--custom--outer-pad) * 5));
					margin-block: calc(var(--wp--custom--outer-pad) * 2) calc(var(--wp--custom--outer-pad) * 3); */
					max-height: 50svh;
					margin-block: var(--wp--preset--spacing--4);
					
					img {
						/* position: absolute;
						inset: 0;
						width: 100%;
						height: 100%; */
						max-height: inherit;
						object-fit: cover;
						
						.wp-block-image.position-top & {
							object-position: top;
						}
					}
				}
			}
		}
	}
	
	/* @media (width <= 781px) {
		display: grid;
		grid-template-columns: 100%;
		grid-auto-rows: 100svh;
		row-gap: 0;
		margin-block: unset !important;
		
		:is(.wp-block-post-content, .wp-block-group.multi-screen-span) > &:has(> :nth-child(4):last-child) {
			grid-row: span 4;
			height: calc(100svh * 4) !important;	
			max-height: calc(100svh * 4) !important;	
		}
		
		:is(.wp-block-post-content, .wp-block-group.multi-screen-span) > &:has(> :nth-child(3):last-child) {
			grid-row: span 3;
			height: calc(100svh * 3) !important;	
			max-height: calc(100svh * 3) !important;	
		}
		
		:is(.wp-block-post-content, .wp-block-group.multi-screen-span) > &:has(> :nth-child(2):last-child) {
			grid-row: span 2;
			height: calc(100svh * 2) !important;	
			max-height: calc(100svh * 2) !important;	
		}
		
		& > .wp-block-column {
			align-self: center;
			
			& > .wp-block-image:only-child {
				position: relative;
				max-height: calc(100svh - (var(--wp--custom--outer-pad) * 3));
				
				img {
					position: absolute;
					inset: 0;
					width: 100%;
					height: 100%;
				}
			}
		}
	} */
}

/******************************/
/* Cover
/******************************/
.wp-block-cover {
	align-self: start !important;
	position: relative;
	min-height: min(620px, calc(100svh * (2/3)));
	padding: var(--wp--custom--outer-pad);
	overflow-y: visible;
	margin-block: unset;
	
	& > .wp-block-cover__background {
		background-color: var(--wp--custom--color--default--text--main) !important;
		opacity: .25 !important;
		mix-blend-mode: multiply;
	}
	
	&:not(.is-style-full-height) > .wp-block-cover__inner-container {
		display: flex;
		flex-direction: column;
		align-items: center;
		position: absolute;
		left: 50%;
		top: calc(100svh - (100svh - 100%));
		max-width: var(--wp--style--global--content-size);
		translate: -50% var(--wp--preset--spacing--1-5);
		z-index: 1;
	}
	
	&:not(.is-style-full-height) + * {
		margin-block-start: var(--wp--preset--spacing--10);
	}
	
	/**** Full height style variation ****/
	&.is-style-full-height {
		--screen-ratio: calc(100vw / 100svh);
		
		align-items: end;
		height: 100svh !important;
		max-height: 100svh !important;
		padding-block-start: calc(var(--wp--custom--header-height) + var(--wp--preset--spacing--1));
		padding-block-end: calc(25% / var(--screen-ratio));
		/* padding-block-end: calc(33% / var(--screen-ratio)); */
		
		& > .wp-block-cover__background {
			background-color: var(--wp--custom--color--default--text--main) !important;
		}
		
		& > .wp-block-cover__inner-container {
			display: flex;
			flex-direction: column;
			align-items: center;
			
			.wp-block-button__link {
				&::after {
					background-color: var(--btn-color-focus) !important;
				}
			}
		}
	}
	
	/******************************/
	/* Responsive
	/******************************/
	@media (width <= 1000px) {
		&:not(.is-style-full-height) {
			display: grid;
			grid-template-columns: 100%;
			grid-template-rows: min(620px, calc(100svh * (2/3))) max-content;
			padding: unset;
			
			& > * {
				grid-column: 1;
			}
			
			& > :not(.wp-block-cover__inner-container) {
				grid-row: 1;
				height: min(620px, calc(100svh * (2/3)));
			}
			
			& > .wp-block-cover__inner-container {
				grid-row: 2;
				position: relative;
				top: unset;
				left: unset;
				padding: var(--wp--custom--outer-pad);
				translate: unset;
			}	
		}
	}
}

/******************************/
/* Group
/******************************/
.wp-block-group {
	/* Group link hover color inheritance */
	&.is-linked[class*="focus-"] > :is(p, .wp-block-heading) {
		color: inherit !important;
		transition: color .3s !important;
	}
	
	/* Virtual visit group style */
	&.virtual-visit iframe {
		display: block;
		width: 100%;
		height: calc(100svh * (2/3));
		border-radius: var(--wp--custom--border-radius--medium);
	}
}

/******************************/
/* Heading
/******************************/
.wp-block-heading {
	/* Stamped variation style */
	&.is-style-stamped {
		z-index: 1;
		
		&::after {
			z-index: -1;
		}
	}

	/******************************/
	/* Responsive
	/******************************/
	@media (width <= 781px) {
		&.responsive-align-left {
			text-align: start;
			margin-inline-start: calc(((100% - var(--wp--custom--viewport-width)) / 2) + var(--wp--custom--outer-pad)) !important;
		}
	}
}

/******************************/
/* Image
/******************************/
.wp-block-image {
	position: relative;
	margin-block-end: unset;
	
	/* Fill style variations */
	:has(> &[class*="is-style-fill"]) {		
		&.wp-block-column {
			align-self: stretch;
		}
		
		& > [class*="is-style-fill"] {
			&:not(.cover, .contain) * {
				object-fit: cover;
			}
			
			/* Fill width */
			&.is-style-fill-width,
			&.is-style-fill-width * {
				width: 100% !important;
			}
			
			/* Fill height */
			&.is-style-fill-height,
			&.is-style-fill-height * {
				height: 100% !important;
			}
			
			/* Fill both */	
			&.is-style-fill-both,
			&.is-style-fill-both * {
				width: 100% !important;
				height: 100% !important;
			}
			
			&.is-style-fill-both * {
				position: absolute;
				inset: 0;
			}
		}
	}
	
	img {
		width: 100%;
		min-width: 100%;
		height: 100%;
		min-height: 100%;
		border-radius: var(--wp--custom--border-radius--medium);
		overflow: clip;
		
		.wp-block-image.contain & {
			object-fit: contain !important;
		}
	}
	
	/* Stamped variation style */
	&.is-style-stamped {
		&::after 												{ z-index: 1 !important; }
		
		&:is(.top-left, .center-left, .bottom-left)::after		{ left: calc(4.5% + var(--wp--custom--outer-pad)) !important; }
		&::after,
		&:is(.top-right, .center-right, .bottom-right)::after 	{ right: calc(4.5% + var(--wp--custom--outer-pad)) !important; }
	}
	
	/* Backend style ****************************************************/
	&[class*="is-style-fill"]:not(.is-resized) .components-resizable-box__container {
		display: contents !important;
	}
	
	/******************************/
	/* Responsive
	/******************************/
	@media (width <= 1000px) {
		/* Fill style variations */
		:has(> &[class*="is-style-fill"]) {		
			.wp-block-columns.responsive-adjust > &.wp-block-column {
				align-self: center;
				max-height: 100svh;
			}
		}
	}
	
	@media (width <= 781px) {
		/* Fill style variations */
		:has(> &[class*="is-style-fill"]) {		
			.wp-block-columns > &.wp-block-column {
				align-self: center;
				max-height: 100svh;
			}
		}
	}
}

/******************************/
/* List
/******************************/
ul.wp-block-list {
	&:is(ul) {
		padding-inline-start: 20px !important;
		
		& > li {
			list-style: disc;
			
			& + li {
				margin-block-start: var(--wp--preset--spacing--0-50);
			}
			
			:is(div, b, strong, em):not([role="textbox"]) {
				display: contents;
			}
		}
	}
	
	&:is(ol) {
		padding-inline-start: 24px !important;
	}
}

/******************************/
/* Media-text
/******************************/
.wp-block-media-text {
	gap: 9.5%;
	
	&:not(.has-media-on-the-right) {
		grid-template-columns: 50% calc(100% / 3);
		justify-content: start;
	}
	
	&.has-media-on-the-right {
		grid-template-columns: calc(100% / 3) 50%;
		justify-content: end;
		
		& > .wp-block-media-text__content {
			text-align: end;
			
			& > * {
				margin-inline-start: auto;
			}
			
			& > .wp-block-buttons {
				justify-content: end;
			}
		}
	}
	
	& > .wp-block-media-text__media {
		position: relative;
		min-height: calc(100svh * (2/3));
		border-radius: var(--wp--custom--border-radius--medium);
		overflow: clip;
		
		img {
			position: absolute;
			inset: 0;
			width: 100%;
			height: 100%;
			object-fit: cover;
		}
	}
	
	& > .wp-block-media-text__content {
		padding-inline: unset !important;
		
		& > * {
			position: relative;
			margin-block: unset;
			z-index: 2;
			
			& + * {
				margin-block-start: 1em;
			}
			
			&:not(p) {
				max-width: 75%;
			}
		}
	}
	
	/* Stamped variation style */
	&.is-style-stamped {
		&::after 												{ z-index: 1 !important; }
		
		&:is(.top-left, .center-left, .bottom-left)::after		{ left: calc(4.5% + var(--wp--custom--outer-pad)) !important; }
		&::after,
		&:is(.top-right, .center-right, .bottom-right)::after 	{ right: calc(4.5% + var(--wp--custom--outer-pad)) !important; }
	}
	
	/* Backend style ****************************************************/
	:is(.edit-post-visual-editor, .editor-styles-wrapper) & {
		& > .wp-block-media-text__media {
			display: flex;
		}
	}
	
	/******************************/
	/* Responsive
	/******************************/
	@media (width <= 1400px) {
		gap: 5%;
		
		&:not(.has-media-on-the-right) {
			grid-template-columns: 50% 40%;
		}
		
		&.has-media-on-the-right {
			grid-template-columns: 40% 50%;
		}
	}
	
	@media (width <= 1000px) {
		&:not(.has-media-on-the-right) {
			grid-template-columns: 40% 50%;
		}
		
		&.has-media-on-the-right {
			grid-template-columns: 50% 40%;
		}
		
		& > .wp-block-media-text__content {
			& > * {
				&:not(p) {
					max-width: 90%;
				}
			}
		}
	}
	
	@media (width <= 800px) {
		column-gap: var(--wp--preset--spacing--2);
		row-gap: var(--wp--preset--spacing--3);
		
		&:not(.has-media-on-the-right),
		&.has-media-on-the-right {
			grid-template-columns: 100%;
		}
		
		& > .wp-block-media-text__media {
			grid-row: 1 !important;
			grid-column: 1 !important;
			min-height: calc(100svh / 3);
			max-height: calc(100svh / 3);
		}
		
		& > .wp-block-media-text__content {
			grid-row: 2 !important;
			grid-column: 1 !important;
		}
		
		/* Stamped variation style */
		&.is-style-stamped {
			&::after { top: 0 !important; translate: -50% -50% !important; }
		}
	}
	
	@media (width <= 600px) {
		&.is-style-stamped::after {
			display: none;
		}
		
		& > .wp-block-media-text__media {
			min-height: 25svh;
			max-height: 25svh;
		}
	}
}

/******************************/
/* Paragraph
/******************************/
.wp-block-paragraph,
.wp-block-post-content p {
	/******************************/
	/* Responsive
	/******************************/
	@media (width <= 781px) {
		&.responsive-align-left {
			text-align: start;
			margin-inline-start: calc(((100% - var(--wp--custom--viewport-width)) / 2) + var(--wp--custom--outer-pad)) !important;
		}
	}
}

/******************************/
/* Video
/******************************/
.wp-block-video {
	position: relative;
	width: 100%;
	height: auto;
	max-height: 100%;
	aspect-ratio: 16/9;
	border-radius: var(--wp--custom--border-radius--medium);
	overflow: clip;
	
	&::before,
	&::after {
		content: '';
		position: absolute;
		opacity: 1;
		pointer-events: none;
		transition: opacity var(--wp--custom--speed--medium);
	}
	
	&.played::before,
	&.played::after {
		opacity: 0;
	}
	
	&::before {
		inset: 0;
		width: 100%;
		height: 100%;
		background-color: var(--wp--preset--color--nebula-blue);
		opacity: .25;
		mix-blend-mode: multiply;
		z-index: 1;
	}
	
	&::after {
		height: auto;
		background-repeat: no-repeat;
		top: 50%;
		left: 50%;
		width: 12.5%;
		height: auto;
		max-height: 50%;
		aspect-ratio: 1;
		background-image: url(../images/play.svg);
		background-size: contain;
		translate: -50% -50%;
		filter: var(--wp--custom--color--dove-white--filter);
		z-index: 2;
	}
	
	video {
		position: absolute;
		inset: 0;
		width: 100%;
		height: 100%;
	}
	
	/* Backend style ****************************************************/
	:is(.edit-post-visual-editor, .editor-styles-wrapper) & {
		& > div:has(> video) {
			display: contents;
		}
	}
}

/************************************************************/
/* Cake blocks
/************************************************************/
/******************************/
/* Accordions
/******************************/
.wp-block-cke-accordions {
	body.wp-theme-escapades-memphremagog-v3 & {
		/**** Accordion item ****/
		.wp-block-cke-accordion-item {
			background-color: unset;
			padding: unset;
			
			& ~.wp-block-cke-accordion-item {
				margin-block-start: var(--wp--preset--spacing--1-5);
			}
		}
		
		/**** Accordion head ****/
		.wp-block-cke-accordion-head {
			display: block;
			padding-block-end: var(--wp--preset--spacing--1);
			border-block-end: 1px solid var(--wp--custom--color--default--accent);
			
			& > .wp-block-heading {
				display: flex;
				justify-content: space-between;
				align-items: center;
				gap: var(--wp--preset--spacing--0-50);
				width: 100%;
				min-width: 100%;
				color: var(--wp--custom--color--default--text--headings);
				margin-block-end: calc(var(--wp--preset--spacing--0-75) * -1);
				transition: color var(--wp--custom--speed--fast);
				
				:is(:hover, :focus, :active) > & {
					color: var(--wp--custom--color--default--text--main);
				}
				
				&::after {
					content: '';
					display: inline-block;
					max-height: 100%;
					width: 20px;
					min-width: 20px;
					height: auto;
					aspect-ratio: 100/49;

					background-repeat: no-repeat;
					background-position: center;
					background-color: var(--wp--custom--color--default--text--headings);
					
					-webkit-mask: url(../images/em-icon-chevron-down.svg);
					mask: url(../images/em-icon-chevron-down.svg);
					mask-repeat: no-repeat;
					mask-position: center;
				}
				
				input:checked + .wp-block-cke-accordion-item > .wp-block-cke-accordion-head > & {
					color: var(--wp--custom--color--default--text--main);
					
					&::after {
						scale: 1 -1;
					}
				}
			}
		}
		
		/**** Accordion body ****/
		.wp-block-cke-accordion-body {
			border-block-end: 1px solid transparent;
			transition: grid-template-rows var(--wp--custom--speed--slow), border-color var(--wp--custom--speed--slow);
			
			input:checked + .wp-block-cke-accordion-item > & {
				border-color: var(--wp--custom--color--default--accent);
			}
			
			& > .wp-block-cke-accordion-body__inner > * {
				margin-block: unset;
				
				&:first-child {
					margin-block-start: var(--wp--preset--spacing--1-5);
				}
				
				&:last-child {
					margin-block-end: var(--wp--preset--spacing--5);
				}
				
				& + * {
					margin-block-start: 1em;
				}
			}
		}
	}
}

/******************************/
/* Anchor
/******************************/
.wp-block-cke-anchor {	
	body.wp-theme-escapades-memphremagog-v3:not(.wp-admin) & {
		:has(> &) {
			position: relative;
		}
		
		position: absolute;
		top: calc((100svh - min(100%, 100svh)) / -2);
		
		&:first-child + * {
			margin-block-start: unset;
		}
		
		/* DEBUG */
		/* width: 100px !important;
		height: 2px !important;
		background-color: red !important;
		opacity: 1 !important; */
		/* DEBUG */
	}
}

/******************************/
/* Scrollspy Nav
/******************************/
.wp-block-cke-scrollspy-nav {
	body.wp-theme-escapades-memphremagog-v3 & {
		display: contents;
		top: unset;
		margin-block-start: unset !important;
	}
}

/******************************/
/* Slider
/******************************/
.wp-block-cke-slider {
	body.wp-theme-escapades-memphremagog-v3 & {
		.slider-items {
			/**** Slide ****/
			& > .wp-block-group,
			& > .wp-block-query .wp-block-post,
			& > .wp-block-query .wp-block-post > .wp-block-group,
			& > .block-editor-inner-blocks > .block-editor-block-list__layout > .wp-block-group {
				justify-content: space-between;
				align-items: center;
				text-align: center;
				background-color: unset;
				
				.wp-block-cke-slider[data-layout="slideshow"] > .slider-items > & {
					transition: opacity var(--wp--custom--speed--slow);
					
					&.active {
						transition: opacity var(--wp--custom--speed--slow) var(--wp--custom--speed--slow);
					}
				}
				
				/**** Slide content ****/
				& > * {
					max-width: 100%;
				}
			}
		}
		
		/**** Controls ****/
		.controls {
			gap: var(--wp--preset--spacing--5-5);
			max-width: 100%;
			margin-block-start: var(--wp--preset--spacing--3-5);
			
			.wp-block-button > :is(.wp-block-button__link, a) {
				--btn-icon: url(../images/em-icon-chevron.svg);
				
				align-items: center;
				row-gap: var(--wp--preset--spacing--1);
				aspect-ratio: unset;
				
				&::after {
					order: -1;
					width: auto;
					height: 16px;
					aspect-ratio: 73/150;
				}
				
				&[rel="prev"] {
					&::before {
						content: 'Précédent';
					}
					
					body.en &::before {
						content: 'Previous';
					}
					
					&::after {
						scale: -1 1;
					}
				}
				
				&[rel="next"] {
					&::before {
						content: 'Suivant';
					}
					
					body.en &::before {
						content: 'Next';
					}
				}
			}
		}
	}
}

/******************************/
/* Tabs
/******************************/
.wp-block-cke-tabs {
	body.wp-theme-escapades-memphremagog-v3 & {
		/**** Tabs ****/
		flex-grow: 1;
		grid-template-columns: repeat(var(--item-count, 2), max-content) minmax(0, 1fr);
		grid-template-rows: max-content minmax(0, 1fr);
		column-gap: var(--wp--preset--spacing--2-5);
		row-gap: var(--wp--preset--spacing--3);
		
		/**** Tab head ****/
		.wp-block-cke-tab-head {
			grid-row: 1;
			flex-direction: column;
			justify-content: start;
			align-items: start;
			color: var(--wp--custom--color--default--accent);
			background-color: transparent !important;
			padding: unset;
			border: unset;
			
			.wp-block-cke-tab-item:nth-of-type(1) & {
				grid-column: 1;
			}
			
			.wp-block-cke-tab-item:nth-of-type(2) & {
				grid-column: 2;
			}
			
			&:is(:hover, :focus, :active) {
				color: var(--wp--custom--color--default--focus);
			}
			
			input:checked + .wp-block-cke-tab-item &,
			.wp-block-cke-tab-item:is(.is-selected, .has-child-selected) & {
				color: var(--wp--custom--color--default--text--main) !important;
				
				&:is(.block-editor-block-list__block) {
					pointer-events: all !important;
					z-index: 5;
				}
				
				&:not(.block-editor-block-list__block) {
					pointer-events: none;
				}
			}
			
			.wp-block-heading {
				&:is(h4) {
					font-size: var(--wp--preset--font-size--x-large);
				}
				
				&:is(h6) {
					font-size: var(--wp--preset--font-size--medium-large);
				}
				
				sup {
					display: inline-block;
					text-transform: initial;
					translate: 0 1px;
				}
			}
		}
		
		/**** Tab body ****/
		.wp-block-cke-tab-body {
			grid-column: 1 / span calc(var(--item-count, 2) + 1);
			grid-row: 1 / span 2;
			display: grid;
			grid-template-columns: subgrid;
			grid-template-rows: subgrid !important;
			
			& > .wp-block-cke-tab-body__inner {
				&,
				& > .block-editor-inner-blocks,
				& > .block-editor-inner-blocks > .block-editor-block-list__layout {
					display: contents;
				}
				
				& > *,
				& > .block-editor-inner-blocks > .block-editor-block-list__layout > * {
					margin-block: unset;
				}
				
				& > :not(.wp-block-image),
				& > .block-editor-inner-blocks > .block-editor-block-list__layout > :not(.wp-block-image) {
					grid-row: 1;
					grid-column: 3 / span calc(3 - var(--item-count, 2));
				}
				
				& > .wp-block-image,
				& > .block-editor-inner-blocks > .block-editor-block-list__layout > .wp-block-image {
					grid-row: 2;
					grid-column: 1 / span calc(var(--item-count, 2) + 1);
					justify-self: center;
					max-width: 80%;
					
					&,
					& :is(img, svg) {
						width: auto;
						height: 100%;
						object-fit: contain;
					}
				}
			}
			
			input:checked + .wp-block-cke-tab-item & {
				transition: opacity var(--wp--custom--speed--medium) var(--wp--custom--speed--fast);
			}
			
			input:not(:checked) + .wp-block-cke-tab-item & {
				transition: opacity var(--wp--custom--speed--medium);
			}
		}
		
		/******************************/
		/* Responsive
		/******************************/
		@media (width <= 1200px) {
			grid-template-columns: max-content minmax(0, 1fr);
			grid-template-rows: repeat(var(--item-count, 2), max-content) minmax(0, 1fr);
			row-gap: var(--wp--preset--spacing--1-5);
			
			.wp-block-cke-tab-head {
				grid-column: 1 !important;
				
				.wp-block-cke-tab-item:nth-of-type(1) & {
					grid-row: 1 !important;
				}
				
				.wp-block-cke-tab-item:nth-of-type(2) & {
					grid-row: 2 !important;
				}
			}
			
			& .wp-block-cke-tab-body {
				grid-column: 1 / span 2;
				grid-row: 1/ span calc(var(--item-count, 2) + 1);
				
				& > .wp-block-cke-tab-body__inner {
					& > :not(.wp-block-image),
					& > .block-editor-inner-blocks > .block-editor-block-list__layout > :not(.wp-block-image) {
						grid-row: 1 / span var(--item-count, 2);
						grid-column: 3 / span calc(3 - var(--item-count, 2));
					}
					
					& > .wp-block-image,
					& > .block-editor-inner-blocks > .block-editor-block-list__layout > .wp-block-image {
						grid-row: calc(var(--item-count, 2) + 1);
					}
				}
			}
		}
		
		@media (width <= 800px) {
			grid-template-columns: repeat(var(--item-count, 2), minmax(0, 1fr));
			grid-template-rows: repeat(2, max-content) minmax(0, 1fr);
			row-gap: var(--wp--preset--spacing--1);
			
			.wp-block-cke-tab-head {
				.wp-block-cke-tab-item:nth-of-type(1) & {
					grid-row: 1 !important;
					grid-column: 1 !important;
				}
				
				.wp-block-cke-tab-item:nth-of-type(2) & {
					grid-row: 1 !important;
					grid-column: 2 !important;
				}
			}
			
			.wp-block-cke-tab-body {
				& > .wp-block-cke-tab-body__inner {
					& > :not(.wp-block-image) {
						grid-row: 2;
						grid-column: 1 / span 2;
					}
					
					& > .wp-block-image {
						grid-row: 3;
						grid-column: 1 / span 2;
						max-width: 100%;
					}
				}
			}
		}
		
		@media (width <= 600px) {
			.wp-block-cke-tab-head {
				.wp-block-heading {
					&:is(h4) {
						font-size: var(--wp--preset--font-size--large);
					}
					
					&:is(h6) {
						font-size: var(--wp--preset--font-size--medium);
					}
					
					sup {
						display: inline-block;
						text-transform: initial;
						translate: 0 1px;
					}
				}
			}
		}
	}
}

/************************************************************/
/* Other blocks/elements
/************************************************************/
/******************************/
/* Stamped block variation
/* (Available for column,
/* group, image,
/* media-text, mosaic-element,
/* paragraph, title blocks)
/******************************/
[class*="wp-block"].is-style-stamped {
	position: relative;
	
	&::after {
		content: '';
		display: block;
		position: absolute;
		top: 0;
		right: 0;
		translate: 50% -50%;
		width: 140px;
		height: auto;
		aspect-ratio: 1;
		background: url(../images/em-stamp.svg) no-repeat center;
		background-size: contain;
		filter: var(--wp--custom--color--prism-blue--filter);
		/* z-index: -1; */
	}
	
	/**** Adjustment classes ****/
	/* Color */
	&.dark-blue::after 		{ filter: var(--wp--custom--color--nebula-blue--filter); }
	&.light-blue::after 	{ filter: var(--wp--custom--color--prism-blue--filter); }
	&.dark-brown::after 	{ filter: var(--wp--custom--color--dark-buff-brown--filter); }
	&.light-brown::after 	{ filter: var(--wp--custom--color--cassius-beige--filter); }
	&.beige::after 			{ filter: var(--wp--custom--color--flour-beige--filter); }
	&.white::after 			{ filter: var(--wp--custom--color--dove-white--filter); }
	
	/* Rotation */
	&.rotate-45-ccw::after 	{ rotate: -45deg; }
	&.rotate-30-ccw::after 	{ rotate: -30deg; }
	&.rotate-15-ccw::after 	{ rotate: -15deg; }
	&.rotate-0::after		{ rotate: 0deg; }
	&.rotate-15-cw::after 	{ rotate: 15deg; }
	&.rotate-30-cw::after 	{ rotate: 30deg; }
	&.rotate-45-cw::after 	{ rotate: 45deg; }
	
	/* Size */
	&.stamp-large::after 	{ width: 180px; }
	&.stamp-medium::after 	{ width: 140px; }
	&.stamp-small::after 	{ width: 100px; }
	
	/* Position */
	&.top-left::after 		{ top: 0; bottom: unset; left: 0; right: unset; }
	&.top-center::after 	{ top: 0; bottom: unset; left: 50%; right: unset; }
	&.top-right::after 		{ top: 0; bottom: unset; left: unset; right: 0; }
	&.center-left::after 	{ top: 50%; bottom: unset; left: 0; right: unset; }
	&.center-right::after 	{ top: 50%; bottom: unset; left: unset; right: 0; }
	&.bottom-left::after 	{ top: unset; bottom: 0; left: 0; right: unset; }
	&.bottom-center::after 	{ top: unset; bottom: 0; left: 50%; right: unset; }
	&.bottom-right::after 	{ top: unset; bottom: 0; left: unset; right: 0; }
	
	/* Type */
	&.em::after {
		aspect-ratio: 1; background: url(../images/em-lettrine.svg) no-repeat center; background-size: contain;
	}
	
	/* Location */
	&, &.in {
		&.top-left::after 		{ translate: -50% -50%; }
		&.top-center::after 	{ translate: -50% -50%; }
		&::after,
		&.top-right::after 		{ translate: 50% -50%; }
		&.center-left::after 	{ translate: -50% -50%; }
		&.center-right::after 	{ translate: 50% -50%; }
		&.bottom-left::after 	{ translate: -50% 50%; }
		&.bottom-center::after 	{ translate: -50% 50%; }
		&.bottom-right::after 	{ translate: 50% 50%; }
	}
	
	&.out {
		&.top-left::after 		{ translate: -100% -100%; }
		&.top-center::after 	{ translate: -50% -100%; }
		&::after,
		&.top-right::after 		{ translate: 100% -100%; }
		&.center-left::after 	{ translate: -100% -50%; }
		&.center-right::after 	{ translate: 100% -50%; }
		&.bottom-left::after 	{ translate: -100% 100%; }
		&.bottom-center::after 	{ translate: -50% 100%; }
		&.bottom-right::after 	{ translate: 100% 100%; }
	}
}

/******************************/
/* Limited width
/* (For elements with no
/* max-width control in editor)
/******************************/
h1, h2, h3, h4, h5, h6, p {
	&.limited-width-xl {
		&,
		.edit-post-visual-editor .is-root-container & {
			max-width: min(50rem, 100%) !important;
		}
	}
	
	&.limited-width-l {
		&,
		.edit-post-visual-editor .is-root-container & {
			max-width: min(40rem, 100%) !important;
		}
	}
	
	&.limited-width {
		&,
		.edit-post-visual-editor .is-root-container & {
			max-width: min(37.5rem, 100%) !important;
		}
	}
	
	&.limited-width-s {
		&,
		.edit-post-visual-editor .is-root-container & {
			max-width: min(28.125rem, 100%) !important;
		}
	}
	
	&.limited-width-xs {
		&,
		.edit-post-visual-editor .is-root-container & {
			max-width: min(20rem, 100%) !important;
		}
	}
}

/******************************/
/* Limited height
/******************************/
[class*="limited-height"] {
	
	&.limited-height-l {
		max-height: 37.5rem;
	}
	
	&.limited-height {
		max-height: 20rem;
	}
	
	&.wp-block-image img {
		max-height: inherit;
		object-fit: cover;
	}
}

/******************************/
/* Buttons
/******************************/
.wp-block-button,
.menu-item.btn,
body:not(.wp-admin, .login) .gfield--type-fileupload .ginput_container_fileupload,
body:not(.wp-admin, .login) .gform_footer {
	position: relative;
	max-width: 100%;
	
	& > :is(.wp-block-button__link, a),
	&.gform_footer {
		--btn-color: var(--wp--custom--color--default--text--headings);
		--btn-color-focus: var(--wp--custom--color--default--focus);
		--btn-color-bg: transparent;
		--btn-icon: url(../images/em-icon-cross.svg);
		
		display: inline-flex;
		flex-direction: column;
		justify-content: center;
		align-items: start;
		gap: var(--wp--preset--spacing--0-50);
		position: relative;
		width: max-content;
		max-width: 100%;
		height: 100%;
		color: var(--btn-color);
		background-color: transparent;
		padding: unset;
		margin: unset;
		border: unset;
		border-radius: var(--wp--custom--border-radius--small);
		box-sizing: border-box;
		transition: color var(--wp--custom--speed--fast), background-color var(--wp--custom--speed--fast), scale var(--wp--custom--speed--medium);
		scale: 1;
		
		&.has-text-align-center {
			align-items: center;
		}
		
		&.has-text-align-right {
			align-items: end;
		}
		
		&::after {
			content: '';
			display: inline-block;
			order: -1;
			width: 30px;
			height: auto;
			max-height: 100%;
			aspect-ratio: 30/31;
			background-repeat: no-repeat;
			background-position: center;
			background-color: var(--btn-color);
			transition: background-color var(--wp--custom--speed--fast);
			
			-webkit-mask: var(--btn-icon);
			mask: var(--btn-icon);
			mask-repeat: no-repeat;
			mask-position: center;
		}
		
		&:is(:hover, :focus, :active) {
			color: var(--btn-color-focus);
			background-color: var(--btn-color-bg);
			
			&::after {
				background-color: var(--btn-color-focus);
			}
		}
		
		&:active {
			scale: 0.975;
		}
	}
}

/* Popup open/close buttons */
button:is(.burger-popup-open, .burger-popup-close, .popup-alert-close) {
	position: relative;
	width: 20px;
	height: 20px;
	background-color: transparent;
	padding: unset;
	border: unset;
	cursor: pointer;
	
	& > svg {
		width: 100%;
		height: 100%;
		fill: var(--wp--custom--color--default--text--main);
		transition: fill var(--wp--custom--speed--fast);
		
		.wp-site-blocks:has(.site-head + #burger-popup:not(:popover-open)) & {
			opacity: 1;
			transition: fill var(--wp--custom--speed--fast), opacity var(--wp--custom--speed--medium) var(--wp--custom--speed--fast);
		}
		
		.wp-site-blocks:has(.site-head + #burger-popup:popover-open) :not(:hover, :focus, :active) > & {
			fill: var(--wp--preset--color--white);
		}
	}
	
	&:is(:hover, :focus, :active) {
		& > svg {
			fill: var(--wp--custom--color--default--focus);
		}
	}
}

/******************************/
/* Forms/inputs
/******************************/
body:not(.wp-admin, .login) .gform_wrapper {
	container-type: inline-size;
	container-name: form-wrapper;
	width: 100%;
	
	form {
		display: flex;
		flex-direction: column;
	}
	
	.wp-block-group:has(> &) {
		grid-row: span var(--rows-needed, 1);
		display: flex;
		flex-direction: column;
		justify-content: start !important;
		/* height: calc((100svh * var(--rows-needed, 1)) - (var(--wp--custom--outer-pad) * 2)) !important; */
		/* min-height: calc((100svh * var(--rows-needed, 1)) - (var(--wp--custom--outer-pad) * 2)) !important; */
		/* max-height: calc((100svh * var(--rows-needed, 1)) - (var(--wp--custom--outer-pad) * 2)) !important; */
		/* padding-block: var(--wp--custom--outer-pad) calc(var(--wp--custom--outer-pad) * 2) !important; */
		/* margin-block: unset !important; */
		box-sizing: border-box;
		
		&.resizing {
			height: max-content !important;
			min-height: max-content !important;
			max-height: max-content !important;
		}
	}
	
	.gform_fields {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		column-gap: var(--wp--preset--spacing--1);
		row-gap: var(--wp--preset--spacing--2-5);
		
		/* Typo */
		:is(input, select, textarea):not([type="submit"], [type="button"], [class*="adminbar"]),
		.gfield_label {
			font-family: var(--wp--preset--font-family--national-2);
			font-size: var(--wp--preset--font-size--medium);
			line-height: 1.2;
			font-weight: 400;
			text-align: center;
			color: var(--wp--custom--color--default--text--main);
		}
		
		/* Labels */
		.gfield_label {
			justify-self: center;
			gap: 0;
			font-size: var(--wp--preset--font-size--medium-large);
			letter-spacing: 1.35px;
			text-transform: uppercase;
			color: var(--wp--custom--color--default--text--headings);
			
			.gfield_required {
				&,
				&::after {
					font-family: inherit !important;
					font-size: inherit !important;
					line-height: inherit !important;
					font-weight: inherit !important;
					color: inherit !important;
				}
				
				&::after {
					content: '*';
				}
				
				.gfield_required_text {
					display: none;
				}
			}
		}
		
		/* Fields */
		.gfield {
			grid-column: span 2;
			
			&.gfield--width-half {
				grid-column: span 1;
			}
			
			&.gfield--type-textarea {
				display: flex;
				flex-direction: column;
				align-items: center;
				max-height: 240px;
				
				& > .ginput_container_textarea {
					display: contents !important;
					
					textarea {
						min-height: unset !important;
						/* min-height: 100px !important; */
					}
				}
			}
			
			:is(input, select, textarea):not([type="submit"], [type="button"] [class*="adminbar"], [class*="ui-datepicker"]) {
				width: 100% !important;
				height: auto !important;
				background-color: unset !important;
				background: linear-gradient(180deg, rgba(var(--wp--custom--color--dove-white--rgb) / 1) 0%, rgba(var(--wp--custom--color--flour-beige--rgb) / 1) 100%) !important;
				padding: var(--wp--preset--spacing--1);
				padding-block-start: calc(var(--wp--preset--spacing--0-75) - 0px);
				border: unset;
				border-block-end: 1px solid var(--wp--custom--color--default--text--headings);
				border-radius: 0;
				box-sizing: border-box;
				box-shadow: unset !important;
				outline: unset !important;
				resize: none;
				
				&:is(select) {
					cursor: pointer;
				}
			}
		}
	}
	
	/* Form footer */
	.gform_footer {
		align-items: center !important;
		position: relative;
		width: max-content;
		text-align: center;
		margin-block-start: var(--wp--preset--spacing--2) !important;
		margin-inline: auto !important;
		overflow: clip;
		
		&::after {
			position: absolute !important;
			top: 0;
			left: 50%;
			translate: -50%;
			pointer-events: none;
		}
		
		&,
		input[type="submit"] {
			padding: unset !important;
			border: unset !important;
			border-radius: unset !important;
			outline: unset !important;
		}
		
		input[type="submit"] {
			min-height: unset !important;
			font-family: inherit !important;
			font-size: inherit !important;
			font-weight: inherit !important;
			line-height: inherit !important;
			color: inherit !important;
			background-color: unset !important;
			padding-block-start: calc(31px + var(--wp--preset--spacing--0-50)) !important;
			margin-inline: unset !important;
			box-shadow: unset !important;
			cursor: pointer;
		}
	}
	
	/* Form error/confirmation messages & Loading icon */
	.gform_validation_errors {
		display: none;
	}
	
	.gform_confirmation_message,
	.gform_confirmation_message > * {
		margin-block: unset;
	}
	
	.gform-loader {
		display: none;
	}
	
	form:has(.gform-loader) {
		position: relative;
		
		& > :is(.gform_body, .gform_footer) :is(input, select, textarea, button, .gfield--type-fileupload):not([type="file"]) {
			opacity: .5 !important;
			pointer-events: none !important;
		}
		
		&::after {
			content: '';
			position: absolute;
			top: 50%;
			left: 50%;
			width: 100px;
			height: auto;
			aspect-ratio: 1;
			background: url(../images/loading.svg) no-repeat center;
			background-size: contain;
			filter: var(--wp--custom--color--dark-buff-brown--filter);
			translate: -50% -50%;
		}
	}
	
	/******************************/
	/* Responsive
	/******************************/
	@media (width <= 800px) {
		.gfield {
			grid-column: span 2 !important;
		}
	}
}