/**
 * Single post body.
 *
 * Figma 290:10003 (desktop 1440): section 1158 tall — 64 padding, 1094 of
 * content, 64 padding — with an 818 article column at x 85 and a 315 table of
 * contents at x 1040. Body 16/24 secondary, section headings 20/30 primary and
 * numbered by a counter, quotes marked with a 2px accent rule.
 */

.mls-article {
	--mls-article-column: 818px;
	--mls-article-toc: 315px;

	background: var( --wp--preset--color--alabaster );
	padding-top: 48px;
	padding-bottom: 48px;
}

.mls-article__inner {
	display: flex;
	flex-direction: column;
	gap: 40px;
}

.mls-article__body {
	/* Desktop sets 9 in the media query below; mobile keeps the copy flush with
	   the column so only the quotes hang out to the left (309:7982). */
	--mls-article-indent: 0px;

	min-width: 0;
	font-size: var( --wp--preset--font-size--text-md );
	line-height: 24px;
	color: var( --wp--preset--color--secondary );
}

/* Everything but the quotes sits inside the indent, so the quote rule can hang
   to its left. */
.mls-article__body > * {
	padding-left: var( --mls-article-indent );
	padding-right: var( --mls-article-indent );
}

.mls-article__body > blockquote {
	/* 2px rule + 16 leaves the text at 18 from the column edge. */
	padding: 0 0 0 16px;
}

/* --- Headings ---------------------------------------------------------- */

/*
 * Sections are numbered here rather than in the text, so the table of contents
 * can list the titles without the numbers — as the design draws it.
 */
.mls-article__body {
	counter-reset: mls-section;
}

.mls-article__body h2 {
	counter-increment: mls-section;
	margin: 40px 0 16px;
	/* Text 30 past the indent, the marker dot painted at 13.5 (290:10645). */
	padding-left: calc( var( --mls-article-indent ) + 30px );
	background:
		radial-gradient(
			circle at calc( var( --mls-article-indent ) + 13.5px ) 15px,
			var( --wp--preset--color--primary ) 0 2.5px,
			transparent 2.5px
		) no-repeat;
	font-size: var( --wp--preset--font-size--text-xl );
	font-weight: 600;
	line-height: 30px;
	letter-spacing: 0;
	color: var( --wp--preset--color--primary );
}

.mls-article__body h2::before {
	content: counter( mls-section ) ". ";
}

.mls-article__body h3 {
	margin: 32px 0 12px;
	font-size: var( --wp--preset--font-size--text-lg );
	font-weight: 600;
	line-height: 28px;
	color: var( --wp--preset--color--primary );
}

.mls-article__body h4 {
	margin: 24px 0 8px;
	font-size: var( --wp--preset--font-size--text-md );
	font-weight: 600;
	line-height: 24px;
	color: var( --wp--preset--color--blue-bayoux );
}

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

/* --- Copy, quotes, lists ----------------------------------------------- */

.mls-article__body p {
	margin: 0 0 16px;
}

/* 2px accent rule, text 18 in, and the copy stays primary rather than the
   body's secondary (290:10644 / 290:10662). */
.mls-article__body blockquote {
	margin: 40px 0;
	border-left: 2px solid var( --wp--preset--color--accent );
	border-radius: 0;
	background: none;
	font-size: var( --wp--preset--font-size--text-md );
	line-height: 24px;
	color: var( --wp--preset--color--primary );
}

.mls-article__body blockquote p:last-child {
	margin-bottom: 0;
}

.mls-article__body ul,
.mls-article__body ol {
	margin: 0 0 16px;
}

.mls-article__body li {
	margin-bottom: 8px;
}

.mls-article__body ol > li::before {
	font-size: var( --wp--preset--font-size--text-sm );
	font-weight: 600;
	line-height: 24px;
}

/* --- Table of contents -------------------------------------------------- */

/* The mobile frame has none (309:7533), so it only appears from the desktop
   breakpoint up, where there is a column for it. */
.mls-toc {
	display: none;
	flex: none;
	border-left: 1px solid var( --wp--preset--color--accent );
	padding-left: 16px;
}

.mls-toc__title {
	margin: 0 0 16px;
	font-size: var( --wp--preset--font-size--display-sm );
	font-weight: 600;
	line-height: 38px;
	letter-spacing: 0;
	color: var( --wp--preset--color--primary );
}

.mls-toc__list {
	counter-reset: none;
	margin: 0;
	padding: 0;
	list-style: none;
}

.mls-toc__list > li {
	margin: 0 0 8px;
	padding-left: 0;
}

.mls-toc__list > li::before {
	content: none;
}

.mls-toc__list > li:last-child {
	margin-bottom: 0;
}

.mls-toc__list a {
	display: block;
	font-size: var( --wp--preset--font-size--text-md );
	line-height: 24px;
	color: var( --wp--preset--color--secondary );
	text-decoration: none;
}

.mls-toc__list a:hover,
.mls-toc__list a:focus-visible {
	color: var( --wp--preset--color--accent );
}

/* The section being read, marked by article.js. */
.mls-toc__list a.is-current {
	font-weight: 600;
	color: var( --wp--preset--color--accent );
}

/* --- Desktop ---------------------------------------------------------- */

@media ( min-width: 1024px ) {
	.mls-article {
		padding-top: 64px;
		padding-bottom: 64px;
	}

	/* The design insets its 1270 frame by 5 inside the 1280 container. */
	.mls-article__inner {
		flex-direction: row;
		align-items: flex-start;
		justify-content: space-between;
		gap: 40px;
		padding-inline: calc( var( --mls-container-gutter, 20px ) + 5px );
	}

	.mls-article__body {
		--mls-article-indent: 9px;

		flex: 0 1 var( --mls-article-column );
		max-width: var( --mls-article-column );
	}

	.mls-toc {
		position: sticky;
		top: 96px;
		display: block;
		width: var( --mls-article-toc );
	}
}
