/* Typography styling
 * All type styling now lives here.
 * DO NOT add type styling to the blocks as Gutenberg destroys it.
 *
 * FLUID TYPE SIZING
 * Font sizes are entered below as pixel-equivalent numbers without units.
 * For example: 16 = 16px / 1rem, 32 = 32px / 2rem, 48 = 48px / 3rem.
 *
 * MIN is the font size at 360px viewport width and below.
 * MAX is the font size at 1440px viewport width and above.
 * Between 360px and 1440px the font size scales fluidly between MIN and MAX.
 * The resulting font sizes use rem units to respect browser font-size preferences.
*/

:root {
	--base-type-spacing: 8rem;

	/* Fluid typography viewport range */
	--type-min-width: 360; /* Width where MIN font sizes are reached */
	--type-max-width: 1440; /* Width where MAX font sizes are reached */

	/* Body - 16px minimum / 18px maximum */
	--body-min: 24;
	--body-max: 28;
	--body-line-height: 1.6;

	/* H1 */
	--h1-min: 48;
	--h1-max: 76;
	--h1-line-height: 1.05;

	/* H2 */
	--h2-min: 40;
	--h2-max: 60;
	--h2-line-height: 1.1;

	/* H3 */
	--h3-min: 35;
	--h3-max: 48;
	--h3-line-height: 1.15;

	/* H4 */
	--h4-min: 31;
	--h4-max: 40;
	--h4-line-height: 1.2;

	/* H5 */
	--h5-min: 28;
	--h5-max: 34;
	--h5-line-height: 1.25;

	/* H6 */
	--h6-min: 26;
	--h6-max: 30;
	--h6-line-height: 1.3;
}


/* Headings */

h1, h2, h3, h4, h5, h6 { margin: 0; color: var(--brand-2); font-family: 'Aleo', Georgia, 'Times New Roman', serif; }

h1, .h1 { font-size: clamp(calc(var(--h1-min) / 16 * 1rem), calc((var(--h1-min) / 16 * 1rem) + (var(--h1-max) - var(--h1-min)) / (var(--type-max-width) - var(--type-min-width)) * (100vw - (var(--type-min-width) / 16 * 1rem))), calc(var(--h1-max) / 16 * 1rem)); line-height: var(--h1-line-height); }
h2, .h2 { font-size: clamp(calc(var(--h2-min) / 16 * 1rem), calc((var(--h2-min) / 16 * 1rem) + (var(--h2-max) - var(--h2-min)) / (var(--type-max-width) - var(--type-min-width)) * (100vw - (var(--type-min-width) / 16 * 1rem))), calc(var(--h2-max) / 16 * 1rem)); line-height: var(--h2-line-height); }
h3, .h3 { font-size: clamp(calc(var(--h3-min) / 16 * 1rem), calc((var(--h3-min) / 16 * 1rem) + (var(--h3-max) - var(--h3-min)) / (var(--type-max-width) - var(--type-min-width)) * (100vw - (var(--type-min-width) / 16 * 1rem))), calc(var(--h3-max) / 16 * 1rem)); line-height: var(--h3-line-height); }
h4, .h4 { font-size: clamp(calc(var(--h4-min) / 16 * 1rem), calc((var(--h4-min) / 16 * 1rem) + (var(--h4-max) - var(--h4-min)) / (var(--type-max-width) - var(--type-min-width)) * (100vw - (var(--type-min-width) / 16 * 1rem))), calc(var(--h4-max) / 16 * 1rem)); line-height: var(--h4-line-height); }
h5, .h5 { font-size: clamp(calc(var(--h5-min) / 16 * 1rem), calc((var(--h5-min) / 16 * 1rem) + (var(--h5-max) - var(--h5-min)) / (var(--type-max-width) - var(--type-min-width)) * (100vw - (var(--type-min-width) / 16 * 1rem))), calc(var(--h5-max) / 16 * 1rem)); line-height: var(--h5-line-height); }
h6, .h6 { font-size: clamp(calc(var(--h6-min) / 16 * 1rem), calc((var(--h6-min) / 16 * 1rem) + (var(--h6-max) - var(--h6-min)) / (var(--type-max-width) - var(--type-min-width)) * (100vw - (var(--type-min-width) / 16 * 1rem))), calc(var(--h6-max) / 16 * 1rem)); line-height: var(--h6-line-height); }

/* Long heading protection */
h1, .h1, h2, .h2, h3, .h3 { overflow-wrap: break-word; }

/* Heading links */
h1 a, h2 a, h3 a, h4 a, h5 a, h6 a { color: var(--brand-1); }
h1 a:hover, h2 a:hover, h3 a:hover, h4 a:hover, h5 a:hover, h6 a:hover { color: var(--brand-2); }


/* Paragraphs */
p { margin: 0; }
p + p { margin-top: calc(var(--base-type-spacing) / 3); }
p:last-of-type:not(:only-child) { margin-bottom: calc(var(--base-type-spacing) / 3); }
p.narrow-para { width: 75%; margin-left: auto; margin-right: auto; }
p, li { font-size: clamp(calc(var(--body-min) / 16 * 1rem), calc((var(--body-min) / 16 * 1rem) + (var(--body-max) - var(--body-min)) / (var(--type-max-width) - var(--type-min-width)) * (100vw - (var(--type-min-width) / 16 * 1rem))), calc(var(--body-max) / 16 * 1rem)); line-height: var(--body-line-height); }
p.small-para { font-size: calc(var(--body-size) * .8); }
p.med-para { font-size: calc(var(--body-size) * 1.5); }
p.larger-para { font-size: calc(var(--body-size) * 2); }
p.extra-large-para { font-size: calc(var(--body-size) * 2.5); }
/*  These use the body size variable together with clamp to increase the size of the paragraph where needed, but retain its fluidity. */

/* SPACING Headings */
:is(h1, h2, h3, h4, h5, h6) + :is(h1, h2, h3, h4, h5, h6) { margin-top: clamp(1.5rem, 4vw, 3rem); }
:is(h1, h2, h3, h4, h5, h6).no-m { margin-top: 0; }

/* Heading colours */
.white-text :is(h1, h2, h3, h4, h5, h6) { color: #fff !important; }

/* SPACING Headings & Paragraphs */
h1 + p, h1 + .section-description { margin-top: calc(var(--base-type-spacing) / 2); }
h2 + p, h2 + .section-description { margin-top: calc(var(--base-type-spacing) / 2.5); }
h3 + p, h3 + .section-description { margin-top: calc(var(--base-type-spacing) / 3); }
h4 + p, h4 + .section-description { margin-top: calc(var(--base-type-spacing) / 3.5); }
h5 + p, h5 + .section-description { margin-top: calc(var(--base-type-spacing) / 4); }
h6 + p, h6 + .section-description { margin-top: calc(var(--base-type-spacing) / 4.5); }

p + h1 { margin-top: calc(var(--base-type-spacing) / 1); }
p + h2 { margin-top: calc(var(--base-type-spacing) / 1.25); }
p + h3 { margin-top: calc(var(--base-type-spacing) / 1.5); }
p + h4 { margin-top: calc(var(--base-type-spacing) / 1.75); }
p + h5 { margin-top: calc(var(--base-type-spacing) / 2); }
p + h6 { margin-top: calc(var(--base-type-spacing) / 2.25); }

/* SPACING Images */
img + p, p + img, picture + p, p + picture, figure + p, p + figure { margin-top: calc(var(--base-type-spacing) / 2); }
:is(h1, h2, h3, h4, h5, h6, p) + img { margin-top: calc(var(--base-type-spacing) / 1.5); }
img + :is(h1, h2, h3, h4, h5, h6, p) { margin-top: calc(var(--base-type-spacing) / 1.5); }
picture { display: block; }

/* SPACING Lists */
:is(h1, h2, h3, h4, h5, h6, p) + ol, :is(h1, h2, h3, h4, h5, h6, p) + ul { margin-top: calc(var(--base-type-spacing) / 4); }
ol + :is(h1, h2, h3, h4, h5, h6, p), ul + :is(h1, h2, h3, h4, h5, h6, p) { margin-top: calc(var(--base-type-spacing) / 4); }
ol.toast-boxed-list + :is(h1, h2, h3, h4, h5, h6, p), ul.toast-boxed-list + :is(h1, h2, h3, h4, h5, h6, p) { margin-top: calc(var(--base-type-spacing) / 1); }


/* Lists */
ul { margin-left: 1rem; padding-left: 2rem; list-style: disc outside; }
ol { margin-left: 1rem; padding-left: 2rem; }
li { margin: 0; margin-bottom: calc(var(--base-type-spacing) / 6); }
main li a { color: var(--brand-1); }
main li a:hover { color: var(--brand-2); }

.tick-list ul {
	list-style: none;
	padding-left: 0;
}

.tick-list ul li {
	position: relative;
	padding-left: 2.75rem;
}

.tick-list ul li::before {
	content: "\f00c";
	position: absolute;
	left: 0;
	top: 0;
	font-family: "Font Awesome 6 Free";
	font-weight: 900;
}

/* Links */
a { text-decoration: none; color: inherit; }
p a { color: var(--brand-2); text-decoration: underline; }
p a:hover { color: var(--brand-1); }

/* Tables */
p + table, table + p { margin-top: 4rem; }
table { width: 100%; border-collapse: collapse; margin-bottom: calc(var(--base-type-spacing) / 2); text-align: left; border: none; }
thead th { background-color: var(--brand-1); font-weight: 600; text-align: left; padding: 1rem; color: #fff; }
tbody tr:nth-child(even) { background-color: #fff; }
tbody tr:nth-child(odd) { background-color: var(--brand-8); }
tbody td, tbody th { padding: 1rem; }
td { border: .1rem solid var(--brand-1); }
th { border-width: .1rem; border-style: solid; border-color: var(--brand-1); }


/* Blockquotes */

blockquote {
	margin-left: 0;
	padding: 0 0 0 2rem;
	border-left: 0.5rem solid var(--brand-1);
	background: none;
}

blockquote p:first-child {
	font-family: 'Aleo', Georgia, serif;
	font-size: clamp(
		calc(var(--h4-min) * 1px),
		calc(
			(var(--h4-min) * 1px) +
			(var(--h4-max) - var(--h4-min)) *
			((100vw - (var(--type-min-width) * 1px)) /
			(var(--type-max-width) - var(--type-min-width)))
		),
		calc(var(--h4-max) * 1px)
	);
	line-height: var(--h4-line-height);
	font-weight: 400;
	font-style: italic;
}

blockquote p:last-child {
	font-family: 'Montserrat', Helvetica, Arial, sans-serif;
	font-size: clamp(
		calc(var(--body-min) * 1px),
		calc(
			(var(--body-min) * 1px) +
			(var(--body-max) - var(--body-min)) *
			((100vw - (var(--type-min-width) * 1px)) /
			(var(--type-max-width) - var(--type-min-width)))
		),
		calc(var(--body-max) * 1px)
	);
	line-height: var(--body-line-height);
	margin-bottom: 0;
}

blockquote p:last-child strong {
	font-family: 'Montserrat', Helvetica, Arial, sans-serif;
	font-size: 80%;
	font-weight: 600;
	font-style: normal;
}

blockquote p:last-of-type { margin-bottom: 0; }

.stars blockquote p:last-child::after {
	content: "\f005 \f005 \f005 \f005 \f005";
	display: block;
	margin-top: 0.75rem;

	font-family: "Font Awesome 6 Free";
	font-weight: 900;

	font-size: 2rem;
	letter-spacing: 0.15rem;

	color: var(--brand-5);
}

/* Tablet */
@media screen and (max-width: 768px) {
	table { overflow-x: auto; width: 100%; }
	:root { --base-type-spacing: 4.5rem; }
}

/* Mobile */
@media screen and (max-width: 576px) {
	:root { --base-type-spacing: 3rem; }
}