/*
 * Prose: the body text of posts and pages (.entry-content).
 * 18/1.65 at a 700 px measure; the container sets the measure.
 */

.entry-content {
	display: flow-root;
	max-width: var(--wp--style--global--content-size, 700px);
	font-size: var(--wp--preset--font-size--body);
	line-height: 1.65;
	overflow-wrap: break-word;
}

.entry-content > :first-child {
	margin-top: 0;
}

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

.entry-content p {
	margin: 0 0 1.2em;
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
	font-family: var(--cm-serif);
	font-weight: 400;
	text-wrap: balance;
}

.entry-content h2 {
	margin: 2.4em 0 0.6em;
	font-size: clamp(1.5rem, 1.3rem + 0.8vw, 1.6875rem);
	line-height: 1.2;
}

.entry-content h3 {
	margin: 1.8em 0 0.5em;
	font-size: 1.3125rem;
	line-height: 1.25;
}

.entry-content h4 {
	margin: 1.6em 0 0.4em;
	font-size: 1.125rem;
	line-height: 1.3;
}

/* Jump targets of the step index keep clear of the viewport edge */
.entry-content h2[id],
.entry-content h3[id] {
	scroll-margin-top: 24px;
}

.entry-content ul,
.entry-content ol {
	margin: 0 0 1.2em;
	padding-left: 1.5em;
}

.entry-content li {
	margin-bottom: 0.45em;
}

.entry-content li > ul,
.entry-content li > ol {
	margin: 0.45em 0 0;
}

.entry-content a {
	text-underline-offset: 3px;
}

.entry-content a:hover {
	color: var(--cm-green);
}

/* Quotes and notes use a tinted background, never a side border */
.entry-content blockquote {
	margin: 1.6em 0;
	padding: 18px 22px;
	border: 0;
	border-radius: 10px;
	background: var(--cm-sage);
}

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

.entry-content hr {
	margin: 2em 0;
	border: 0;
	border-top: 1px solid var(--cm-line);
}

.entry-content pre,
.entry-content code {
	font-size: 0.9375rem;
}

.entry-content pre {
	max-width: 100%;
	padding: 14px 16px;
	overflow-x: auto;
	border-radius: 8px;
	background: var(--cm-tint-neutral);
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}

/* Media */
.entry-content img,
.entry-content video,
.entry-content iframe,
.entry-content embed,
.entry-content object {
	max-width: 100%;
}

.entry-content img {
	height: auto;
}

.entry-content figure {
	max-width: 100%;
	margin: 1.6em 0;
}

.entry-content figcaption,
.entry-content .wp-caption-text,
.entry-content .wp-element-caption {
	margin-top: 8px;
	font-size: 0.8125rem;
	line-height: 1.4;
	color: var(--cm-muted);
}

.entry-content .wp-caption {
	max-width: 100%;
	margin: 1.4em 0;
}

.entry-content .wp-caption img {
	display: block;
	max-width: 100%;
}

.entry-content .alignleft {
	float: left;
	margin: 4px 28px 16px 0;
}

.entry-content .alignright {
	float: right;
	margin: 4px 0 16px 28px;
}

.entry-content .aligncenter {
	display: block;
	margin-inline: auto;
	text-align: center;
}

/* Tables scroll inside their own region (keyboard reachable) instead of widening the page */
.entry-content .table-scroll {
	max-width: 100%;
	margin: 1.6em 0;
	overflow-x: auto;
	border: 1px solid var(--cm-line);
	border-radius: 10px;
}

.entry-content .table-scroll:focus-visible {
	outline-offset: -3px;
}

.entry-content table {
	width: 100%;
	border-collapse: collapse;
	font-size: var(--wp--preset--font-size--small);
	font-variant-numeric: tabular-nums;
}

.entry-content caption {
	padding: 14px 16px 6px;
	font-weight: 700;
	text-align: left;
}

.entry-content th,
.entry-content td {
	padding: 10px 16px;
	text-align: left;
	vertical-align: top;
}

.entry-content th {
	background: var(--cm-tint-neutral);
	font-weight: 600;
}

.entry-content tr + tr > td,
.entry-content tr + tr > th,
.entry-content tbody tr > td {
	border-top: 1px solid var(--cm-line);
}

@media (max-width: 559px) {
	.entry-content .alignleft,
	.entry-content .alignright {
		float: none;
		display: block;
		margin: 1.2em auto;
	}
}
