/*
 * Rich text block. Loaded only on pages that use it. Mobile first; desktop from 900px.
 * "Narrow" keeps lines to a comfortable reading length; "wide" uses the full page width.
 * Everything uses the design tokens.
 */

.richtext { padding: 40px 0; }
.richtext--surface { background: var(--surface); }

.richtext__inner { max-width: 68ch; }
.richtext__inner--medium { max-width: 90ch; }
.richtext__inner--large { max-width: 110ch; }
.richtext__inner--wide { max-width: none; }

.richtext__title { margin-bottom: 0.5em; font-size: 1.9rem; line-height: 1.1; }

.richtext__content > * { margin: 0; }
.richtext__content > * + * { margin-top: 1em; }

.richtext__content h2 { margin-top: 1.6em; font-size: 1.5rem; }
.richtext__content h3 { margin-top: 1.4em; font-size: 1.2rem; }
.richtext__content h4 { margin-top: 1.2em; font-size: 1.05rem; }

.richtext__content ul,
.richtext__content ol { padding-left: 1.3em; }
.richtext__content li + li { margin-top: 0.35em; }

.richtext__content a { text-underline-offset: 3px; }
.richtext__content img { height: auto; border-radius: var(--card-r); }

.richtext__content blockquote {
	margin-inline: 0;
	padding: 4px 0;
	color: var(--muted);
	font-family: var(--fh);
	font-size: 1.15em;
	font-style: italic;
}

.richtext__content hr { border: 0; border-top: 1px solid var(--line); }

.richtext__content table { width: 100%; border-collapse: collapse; }
.richtext__content th,
.richtext__content td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; }

/* Centred: the whole block sits in the middle of the page, text and heading centred. */
.richtext__inner--centre { margin-inline: auto; text-align: center; }
.richtext__inner--centre .richtext__content ul,
.richtext__inner--centre .richtext__content ol { padding-left: 0; list-style-position: inside; }

/* List of points: the bullet is drawn by ::before in --list-color (brand when not set). */
.richtext__list { margin: 1.25em 0 0; padding: 0; list-style: none; display: grid; gap: 0.6em 2em; text-align: left; }
.richtext__list li { position: relative; margin: 0; padding-left: 1.6em; }
.richtext__list li::before { position: absolute; left: 0; top: 0; color: var(--list-color, var(--brand)); font-weight: 700; line-height: inherit; }
.richtext__list--circle li::before { content: ""; top: 0.55em; width: 0.6em; height: 0.6em; border-radius: 50%; background: currentColor; }
.richtext__list--square li::before { content: ""; top: 0.55em; width: 0.55em; height: 0.55em; background: currentColor; }
.richtext__list--arrow li::before { content: "\2192"; }
.richtext__list--tick li::before { content: "\2713"; }

/* A centred one-column list shrinks to its widest line so it sits in the middle; columns fill the width. */
.richtext__inner--centre .richtext__list--cols-1 { width: fit-content; max-width: 100%; margin-inline: auto; }

@media (min-width: 600px) {
	.richtext__list--cols-2,
	.richtext__list--cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 900px) {
	.richtext__list--cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 900px) {
	.richtext { padding: 56px 0; }
	.richtext__title { font-size: 2.6rem; }
}
