/* Typography for page text rendered by Wikisource (MediaWiki parser output). */

.page-text {
	font-family: var(--read-font, var(--font-serif));
	font-size: var(--read-size, 19px);
	line-height: 1.65;
	overflow-wrap: break-word;
	hyphens: auto;
	-webkit-hyphens: auto;
	font-variant-numeric: oldstyle-nums proportional-nums;
	color: var(--text);
}

@media (min-width: 640px) {
	.page-text p { text-align: justify; }
}

.page-text p { margin: 0 0 0.85em; }
.page-text h1, .page-text h2, .page-text h3, .page-text h4 {
	font-weight: 600;
	line-height: 1.25;
	margin: 1.2em 0 0.6em;
	border: 0;
}
.page-text h1 { font-size: 1.6em; }
.page-text h2 { font-size: 1.35em; }
.page-text h3 { font-size: 1.15em; }
.page-text a { color: var(--accent); }
.page-text a.new { color: var(--q1); }
.page-text img { max-width: 100%; height: auto; }
.page-text hr { border: 0; border-top: 1px solid var(--border); margin: 1.5em auto; width: 40%; }
.page-text blockquote { margin: 1em 1.5em; }
.page-text table { max-width: 100%; border-collapse: collapse; }
.page-text .mw-parser-output { overflow-x: auto; }
.page-text dl { margin: 0 0 0.85em; }
.page-text dd { margin-left: 1.6em; }
.page-text ul, .page-text ol { padding-left: 1.6em; }

.page-text .center, .page-text .wst-center { text-align: center; }
/* Their paragraphs would otherwise be justified by the rule above. */
.page-text .center p, .page-text .wst-center p { text-align: center; }
.page-text .center table, .page-text .wst-center table { margin-left: auto; margin-right: auto; }
.page-text .smallcaps, .page-text .wst-sc { font-variant: small-caps; }
.page-text .poem, .page-text .wst-poem { margin: 0 0 0.85em 1.5em; text-align: left; }
.page-text .poem p { margin: 0; text-align: left; }
.page-text .mw-poem-indented { display: inline-block; }

.page-text sup.reference { font-size: 0.7em; line-height: 0; }
.page-text .mw-references-wrap, .page-text ol.references {
	font-size: 0.85em;
	line-height: 1.5;
	margin-top: 1em;
	padding-top: 0.6em;
	border-top: 1px solid var(--border);
}
.page-text .mw-cite-backlink { display: none; }

.page-text .floatleft, .page-text .float-left { float: left; margin: 0 1em 0.5em 0; }
.page-text .floatright, .page-text .float-right { float: right; margin: 0 0 0.5em 1em; }
.page-text .mw-halign-left { float: left; margin: 0.3em 1em 0.5em 0; }
.page-text .mw-halign-right { float: right; margin: 0.3em 0 0.5em 1em; }
.page-text .mw-halign-center, .page-text .mw-halign-center > * { margin-left: auto; margin-right: auto; display: table; }
.page-text figure { margin: 1em auto; max-width: 100%; }
.page-text figcaption, .page-text .thumbcaption { font-size: 0.85em; color: var(--muted); text-align: center; margin-top: 0.3em; }
.page-text .tright { float: right; margin: 0.3em 0 0.5em 1em; }
.page-text .tleft { float: left; margin: 0.3em 1em 0.5em 0; }
.page-text .thumbinner { max-width: 100%; }

/* Sidenotes ({{left sidenote}}, {{right sidenote}}): Wikisource hangs them in 11em margins (inline
   padding on the container), which leaves no room in a reading column, let alone on a phone.
   Inset them into the text instead. */
.page-text :is(.wst-sidenote-container, ._sidenote_container) {
	padding-left: 0 !important;
	padding-right: 0 !important;
}
.page-text :is(.wst-sidenote-left, .wst-sidenote-right) {
	float: left !important;
	clear: left !important;
	width: 8em !important;
	margin: 0.3em 1em 0.5em 0 !important;
	padding: 0 !important;
	font-size: 0.8em;
	line-height: 1.35;
	text-align: left;
	color: var(--muted);
}
.page-text .wst-sidenote-right {
	float: right !important;
	clear: right !important;
	margin: 0.3em 0 0.5em 1em !important;
}
@media (max-width: 600px) {
	.page-text :is(.wst-sidenote-left, .wst-sidenote-right) {
		float: none !important;
		display: block !important;
		width: auto !important;
		margin: 0 0 0.4em !important;
	}
}

/* Abbreviation expansions, appended in lib/wiki.js, are editorial aids rather than printed text. */
.page-text .b2s-abbr {
	font-size: 0.8em;
	color: var(--muted);
}

/* Large inline indents (marked in lib/wiki.js) leave no room on a phone. */
@media (max-width: 600px) {
	.page-text .b2s-wide-indent {
		padding-left: 0 !important;
		padding-right: 0 !important;
		margin-left: 0 !important;
		margin-right: 0 !important;
	}
}

/* Fixed widths set by templates must not exceed the column. */
.page-text [style*="width"] { max-width: 100%; }

/* Running headers and footers, hidden unless the reader asks for them. */
.hide-headers .page-text :is(.wst-rh, .__rh, .running-header, .runningheader, .rh, .ws-rh, .wst-running-header, .ws-pagenum, .pagenum, .ws-header, .__header, [id='bstand'], [id='zitierhilfe']) {
	display: none !important;
}

/* In dark mode, neutralise hard-coded colours from templates. */
[data-theme='dark'] .page-text *:not(a):not(img) {
	color: inherit !important;
	background-color: transparent !important;
	border-color: var(--border) !important;
}
[data-theme='dark'] .page-text img { filter: brightness(0.9); }
[data-theme='sepia'] .page-text *:not(img) { background-color: transparent !important; }

/* Search hits, via the CSS Custom Highlight API */
::highlight(b2s-search) { background-color: #ffd54a; color: #1d1b18; }
::highlight(b2s-speech) { background-color: color-mix(in srgb, var(--accent) 22%, transparent); }
