/*
 * Article and page bodies. Loaded on the front end (.prose) and in the block
 * editor (add_editor_style). The selectors name .editor-styles-wrapper
 * themselves so the editor applies them unprefixed; :where() keeps their
 * specificity at zero so block styles and story.css still win.
 *
 * Every Quote block is a punchline (D24): centred, Alice, purple, with the
 * ◆◇◆ ornament above; each paragraph inside one quote is its own line.
 */

:where(.prose, .editor-styles-wrapper) {
	font-family: var(--fe-font-sans);
	font-size: var(--fe-size-medium);
	line-height: 1.7;
	color: var(--fe-text);
	overflow-wrap: break-word;
}

:where(.prose, .editor-styles-wrapper) :where(h2, h3, h4) {
	font-family: var(--fe-font-serif);
	font-weight: 400;
	font-synthesis: none;
	line-height: 1.25;
	color: var(--fe-ink);
	margin: 2.2em 0 0.7em;
}

:where(.prose, .editor-styles-wrapper) :where(h2) {
	font-size: 2rem;
}

:where(.prose, .editor-styles-wrapper) :where(h3) {
	font-size: 1.5rem;
}

:where(.prose, .editor-styles-wrapper) :where(h4) {
	font-size: 1.25rem;
}

:where(.prose, .editor-styles-wrapper) :where(p, ul, ol, figure, table) {
	margin: 0 0 1.15em;
}

:where(.prose, .editor-styles-wrapper) :where(ul) {
	padding-left: 1.1em;
}

:where(.prose, .editor-styles-wrapper) :where(ol) {
	padding-left: 1.4em;
}

:where(.prose, .editor-styles-wrapper) :where(li) {
	margin: 0 0 0.45em;
	padding-left: 0.3em;
}

/* Lists carry the diamond marker of the design. */
:where(.prose, .editor-styles-wrapper) :where(ul > li)::marker {
	content: "◆  ";
	color: var(--fe-accent);
	font-size: 0.6em;
}

:where(.prose, .editor-styles-wrapper) :where(a) {
	color: var(--fe-primary);
	text-underline-offset: 0.15em;
}

:where(.prose, .editor-styles-wrapper) :where(hr) {
	margin: 2.5em auto;
	width: 64px;
	border: 0;
	border-top: 1px solid var(--fe-line-soft);
}

/* Tables (the policy pages, the Privacy provider list): ruled rows, headings left. */
:where(.prose, .editor-styles-wrapper) :where(table) {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.9375em;
}

:where(.prose, .editor-styles-wrapper) :where(th, td) {
	padding: 0.6em 0.75em 0.6em 0;
	border-bottom: 1px solid var(--fe-line-soft);
	text-align: left;
	vertical-align: top;
}

:where(.prose, .editor-styles-wrapper) :where(thead th) {
	border-bottom-color: currentColor;
}

:where(.prose, .editor-styles-wrapper) :where(img, iframe, video) {
	max-width: 100%;
	height: auto;
}

/* Punchlines (D24). */
:where(.prose, .editor-styles-wrapper) :where(blockquote, .wp-block-quote) {
	margin: 56px 0;
	padding: 0;
	border: 0;
	text-align: center;
}

:where(.prose, .editor-styles-wrapper) :where(blockquote, .wp-block-quote)::before {
	content: "◆◇◆";
	display: block;
	margin: 0 0 22px;
	font-size: 10px;
	letter-spacing: 10px;
	text-indent: 10px; /* balance the space letter-spacing adds after the last glyph */
	line-height: 1;
	color: var(--fe-accent);
	/* The hairlines either side of the ornament. */
	background:
		linear-gradient(var(--fe-line-soft), var(--fe-line-soft)) calc(50% - 76px) center / 64px 1px no-repeat,
		linear-gradient(var(--fe-line-soft), var(--fe-line-soft)) calc(50% + 76px) center / 64px 1px no-repeat;
}

:where(.prose, .editor-styles-wrapper) :where(blockquote, .wp-block-quote) :where(p) {
	margin: 0 0 10px;
	font-family: var(--fe-font-serif);
	font-size: 1.9375rem;
	font-style: normal;
	line-height: 1.38;
	color: var(--fe-primary);
}

:where(.prose, .editor-styles-wrapper) :where(blockquote, .wp-block-quote) :where(p:last-of-type) {
	margin-bottom: 0;
}

/*
 * Core's layout rule (:root :where(.is-layout-flow) > *, specificity 0,1,0)
 * would set 24px between the lines of a punchline; this keeps the design's 10px.
 */
.prose .wp-block-quote > p,
.editor-styles-wrapper .wp-block-quote > p {
	margin-block: 0 10px;
}

.prose .wp-block-quote > p:last-child,
.editor-styles-wrapper .wp-block-quote > p:last-child {
	margin-block-end: 0;
}

/* Bold or italic inside a punchline keeps Alice regular (no synthesized weight). */
:where(.prose, .editor-styles-wrapper) :where(blockquote, .wp-block-quote) :where(strong, b, em, i) {
	font-weight: 400;
	font-style: normal;
	font-synthesis: none;
}

:where(.prose, .editor-styles-wrapper) :where(blockquote, .wp-block-quote) :where(cite) {
	display: block;
	margin-top: 14px;
	font-family: var(--fe-font-sans);
	font-size: 0.875rem;
	font-style: normal;
	color: var(--fe-muted);
}

@media (max-width: 560px) {
	:where(.prose, .editor-styles-wrapper) :where(blockquote, .wp-block-quote) :where(p) {
		font-size: 1.5rem;
	}
}
