/*
 * The blog (/blog and /blog/{slug}): HeyCatch's articles in the site's own type and colours,
 * on top of reading.css. Loaded only on the blog (Blog::assets). Rules for p, ul and ol start
 * with .mgs-blog: the runtime's later .mg-doc :where(p, ul, ol) reset would win otherwise.
 */

.mgs-blog {
	max-width: 760px;
	margin-inline: auto;
	color: var(--mg-c-ink);
}

.mgs-blog__title {
	margin: 0;
	font-family: var(--mg-t-h2-family);
	font-size: var(--mg-t-h2-size);
	font-weight: var(--mg-t-h2-weight);
	line-height: var(--mg-t-h2-lh);
	letter-spacing: var(--mg-t-h2-ls);
	text-wrap: balance;
}

.mgs-blog .mgs-blog__meta {
	margin: var(--mg-s-4, 1rem) 0 0;
	color: var(--mg-c-stone);
	font-size: 0.95rem;
}

.mgs-blog .mgs-blog__back {
	margin: 0 0 var(--mg-s-4, 1rem);
	font-size: 0.95rem;
}

.mgs-blog__back a {
	color: var(--mg-c-stone);
	text-decoration: none;
}

.mgs-blog__back a:hover,
.mgs-blog__back a:focus-visible {
	color: var(--mg-c-accent);
}

.mgs-blog .mgs-blog__empty {
	margin-top: var(--mg-s-5, 1.5rem);
	color: var(--mg-c-stone);
}

/* The list. */
.mgs-blog .mgs-blog__list {
	list-style: none;
	margin: var(--mg-s-6, 2rem) 0 0;
	padding: 0;
	border-top: 1px solid var(--mg-c-line);
}

.mgs-blog__list li {
	padding: var(--mg-s-5, 1.5rem) 0;
	border-bottom: 1px solid var(--mg-c-line);
}

.mgs-blog__list a {
	font-family: var(--mg-t-h3-family);
	font-size: var(--mg-t-h3-size);
	font-weight: var(--mg-t-h3-weight);
	line-height: var(--mg-t-h3-lh);
	letter-spacing: var(--mg-t-h3-ls);
	color: var(--mg-c-ink);
	text-decoration: none;
}

.mgs-blog__list a:hover,
.mgs-blog__list a:focus-visible {
	color: var(--mg-c-accent);
}

.mgs-blog .mgs-blog__list .mgs-blog__meta {
	margin-top: var(--mg-s-2, 0.5rem);
}

/* One article. */
.mgs-blog__image {
	display: block;
	width: 100%;
	height: auto;
	margin-top: var(--mg-s-6, 2rem);
	border-radius: var(--mg-r-m, 12px);
}

.mgs-blog__body {
	margin-top: var(--mg-s-6, 2rem);
	font-size: var(--mg-t-body-size);
	line-height: var(--mg-t-body-lh);
}

.mgs-blog__body > :first-child {
	margin-top: 0;
}

.mgs-blog__body h2 {
	margin: 2.2em 0 0.6em;
	font-family: var(--mg-t-h3-family);
	font-size: calc(var(--mg-t-h3-size) * 1.2);
	font-weight: var(--mg-t-h3-weight);
	line-height: 1.2;
	letter-spacing: var(--mg-t-h3-ls);
}

.mgs-blog__body h3 {
	margin: 1.6em 0 0.4em;
	font-family: var(--mg-t-h3-family);
	font-size: 1.15em;
	font-weight: 650;
	line-height: 1.3;
}

.mgs-blog__body h4 {
	margin: 1.4em 0 0.3em;
	font-size: 1em;
	font-weight: 650;
}

.mgs-blog__body p,
.mgs-blog__body ul,
.mgs-blog__body ol,
.mgs-blog__body table,
.mgs-blog__body blockquote,
.mgs-blog__body pre {
	margin: 0 0 1.1em;
}

.mgs-blog__body a {
	color: var(--mg-c-accent);
}

.mgs-blog__body blockquote {
	padding: 0.2em 0 0.2em 1.1em;
	border-left: 3px solid var(--mg-c-accent);
	color: var(--mg-c-stone);
}

.mgs-blog__body table {
	display: block;
	max-width: 100%;
	overflow-x: auto;
	border-collapse: collapse;
	font-size: 0.95em;
}

.mgs-blog__body th,
.mgs-blog__body td {
	padding: 0.55em 0.8em;
	border-bottom: 1px solid var(--mg-c-line);
	text-align: left;
	vertical-align: top;
}

.mgs-blog__body thead th {
	border-bottom: 2px solid var(--mg-c-ink);
}

.mgs-blog__body pre {
	overflow-x: auto;
	padding: 1em;
	border-radius: var(--mg-r-m, 12px);
	background: color-mix(in srgb, var(--mg-c-line) 45%, transparent);
}

.mgs-blog__body pre code {
	padding: 0;
	background: none;
}

/* Table of contents. */
.mgs-blog__toc {
	margin: 0 0 1.6em;
	padding: 1.1em 1.3em;
	border-radius: var(--mg-r-m, 12px);
	background: var(--mg-c-white);
	border: 1px solid var(--mg-c-line);
}

.mgs-blog__body .mgs-blog__toc h2 {
	margin: 0 0 0.5em;
	font-size: 1rem;
	letter-spacing: 0;
}

.mgs-blog__toc ol {
	margin: 0;
}

.mgs-blog__toc a {
	color: var(--mg-c-ink);
}
