.middleclass-text > *:last-child {
	margin-bottom: 0;
}

.middleclass-text > *:first-child {
	margin-top: 0;
}

.middleclass-text p {
	@apply mb-4 font-normal;
}

.middleclass-text strong {
	@apply font-medium;
}

.middleclass-text a {
	@apply font-medium underline;
}

.middleclass-text a:hover,
.middleclass-text a:focus {
	@apply no-underline;
}

.styled-links a {
	@apply underline;
}

.styled-links a:hover,
.styled-links a:focus {
	@apply no-underline;
}

@layer components {
	.richtext {
		font-size: inherit;
	}

	.richtext > *:last-child {
		margin-bottom: 0;
	}

	.richtext > *:first-child {
		margin-top: 0;
	}

	.richtext h2,
	.richtext h3,
	.richtext h4 {
		@apply text-imperial;
	}

	.richtext h1 {
		@apply mb-20 text-2xl font-medium leading-tight;
	}

	.richtext h2 {
		@apply mt-20 mb-8 font-medium heading-3;
	}

	.richtext h3 {
		@apply pt-2 mt-16 mb-6 font-medium border-t-2 border-gray-400 heading-4;
	}

	.richtext h4 {
		@apply mt-12 mb-4 font-medium heading-5;
	}

	.richtext h2 + * {
		margin-top: 0;
	}
	.richtext h3 + * {
		margin-top: 0;
	}
	.richtext h4 + * {
		margin-top: 0;
	}

	.richtext p,
	.richtext li {
		@apply text-gray-700 copy;
	}

	.richtext p {
		@apply mb-4;
	}

	.richtext p.feature-paragraph {
		@apply mb-6 text-blue copy-lg;
	}

	.richtext strong {
		@apply font-bold;
	}

	.richtext a {
		@apply font-bold underline text-blue;
	}

	.richtext a:hover,
	.richtext a:focus {
		@apply text-blue no-underline;
	}

	/* Lists */

	.richtext ol,
	.richtext ul {
		@apply relative pl-8 my-6 list-none;
	}

	.richtext ol > li::before {
		content: counter(list-item, decimal) ".";
		@apply absolute left-0 text-gray-600;
	}

	.richtext ol ol {
		@apply pl-5 mt-3;
	}

	.richtext ol ol li::before {
		content: counter(list-item, lower-roman) ".";
	}

	.richtext ul > li::before {
		content: "";
		@apply absolute left-0 w-6 h-6 bg-no-repeat bg-contain;
		background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22.884' height='22.884' viewBox='0 0 22.884 22.884'%3E%3Cpath id='Path_868' data-name='Path 868' d='M779.442,3221a11.442,11.442,0,1,0,11.442,11.442A11.455,11.455,0,0,0,779.442,3221m0,22A10.562,10.562,0,1,1,790,3232.442,10.574,10.574,0,0,1,779.442,3243m5.324-14.7-6.671,7.735-4.019-3.314a.426.426,0,0,0-.61.07.457.457,0,0,0,.068.629l4.341,3.579a.422.422,0,0,0,.271.1.428.428,0,0,0,.325-.15l6.945-8.053a.456.456,0,0,0-.036-.631.425.425,0,0,0-.613.037' transform='translate(-768 -3221)' fill='%23632b70'/%3E%3C/svg%3E%0A");
	}

	.richtext ul ul {
		@apply pl-5 mt-3;
	}

	.richtext ul ul > li {
		@apply pl-2;
	}

	.richtext ul ul > li::before {
		content: "";
		@apply w-2 h-2 mt-2 bg-gray-300 rounded-full;
	}

	.richtext li + li {
		@apply mt-3;
	}

	.richtext li strong:first-child {
		@apply block;
	}

	/* Blockquote */

	.richtext blockquote {
		@apply pt-1 pb-2 pl-4 my-8 border-l-4 border-yellow-400 copy-lg;
	}

	.richtext blockquote p {
		@apply last-of-type:mb-0;
		font-size: inherit;
	}

	/* Code */
	.richtext pre {
		@apply px-4 py-4 mt-4 mb-4 overflow-x-scroll font-mono bg-gray-700 rounded-lg;
	}

	.richtext pre code {
		@apply text-gray-100 bg-gray-700;
	}

	.richtext code {
		@apply px-1 font-mono bg-gray-100;
		font-size: 0.875em;
	}

	/* Table */
	.richtext table {
		@apply w-full my-12 table-fixed table-responsive;
	}

	.richtext table thead {
		@apply text-left;
	}

	.richtext table thead th {
		@apply px-3 pt-2 pb-8;
		@apply border-t-2 border-blue;
		@apply font-medium text-blue heading-5;
	}

	.richtext table tbody {
		@apply bg-white;
	}

	.richtext table tbody tr:nth-of-type(even) {
		@apply bg-gray-100;
	}

	.richtext table tbody td {
		@apply px-3 py-3;
		@apply border-t border-gray-200;
	}

	@media (max-width: theme("screens.md")) {
		.table-responsive tbody td[data-th] {
			position: relative;
			border: none;
			padding-left: 9.5rem !important;
			display: block;
		}

		.table-responsive tbody td[data-th]:before {
			@apply font-bold text-gray-900;
			content: attr(data-th);
			display: inline-block;
			width: 7.5em;
			vertical-align: inherit;
			line-height: 1;
			position: absolute;
			left: 0.5rem;
			top: 1rem;
		}

		.table-responsive,
		.table-responsive thead,
		.table-responsive tbody,
		.table-responsive tr {
			display: block;
		}

		.table-responsive th,
		.table-responsive td {
			display: flex;
			align-items: flex-start;
		}

		.table-responsive thead th {
			@apply sr-only;
		}

		.table-responsive tbody td {
			@apply p-3;
		}

		.table-responsive tbody tr {
			@apply border-b border-gray-200;
		}

		.table-responsive tbody tr:nth-of-type(even) td {
			@apply bg-gray-100;
		}

		.table-responsive tbody tr:last-of-type {
			border-bottom: 0;
		}
	}

	/* Misc */
	.richtext hr {
		@apply mt-20 mb-4 border-0 border-t border-gray-300;
	}

	.richtext iframe {
		@apply mt-8;
	}
}
