/* Editor content: post body on the site and inside the classic editor.
   Figma: Blog post 1:390-1:410. */

/* Inside the editor iframe: WordPress styles body#tinymce, so match that specificity. */
html:has(> .mce-content-body) { background: var(--c-bg); }

body.mce-content-body {
	max-width: 1320px;
	margin: 0 auto !important;
	padding: 20px 28px !important; /* the editor sets its own body padding; this file is the only place that overrides it */
}

.entry-content,
.mce-content-body {
	color: var(--c-ink-2);
	font-size: var(--fs-small);
	line-height: 1.375;
	letter-spacing: -0.03em;
}

.entry-content > * + *,
.mce-content-body > * + * { margin-top: clamp(28px, 3.125vw, 60px); }

.entry-content > p + p,
.mce-content-body > p + p { margin-top: clamp(24px, 3.125vw, 60px); }

:is(.entry-content, .mce-content-body) :is(h2, h3, h4) {
	color: var(--c-ink);
	font-weight: 500;
}

:is(.entry-content, .mce-content-body) h2 {
	font-size: var(--fs-h2);
	line-height: 1.1;
	letter-spacing: -0.05em;
}

:is(.entry-content, .mce-content-body) h3 { font-size: var(--fs-h3); line-height: 1.18; letter-spacing: -0.04em; }
:is(.entry-content, .mce-content-body) h4 { font-size: var(--fs-h4); line-height: 1.2; letter-spacing: -0.03em; }

/* A heading belongs to the text under it; its own line box adds the rest of the space above. */
:is(.entry-content, .mce-content-body) > * + h2 { margin-top: clamp(24px, 2.19vw, 42px); }
.entry-content > h2:first-child { margin-top: clamp(-18px, -0.94vw, -8px); }
:is(.entry-content, .mce-content-body) > :is(h2, h3, h4) + * { margin-top: clamp(14px, 1.2vw, 23px); }

:is(.entry-content, .mce-content-body) a {
	color: var(--c-ink);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
}

:is(.entry-content, .mce-content-body) a:hover { text-decoration-thickness: 2px; }
:is(.entry-content, .mce-content-body) strong { color: var(--c-ink); font-weight: 600; }

:is(.entry-content, .mce-content-body) :is(ul, ol) { padding-left: 1.85em; }
:is(.entry-content, .mce-content-body) > p + :is(ul, ol) { margin-top: clamp(20px, 1.6vw, 31px); }
:is(.entry-content, .mce-content-body) li::marker { font-size: 0.8em; }

/* Quote: bar on the left, large text, then "Quote author" / "Quote author role" lines. */
:is(.entry-content, .mce-content-body) blockquote {
	margin-inline: 0;
	padding: 0 0 0 clamp(18px, 1.56vw, 30px);
	border-left: 2px solid var(--c-ink);
}

:is(.entry-content, .mce-content-body) blockquote p {
	max-width: 34em;
	color: var(--c-ink);
	font-size: clamp(1.25rem, 1.5625vw, 1.875rem); /* 30 */
	line-height: 1.133;
	letter-spacing: 0;
}

:is(.entry-content, .mce-content-body) blockquote p + p { margin-top: 0.6em; }

:is(.entry-content, .mce-content-body) blockquote :is(cite, .quote-author) {
	display: block;
	margin-top: 18px;
	color: var(--c-ink);
	font-size: var(--fs-small);
	font-style: normal;
	line-height: 1.125;
	letter-spacing: -0.03em;
}

:is(.entry-content, .mce-content-body) blockquote :is(cite span, .quote-role) {
	display: block;
	margin-top: 0;
	color: #999999;
	font-size: 0.875rem;
	line-height: 1.29;
	letter-spacing: -0.03em;
}

/* Images */
:is(.entry-content, .mce-content-body) img { height: auto; }
:is(.entry-content, .mce-content-body) figure { margin-inline: 0; }
:is(.entry-content, .mce-content-body) :is(.size-full, .size-large) { width: 100%; }
:is(.entry-content, .mce-content-body) .wp-caption { max-width: 100%; }

:is(.entry-content, .mce-content-body) .wp-caption-text,
:is(.entry-content, .mce-content-body) figcaption {
	margin-top: 10px;
	color: #999999;
	font-size: 0.875rem;
}

.entry-content .aligncenter { display: block; margin-inline: auto; }
.entry-content .alignleft { float: left; max-width: 50%; margin: 0 clamp(16px, 1.56vw, 30px) 16px 0; }
.entry-content .alignright { float: right; max-width: 50%; margin: 0 0 16px clamp(16px, 1.56vw, 30px); }
.entry-content::after { content: ""; display: block; clear: both; }

/* Galleries ("Add Media → Create gallery"). Two columns is the asymmetric pair of the design. */
.entry-content .gallery {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: clamp(12px, 1.56vw, 30px);
}

.entry-content .gallery-columns-1 { grid-template-columns: 1fr; }
.entry-content .gallery-columns-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.entry-content .gallery-item { margin: 0; }
.entry-content .gallery-icon { overflow: hidden; aspect-ratio: 4 / 3; }

.entry-content .gallery img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.entry-content .gallery-columns-2 {
	grid-template-columns: 60.15% minmax(0, 1fr); /* 794 and 496 of 1320 */
	align-items: start;
}

.entry-content .gallery-columns-2 .gallery-item:nth-child(odd) .gallery-icon { aspect-ratio: 794 / 700; }

.entry-content .gallery-columns-2 .gallery-item:nth-child(even) { margin-top: clamp(0px, 1.04vw, 20px); }
.entry-content .gallery-columns-2 .gallery-item:nth-child(even) .gallery-icon { aspect-ratio: 496 / 620; }

@media (max-width: 600px) {
	.entry-content .gallery,
	.entry-content .gallery-columns-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.entry-content .alignleft,
	.entry-content .alignright { float: none; max-width: 100%; margin: 0; }
}
