/*
 * Base: type scale, sections and the defaults Breakdance set on every page.
 * Breakpoints are Breakdance's: 1119, 1023, 767 and 479px.
 */

/* Type scale: h6 is the base size, each level up multiplies by the ratio (Breakdance global settings). */
:root {
	--ioa-base: 16px;
	--ioa-ratio: 1.2;
	--ioa-h6: var(--ioa-base);
	--ioa-h5: calc(var(--ioa-h6) * var(--ioa-ratio));
	--ioa-h4: calc(var(--ioa-h5) * var(--ioa-ratio));
	--ioa-h3: calc(var(--ioa-h4) * var(--ioa-ratio));
	--ioa-h2: calc(var(--ioa-h3) * var(--ioa-ratio));
	--ioa-h1: calc(var(--ioa-h2) * var(--ioa-ratio));
	--ioa-section-width: 1120px;
}
@media (max-width: 767px) {
	:root {
		--ioa-base: 15px;
		--ioa-ratio: 1.1;
	}
}

*,
*::before,
*::after {
	box-sizing: border-box;
}
body {
	margin: 0;
}
img {
	max-width: 100%;
	height: auto;
}

/* Breakdance had no space between blocks unless a gap was set, and its headings and text had no margin.
   Rich-text groups (.ioa-text) keep the browser's 1em paragraph spacing, as Breakdance rich text did. */
:where(.wp-site-blocks) :where(h1, h2, h3, h4, h5, h6, p) {
	margin: 0;
}
.ioa-text > * + * {
	margin-block-start: 1em;
}

/* Sections: full width, 1120px including 20px sides, 40px top and bottom (Breakdance section defaults). */
.ioa-section {
	padding-block: 40px;
}

/* Page hero: the green 350px band with the page title at the bottom left (Contact Us, Membership, ...). */
.wp-block-group.is-style-page-hero {
	background-color: var(--wp--preset--color--brand);
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	height: 350px;
	justify-content: flex-end;
	padding-block: 40px 50px;
}
.wp-block-group.is-style-page-hero > * {
	width: 100%;
}
.wp-block-group.is-style-page-hero :where(h1, h2, h3, p) {
	color: var(--wp--preset--color--white);
}
/* The text sits in a 600px column at the left (a capped wrapper would be centred by the constrained layout). */
.is-style-page-hero .ioa-hero-text {
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.is-style-page-hero .ioa-hero-text > * {
	max-width: 600px;
}

/* Buttons with an icon before the text: a 0.9em icon drawn from assets/images/icons/<name>.svg, 10px gap. */
.wp-block-button.has-icon .wp-block-button__link::before {
	background-color: currentColor;
	content: "";
	flex-shrink: 0;
	height: 0.9em;
	margin-right: 10px;
	-webkit-mask-position: 0 0;
	mask-position: 0 0;
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
	-webkit-mask-size: 100% 100%;
	mask-size: 100% 100%;
	width: 0.9em;
}
.wp-block-button.icon-pdf .wp-block-button__link::before {
	-webkit-mask-image: url(../images/icons/pdf.svg);
	mask-image: url(../images/icons/pdf.svg);
}

/* Buttons: primary is the theme.json default. "Dark" is Breakdance's small custom button. */
.wp-block-button__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	word-break: normal;
	overflow-wrap: normal;
}
.wp-block-button.is-style-dark .wp-block-button__link {
	background: var(--wp--preset--color--headings);
	border-color: var(--wp--preset--color--headings);
	color: var(--wp--preset--color--white);
	padding: 8px 16px;
	transition: all 300ms ease-in-out;
}
.wp-block-button.is-style-dark .wp-block-button__link:hover {
	background: var(--wp--preset--color--body-text);
	border-color: var(--wp--preset--color--body-text);
}

/* Columns: Breakdance's column gap is 32px and its columns only wrap words between words. */
.wp-block-columns {
	gap: 32px;
	margin-bottom: 0;
}
.wp-block-column {
	overflow-wrap: normal;
	word-break: normal;
}

/* Form controls take the page font. */
:where(button, input, select, textarea) {
	font-family: inherit;
}
