/*
 * Running text: article body, page bodies and the post editor (loaded there as an editor style,
 * where the blocks sit in .is-root-container). Colours come straight from the theme.json presets
 * because the editor does not load main.css.
 */

:is(.prose, .is-root-container) {
	max-width: 720px;
	text-wrap: pretty;
}

/*
 * Running text keeps about 73 characters per line (measured on Polish copy); headings, images and
 * tables use the full column. In em rather than ch: "ch" is the zero's width, much wider than
 * average Polish text.
 */
:is(.prose, .is-root-container) :is(p, ul, ol, blockquote) {
	max-width: 36em;
}

:is(.prose, .is-root-container) > :first-child {
	margin-top: 0;
}

:is(.prose, .is-root-container) > :last-child {
	margin-bottom: 0;
}

:is(.prose, .is-root-container) :is(p, ul, ol, blockquote, figure, table) {
	margin-block: 0 1.25em;
}

/* More room above a heading than below it, so it reads as the start of the next section. */
:is(.prose, .is-root-container) h2 {
	margin: 2.25em 0 0.6em;
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.25;
	letter-spacing: -0.015em;
	scroll-margin-top: calc(84px + 1.5rem);
}

:is(.prose, .is-root-container) h3 {
	margin: 1.75em 0 0.5em;
	font-size: 1.1875rem;
	line-height: 1.35;
	scroll-margin-top: calc(84px + 1.5rem);
}

:is(.prose, .is-root-container) :is(h2, h3) + :is(h2, h3) {
	margin-top: 0;
}

:is(.prose, .is-root-container) strong {
	font-weight: 600;
	color: var(--wp--preset--color--indigo);
}

:is(.prose, .is-root-container) a {
	color: var(--wp--preset--color--brass);
	text-decoration: underline;
	text-decoration-color: rgb(138 92 34 / 0.35);
	text-underline-offset: 0.2em;
}

:is(.prose, .is-root-container) a:hover {
	text-decoration-color: currentColor;
}

:is(.prose, .is-root-container) :is(ul, ol) {
	padding-left: 1.5em;
}

:is(.prose, .is-root-container) li {
	margin-bottom: 0.5em;
	padding-left: 0.35em;
}

:is(.prose, .is-root-container) li::marker {
	color: var(--wp--preset--color--brass);
}

:is(.prose, .is-root-container) ol li::marker {
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}

/* Two-digit markers need more room, or they stick out left of the text column. */
:is(.prose, .is-root-container) ol:has(> li:nth-child(10)) {
	padding-left: 2.1em;
}

/* Lettered sub-points of a numbered legal text, written "a)" as is usual in Polish documents. */
@counter-style kz-lower-alpha-paren {
	system: extends lower-alpha;
	suffix: ") ";
}

:is(.prose, .is-root-container) li > ol[type="a"] {
	margin-block: 0.5em 0;
	list-style-type: kz-lower-alpha-paren;
}

/* Quote: a 2px brass piping, the accent shared with the hero gold. */
:is(.prose, .is-root-container) blockquote {
	margin-inline: 0;
	padding: 0.25em 0 0.25em 1.5rem;
	border-left: 2px solid var(--wp--preset--color--brass);
	font-size: 1.1875rem;
	line-height: 1.6;
	color: var(--wp--preset--color--indigo);
}

:is(.prose, .is-root-container) blockquote p {
	margin-bottom: 0.5em;
}

:is(.prose, .is-root-container) blockquote cite {
	display: block;
	font-size: 0.9375rem;
	font-style: normal;
	font-weight: 600;
}

:is(.prose, .is-root-container) img {
	border-radius: 4px;
}

:is(.prose, .is-root-container) figcaption {
	margin-top: 0.75em;
	font-size: 0.875rem;
	line-height: 1.5;
	color: var(--wp--preset--color--muted);
	text-align: left;
}

:is(.prose, .is-root-container) hr {
	width: 2.5rem;
	margin: 2.5em 0;
	border: 0;
	border-top: 2px solid var(--wp--preset--color--brass);
}

:is(.prose, .is-root-container) .wp-block-table {
	overflow-x: auto;
}

:is(.prose, .is-root-container) table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.9375rem;
	line-height: 1.5;
	font-variant-numeric: tabular-nums;
}

:is(.prose, .is-root-container) :is(th, td) {
	padding: 0.75em 1em 0.75em 0;
	border: 0;
	border-bottom: 1px solid var(--wp--preset--color--line);
	text-align: left;
	vertical-align: top;
}

:is(.prose, .is-root-container) thead th {
	border-bottom-color: var(--wp--preset--color--indigo);
	font-weight: 600;
	color: var(--wp--preset--color--indigo);
}
