/*
 * Rechtspause Bibliothek – Startseite
 * Markenfarben laut Leitfaden, Montserrat lokal (SIL OFL), Georgia als Lesetext.
 * Alle Selektoren sind auf .rpb / .rpb-body begrenzt.
 */

@font-face {
	font-family: "Montserrat RPB";
	src: url("fonts/montserrat-latin.woff2") format("woff2-variations"),
	     url("fonts/montserrat-latin.woff2") format("woff2");
	font-weight: 100 900;
	font-style: normal;
	font-display: swap;
}

.rpb {
	--rpb-dunkel: #132820;
	--rpb-dunkel-2: #1a372c;
	--rpb-teal: #1d9e75;
	--rpb-teal-hell: #5dcaa5;
	--rpb-teal-text: #0f6e50;
	--rpb-gold: #ba7517;
	--rpb-gold-hell: #fac775;
	--rpb-gold-text: #8a5410;
	--rpb-creme: #f5f0e3;
	--rpb-creme-2: #ece4cf;
	--rpb-papier: #fbf8f1;
	--rpb-familie: #e3eee8;
	--rpb-grau: #4c5b54;
	--rpb-linie: rgba(19, 40, 32, 0.14);
	--rpb-sans: "Montserrat RPB", Montserrat, "Helvetica Neue", Arial, sans-serif;
	--rpb-serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
}

body.rpb-body {
	margin: 0;
	background: #f5f0e3;
	color: #132820;
}

.rpb {
	font-family: var(--rpb-serif);
	font-size: 1.125rem;
	line-height: 1.6;
	color: var(--rpb-dunkel);
	background: var(--rpb-creme);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

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

.rpb :where(img) { display: block; max-width: 100%; height: auto; }
.rpb :where(p, blockquote, figure) { margin: 0; }
.rpb :where(h1, h2, h3) { margin: 0; font-family: var(--rpb-sans); color: inherit; }
.rpb :where(ul) { margin: 0; padding: 0; list-style: none; }
.rpb :where(a) { color: inherit; }

.rpb :focus-visible {
	outline: 3px solid var(--rpb-gold);
	outline-offset: 3px;
	border-radius: 2px;
}

.rpb-wrap {
	max-width: 1180px;
	margin: 0 auto;
	padding: 0 clamp(20px, 4vw, 40px);
}

.rpb-sr {
	position: absolute; width: 1px; height: 1px; overflow: hidden;
	clip: rect(0 0 0 0); white-space: nowrap;
}

.rpb-skip {
	position: absolute; left: 12px; top: -60px; z-index: 50;
	background: var(--rpb-gold-hell); color: var(--rpb-dunkel);
	font: 700 0.9rem/1 var(--rpb-sans); padding: 12px 16px; border-radius: 6px;
	text-decoration: none;
}
.rpb-skip:focus { top: 12px; }

/* ---------------------------------------------------------------- Kopf */

.rpb-kopf { background: var(--rpb-dunkel); color: var(--rpb-creme); }

.rpb-kopf__inner {
	display: flex; align-items: center; justify-content: space-between;
	gap: 24px; min-height: 72px;
}

.rpb-marke {
	display: inline-flex; align-items: center; gap: 12px;
	text-decoration: none;
}
.rpb-marke__bild { width: 36px; height: 36px; }
.rpb-marke__ersatz {
	display: grid; place-items: center; width: 36px; height: 36px;
	border: 2px solid var(--rpb-gold-hell); border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
	color: var(--rpb-gold-hell); font: 700 1.1rem/1 var(--rpb-serif);
}

.rpb-wortmarke {
	font-family: var(--rpb-sans); font-weight: 700;
	font-size: 0.95rem; letter-spacing: 0.2em; white-space: nowrap;
}
.rpb-wortmarke__r { color: var(--rpb-teal-hell); }
.rpb-wortmarke__p { color: var(--rpb-gold-hell); }

.rpb-kopf__nav { display: flex; gap: clamp(14px, 2.4vw, 32px); }
.rpb-kopf__nav a {
	font: 600 0.92rem/1 var(--rpb-sans);
	color: var(--rpb-creme); text-decoration: none; opacity: 0.86;
	padding: 8px 0; border-bottom: 2px solid transparent;
}
.rpb-kopf__nav a:hover { opacity: 1; border-bottom-color: var(--rpb-teal-hell); }

/* ---------------------------------------------------------------- Held */

.rpb-held {
	background: var(--rpb-dunkel);
	color: var(--rpb-creme);
	overflow: hidden;
}

.rpb-held__inner {
	display: grid;
	grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
	gap: clamp(32px, 5vw, 72px);
	align-items: center;
	padding-top: clamp(48px, 7vw, 88px);
	padding-bottom: clamp(56px, 8vw, 104px);
}

/* Eingangsstempel – das eine laute Element der Seite */
.rpb-eingang {
	display: inline-flex; flex-direction: column; align-items: center;
	gap: 2px;
	margin: 0 0 44px 6px;
	padding: 8px 18px 9px;
	color: var(--rpb-gold-hell);
	border: 3px solid currentColor;
	border-radius: 8px;
	outline: 1px solid currentColor;
	outline-offset: 3px;
	transform: rotate(-5deg);
	font-family: var(--rpb-sans);
	text-transform: uppercase;
	opacity: 0.94;
	animation: rpb-stempeln 0.55s cubic-bezier(0.2, 0.9, 0.3, 1.2) 0.25s both;
}
.rpb-eingang__zeile { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.16em; }
.rpb-eingang__datum { font-size: 1.5rem; font-weight: 800; letter-spacing: 0.08em; line-height: 1.05; }

@keyframes rpb-stempeln {
	0%   { opacity: 0; transform: rotate(-5deg) scale(1.7); }
	65%  { opacity: 1; transform: rotate(-5deg) scale(0.95); }
	100% { opacity: 0.94; transform: rotate(-5deg) scale(1); }
}

.rpb-held h1 {
	font-size: clamp(2.8rem, 7.4vw, 5.9rem);
	font-weight: 800;
	line-height: 0.98;
	letter-spacing: -0.025em;
	color: var(--rpb-creme);
	max-width: 11ch;
}

.rpb-held__lead {
	margin-top: 26px;
	max-width: 36em;
	font-size: clamp(1.08rem, 1.5vw, 1.25rem);
	line-height: 1.65;
	color: rgba(245, 240, 227, 0.84);
}

.rpb-held__bestand {
	margin-top: 22px;
	font: 600 0.95rem/1.5 var(--rpb-sans);
	color: rgba(245, 240, 227, 0.7);
}
.rpb-held__bestand a {
	color: var(--rpb-teal-hell);
	text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px;
}
.rpb-held__bestand a:hover { color: var(--rpb-gold-hell); }

/* Coverstapel */
.rpb-held__stapel {
	position: relative;
	height: clamp(320px, 36vw, 460px);
}
.rpb-fan {
	position: absolute; bottom: 0;
	width: 46%;
	filter: drop-shadow(0 22px 30px rgba(0, 0, 0, 0.45));
}
.rpb-fan img, .rpb-fan .rpb-typecover { border-radius: 2px 5px 5px 2px; }
.rpb-fan--1 { left: 2%;  transform: rotate(-8deg); z-index: 1; bottom: 4%; }
.rpb-fan--2 { left: 27%; transform: rotate(-1deg); z-index: 3; }
.rpb-fan--3 { left: 52%; transform: rotate(6deg);  z-index: 2; bottom: 6%; }

/* ---------------------------------------------------------------- Register */

.rpb-register {
	position: sticky; top: 0; z-index: 20;
	background: var(--rpb-creme);
	border-bottom: 1px solid var(--rpb-linie);
	scroll-margin-top: 0;
}
body.admin-bar .rpb-register { top: 32px; }
@media (max-width: 782px) { body.admin-bar .rpb-register { top: 0; position: relative; } }

.rpb-register ul {
	display: flex; gap: 6px;
	overflow-x: auto; scrollbar-width: none;
	padding: 12px 0 0;
}
.rpb-register ul::-webkit-scrollbar { display: none; }

.rpb-register a {
	display: inline-flex; align-items: center; gap: 8px;
	padding: 9px 14px 11px;
	border-radius: 9px 9px 0 0;
	background: var(--rpb-creme-2);
	font: 600 0.86rem/1 var(--rpb-sans);
	color: var(--rpb-dunkel);
	text-decoration: none; white-space: nowrap;
}
.rpb-register a:hover { background: var(--rpb-dunkel); color: var(--rpb-creme); }
.rpb-register a:hover .rpb-register__buchst { color: var(--rpb-gold-hell); }
.rpb-register__buchst { font-weight: 800; color: var(--rpb-gold-text); }

/* ---------------------------------------------------------------- Neu eingegangen */

.rpb-neu {
	padding: clamp(48px, 6vw, 72px) 0 clamp(24px, 3vw, 40px);
	scroll-margin-top: 64px;
}

.rpb-neu__kopf {
	display: flex; flex-wrap: wrap; align-items: baseline;
	justify-content: space-between; gap: 8px 24px;
}
.rpb-neu__kopf h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 750; letter-spacing: -0.01em; }
.rpb-neu__kopf p { color: var(--rpb-grau); font-size: 1rem; }

.rpb-neu__leiste {
	display: flex; gap: 22px;
	margin-top: 28px;
	padding: 8px 2px 22px;
	overflow-x: auto;
	scroll-snap-type: x proximity;
}
.rpb-neu__leiste li { flex: 0 0 auto; width: 150px; scroll-snap-align: start; }
.rpb-neu__leiste a { display: block; text-decoration: none; }

.rpb-neu__cover {
	display: flex; align-items: flex-end;
	height: 200px;
}
.rpb-neu__cover img {
	max-height: 200px; width: auto;
	border-radius: 2px 4px 4px 2px;
	box-shadow: 0 12px 22px -10px rgba(19, 40, 32, 0.5);
}
.rpb-neu__cover .rpb-typecover { width: 133px; }

.rpb-neu__titel {
	display: block; margin-top: 12px;
	font: 700 0.9rem/1.3 var(--rpb-sans);
}
.rpb-neu__status {
	display: block; margin-top: 4px;
	font: 500 0.78rem/1.35 var(--rpb-sans); color: var(--rpb-grau);
}
.rpb-neu__leiste a:hover .rpb-neu__titel { color: var(--rpb-teal-text); text-decoration: underline; text-underline-offset: 3px; }

/* ---------------------------------------------------------------- Fächer */

.rpb-fach {
	padding: clamp(56px, 7vw, 88px) 0 clamp(16px, 2vw, 24px);
	scroll-margin-top: 56px;
}

.rpb-fach__kopf {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	gap: 20px;
	align-items: end;
	padding-bottom: 20px;
	border-bottom: 2px solid var(--rpb-dunkel);
}

/* Aktenreiter */
.rpb-reiter {
	display: grid; place-items: center;
	width: 56px; height: 64px;
	margin-bottom: -22px;
	border-radius: 10px 10px 0 0;
	background: var(--rpb-dunkel);
	color: var(--rpb-gold-hell);
	font: 800 1.7rem/1 var(--rpb-sans);
}
.rpb-fach--familie .rpb-reiter { background: var(--rpb-teal-text); color: var(--rpb-papier); }

.rpb-fach__titel h2 {
	font-size: clamp(1.8rem, 3.6vw, 2.7rem);
	font-weight: 750;
	letter-spacing: -0.015em;
	line-height: 1.1;
}
.rpb-fach__lead {
	margin-top: 6px;
	font-style: italic;
	color: var(--rpb-grau);
	max-width: 42em;
}
.rpb-fach__anzahl {
	font: 600 0.85rem/1 var(--rpb-sans);
	color: var(--rpb-grau);
	white-space: nowrap;
	padding-bottom: 4px;
}

.rpb-regal {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr));
	gap: clamp(40px, 5vw, 64px) clamp(32px, 5vw, 64px);
	margin-top: clamp(40px, 5vw, 56px);
}

/* ---------------------------------------------------------------- Buch */

.rpb-buch {
	display: grid;
	grid-template-columns: 150px minmax(0, 1fr);
	gap: 26px;
	align-items: start;
	scroll-margin-top: 72px;
}

.rpb-buch__cover { position: relative; }

.rpb-buch__band {
	position: relative; display: block;
	text-decoration: none;
	border-radius: 2px 4px 4px 2px;
	box-shadow: 0 1px 0 rgba(19, 40, 32, 0.06), 0 16px 26px -12px rgba(19, 40, 32, 0.45);
}
.rpb-buch__band img,
.rpb-buch__band .rpb-typecover { border-radius: 2px 4px 4px 2px; }
/* Buchrücken-Schatten */
.rpb-buch__band::after {
	content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 9px;
	background: linear-gradient(90deg, rgba(0, 0, 0, 0.22), rgba(0, 0, 0, 0));
	border-radius: 2px 0 0 2px;
	pointer-events: none;
}
a.rpb-buch__band:hover { transform: translateY(-2px); }
.is-soon .rpb-buch__band { opacity: 0.9; }

/* Stempel auf dem Cover */
.rpb-stempel {
	position: absolute; top: -10px; right: -16px; z-index: 2;
	padding: 4px 8px 5px;
	background: var(--rpb-papier);
	color: var(--rpb-gold-text);
	border: 2px solid currentColor;
	border-radius: 5px;
	box-shadow: 0 0 0 2px var(--rpb-papier);
	transform: rotate(7deg);
	font: 800 0.66rem/1.1 var(--rpb-sans);
	letter-spacing: 0.07em;
	text-transform: uppercase;
	white-space: nowrap;
}
.rpb-stempel--wv {
	color: var(--rpb-teal-text);
	transform: rotate(-5deg);
	top: auto; bottom: 14px; right: -18px;
}

.rpb-buch__fmt {
	font: 600 0.8rem/1.3 var(--rpb-sans);
	color: var(--rpb-gold-text);
}
.rpb-buch__titel {
	margin-top: 6px;
	font-size: 1.3rem;
	font-weight: 750;
	line-height: 1.2;
	letter-spacing: -0.005em;
}
.rpb-buch__sub {
	margin-top: 4px;
	font-style: italic;
	font-size: 1rem;
	line-height: 1.45;
	color: var(--rpb-grau);
}
.rpb-buch__blurb {
	margin-top: 12px;
	font-size: 1rem;
	line-height: 1.62;
	max-width: 36em;
}
.rpb-buch__aktion { margin-top: 14px; }

.rpb-link {
	font: 700 0.92rem/1.3 var(--rpb-sans);
	color: var(--rpb-teal-text);
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: 5px;
	text-decoration-color: rgba(15, 110, 80, 0.35);
}
.rpb-link:hover { color: var(--rpb-dunkel); text-decoration-color: var(--rpb-gold); }

.rpb-bald {
	font: 700 0.92rem/1.3 var(--rpb-sans);
	color: var(--rpb-gold-text);
}

/* ---------------------------------------------------------------- Ersatz-Cover */

.rpb-typecover {
	container-type: inline-size;
	display: flex; flex-direction: column;
	width: 100%;
	aspect-ratio: 2 / 3;
	padding: 13% 11% 10%;
	background: var(--rpb-dunkel);
	color: var(--rpb-creme);
	overflow: hidden;
	font-size: 0.8rem;
}
.rpb-typecover__mark {
	font: 400 2.2em/1 var(--rpb-serif);
	font-size: 17cqw;
	color: var(--rpb-gold-hell);
}
.rpb-typecover__title {
	margin-top: 12%;
	font: 800 1.1em/1.08 var(--rpb-sans);
	font-size: 10.5cqw;
	letter-spacing: -0.01em;
	hyphens: auto;
	overflow-wrap: anywhere;
}
.rpb-typecover__sub {
	margin-top: 7%;
	font: italic 0.8em/1.3 var(--rpb-serif);
	font-size: 6.4cqw;
	opacity: 0.8;
	display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.rpb-typecover__brand {
	margin-top: auto;
	font: 700 0.6em/1 var(--rpb-sans);
	font-size: 5.4cqw;
	letter-spacing: 0.2em;
	color: var(--rpb-teal-hell);
}
.rpb-typecover--creme { background: var(--rpb-creme-2); color: var(--rpb-dunkel); }
.rpb-typecover--creme .rpb-typecover__mark { color: var(--rpb-gold); }
.rpb-typecover--creme .rpb-typecover__brand { color: var(--rpb-teal-text); }
.rpb-typecover--teal { background: var(--rpb-teal-text); color: var(--rpb-papier); }
.rpb-typecover--teal .rpb-typecover__mark { color: var(--rpb-gold-hell); }
.rpb-typecover--teal .rpb-typecover__brand { color: var(--rpb-gold-hell); }

/* ---------------------------------------------------------------- Familienbereich */

.rpb-bereich {
	margin-top: clamp(48px, 6vw, 80px);
	padding: clamp(40px, 5vw, 64px) 0 clamp(56px, 7vw, 88px);
	background: var(--rpb-familie);
}
.rpb-bereich__intro {
	font: 600 1rem/1.5 var(--rpb-sans);
	color: var(--rpb-teal-text);
	max-width: 40em;
}
.rpb-bereich .rpb-fach:first-of-type { padding-top: clamp(32px, 4vw, 48px); }
.rpb-bereich .rpb-typecover--creme { background: var(--rpb-papier); }

.rpb-hinweis {
	margin-top: clamp(40px, 5vw, 56px);
	max-width: 48em;
	padding: 20px 24px;
	background: rgba(251, 248, 241, 0.75);
	border-left: 4px solid var(--rpb-teal-text);
	font-size: 1rem;
}
.rpb-hinweis strong { font-family: var(--rpb-sans); font-weight: 700; font-size: 0.95em; }

/* ---------------------------------------------------------------- Regel */

.rpb-regel {
	background: var(--rpb-dunkel);
	color: var(--rpb-creme);
	padding: clamp(72px, 10vw, 120px) 0;
}
.rpb-regel blockquote { margin: 0; }
.rpb-regel blockquote p {
	max-width: 15ch;
	font: 800 clamp(2rem, 5vw, 3.8rem)/1.05 var(--rpb-sans);
	letter-spacing: -0.02em;
}
.rpb-regel blockquote footer {
	margin-top: 22px;
	font: italic 1.05rem/1.4 var(--rpb-serif);
	color: var(--rpb-gold-hell);
}
.rpb-regel blockquote footer::before { content: "— "; }

/* ---------------------------------------------------------------- Über */

.rpb-ueber { padding: clamp(64px, 8vw, 104px) 0; scroll-margin-top: 56px; }

.rpb-ueber__inner {
	display: grid;
	grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
	gap: clamp(32px, 5vw, 72px);
	align-items: center;
}
.rpb-ueber__inner--ohne-bild { grid-template-columns: minmax(0, 1fr); }
.rpb-ueber__bild { width: 100%; max-width: 300px; border-radius: 12px; }
.rpb-ueber__text { max-width: 38em; }
.rpb-ueber h2 {
	font-size: clamp(1.7rem, 3.2vw, 2.5rem);
	font-weight: 750;
	line-height: 1.12;
	letter-spacing: -0.015em;
	margin-bottom: 22px;
}
.rpb-ueber p + p { margin-top: 1em; }
.rpb-ueber strong { font-family: var(--rpb-sans); font-weight: 700; }

/* ---------------------------------------------------------------- Fuß */

.rpb-fuss { background: var(--rpb-dunkel); color: rgba(245, 240, 227, 0.8); }
.rpb-fuss__inner {
	display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
	gap: 16px 32px;
	padding-top: 36px; padding-bottom: 40px;
	font: 500 0.88rem/1.5 var(--rpb-sans);
}
.rpb-fuss .rpb-marke__bild { width: 28px; height: 28px; }
.rpb-fuss nav { display: flex; gap: 24px; }
.rpb-fuss nav a { color: var(--rpb-creme); text-decoration: none; }
.rpb-fuss nav a:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ---------------------------------------------------------------- Admin-Prüfung */

.rpb-debug { padding: 48px 0; background: #fff; font: 400 0.85rem/1.4 var(--rpb-sans); }
.rpb-debug h2 { font-size: 1.2rem; margin-bottom: 8px; }
.rpb-debug table { width: 100%; border-collapse: collapse; margin-top: 16px; }
.rpb-debug th, .rpb-debug td { text-align: left; padding: 8px; border-bottom: 1px solid #ddd; vertical-align: top; }
.rpb-debug tr.fehlt td { background: #fff4e0; }
.rpb-debug code { background: #f2f2f2; padding: 1px 4px; }

/* ---------------------------------------------------------------- Responsiv */

@media (max-width: 900px) {
	.rpb-held__inner { grid-template-columns: 1fr; }
	.rpb-held__stapel { height: 300px; max-width: 420px; }
	.rpb-ueber__inner { grid-template-columns: 1fr; }
	.rpb-ueber__bild { max-width: 220px; }
}

@media (max-width: 640px) {
	.rpb { font-size: 1.0625rem; }
	.rpb-kopf__inner { flex-wrap: wrap; padding-top: 14px; padding-bottom: 10px; gap: 10px; }
	.rpb-kopf__nav { width: 100%; justify-content: space-between; }
	.rpb-fach__kopf { grid-template-columns: auto minmax(0, 1fr); }
	.rpb-fach__anzahl { display: none; }
	.rpb-reiter { width: 46px; height: 54px; font-size: 1.4rem; }
	.rpb-buch { grid-template-columns: 108px minmax(0, 1fr); gap: 18px; }
	.rpb-stempel { right: -10px; font-size: 0.6rem; }
	.rpb-stempel--wv { right: auto; left: 50%; transform: translateX(-50%) rotate(-5deg); }
	.rpb-held__stapel { height: 250px; }
}

@media (prefers-reduced-motion: reduce) {
	.rpb-eingang { animation: none; }
	a.rpb-buch__band:hover { transform: none; }
	.rpb { scroll-behavior: auto; }
}

@media (prefers-reduced-motion: no-preference) {
	html:has(.rpb) { scroll-behavior: smooth; }
	a.rpb-buch__band { transition: transform 0.2s ease; }
}

@media print {
	.rpb-kopf__nav, .rpb-register, .rpb-neu, .rpb-skip { display: none; }
	.rpb-held, .rpb-regel, .rpb-fuss, .rpb-kopf { background: #fff; color: #000; }
}
