/**
 * Post content: the default editor blocks inside single posts and static
 * pages (body.bst-post-content). Text and media use the full width of
 * the content column; blocks are about 1.5em apart; other blocks keep
 * the base styles. Loaded on those pages only. See "Post
 * content" in docs/design-system.md (single-post-02.jpg, layout and feel
 * only).
 */

.bst-post-content .entry-content > * {
	margin-top: 0;
	margin-bottom: 1.5em;
}

.bst-post-content .entry-content > :last-child {
	margin-bottom: 0;
}

/*
 * Headings: h2 at --text-h2-content, h3 and h4 at their tokens, in the
 * heading style (base.css, line-height 1.3 keeps stacked diacritics);
 * clearly more space above than below. They clear floated images.
 */
.bst-post-content .entry-content :is(h2, h3, h4) {
	clear: both;
	margin-bottom: 0.6em;
}

.bst-post-content .entry-content > * + :is(h2, h3, h4) {
	margin-top: 2em;
}

.bst-post-content .entry-content h2 {
	font-size: var(--text-h2-content);
}

.bst-post-content .entry-content h3 {
	font-size: var(--text-h3);
}

.bst-post-content .entry-content h4 {
	font-size: var(--text-h4);
}

/*
 * Lists (list block and plain lists): indented (base.css); bullets are
 * small accent squares, numbers the heading font italic in accent; a
 * little space between items (base.css); nested lists keep the markers.
 */
.bst-post-content .entry-content :is(ul, ol):where(.wp-block-list, :not([class])) {
	list-style: none;
}

.bst-post-content .entry-content :is(ul, ol):where(.wp-block-list, :not([class])) > li {
	position: relative;
}

.bst-post-content .entry-content ul:where(.wp-block-list, :not([class])) > li::before {
	position: absolute;
	top: 0.7em;
	left: -1.1em;
	width: 0.35em;
	height: 0.35em;
	background-color: var(--color-accent);
	content: "";
}

.bst-post-content .entry-content ol:where(.wp-block-list, :not([class])) {
	counter-reset: bst-list;
}

.bst-post-content .entry-content ol:where(.wp-block-list, :not([class])) > li {
	counter-increment: bst-list;
}

.bst-post-content .entry-content ol:where(.wp-block-list, :not([class])) > li::before {
	position: absolute;
	top: 0;
	right: calc(100% + 0.4em);
	color: var(--color-accent);
	font-family: var(--font-heading);
	font-size: var(--text-link);
	font-style: italic;
	line-height: inherit;
	content: counter(bst-list) ".";
}

/* Images: never wider than the column, never upscaled. */
.bst-post-content .entry-content img {
	max-width: 100%;
	height: auto;
}

/* Captions (image and table): heading font italic at --text-link. */
.bst-post-content .entry-content :is(figcaption, .wp-element-caption) {
	margin: 0.5em 0 0;
	color: var(--color-text);
	font-family: var(--font-heading);
	font-size: var(--text-link);
	font-style: italic;
	line-height: 1.5;
	text-align: left;
}

/* Left and right aligned images: full width below 600px, floated from 600px. */
.bst-post-content .entry-content :is(.wp-block-image.alignleft, .wp-block-image.alignright, .wp-block-image .alignleft, .wp-block-image .alignright) {
	float: none;
	margin: 0 0 1.5em;
}

@media (min-width: 600px) {

	.bst-post-content .entry-content :is(.wp-block-image.alignleft, .wp-block-image .alignleft) {
		float: left;
		max-width: 50%;
		margin: 0.35em 1.5em 1em 0;
	}

	.bst-post-content .entry-content :is(.wp-block-image.alignright, .wp-block-image .alignright) {
		float: right;
		max-width: 50%;
		margin: 0.35em 0 1em 1.5em;
	}
}

/*
 * Quote (quote block, pullquote block, plain blockquote): the accent
 * quote mark of the testimonial component, the text beside it in the
 * heading font italic at --text-h3 in forest; no border, no background.
 * Citation in the menu type style. Below 600px the mark sits above.
 */
.bst-post-content .entry-content blockquote,
.bst-post-content .entry-content .wp-block-pullquote {
	clear: both;
}

.bst-post-content .entry-content .wp-block-pullquote {
	padding: 0;
	border: 0;
	text-align: left;
}

.bst-post-content .entry-content blockquote {
	position: relative;
	margin: 0 0 1.5em;
	padding: 0;
	border: 0;
	background: none;
	color: var(--color-forest);
	font-family: var(--font-heading);
	font-size: var(--text-h3);
	font-style: italic;
	line-height: 1.6;
	text-align: left;
}

.bst-post-content .entry-content .wp-block-pullquote blockquote {
	margin: 0;
}

.bst-post-content .entry-content blockquote::before {
	display: block;
	height: 0.55em;
	color: var(--color-accent);
	font-family: var(--font-heading);
	font-size: calc(var(--text-h1) * 1.5);
	font-style: normal;
	line-height: 1;
	content: "\201D";
}

.bst-post-content .entry-content blockquote p {
	margin: 0 0 0.75em;
	font-size: inherit;
	line-height: inherit;
}

.bst-post-content .entry-content blockquote :is(cite, footer) {
	display: block;
	margin-top: 0.25em;
	color: var(--color-text);
	font-family: var(--font-body);
	font-size: var(--text-menu);
	font-style: normal;
	font-weight: 500;
	letter-spacing: 0.15em;
	text-align: left;
	text-transform: uppercase;
}

.bst-post-content .entry-content blockquote > :last-child {
	margin-bottom: 0;
}

@media (min-width: 600px) {

	.bst-post-content .entry-content blockquote {
		padding-left: calc(var(--text-h1) * 1.1);
	}

	.bst-post-content .entry-content blockquote::before {
		position: absolute;
		top: 0;
		left: 0;
	}
}

/* Separator: a 1px hairline across the column. */
.bst-post-content .entry-content :is(hr, .wp-block-separator) {
	clear: both;
	width: 100%;
	max-width: none;
	height: 1px;
	margin: 2.5em 0;
	border: 0;
	background-color: var(--color-border);
	opacity: 1;
}

/*
 * Table (table block): full column width, hairlines between rows, header
 * cells in the menu type style in forest; a wide table scrolls inside
 * its own box (.wp-block-table has overflow-x: auto from WordPress).
 */
.bst-post-content .entry-content .wp-block-table {
	max-width: 100%;
}

.bst-post-content .entry-content .wp-block-table table {
	width: 100%;
	margin: 0;
	border: 0;
	border-collapse: collapse;
}

.bst-post-content .entry-content .wp-block-table :is(thead, tfoot) {
	border: 0;
}

.bst-post-content .entry-content .wp-block-table :is(th, td) {
	padding: 0.75em 1em 0.75em 0;
	border: 0;
	border-bottom: 1px solid var(--color-border);
	text-align: left;
	vertical-align: top;
}

.bst-post-content .entry-content .wp-block-table th {
	color: var(--color-forest);
	font-family: var(--font-body);
	font-size: var(--text-menu);
	font-weight: 500;
	letter-spacing: 0.15em;
	text-transform: uppercase;
}
