/*
 * BlogMagazin – E-Reader (Vorlage „Buchtext“, pagebooktext.php, Skript assets/js/reader.js).
 *
 * Eigenes, vollständiges Stylesheet: Im Leser wird das Blog-CSS nicht geladen.
 * Ohne Skript: eine ruhige, lange Leseseite. Mit Skript (html.bmr-on): Seiten zum Blättern
 * (CSS-Spalten, je Kapitel) oder Scrollen, Leisten oben und unten, Bereiche für Inhalt, Suche,
 * Darstellung und Vorlesen.
 */

/* --- Schriften (dieselben Dateien wie das Theme) ------------------------------------------- */

@font-face {
	font-family: "Literata";
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url("../fonts/literata-latin-400.woff2") format("woff2");
	unicode-range: U+0020-007E, U+00A0-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2009-200A, U+2010-2015, U+2018-201E, U+2020-2022, U+2026, U+2030, U+2032-2033, U+2039-203A, U+20AC, U+2122, U+2190-2193, U+2212, U+FFFD;
}

@font-face {
	font-family: "Literata";
	font-style: normal;
	font-weight: 700;
	font-display: swap;
	src: url("../fonts/literata-latin-700.woff2") format("woff2");
	unicode-range: U+0020-007E, U+00A0-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2009-200A, U+2010-2015, U+2018-201E, U+2020-2022, U+2026, U+2030, U+2032-2033, U+2039-203A, U+20AC, U+2122, U+2190-2193, U+2212, U+FFFD;
}

@font-face {
	font-family: "Literata";
	font-style: italic;
	font-weight: 400;
	font-display: swap;
	src: url("../fonts/literata-latin-400-italic.woff2") format("woff2");
	unicode-range: U+0020-007E, U+00A0-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2009-200A, U+2010-2015, U+2018-201E, U+2020-2022, U+2026, U+2030, U+2032-2033, U+2039-203A, U+20AC, U+2122, U+2190-2193, U+2212, U+FFFD;
}

/* Latein-Erweiterung: gleiche Deskriptoren wie oben (400 / 700 / 400 kursiv), sonst kombiniert der Browser die Dateien nicht. */
@font-face {
	font-family: "Literata";
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url("../fonts/literata-latin-ext-wght-normal.woff2") format("woff2");
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
	font-family: "Literata";
	font-style: normal;
	font-weight: 700;
	font-display: swap;
	src: url("../fonts/literata-latin-ext-wght-normal.woff2") format("woff2");
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
	font-family: "Literata";
	font-style: italic;
	font-weight: 400;
	font-display: swap;
	src: url("../fonts/literata-latin-ext-wght-italic.woff2") format("woff2");
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
	font-family: "Schibsted Grotesk";
	font-style: normal;
	font-weight: 400 900;
	font-display: swap;
	src: url("../fonts/schibsted-grotesk-latin.woff2") format("woff2");
	unicode-range: U+0020-007E, U+00A0-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2009-200A, U+2010-2015, U+2018-201E, U+2020-2022, U+2026, U+2030, U+2032-2033, U+2039-203A, U+20AC, U+2122, U+2190-2193, U+2212, U+FFFD;
}

@font-face {
	font-family: "Schibsted Grotesk";
	font-style: normal;
	font-weight: 400 900;
	font-display: swap;
	src: url("../fonts/schibsted-grotesk-latin-ext-wght-normal.woff2") format("woff2");
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* --- Farben und Maße --------------------------------------------------------------------- */

:root {
	--bmr-size: 20px;
	--bmr-lh: 1.6;
	--bmr-serif: "Literata", Georgia, "Noto Serif", serif;
	--bmr-sans: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
	--bmr-font: var(--bmr-serif);
	--bmr-ui: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

	/* Seitenränder: oben und unten liegen die Leisten im Rand, der Text springt nie. */
	--bmr-top: 3.5rem;
	--bmr-bottom: 3rem;
	--bmr-pad: clamp(1.25rem, 5vw, 4rem);

	--bmr-bg: #fbfaf7;
	--bmr-ink: #1d1e22;
	--bmr-soft: #6c6f78;
	--bmr-line: #e6e2d9;
	--bmr-panel: #ffffff;
	--bmr-chrome: rgba(251, 250, 247, 0.88);
	--bmr-hover: rgba(29, 30, 34, 0.06);
	--bmr-link: #2340b5;
	--bmr-marker: #ffe45c;
	--bmr-marker-ink: #1b1d22;
	--bmr-hit: rgba(255, 214, 10, 0.55);
	--bmr-speak: rgba(35, 64, 181, 0.14);
	--bmr-shadow: 0 1px 2px rgba(20, 20, 30, 0.06), 0 12px 40px rgba(20, 20, 30, 0.14);
	color-scheme: light;
}

:root[data-bmr-theme="sepia"] {
	--bmr-bg: #f4ecd9;
	--bmr-ink: #3f3122;
	--bmr-soft: #85735b;
	--bmr-line: #e2d4b6;
	--bmr-panel: #fbf5e6;
	--bmr-chrome: rgba(244, 236, 217, 0.9);
	--bmr-hover: rgba(63, 49, 34, 0.07);
	--bmr-link: #8a4b0f;
	--bmr-hit: rgba(230, 170, 30, 0.45);
	--bmr-speak: rgba(138, 75, 15, 0.14);
}

:root[data-bmr-theme="dark"] {
	--bmr-bg: #15161a;
	--bmr-ink: #dcd9d2;
	--bmr-soft: #8d909a;
	--bmr-line: #2b2d34;
	--bmr-panel: #1f2026;
	--bmr-chrome: rgba(21, 22, 26, 0.88);
	--bmr-hover: rgba(255, 255, 255, 0.07);
	--bmr-link: #a6b7ff;
	--bmr-marker: #f0d84a;
	--bmr-marker-ink: #14161b;
	--bmr-hit: rgba(240, 216, 74, 0.35);
	--bmr-speak: rgba(166, 183, 255, 0.16);
	--bmr-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 16px 48px rgba(0, 0, 0, 0.5);
	color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
	:root[data-bmr-theme="auto"] {
		--bmr-bg: #15161a;
		--bmr-ink: #dcd9d2;
		--bmr-soft: #8d909a;
		--bmr-line: #2b2d34;
		--bmr-panel: #1f2026;
		--bmr-chrome: rgba(21, 22, 26, 0.88);
		--bmr-hover: rgba(255, 255, 255, 0.07);
		--bmr-link: #a6b7ff;
		--bmr-marker: #f0d84a;
		--bmr-marker-ink: #14161b;
		--bmr-hit: rgba(240, 216, 74, 0.35);
		--bmr-speak: rgba(166, 183, 255, 0.16);
		--bmr-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 16px 48px rgba(0, 0, 0, 0.5);
		color-scheme: dark;
	}
}

:root[data-bmr-font="sans"] {
	--bmr-font: var(--bmr-sans);
}

@media (max-width: 599px) {
	:root {
		--bmr-size: 18px;
		--bmr-top: 3.25rem;
		--bmr-bottom: 2.75rem;
	}

	/* Schmal: nur das Kapitel in der Leiste (im Vorspann der Buchtitel), etwas kleinere Knöpfe. */
	.bmr-booktitle {
		display: none;
	}

	.bmr-heading:has(.bmr-chaptertitle:empty) .bmr-booktitle {
		display: block;
		color: var(--bmr-ink);
		font-size: 0.8125rem;
		letter-spacing: 0.04em;
	}

	.bmr-top .bmr-btn {
		width: 2.375rem;
	}

	.bmr-heading {
		padding: 0 0.25rem;
		text-align: left;
	}
}

/* --- Grundlagen -------------------------------------------------------------------------- */

*,
*::before,
*::after {
	box-sizing: border-box;
}

html,
body {
	margin: 0;
	padding: 0;
	background: var(--bmr-bg);
	color: var(--bmr-ink);
}

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

body {
	font-family: var(--bmr-ui);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	white-space: nowrap;
}

button {
	font: inherit;
	color: inherit;
}

.icon {
	width: 1.25rem;
	height: 1.25rem;
	flex: none;
}

/* Bis das Skript die Seiten aufgebaut hat: nichts zeigen, was gleich wieder springt. */
.bmr-js:not(.bmr-ready) .bmr-flow {
	visibility: hidden;
}

/* --- Buchtext ---------------------------------------------------------------------------- */

.bmr-stage {
	padding: var(--bmr-top) var(--bmr-pad) var(--bmr-bottom);
}

.bmr-flow {
	max-width: 36em;
	margin: 0 auto;
	font-family: var(--bmr-font);
	font-size: var(--bmr-size);
	line-height: var(--bmr-lh);
	font-kerning: normal;
	font-variant-ligatures: common-ligatures;
	font-optical-sizing: auto;
	hyphens: auto;
	-webkit-hyphens: auto;
	hyphenate-limit-chars: 6 3 2;
	overflow-wrap: break-word;
	orphans: 2;
	widows: 2;
}

:root[data-bmr-align="justify"] .bmr-flow :is(p, li, blockquote) {
	text-align: justify;
}

.bmr-flow p {
	margin: 0;
}

.bmr-section > :last-child {
	margin-bottom: 0;
}

/* Wie im gedruckten Buch: Absätze mit Einzug, ohne Leerzeile. */
.bmr-flow p + p {
	text-indent: 1.4em;
}

.bmr-flow :is(p.has-text-align-center, p.has-text-align-right, p.bmr-break, p.bm-title, p.bm-subtitle, p.bm-caption) {
	text-indent: 0;
}

/* Aus Word: Titel und Untertitel (Formatvorlagen „Titel“, „Untertitel“), Beschriftungen, Kapitälchen. */
.bmr-flow p.bm-title {
	margin: 0 0 0.35em;
	font-size: 2em;
	font-weight: 700;
	line-height: 1.12;
	letter-spacing: -0.015em;
	text-align: center !important;
	text-wrap: balance;
	hyphens: manual;
	-webkit-hyphens: manual;
}

.bmr-flow p.bm-subtitle {
	margin: 0 0 1.6em;
	color: var(--bmr-soft);
	font-size: 1.15em;
	font-style: italic;
	line-height: 1.35;
	text-align: center !important;
	text-wrap: balance;
	hyphens: manual;
	-webkit-hyphens: manual;
}

.bmr-flow p.bm-caption {
	margin: 0.4em 0 1.1em;
	color: var(--bmr-soft);
	font-family: var(--bmr-ui);
	font-size: 0.75em;
	line-height: 1.4;
	text-align: center !important;
	hyphens: manual;
}

.bmr-flow :is(p.bm-title, p.bm-subtitle, p.bm-caption) + p {
	text-indent: 0;
}

.bmr-flow .bm-sc {
	font-variant-caps: small-caps;
	letter-spacing: 0.03em;
}

.bmr-flow .has-text-align-center {
	text-align: center !important;
}

.bmr-flow .has-text-align-right {
	text-align: right !important;
}

.bmr-flow h1,
.bmr-flow h2,
.bmr-flow h3,
.bmr-flow h4,
.bmr-flow h5,
.bmr-flow h6 {
	font-family: var(--bmr-font);
	hyphens: manual;
	-webkit-hyphens: manual;
	text-align: left;
	text-wrap: balance;
	break-after: avoid;
	page-break-after: avoid;
}

.bmr-flow .bmr-chapter-title {
	margin: 0 0 1.1em;
	padding-top: 3em;
	font-size: 1.65em;
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: -0.012em;
}

/* Signatur des Blogs: ein kurzer Strich Textmarker-Gelb über jedem Kapitel. */
.bmr-flow .bmr-chapter-title::before {
	content: "";
	display: block;
	width: 2em;
	height: 0.2em;
	margin-bottom: 0.85em;
	border-radius: 1px;
	background: var(--bmr-marker);
}

.bmr-flow h1:not(.bmr-chapter-title) {
	margin: 1.5em 0 0.75em;
	font-size: 1.5em;
	line-height: 1.2;
}

.bmr-flow h3 {
	margin: 1.6em 0 0.6em;
	font-size: 1.15em;
	font-weight: 700;
	line-height: 1.3;
}

.bmr-flow h4,
.bmr-flow h5,
.bmr-flow h6 {
	margin: 1.4em 0 0.5em;
	font-size: 1em;
	font-weight: 700;
	font-style: italic;
	line-height: 1.4;
}

.bmr-flow :is(h1, h2, h3, h4, h5, h6) + * {
	text-indent: 0;
}

.bmr-flow blockquote {
	margin: 1em 0 1em 1.25em;
	padding: 0;
	border: 0;
}

.bmr-flow blockquote p + p {
	text-indent: 0;
	margin-top: 0.5em;
}

.bmr-flow blockquote cite {
	display: block;
	margin-top: 0.4em;
	color: var(--bmr-soft);
	font-size: 0.85em;
	font-style: normal;
}

.bmr-flow :is(ul, ol) {
	margin: 0.75em 0;
	padding-left: 1.4em;
}

.bmr-flow li + li {
	margin-top: 0.25em;
}

.bmr-flow :is(blockquote, ul, ol, figure, table, hr, .wp-block-image, .bmr-break, pre, .wp-block-table) + p {
	text-indent: 0;
}

.bmr-flow :is(figure, .wp-block-image) {
	margin: 1.25em 0;
	text-align: center;
	break-inside: avoid;
	page-break-inside: avoid;
}

.bmr-flow img {
	display: inline-block;
	max-width: 100%;
	height: auto;
	vertical-align: top;
	/* Ein Bild passt immer auf eine Seite. */
	max-height: calc(var(--bmr-page-h, 85vh) - 4em);
	width: auto;
	object-fit: contain;
}

.bmr-flow figcaption,
.bmr-flow .wp-element-caption {
	margin-top: 0.5em;
	color: var(--bmr-soft);
	font-family: var(--bmr-ui);
	font-size: 0.75em;
	line-height: 1.4;
	text-align: center;
	text-indent: 0;
	hyphens: manual;
}

.bmr-flow table {
	display: block;
	max-width: 100%;
	overflow-x: auto;
	margin: 1em 0;
	border-collapse: collapse;
	font-size: 0.85em;
	line-height: 1.45;
	hyphens: manual;
	break-inside: avoid;
}

.bmr-flow :is(td, th) {
	padding: 0.35em 0.75em 0.35em 0;
	border-bottom: 1px solid var(--bmr-line);
	text-align: left;
	vertical-align: top;
}

.bmr-flow .wp-block-table {
	margin: 1em 0;
}

.bmr-flow .wp-block-table :is(td, th),
.bmr-flow .wp-block-table thead {
	border-width: 0 0 1px;
	border-style: solid;
	border-color: var(--bmr-line);
}

.bmr-flow .wp-block-table thead th {
	border-bottom: 2px solid var(--bmr-ink);
}

/* Schriftgrößen aus dem Editor – relativ zur gewählten Lesegröße. */
.bmr-flow .has-small-font-size {
	font-size: 0.85em !important;
}

.bmr-flow .has-regular-font-size,
.bmr-flow .has-normal-font-size {
	font-size: 1em !important;
}

.bmr-flow .has-large-font-size {
	font-size: 1.3em !important;
	line-height: 1.3;
}

.bmr-flow .has-larger-font-size,
.bmr-flow .has-x-large-font-size,
.bmr-flow .has-huge-font-size {
	font-size: 1.9em !important;
	line-height: 1.15;
}

/* Kurzer Vorspann (Titelei, Widmung, Impressum): mittig und mit Luft, wie im Buch. */
.bmr-front.is-short {
	padding-top: 12vh;
	text-align: center;
}

.bmr-front.is-short p {
	margin: 0 0 1.1em;
	text-align: center !important;
	text-indent: 0;
	hyphens: manual;
	text-wrap: balance;
}

.bmr-on[data-bmr-mode="paged"] .bmr-front.is-short {
	padding-top: calc(var(--bmr-page-h, 600px) * 0.16);
}

.bmr-flow pre,
.bmr-flow code {
	font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
	font-size: 0.85em;
}

.bmr-flow pre {
	white-space: pre-wrap;
	hyphens: none;
}

/* Szenenwechsel: Trennlinie oder ein Absatz aus „* * *“. */
.bmr-flow hr,
.bmr-flow .wp-block-separator {
	height: auto;
	margin: 1.25em 0;
	border: 0;
	background: none;
	text-align: center;
	break-after: avoid;
}

.bmr-flow hr::before {
	content: "* \2002 * \2002 *";
	color: var(--bmr-soft);
	font-family: var(--bmr-font);
	line-height: 1;
}

.bmr-flow p.bmr-break {
	margin: 1.25em 0;
	color: var(--bmr-soft);
	letter-spacing: 0.5em;
	text-align: center !important;
}

.bmr-flow a {
	color: var(--bmr-link);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.15em;
}

.bmr-flow sup {
	line-height: 0;
}

/* Fußnotenzeichen: klein, gut zu treffen. */
.bmr-flow sup.fn a,
.bmr-flow a.bmr-fnref {
	display: inline-block;
	/* Großzügige Trefferfläche, ohne den Satz auseinanderzuschieben. */
	padding: 0.35em 0.3em;
	margin: -0.35em -0.3em -0.35em -0.1em;
	color: var(--bmr-link);
	font-family: var(--bmr-ui);
	font-size: 0.68em;
	font-weight: 700;
	line-height: 1;
	text-decoration: none;
	text-indent: 0;
	vertical-align: 0.15em;
}

.bmr-notes .bmr-notelist {
	padding-left: 1.6em;
	font-size: 0.9em;
}

.bmr-notes .bmr-notelist li {
	margin: 0 0 0.6em;
	text-indent: 0;
}

.bmr-notes .bmr-notelist p {
	display: inline;
}

.bmr-backref {
	text-decoration: none;
}

.bmr-flow ::selection {
	background: color-mix(in srgb, var(--bmr-marker) 70%, transparent);
	color: inherit;
}

/* Suchtreffer und vorgelesener Satz (CSS Custom Highlight API bzw. <mark> als Ersatz). */
::highlight(bmr-hit) {
	background-color: var(--bmr-hit);
}

::highlight(bmr-speak) {
	background-color: var(--bmr-speak);
}

mark.bmr-hit {
	background: var(--bmr-hit);
	color: inherit;
}

mark.bmr-speak {
	background: var(--bmr-speak);
	color: inherit;
}

/* Ende des Buches bzw. der Leseprobe */
.bmr-end {
	text-align: center;
}

.bmr-end-inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 60vh;
	padding: 2em 0;
	break-inside: avoid;
}

.bmr-end-cover {
	width: auto;
	max-width: 9em !important;
	max-height: 13em !important;
	margin-bottom: 1.5em;
	border-radius: 2px;
	box-shadow: var(--bmr-shadow);
}

.bmr-end-kicker {
	margin: 0 0 0.5em !important;
	color: var(--bmr-soft);
	font-family: var(--bmr-ui);
	font-size: 0.75em;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-indent: 0 !important;
	text-transform: uppercase;
}

.bmr-end-title {
	max-width: 16em;
	margin: 0 0 1.25em !important;
	font-size: 1.4em;
	font-weight: 700;
	line-height: 1.2;
	text-align: center !important;
	text-indent: 0 !important;
	hyphens: manual;
	text-wrap: balance;
}

.bmr-end-links {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.5em;
	margin: 0 0 1.25em !important;
	text-indent: 0 !important;
}

.bmr-pill {
	display: inline-flex;
	align-items: center;
	min-height: 2.75rem;
	padding: 0.55rem 1.1rem;
	border: 1px solid var(--bmr-line);
	border-radius: 0;
	color: var(--bmr-ink) !important;
	font-family: var(--bmr-ui);
	font-size: 0.9375rem;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none !important;
}

.bmr-pill:hover,
.bmr-pill:focus-visible {
	border-color: var(--bmr-ink);
}

.bmr-pill.is-primary {
	border-color: var(--bmr-marker);
	background: var(--bmr-marker);
	color: var(--bmr-marker-ink) !important;
}

.bmr-pill.is-primary:hover,
.bmr-pill.is-primary:focus-visible {
	border-color: var(--bmr-ink);
}

.bmr-end-back {
	margin: 0 !important;
	font-family: var(--bmr-ui);
	font-size: 0.875rem;
	text-indent: 0 !important;
}

.bmr-end-back a {
	color: var(--bmr-soft);
}

.bmr-locked input[type="password"] {
	padding: 0.5rem;
	font: inherit;
}

/* --- Leisten ----------------------------------------------------------------------------- */

.bmr-top {
	position: fixed;
	top: 0;
	right: 0;
	left: 0;
	z-index: 30;
	display: flex;
	align-items: center;
	gap: 0.25rem;
	height: calc(var(--bmr-top) + env(safe-area-inset-top));
	padding: env(safe-area-inset-top) max(0.5rem, env(safe-area-inset-right)) 0 max(0.5rem, env(safe-area-inset-left));
	background: var(--bmr-chrome);
	-webkit-backdrop-filter: blur(14px) saturate(1.3);
	backdrop-filter: blur(14px) saturate(1.3);
	font-family: var(--bmr-ui);
	transition: opacity 0.25s ease, transform 0.25s ease;
}

.bmr-heading {
	flex: 1;
	min-width: 0;
	padding: 0 0.5rem;
	line-height: 1.2;
	text-align: center;
}

.bmr-booktitle,
.bmr-chaptertitle {
	display: block;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.bmr-booktitle {
	color: var(--bmr-soft);
	font-size: 0.6875rem;
	font-weight: 700;
	letter-spacing: 0.07em;
	text-transform: uppercase;
}

.bmr-chaptertitle {
	font-size: 0.875rem;
	font-weight: 600;
}

.bmr-chaptertitle:empty {
	display: none;
}

.bmr-tools {
	display: flex;
	gap: 0.125rem;
}

.bmr-tools[hidden] {
	display: none;
}

.bmr-btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	height: 2.5rem;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: var(--bmr-ink);
	text-decoration: none;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.bmr-btn:hover {
	background: var(--bmr-hover);
}

.bmr-btn:focus-visible,
.bmr-pill:focus-visible,
.bmr-seg button:focus-visible,
.bmr-list-btn:focus-visible {
	outline: 2px solid var(--bmr-link);
	outline-offset: 1px;
}

.bmr-btn[aria-expanded="true"],
.bmr-btn[aria-pressed="true"] {
	background: var(--bmr-hover);
}

.bmr-btn[hidden] {
	display: none;
}

.bmr-aa {
	font-family: var(--bmr-serif);
	font-size: 1.0625rem;
	font-weight: 700;
	letter-spacing: -0.02em;
}

.bmr-bookmark[aria-pressed="true"] .icon {
	fill: var(--bmr-marker);
	stroke: var(--bmr-ink);
}

/* Ohne Skript: nur der Zurück-Pfeil, Leiste im Fluss. */
html:not(.bmr-on) .bmr-top {
	position: sticky;
}

.bmr-foot {
	position: fixed;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 20;
	height: calc(var(--bmr-bottom) + env(safe-area-inset-bottom));
	padding: 0 var(--bmr-pad) env(safe-area-inset-bottom);
	font-family: var(--bmr-ui);
	font-size: 0.75rem;
	color: var(--bmr-soft);
	pointer-events: none;
}

.bmr-foot[hidden] {
	display: none;
}

.bmr-foot-inner {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 0.45rem;
	width: var(--bmr-w, 100%);
	max-width: 100%;
	height: 100%;
	margin: 0 auto;
}

/* Bündig mit dem Text – auch wenn er links oder rechts steht. */
.bmr-on .bmr-foot-inner {
	position: absolute;
	top: 0;
	left: var(--bmr-flow-l, var(--bmr-pad));
	height: calc(100% - env(safe-area-inset-bottom));
	margin: 0;
}

.bmr-progress {
	height: 2px;
	border-radius: 2px;
	background: var(--bmr-line);
	overflow: hidden;
}

.bmr-progress span {
	display: block;
	width: 100%;
	height: 100%;
	background: var(--bmr-soft);
	transform: scaleX(var(--bmr-pct, 0));
	transform-origin: left center;
	transition: transform 0.3s ease;
}

.bmr-status {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	white-space: nowrap;
}

.bmr-status span {
	overflow: hidden;
	text-overflow: ellipsis;
}

#bmr-left {
	flex: none;
	font-variant-numeric: tabular-nums;
}

.bmr.is-chrome-hidden .bmr-top {
	opacity: 0;
	transform: translateY(-0.5rem);
	pointer-events: none;
}

.bmr.is-chrome-hidden .bmr-progress span {
	background: color-mix(in srgb, var(--bmr-soft) 70%, transparent);
}

/* --- Seiten (Blättern) ------------------------------------------------------------------- */

.bmr-on body {
	overflow: hidden;
}

.bmr-on .bmr-stage {
	position: fixed;
	inset: 0;
	padding: calc(var(--bmr-top) + env(safe-area-inset-top)) max(var(--bmr-pad), env(safe-area-inset-right)) calc(var(--bmr-bottom) + env(safe-area-inset-bottom)) max(var(--bmr-pad), env(safe-area-inset-left));
}

.bmr-on[data-bmr-mode="paged"] .bmr-stage {
	overflow: hidden;
	touch-action: pan-y pinch-zoom;
	user-select: text;
}

.bmr-on[data-bmr-mode="paged"] .bmr-flow {
	position: relative;
	width: var(--bmr-w, 100%);
	max-width: none;
	height: 100%;
	margin: 0 auto;
	/* Nur die sichtbare Seite zeigen; ein Hauch Rand für Kursives und Akzente. */
	overflow: hidden;
	overflow: clip;
	overflow-clip-margin: 0.6em;
}

.bmr-on[data-bmr-mode="paged"] .bmr-section {
	display: none;
}

.bmr-on[data-bmr-mode="paged"] .bmr-section.is-current {
	display: block;
	width: 100%;
	height: 100%;
	column-width: var(--bmr-col, 30em);
	column-gap: var(--bmr-gap, 4em);
	column-fill: auto;
	transform: translate3d(var(--bmr-x, 0px), 0, 0);
	will-change: transform;
}

.bmr-on[data-bmr-mode="paged"] .bmr-section.is-anim {
	transition: transform 0.34s cubic-bezier(0.22, 0.8, 0.24, 1);
}

.bmr-on[data-bmr-mode="paged"] .bmr-section.is-fade {
	animation: bmr-fade 0.28s ease;
}

@keyframes bmr-fade {
	from {
		opacity: 0;
	}
}

/* Kapitelanfang wie im Buch: mit Luft nach oben. */
.bmr-on[data-bmr-mode="paged"] .bmr-chapter-title {
	padding-top: calc(var(--bmr-page-h, 600px) * 0.14);
}

.bmr-on[data-bmr-mode="paged"] .bmr-end-inner {
	min-height: var(--bmr-page-h, 60vh);
	padding: 0;
	/* Auf der Doppelseite in der Mitte beider Seiten. */
	column-span: all;
}

/* Doppelseite: feiner Falz in der Mitte. */
.bmr-on[data-bmr-mode="paged"] .bmr.is-spread .bmr-flow::after {
	content: "";
	position: absolute;
	top: 6%;
	bottom: 6%;
	left: 50%;
	width: 1px;
	background: linear-gradient(transparent, var(--bmr-line) 20%, var(--bmr-line) 80%, transparent);
	pointer-events: none;
}

/* Pfeile am Rand (Maus) */
.bmr-turn {
	position: fixed;
	top: 50%;
	z-index: 15;
	display: none;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: var(--bmr-soft);
	cursor: pointer;
	transform: translateY(-50%);
	transition: opacity 0.25s ease;
}

.bmr-turn:hover {
	background: var(--bmr-hover);
	color: var(--bmr-ink);
}

.bmr-turn-prev {
	left: max(0.5rem, env(safe-area-inset-left));
}

.bmr-turn-next {
	right: max(0.5rem, env(safe-area-inset-right));
}

@media (hover: hover) and (pointer: fine) {
	.bmr-on[data-bmr-mode="paged"] .bmr-turn {
		display: inline-flex;
	}

	.bmr-on[data-bmr-mode="paged"] .bmr.is-chrome-hidden .bmr-turn {
		opacity: 0;
	}

	.bmr-on[data-bmr-mode="paged"] .bmr-turn:disabled {
		opacity: 0;
		pointer-events: none;
	}
}

/* --- Scrollen ---------------------------------------------------------------------------- */

.bmr-on[data-bmr-mode="scroll"] .bmr-stage {
	overflow-x: hidden;
	overflow-y: auto;
	/* Text läuft unter den Leisten weich aus. */
	-webkit-mask-image: linear-gradient(transparent calc(var(--bmr-top) + env(safe-area-inset-top) - 1.5rem), #000 calc(var(--bmr-top) + env(safe-area-inset-top) - 0.25rem), #000 calc(100% - var(--bmr-bottom) - env(safe-area-inset-bottom) + 0.25rem), transparent calc(100% - var(--bmr-bottom) - env(safe-area-inset-bottom) + 1.25rem));
	mask-image: linear-gradient(transparent calc(var(--bmr-top) + env(safe-area-inset-top) - 1.5rem), #000 calc(var(--bmr-top) + env(safe-area-inset-top) - 0.25rem), #000 calc(100% - var(--bmr-bottom) - env(safe-area-inset-bottom) + 0.25rem), transparent calc(100% - var(--bmr-bottom) - env(safe-area-inset-bottom) + 1.25rem));
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
	scrollbar-gutter: stable;
}

.bmr-on[data-bmr-mode="scroll"] .bmr-flow {
	max-width: var(--bmr-measure, 36em);
	padding-bottom: 20vh;
}

/* Anordnung: Textspalte links oder rechts statt in der Mitte (Blättern und Scrollen). */
.bmr-on[data-bmr-layout="left"] .bmr-flow {
	margin-left: 0;
	margin-right: auto;
}

.bmr-on[data-bmr-layout="right"] .bmr-flow {
	margin-left: auto;
	margin-right: 0;
}

.bmr-on[data-bmr-mode="scroll"] .bmr-section + .bmr-section {
	margin-top: 4em;
}

.bmr-on[data-bmr-mode="scroll"] .bmr-end-inner {
	min-height: 70vh;
}

/* --- Bereiche: Inhalt, Suche, Darstellung, Fußnote, Vorlesen ----------------------------- */

.bmr-scrim {
	position: fixed;
	inset: 0;
	z-index: 40;
	background: rgba(10, 10, 15, 0.28);
	opacity: 0;
	transition: opacity 0.25s ease;
}

.bmr-scrim.is-open {
	opacity: 1;
}

.bmr-scrim[hidden] {
	display: none;
}

.bmr-sheet {
	position: fixed;
	top: 0;
	bottom: 0;
	z-index: 50;
	display: flex;
	flex-direction: column;
	width: min(25rem, 92vw);
	padding-top: env(safe-area-inset-top);
	padding-bottom: env(safe-area-inset-bottom);
	background: var(--bmr-panel);
	box-shadow: var(--bmr-shadow);
	font-family: var(--bmr-ui);
	/* Sichtbar sofort beim Öffnen (sonst kann der Fokus nicht hinein), versteckt erst nach dem Schließen. */
	transition: transform 0.3s cubic-bezier(0.22, 0.8, 0.24, 1), visibility 0s linear 0.3s;
	visibility: hidden;
}

.bmr-sheet.is-left {
	left: 0;
	transform: translateX(-100%);
}

.bmr-sheet.is-right {
	right: 0;
	transform: translateX(100%);
}

.bmr-sheet.is-open {
	transform: none;
	visibility: visible;
	transition-delay: 0s;
}

.bmr-sheet-head {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.75rem 0.75rem 0.5rem 1.25rem;
}

.bmr-sheet-title {
	flex: 1;
	margin: 0;
	font-size: 1.0625rem;
	font-weight: 800;
	letter-spacing: -0.01em;
}

.bmr-sheet-body {
	flex: 1;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 0 0.75rem 1.5rem;
}

.bmr-tabs {
	display: flex;
	gap: 0.25rem;
	margin: 0 0.75rem 0.5rem;
	padding: 0.2rem;
	border-radius: 999px;
	background: var(--bmr-hover);
}

.bmr-tabs button {
	flex: 1;
	min-height: 2.25rem;
	padding: 0 0.75rem;
	border: 0;
	border-radius: 999px;
	background: transparent;
	font-size: 0.875rem;
	font-weight: 700;
	cursor: pointer;
}

.bmr-tabs button[aria-selected="true"] {
	background: var(--bmr-panel);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.bmr-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.bmr-list li {
	display: flex;
	align-items: stretch;
}

.bmr-list-btn {
	display: flex;
	flex: 1;
	gap: 0.75rem;
	align-items: baseline;
	width: 100%;
	min-height: 2.75rem;
	padding: 0.6rem 0.5rem;
	border: 0;
	border-radius: 0.5rem;
	background: transparent;
	color: var(--bmr-ink);
	font-size: 0.9375rem;
	line-height: 1.35;
	text-align: left;
	cursor: pointer;
}

.bmr-list-btn:hover {
	background: var(--bmr-hover);
}

.bmr-list-btn:disabled {
	color: var(--bmr-soft);
	cursor: default;
}

.bmr-list-btn:disabled:hover {
	background: transparent;
}

.bmr-list-num {
	flex: none;
	min-width: 1.6em;
	color: var(--bmr-soft);
	font-size: 0.8125rem;
	font-variant-numeric: tabular-nums;
}

.bmr-list-text {
	flex: 1;
	min-width: 0;
}

.bmr-list-meta {
	flex: none;
	color: var(--bmr-soft);
	font-size: 0.75rem;
}

.bmr-list-btn .icon {
	width: 0.95rem;
	height: 0.95rem;
	align-self: center;
	color: var(--bmr-soft);
}

.bmr-list-btn.is-current {
	background: color-mix(in srgb, var(--bmr-marker) 45%, transparent);
	font-weight: 700;
}

.bmr-list-snip {
	display: block;
	margin-top: 0.15rem;
	color: var(--bmr-soft);
	font-family: var(--bmr-serif);
	font-size: 0.875rem;
}

.bmr-list-snip mark {
	background: var(--bmr-hit);
	color: inherit;
}

.bmr-del {
	flex: none;
	align-self: center;
}

.bmr-empty {
	margin: 1.5rem 0.5rem;
	color: var(--bmr-soft);
	font-size: 0.9375rem;
	line-height: 1.45;
}

.bmr-locked-note {
	margin: 0.75rem 0.5rem 0;
	padding: 0.75rem;
	border-radius: 0.5rem;
	background: var(--bmr-hover);
	font-size: 0.875rem;
	line-height: 1.45;
}

.bmr-locked-note a {
	color: var(--bmr-link);
	font-weight: 700;
}

.bmr-search-form {
	display: flex;
	gap: 0.5rem;
	align-items: center;
	margin: 0 0.75rem 0.5rem;
	padding: 0 0.25rem 0 0.75rem;
	border: 1px solid var(--bmr-line);
	border-radius: 999px;
	background: var(--bmr-bg);
}

.bmr-search-form:focus-within {
	border-color: var(--bmr-link);
}

.bmr-search-form .icon {
	color: var(--bmr-soft);
}

.bmr-search-form input {
	flex: 1;
	min-width: 0;
	height: 2.75rem;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--bmr-ink);
	font: inherit;
	font-size: 1rem;
	outline: none;
}

.bmr-search-count {
	margin: 0.25rem 1.25rem 0.5rem;
	color: var(--bmr-soft);
	font-size: 0.8125rem;
}

/* Darstellung */
.bmr-pop {
	position: fixed;
	top: calc(var(--bmr-top) + env(safe-area-inset-top) + 0.25rem);
	right: max(0.75rem, env(safe-area-inset-right));
	z-index: 50;
	width: min(21rem, calc(100vw - 1.5rem));
	max-height: calc(100vh - var(--bmr-top) - 2rem);
	overflow-y: auto;
	padding: 1rem;
	border-radius: 1rem;
	background: var(--bmr-panel);
	box-shadow: var(--bmr-shadow);
	font-family: var(--bmr-ui);
	opacity: 0;
	transform: translateY(-0.5rem) scale(0.98);
	transform-origin: top right;
	transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
	visibility: hidden;
}

.bmr-pop.is-open {
	opacity: 1;
	transform: none;
	visibility: visible;
	transition-delay: 0s;
}

.bmr-row + .bmr-row {
	margin-top: 0.9rem;
}

.bmr-row-label {
	display: block;
	margin: 0 0 0.4rem 0.25rem;
	color: var(--bmr-soft);
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.bmr-row-value {
	color: var(--bmr-ink);
	font-weight: 600;
	letter-spacing: 0;
	text-transform: none;
}

.bmr-row[hidden] {
	display: none;
}

.bmr-arr {
	display: block;
	width: 1.75rem;
	height: 1.25rem;
}

.bmr-seg {
	display: flex;
	gap: 0.25rem;
	padding: 0.2rem;
	border-radius: 0.75rem;
	background: var(--bmr-hover);
}

.bmr-seg button {
	display: inline-flex;
	flex: 1;
	align-items: center;
	justify-content: center;
	gap: 0.35rem;
	min-height: 2.5rem;
	padding: 0 0.5rem;
	border: 0;
	border-radius: 0.6rem;
	background: transparent;
	font-size: 0.875rem;
	font-weight: 600;
	cursor: pointer;
}

.bmr-seg button[aria-pressed="true"] {
	background: var(--bmr-panel);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.14);
}

.bmr-seg button:disabled {
	opacity: 0.35;
	cursor: default;
}

.bmr-seg .bmr-size-small {
	font-family: var(--bmr-serif);
	font-size: 0.8125rem;
}

.bmr-seg .bmr-size-big {
	font-family: var(--bmr-serif);
	font-size: 1.25rem;
}

.bmr-size-value {
	flex: 0 0 auto;
	min-width: 3.5rem;
	color: var(--bmr-soft);
	font-size: 0.8125rem;
	font-variant-numeric: tabular-nums;
	line-height: 2.5rem;
	text-align: center;
}

.bmr-swatch {
	width: 1.1rem;
	height: 1.1rem;
	border: 1px solid rgba(0, 0, 0, 0.18);
	border-radius: 50%;
}

.bmr-lh {
	display: inline-flex;
	flex-direction: column;
	justify-content: center;
	width: 1.1rem;
}

.bmr-lh i {
	display: block;
	height: 2px;
	border-radius: 1px;
	background: currentColor;
}

/* Fußnote */
.bmr-note {
	position: fixed;
	left: 50%;
	bottom: calc(var(--bmr-bottom) + env(safe-area-inset-bottom) + 0.5rem);
	z-index: 50;
	width: min(34rem, calc(100vw - 1.5rem));
	max-height: min(50vh, 24rem);
	overflow-y: auto;
	padding: 1rem 3rem 1.1rem 1.25rem;
	border-radius: 1rem;
	background: var(--bmr-panel);
	box-shadow: var(--bmr-shadow);
	font-family: var(--bmr-font);
	font-size: calc(var(--bmr-size) * 0.85);
	line-height: 1.5;
	opacity: 0;
	transform: translate(-50%, 0.75rem);
	transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
	visibility: hidden;
}

.bmr-note.is-open {
	opacity: 1;
	transform: translate(-50%, 0);
	visibility: visible;
	transition-delay: 0s;
}

.bmr-note-label {
	display: block;
	margin-bottom: 0.3rem;
	color: var(--bmr-soft);
	font-family: var(--bmr-ui);
	font-size: 0.6875rem;
	font-weight: 700;
	letter-spacing: 0.07em;
	text-transform: uppercase;
}

.bmr-note p {
	margin: 0;
}

.bmr-note a {
	color: var(--bmr-link);
}

.bmr-note .bmr-btn {
	position: absolute;
	top: 0.5rem;
	right: 0.5rem;
}

/* Vorlesen */
/* Beim Vorlesen wird der untere Rand höher: Die Leiste liegt darin und verdeckt keinen Text. */
:root.bmr-speaking {
	--bmr-bottom: 5.25rem;
}

.bmr-speaking .bmr-foot-inner {
	justify-content: flex-start;
	padding-top: 0.75rem;
}

.bmr-speech {
	position: fixed;
	left: 50%;
	bottom: calc(env(safe-area-inset-bottom) + 0.6rem);
	z-index: 35;
	display: flex;
	align-items: center;
	gap: 0.125rem;
	padding: 0.3rem;
	border-radius: 999px;
	background: var(--bmr-panel);
	box-shadow: var(--bmr-shadow);
	font-family: var(--bmr-ui);
	transform: translateX(-50%);
}

.bmr-speech[hidden] {
	display: none;
}

.bmr-speech .bmr-play {
	width: 2.75rem;
	height: 2.75rem;
	background: var(--bmr-ink);
	color: var(--bmr-bg);
}

.bmr-speech .bmr-play:hover {
	background: var(--bmr-ink);
	opacity: 0.88;
}

.bmr-speech .bmr-play .icon-play {
	fill: currentColor;
	stroke-width: 1.5;
}

.bmr-rate {
	min-width: 3.25rem;
	height: 2.5rem;
	padding: 0 0.5rem;
	border: 0;
	border-radius: 999px;
	background: transparent;
	font-size: 0.875rem;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	cursor: pointer;
}

.bmr-rate:hover {
	background: var(--bmr-hover);
}

.bmr-voice {
	max-width: 9rem;
	height: 2.5rem;
	padding: 0 0.5rem;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: var(--bmr-ink);
	font: inherit;
	font-size: 0.8125rem;
	cursor: pointer;
}

.bmr-voice:hover {
	background: var(--bmr-hover);
}

@media (max-width: 479px) {
	.bmr-voice {
		max-width: 5.5rem;
	}
}

/* Kurze Meldung */
.bmr-toast {
	position: fixed;
	top: calc(var(--bmr-top) + env(safe-area-inset-top) + 0.5rem);
	left: 50%;
	z-index: 60;
	padding: 0.55rem 1rem;
	border-radius: 999px;
	background: var(--bmr-ink);
	color: var(--bmr-bg);
	font-family: var(--bmr-ui);
	font-size: 0.875rem;
	font-weight: 600;
	opacity: 0;
	transform: translate(-50%, -0.5rem);
	transition: opacity 0.2s ease, transform 0.2s ease;
	pointer-events: none;
}

.bmr-toast.is-open {
	opacity: 1;
	transform: translate(-50%, 0);
}

/* Lesezeichen-Band an der Seite */
.bmr-ribbon {
	position: fixed;
	top: 0;
	left: calc(var(--bmr-flow-r, 50%) - 1.35rem);
	z-index: 5;
	width: 1.1rem;
	height: 2.4rem;
	background: var(--bmr-marker);
	clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%);
	opacity: 0;
	transform: translateY(-100%);
	transition: opacity 0.2s ease, transform 0.25s ease;
	pointer-events: none;
}

.bmr-ribbon.is-on {
	opacity: 1;
	transform: none;
}

@media (prefers-reduced-motion: reduce) {
	.bmr-on[data-bmr-mode="paged"] .bmr-section.is-anim,
	.bmr-sheet,
	.bmr-pop,
	.bmr-note,
	.bmr-top,
	.bmr-ribbon {
		transition: none;
	}

	.bmr-on[data-bmr-mode="paged"] .bmr-section.is-fade {
		animation: none;
	}
}

@media print {
	.bmr-top,
	.bmr-foot,
	.bmr-turn,
	.bmr-sheet,
	.bmr-pop,
	.bmr-speech {
		display: none !important;
	}

	.bmr-on body {
		overflow: visible;
	}

	.bmr-on .bmr-stage {
		position: static;
		padding: 0;
	}

	.bmr-on .bmr-section {
		display: block !important;
		transform: none !important;
		columns: auto !important;
		height: auto !important;
	}
}
