/**
 * Post Content (core block): long-form article typography.
 *
 * Applied where the template gives the block the `ab-prose` class.
 */

.ab-prose {
	max-width: var(--wp--custom--measure);
	min-width: 0;
	color: var(--wp--custom--color--ink-prose);
	font-size: var(--wp--preset--font-size--prose);
	line-height: var(--wp--custom--line-height--prose);
}

.ab-prose > * {
	margin-block: var(--wp--preset--spacing--5) 0;
}

.ab-prose > :first-child {
	margin-block-start: 0;
}

.ab-prose > h2 {
	margin-block-start: var(--wp--preset--spacing--12);
	font-size: var(--wp--preset--font-size--prose-title);
	line-height: var(--wp--custom--line-height--heading);
	letter-spacing: var(--wp--custom--letter-spacing--prose-title);
}

.ab-prose > h3 {
	margin-block-start: var(--wp--preset--spacing--8);
}

.ab-prose > :is(ul, ol):not([class*="is-style-"]) {
	padding-inline-start: 1.2em;
}

.ab-prose > :is(ul, ol):not([class*="is-style-"]) > li + li {
	margin-block-start: var(--wp--preset--spacing--2);
}

/* Article page: contents beside the text on wide screens, above it otherwise. */
.ab-article-body {
	display: grid;
	padding-block: var(--wp--preset--spacing--12) var(--wp--preset--spacing--section);
	grid-template-columns: minmax(0, 1fr);
	gap: var(--wp--preset--spacing--8);
}

.ab-article-body > * {
	margin-block: 0;
}

@media (min-width: 60em) {

	.ab-article-body {
		grid-template-columns: 13.75rem minmax(0, var(--wp--custom--measure));
		gap: var(--wp--preset--spacing--24);
	}

	.ab-article-body > .ab-article-aside > * {
		position: sticky;
		top: var(--wp--preset--spacing--6);
	}
}

/* Article header: topics, title, summary and the byline row. */
.ab-article-header {
	padding-block: var(--wp--preset--spacing--section-sm) var(--wp--preset--spacing--12);
	border-block-end: var(--wp--custom--line--width) solid var(--wp--custom--line--base);
}

.ab-article-header > * {
	margin-block: var(--wp--preset--spacing--5) 0;
}

.ab-article-header > :first-child {
	margin-block-start: 0;
}

.ab-article-header .wp-block-post-title {
	max-width: 22ch;
	font-size: var(--wp--preset--font-size--display-sm);
}

.ab-article-header .wp-block-post-excerpt {
	max-width: 62ch;
	color: var(--wp--preset--color--ink-2);
	font-size: var(--wp--preset--font-size--lead);
}

.ab-article-header .wp-block-post-excerpt__excerpt {
	margin: 0;
}

.ab-article-topics,
.ab-article-byline {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wp--preset--spacing--1) var(--wp--preset--spacing--5);
	align-items: center;
	color: var(--wp--preset--color--ink-3);
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--mono-xs);
	line-height: var(--wp--custom--line-height--control);
}

.ab-article-topics {
	font-size: var(--wp--preset--font-size--mono-sm);
	text-transform: lowercase;
}

.wp-block-group.ab-article-topics > *,
.wp-block-group.ab-article-byline > * {
	margin: 0;
}

.ab-article-topics::before {
	content: "";
	flex: none;
	width: var(--wp--custom--marker);
	height: var(--wp--custom--marker);
	background: var(--wp--custom--color--orange);
}

.ab-article-topics a {
	display: inline-flex;
	align-items: center;
	min-height: var(--wp--custom--target);
	color: inherit;
}

/* Author box and related articles: ruled off from the article above. */
.ab-author-box,
.ab-related {
	margin-block: 0;
	padding-block: var(--wp--preset--spacing--10);
	border-block-start: var(--wp--custom--line--width) solid var(--wp--custom--line--base);
}

.ab-author-box .wp-block-post-author-name {
	font-weight: var(--wp--custom--font-weight--semibold);
}

.ab-author-box .wp-block-post-author-biography {
	max-width: 52ch;
}

.ab-related {
	padding-block-end: var(--wp--preset--spacing--section);
}

/* No related articles: no heading left on its own. */
.ab-related:not(:has(.wp-block-post)) {
	display: none;
}
