/* ==========================================================================
   Buchübersicht (archive-buch.php) – /buecher/ und /buecher/hoerbuecher/
   Farben, Schriften und Schatten kommen aus style.css (:root).
   Bausteine (Panel, Kicker, Buttons) wie auf Startseite und Buchseite.
   ========================================================================== */

/* ---------- Grundgerüst ---------- */

.buecher {
	width: min(100% - 20px, 1176px);
	margin-inline: auto;
	display: flex;
	flex-direction: column;
	gap: 14px;
	font-family: var(--font-body);
	font-size: 17px;
	line-height: 1.6;
	color: var(--ink);
}

@media (min-width: 900px) {
	.buecher { width: min(100% - 48px, 1176px); gap: 28px; font-size: 18px; }
}

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

.buecher h1, .buecher h2, .buecher h3 { margin: 0; color: var(--ink); }
.buecher p { margin: 0; }
.buecher ul,
.buecher ol { list-style: none; margin: 0; padding: 0; }
.buecher img { max-width: 100%; height: auto; }
.buecher .icon { display: inline-block; flex: none; vertical-align: middle; }

.buecher a { color: var(--accent); text-underline-offset: 3px; }
.buecher a:hover { color: var(--accent-dark); }

/* Ohne border-radius: Knöpfe und Felder behalten beim Fokus ihre runde Form (Textlinks: 6px aus style.css). */
.buecher :is(a, button, select, [tabindex]):focus-visible {
	outline: 3px solid var(--focus);
	outline-offset: 3px;
}

/* ---------- Bausteine ---------- */

.buecher .panel {
	position: relative;
	background: var(--panel-bg);
	-webkit-backdrop-filter: blur(14px);
	backdrop-filter: blur(14px);
	border-radius: var(--radius-panel);
	padding: 24px 18px;
}

/* Rosegold-Rahmen wie auf der Startseite */
.buecher .panel::after {
	content: "";
	position: absolute;
	inset: var(--frame-inset);
	padding: 1px;
	border-radius: var(--radius-frame);
	background: var(--rosegold);
	-webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
	-webkit-mask-composite: xor;
	mask-composite: exclude;
	pointer-events: none;
}

@media (min-width: 900px) {
	.buecher .panel { padding: 28px 32px; }
}

.buecher .kicker {
	display: block;
	font-size: 13px;
	font-weight: 800;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--accent);
}

.buecher .feather-line {
	display: block;
	width: 72px;
	height: 2px;
	background: var(--feather);
}

.buecher .btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 52px;
	padding: 8px 24px;
	border-radius: var(--radius-button);
	box-shadow: var(--button-keyline);
	border: 1.5px solid var(--accent);
	font-family: var(--font-body);
	font-weight: 800;
	font-size: 14px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.2s, color 0.2s;
}

.buecher .btn--primary { background: var(--accent); color: #fff; }
.buecher .btn--primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.buecher .btn--outline { background: #fff; color: var(--accent); }
.buecher .btn--outline:hover { background: var(--accent-light); color: var(--accent-dark); }

/* Brotkrümel wie auf der Buchseite */
.buecher .breadcrumbs {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 2px 8px;
	font-size: 14px;
}
.buecher .breadcrumbs a { color: var(--accent-dark); font-weight: 600; white-space: nowrap; }
.buecher .breadcrumbs span[aria-hidden] { color: var(--ink-50); }
.buecher .breadcrumbs [aria-current] { font-weight: 800; color: var(--ink); }

/* Cover-Platzhalter (solange kein Beitragsbild da ist) */
.buecher .cover-ph {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	width: 100%;
	height: 100%;
	padding: 1.2em 0.7em 0.8em;
	background:
		radial-gradient(circle at 70% 18%, rgba(255, 255, 255, 0.35), transparent 50%),
		linear-gradient(170deg, var(--c1, #C76A80), var(--c2, #6E1229));
	color: #fff;
	text-align: center;
	overflow: hidden;
}
.buecher .cover-ph__title {
	font-family: var(--font-heading);
	font-size: 1.15em;
	line-height: 1.1;
	text-shadow: 0 2px 8px rgba(43, 16, 24, 0.25);
	overflow-wrap: break-word;
	-webkit-hyphens: auto;
	hyphens: auto;
}
.buecher .cover-ph__author {
	font-size: 0.55em;
	font-weight: 800;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	opacity: 0.9;
}

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

.catalog-head {
	display: grid;
	gap: 18px;
	overflow: hidden;
}

.catalog-head__text { display: flex; flex-direction: column; gap: 12px; max-width: 640px; }

.catalog-head__title {
	font-family: var(--font-heading);
	font-weight: 400;
	font-size: clamp(34px, 5vw, 60px);
	line-height: 1.04;
	overflow-wrap: break-word;
}

.catalog-head__lead { color: var(--ink-70); }

/* Fächer aus drei Covern (nur Deko) */
.catalog-head__fan { display: none; }

@media (min-width: 900px) {
	.catalog-head {
		grid-template-columns: 1fr 300px;
		grid-template-areas: "crumbs crumbs" "text fan";
		align-items: center;
		padding-block: 28px 36px;
	}
	.catalog-head .breadcrumbs { grid-area: crumbs; }
	.catalog-head__text { grid-area: text; }

	.catalog-head__fan {
		grid-area: fan;
		position: relative;
		display: block;
		height: 230px;
	}
	.fan__book {
		position: absolute;
		top: 18px;
		left: 50%;
		width: 112px;
		aspect-ratio: 2 / 3;
		overflow: hidden;
		border-radius: 3px 6px 6px 3px;
		box-shadow: 0 22px 34px -18px rgba(43, 16, 24, 0.55), 0 6px 12px -6px rgba(43, 16, 24, 0.3);
		font-size: 13px;
		transition: transform 0.4s ease;
	}
	.fan__book--1 { z-index: 3; transform: translateX(-50%) rotate(-2deg); }
	.fan__book--2 { z-index: 2; transform: translateX(-118%) translateY(14px) rotate(-12deg); }
	.fan__book--3 { z-index: 1; transform: translateX(18%) translateY(14px) rotate(10deg); }
	.catalog-head:hover .fan__book--2 { transform: translateX(-126%) translateY(10px) rotate(-15deg); }
	.catalog-head:hover .fan__book--3 { transform: translateX(26%) translateY(10px) rotate(13deg); }
	.fan__img { display: block; width: 100%; height: 100%; object-fit: cover; }
}

/* ---------- 2 Raster: Filter links, Ergebnisse rechts ---------- */

.catalog {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

@media (min-width: 900px) {
	.catalog {
		display: grid;
		grid-template-columns: 300px minmax(0, 1fr);
		align-items: start;
		gap: 28px;
	}
}

/* Handy: Filter hinter einem Knopf (nur mit JavaScript) */
.catalog__toggle {
	display: none;
	align-items: center;
	gap: 10px;
	width: 100%;
	min-height: 56px;
	padding: 0 20px;
	border: 0;
	border-radius: var(--radius-button);
	box-shadow: var(--button-keyline);
	background: var(--panel-bg);
	-webkit-backdrop-filter: blur(14px);
	backdrop-filter: blur(14px);
	box-shadow: inset 0 0 0 1.5px var(--line-strong);
	font-family: var(--font-body);
	font-size: 15px;
	font-weight: 800;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--accent);
	cursor: pointer;
}
.catalog__toggle > .icon:last-child { margin-left: auto; transition: transform 0.25s; }
.catalog__toggle[aria-expanded="true"] > .icon:last-child { transform: rotate(180deg); }

.catalog__toggle-count {
	display: inline-grid;
	place-items: center;
	min-width: 24px;
	height: 24px;
	padding: 0 7px;
	border-radius: 999px;
	background: var(--accent);
	color: #fff;
	font-size: 13px;
	letter-spacing: 0;
}
.catalog__toggle-count[hidden] { display: none; }

@media (max-width: 899px) {
	.catalog__side.is-enhanced .catalog__toggle:not([hidden]) { display: flex; }
	.catalog__side.is-enhanced.is-collapsed .filter { display: none; }
	.catalog__side.is-enhanced .filter { margin-top: 10px; }
}

/* ---------- 3 Filter ---------- */

.filter { display: flex; flex-direction: column; gap: 4px; }

@media (min-width: 900px) {
	.buecher .filter { padding: 26px 24px 28px; }
}

.filter__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 6px;
}

.filter__title {
	font-family: var(--font-heading);
	font-weight: 400;
	font-size: 24px;
	line-height: 1.15;
}

.buecher .filter__reset {
	font-size: 14px;
	font-weight: 700;
	white-space: nowrap;
}
.filter__reset[hidden] { display: none; }

.filter__group {
	min-width: 0;
	margin: 0;
	padding: 16px 0 14px;
	border: 0;
	border-top: 1px solid var(--line);
}

.filter__legend {
	float: left; /* legt die Legende in den Fluss der Gruppe */
	width: 100%;
	padding: 0;
	margin-bottom: 10px;
	font-size: 13px;
	font-weight: 800;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--accent-dark);
}
.filter__legend + * { clear: both; }

.filter__hint {
	margin: -4px 0 10px;
	font-size: 14px;
	line-height: 1.45;
	color: var(--ink-70);
}

.pills { display: flex; flex-wrap: wrap; gap: 8px; }

/* Ausklappen langer Listen: ausgewählte Begriffe bleiben immer sichtbar */
.filter__group.is-collapsed .pills__item[data-extra]:not(:has(:checked)) { display: none; }

.pill {
	position: relative;
	display: block;
	cursor: pointer;
}

.pill__input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: 0;
	opacity: 0;
	pointer-events: none;
}

.pill__box {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 40px;
	padding: 6px 8px 6px 14px;
	border-radius: var(--radius-control);
	border: 1.5px solid var(--line-strong);
	background: #fff;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.2;
	color: var(--ink);
	transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.filter__group--ohne .pill__box { padding-right: 14px; }

.pill__count {
	display: inline-grid;
	place-items: center;
	min-width: 26px;
	height: 24px;
	padding: 0 7px;
	border-radius: 999px;
	background: var(--accent-tint);
	font-size: 13px;
	font-weight: 800;
	color: var(--ink-70);
}

.pill:hover .pill__box { border-color: var(--accent); background: var(--accent-hover); }

.pill__input:focus-visible + .pill__box {
	outline: 3px solid var(--focus);
	outline-offset: 2px;
}

/* Ausgewählt: gefüllt und mit Häkchen (nicht nur über die Farbe erkennbar) */
.pill__input:checked + .pill__box {
	border-color: var(--accent);
	background: var(--accent);
	color: #fff;
}
.pill__input:checked + .pill__box::before {
	content: "";
	width: 16px;
	height: 16px;
	margin-left: -4px;
	background: url("../icons/check-white.svg") center / contain no-repeat;
}
.pill__input:checked + .pill__box .pill__count { background: rgba(255, 255, 255, 0.22); color: #fff; }

/* „Lieber ohne …“: ausgewählt = durchgestrichen mit Kreuz */
.filter__group--ohne .pill__input:checked + .pill__box {
	background: #fff;
	color: var(--accent-dark);
	text-decoration: line-through;
	text-decoration-thickness: 1.5px;
}
.filter__group--ohne .pill__input:checked + .pill__box::before {
	background-image: url("../icons/x-violet.svg");
}

/* Bei dieser Auswahl kein Roman: nicht wählbar */
.pill__input:disabled + .pill__box {
	border-style: dashed;
	background: transparent;
	color: var(--ink-50);
	cursor: not-allowed;
}
.pill__input:disabled + .pill__box .pill__count { background: transparent; color: var(--ink-50); }
.pill:has(:disabled) { cursor: not-allowed; }
.pill:has(:disabled):hover .pill__box { border-color: var(--line-strong); background: transparent; }

.filter__more {
	margin-top: 10px;
	padding: 6px 0;
	border: 0;
	background: none;
	font-family: var(--font-body);
	font-size: 15px;
	font-weight: 800;
	color: var(--accent);
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}
.filter__more[hidden] { display: none; }

.buecher .filter__submit { margin-top: 12px; }
.buecher .catalog__side.is-enhanced .filter__submit { display: none; }

.buecher .filter__done { display: none; }
@media (max-width: 899px) {
	.buecher .catalog__side.is-enhanced .filter__done:not([hidden]) { display: inline-flex; width: 100%; margin-top: 12px; }
}

/* ---------- 4 Ergebnisse ---------- */

.catalog__results { min-width: 0; transition: opacity 0.2s; }
.catalog__results[aria-busy="true"] .results__body { opacity: 0.5; }

.results__bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px 20px;
	margin-bottom: 18px;
}

.results__count {
	font-family: var(--font-heading);
	font-weight: 400;
	font-size: clamp(24px, 2.6vw, 30px);
	line-height: 1.15;
}
.results__count { scroll-margin-top: 150px; } /* Platz für die feste Kopfzeile */
@media (min-width: 900px) {
	.results__count { scroll-margin-top: 110px; }
}
.results__count:focus { outline: none; }
.results__count:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }

.results__sort {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 15px;
	font-weight: 700;
	color: var(--ink-70);
}

.select { position: relative; display: inline-block; }
.select::after {
	content: "";
	position: absolute;
	top: 50%;
	right: 14px;
	width: 16px;
	height: 16px;
	transform: translateY(-50%);
	background: url("../icons/chevron-down-violet.svg") center / contain no-repeat;
	pointer-events: none;
}

.buecher .select select {
	-webkit-appearance: none;
	appearance: none;
	min-height: 44px;
	padding: 0 42px 0 18px;
	border: 1.5px solid var(--line-strong);
	border-radius: var(--radius-control);
	background: #fff;
	font-family: var(--font-body);
	font-size: 15px;
	font-weight: 700;
	color: var(--ink);
	cursor: pointer;
}
.buecher .select select:hover { border-color: var(--accent); }

/* Aktive Filter als Chips zum Entfernen */
.active-filters {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 10px;
	margin-bottom: 20px;
}

.buecher .active-filter {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 36px;
	padding: 0 10px 0 14px;
	border-radius: var(--radius-control);
	background: var(--accent-light);
	color: var(--accent-dark);
	font-size: 14px;
	font-weight: 700;
	text-decoration: none;
}
.buecher .active-filter:hover { background: var(--accent-soft); color: var(--accent-deep); }

.buecher .active-filters__reset {
	font-size: 14px;
	font-weight: 700;
}

/* Regal mit Karten */
.shelf {
	--shelf-gap: 12px;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--shelf-gap);
}

@media (min-width: 600px) {
	.shelf { --shelf-gap: 18px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 900px) and (max-width: 1079px) {
	.shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.shelf__item { display: flex; min-width: 0; scroll-margin-top: 150px; } /* nachgeladene Karten nicht unter der Kopfzeile */
@media (min-width: 900px) {
	.shelf__item { scroll-margin-top: 110px; }
}

.bookcard {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	border-radius: var(--radius-card);
	background: #fff;
	box-shadow: var(--shadow-card);
	overflow: hidden;
	transition: box-shadow 0.25s ease;
}

.bookcard:hover {
	box-shadow: 0 22px 40px -24px rgba(43, 16, 24, 0.5);
}

/* Tastatur: Rahmen um die ganze Karte */
.bookcard:has(a:focus-visible) {
	outline: 3px solid var(--focus);
	outline-offset: 3px;
}
.buecher .bookcard__title a:focus-visible { outline: none; }

.bookcard__scene {
	--s1: #F7D9DF;
	--s2: #E3A6B4;
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	justify-items: center;
	gap: 6px;
	padding: 8px 8px 18px;
	border-bottom: 1px solid var(--line);
	background:
		radial-gradient(circle at 50% 32%, rgba(255, 255, 255, 0.7), transparent 62%),
		linear-gradient(170deg, var(--s1), var(--s2));
}
.bookcard__scene--rose { --s1: #F7D9DF; --s2: #E3A6B4; }
.bookcard__scene--blau { --s1: #DCE9F2; --s2: #9DBBD3; }
.bookcard__scene--herbst { --s1: #F8E0CC; --s2: #E5A57E; }
.bookcard__scene--gruen { --s1: #E9EFD9; --s2: #A9C08A; }
.bookcard__scene--lila { --s1: #EDE3F2; --s2: #BFA6CF; }
.bookcard__scene--meer { --s1: #DDEFEE; --s2: #8FC3C4; }

.bookcard__cover {
	width: min(68%, 150px);
	aspect-ratio: 2 / 3;
	overflow: hidden;
	border-radius: 2px 5px 5px 2px;
	box-shadow: 0 18px 26px -14px rgba(43, 16, 24, 0.55), 0 4px 10px -4px rgba(43, 16, 24, 0.3);
	font-size: clamp(10px, 3vw, 13px); /* Platzhalter-Titel auf schmalen Handys */
	transform: rotate(-1.5deg);
	transition: transform 0.35s ease;
}
.bookcard:hover .bookcard__cover { transform: rotate(0deg) scale(1.04); }

.bookcard__img { display: block; width: 100%; height: 100%; object-fit: cover; }

.bookcard__status {
	display: flex;
	align-items: flex-start;
	justify-self: stretch;
	min-height: 23px;
}

.bookcard__badge {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 1px 3px;
	max-width: 100%;
	padding: 4px;
	border-radius: var(--radius-control);
	font-size: 11px;
	font-weight: 800;
	line-height: 1.2;
	overflow-wrap: anywhere;
}
.bookcard__badge-price { font-variant-numeric: tabular-nums; }
.bookcard__badge--neu { background: var(--accent); color: #fff; }
.bookcard__badge--bald { background: #fff; color: var(--accent-dark); box-shadow: inset 0 0 0 1.5px var(--accent-soft); }
.bookcard__badge--aktion { background: var(--gold); color: var(--ink); }

.bookcard__body {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 14px 14px 16px;
}

.bookcard__series {
	font-size: 13px;
	font-weight: 600;
	line-height: 1.35;
	overflow-wrap: anywhere;
	color: var(--ink-70);
}

.bookcard__title {
	font-family: var(--font-heading);
	font-weight: 400;
	font-size: 17px;
	line-height: 1.18;
	overflow-wrap: break-word;
	-webkit-hyphens: auto;
	hyphens: auto;
}

.buecher .bookcard__title a { color: var(--ink); text-decoration: none; }
.buecher .bookcard__title a:hover { color: var(--accent-dark); }
/* ganze Karte klickbar */
.bookcard__title a::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
}

.bookcard__note {
	display: flex;
	align-items: flex-start;
	gap: 6px;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.35;
	color: var(--accent-dark);
}
.bookcard__note .icon { margin-top: 1px; }
.bookcard__note span { min-width: 0; overflow-wrap: anywhere; }

.bookcard__formats {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 10px;
	padding-top: 3px;
}

.bookcard__format {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	color: var(--ink-70);
	font-size: 13px;
}

.bookcard__format-label { display: none; }

@media (min-width: 600px) {
	.bookcard__format-label { display: inline; }
}

@media (min-width: 900px) {
	.bookcard__scene { padding: 10px 12px 22px; }
	.bookcard__body { padding: 16px 18px 18px; }
	.bookcard__title { font-size: 20px; }
}

/* Jede Kartenreihe teilt die Höhen von Status, Cover, Titel, Reihe, Hinweis und Formaten. */
@supports (grid-template-rows: subgrid) {
	.shelf { row-gap: 0; }

	.shelf__item,
	.bookcard,
	.bookcard__scene,
	.bookcard__body {
		display: grid;
		grid-template-rows: subgrid;
		row-gap: 0;
	}

	.shelf__item {
		grid-row: span 6;
		margin-block-end: var(--shelf-gap);
	}

	.bookcard { grid-row: 1 / -1; }
	.bookcard__scene { grid-row: 1 / 3; }
	.bookcard__cover { margin-top: 6px; }
	.bookcard__body { grid-row: 3 / 7; align-items: start; }
	.bookcard__title { grid-row: 1; }
	.bookcard__series { grid-row: 2; padding-top: 4px; }
	.bookcard__note { grid-row: 3; padding-top: 4px; }
	.bookcard__formats { grid-row: 4; padding-top: 6px; }
}

/* Nachladen (erst ab mehr als 48 Treffern) */
.shelf__more {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	margin-top: 28px;
	text-align: center;
}

.shelf__status { font-size: 15px; color: var(--ink-70); }

.buecher .shelf__btn.is-loading { opacity: 0.6; cursor: progress; }

@media (max-width: 599px) {
	.buecher .shelf__btn { width: 100%; }
}

/* Keine Treffer */
.catalog-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	padding: 36px 12px 28px;
	text-align: center;
	color: var(--ink-70);
}

.catalog-empty__title {
	font-family: var(--font-heading);
	font-size: 22px;
	line-height: 1.2;
	color: var(--ink);
}

/* ==========================================================================
   Begriffsseiten: Reihe, Trope, Thema, Schauplatz (template-parts/begriff/seite.php)
   ========================================================================== */

.term-head__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 20px;
	font-size: 15px;
	font-weight: 700;
	color: var(--ink-70);
}
.term-head__meta > span { display: inline-flex; align-items: center; gap: 6px; }

.term-head__lead { color: var(--ink-70); }
.term-head__lead p + p { margin-top: 10px; }

.term-head__hint {
	align-self: flex-start;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 6px 14px;
	border-radius: 999px;
	background: var(--success-bg);
	color: var(--success);
	font-size: 14px;
	font-weight: 700;
}

.term-head__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 24px;
	margin-top: 6px;
}

.buecher .term-head__all {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	font-size: 15px;
	font-weight: 800;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

/* Bild oben (Landschaftsbild der Reihe bzw. Bild des Begriffs) */
.term-head__image {
	margin: 0;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	border-radius: 20px;
	box-shadow: var(--shadow-card);
}
.term-head__image img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* Handy: Bild gleich unter den Brotkrümeln, flacher */
@media (max-width: 899px) {
	.term-head .breadcrumbs { order: -2; }
	.term-head__image { order: -1; aspect-ratio: 16 / 10; }
}

@media (min-width: 900px) {
	.catalog-head.term-head--bild { grid-template-columns: 1fr 440px; gap: 18px 40px; }
	.term-head__image { grid-area: fan; }
}

/* Bücher über die volle Breite */
@media (min-width: 900px) {
	.shelf.shelf--wide { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1080px) {
	.shelf.shelf--wide { --shelf-gap: 22px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Weitere Reihen / Begriffe */
.term-more { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; }

.term-more__title {
	font-family: var(--font-heading);
	font-weight: 400;
	font-size: clamp(24px, 2.6vw, 30px);
	line-height: 1.15;
}

.series-links {
	align-self: stretch;
	display: grid;
	gap: 12px;
}
@media (min-width: 700px) {
	.series-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1080px) {
	.series-links { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.buecher .series-link {
	display: flex;
	align-items: center;
	gap: 14px;
	height: 100%;
	padding: 10px 16px 10px 10px;
	border-radius: var(--radius-card);
	background: #fff;
	box-shadow: var(--shadow-card);
	color: var(--ink);
	text-decoration: none;
	transition: transform 0.25s ease;
}
.buecher .series-link:hover { transform: translateY(-3px); color: var(--ink); }
.series-link > .icon { margin-left: auto; }

.series-link__covers {
	position: relative;
	flex: none;
	width: 96px;
	height: 78px;
	border-radius: 12px;
	background: linear-gradient(170deg, var(--s1, #F7D9DF), var(--s2, #E3A6B4));
	overflow: hidden;
}

.series-link__cover {
	position: absolute;
	bottom: 9px;
	width: 34px;
	aspect-ratio: 2 / 3;
	overflow: hidden;
	border-radius: 2px 3px 3px 2px;
	box-shadow: 0 8px 12px -6px rgba(43, 16, 24, 0.5);
	font-size: 5px;
}
.series-link__cover--1 { z-index: 3; left: 31px; }
.series-link__cover--2 { z-index: 2; left: 12px; transform: rotate(-10deg); }
.series-link__cover--3 { z-index: 1; left: 50px; transform: rotate(10deg); }
.series-link__img { display: block; width: 100%; height: 100%; object-fit: cover; }

.series-link__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.series-link__name {
	font-family: var(--font-heading);
	font-size: 18px;
	line-height: 1.2;
	overflow-wrap: break-word;
}
.series-link__meta { font-size: 13px; font-weight: 600; color: var(--ink-70); }

.term-links { display: flex; flex-wrap: wrap; gap: 8px; }

.buecher .term-link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 40px;
	padding: 6px 8px 6px 14px;
	border-radius: var(--radius-control);
	border: 1.5px solid var(--line-strong);
	background: #fff;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.2;
	color: var(--ink);
	text-decoration: none;
	transition: background-color 0.2s, border-color 0.2s;
}
.buecher .term-link:hover { border-color: var(--accent); background: var(--accent-hover); color: var(--ink); }

/* ==========================================================================
   Lesereihenfolge (/buecher/reihenfolge/, template-parts/buecher/reihenfolge.php)
   ========================================================================== */

.order-jump { margin-top: 8px; }
.order-jump .term-link { padding-right: 14px; }

.order-series { scroll-margin-top: 150px; } /* Sprungziel unter der festen Kopfzeile */
@media (min-width: 900px) {
	.order-series { scroll-margin-top: 110px; }
}

.order-series__head {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 8px 24px;
	margin-bottom: 14px;
}
.order-series__intro { display: flex; flex-direction: column; gap: 6px; }

.order-series__title {
	font-family: var(--font-heading);
	font-weight: 400;
	font-size: clamp(26px, 3vw, 36px);
	line-height: 1.1;
}

.order-series .term-head__hint { margin-bottom: 4px; }

/* Leseweg – Handy: Zeilen mit Nummer, Cover und Titel, gestrichelt verbunden */
.steps {
	display: flex;
	flex-direction: column;
	gap: 14px;
	margin-top: 16px;
}

.step {
	position: relative;
	display: grid;
	grid-template-columns: 36px 60px minmax(0, 1fr);
	align-items: center;
	gap: 0 14px;
	padding: 10px 14px 10px 10px;
	border-radius: var(--radius-card);
	background: #fff;
	box-shadow: var(--shadow-card);
	transition: transform 0.25s ease;
}
.step:hover { transform: translateY(-3px); }
.step:has(a:focus-visible) { outline: 3px solid var(--focus); outline-offset: 3px; }

.step__num {
	position: relative;
	z-index: 1;
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: var(--accent);
	color: #fff;
	font-family: var(--font-heading);
	font-size: 18px;
	line-height: 1;
}

/* Verbindung zur nächsten Nummer */
.step:not(:last-child)::after {
	content: "";
	position: absolute;
	left: 27px;
	top: calc(50% + 18px);
	height: calc(100% - 22px);
	border-left: 2px dashed var(--accent-soft);
}

.step__cover {
	width: 60px;
	aspect-ratio: 2 / 3;
	overflow: hidden;
	border-radius: 2px 4px 4px 2px;
	box-shadow: 0 10px 16px -8px rgba(43, 16, 24, 0.5);
	font-size: 7px;
}
.step__img { display: block; width: 100%; height: 100%; object-fit: cover; }

.step__text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }

.step__band {
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--accent);
}

.buecher .step__title {
	font-family: var(--font-heading);
	font-size: 17px;
	line-height: 1.2;
	color: var(--ink);
	text-decoration: none;
	overflow-wrap: break-word;
	-webkit-hyphens: auto;
	hyphens: auto;
}
.buecher .step__title:hover { color: var(--accent-dark); }
.buecher .step__title:focus-visible { outline: none; }
/* ganze Zeile klickbar */
.step__title::after { content: ""; position: absolute; inset: 0; z-index: 2; }

.step__note { font-size: 13px; font-weight: 700; line-height: 1.35; color: var(--ink-70); }
.step__note--bald { color: var(--accent-dark); }

/* Einzelromane: keine Nummern, keine Verbindung */
.steps--einzeln .step { grid-template-columns: 60px minmax(0, 1fr); }
.steps--einzeln .step__num,
.steps--einzeln .step::after { display: none; }

/* Computer: Bände nebeneinander, Nummern oben, gestrichelt verbunden */
@media (min-width: 700px) {
	.steps {
		display: grid;
		grid-template-columns: repeat(4, minmax(0, 1fr));
		gap: 28px 20px;
	}

	.step {
		grid-template-columns: 1fr;
		justify-items: center;
		align-content: start;
		gap: 14px;
		padding: 0;
		background: none;
		box-shadow: none;
		text-align: center;
	}

	.step:not(:last-child)::after {
		left: calc(50% + 24px);
		top: 18px;
		width: calc(100% - 48px + 20px);
		height: 0;
		border-left: 0;
		border-top: 2px dashed var(--accent-soft);
	}
	.step:nth-child(4n)::after { display: none; }

	.step__cover { width: min(70%, 130px); font-size: 11px; box-shadow: 0 18px 26px -14px rgba(43, 16, 24, 0.55); }
	.step:hover .step__cover { transform: rotate(-1.5deg); }
	.step__cover { transition: transform 0.3s ease; }
	.step__text { align-items: center; }
	.buecher .step__title { font-size: 18px; }

	.steps--einzeln .step { grid-template-columns: 1fr; }
}

@media (min-width: 1080px) {
	.steps { grid-template-columns: repeat(5, minmax(0, 1fr)); }
	.step:nth-child(4n)::after { display: block; }
	.step:nth-child(5n)::after,
	.step:last-child::after { display: none; }
}

/* ---------- Weniger Bewegung ---------- */

@media (prefers-reduced-motion: reduce) {
	.bookcard,
	.bookcard__cover,
	.fan__book,
	.series-link,
	.step,
	.step__cover,
	.catalog__toggle > .icon:last-child,
	.catalog__results { transition: none; }
	.bookcard:hover,
	.step:hover,
	.step:hover .step__cover,
	.buecher .series-link:hover { transform: none; }
	.bookcard:hover .bookcard__cover { transform: rotate(-1.5deg); }
}

/* ------------------------------------------------------------------
 * Cover im eigenen Format (24.11.): nichts mehr abschneiden.
 * Der Rahmen bleibt 2:3, damit Karten und Reihen gleich hoch bleiben.
 * Das Bild passt sich ganz ein (z. B. 1:1,6 von KDP) und steht unten.
 * Schatten und Ecken sitzen am Bild statt am Rahmen.
 * Platzhalter ohne Bild bleiben wie bisher.
 * ------------------------------------------------------------------ */
.bookcard__cover:has(img),
.fan__book:has(img),
.step__cover:has(img),
.series-link__cover:has(img) {
	display: flex;
	align-items: flex-end;
	justify-content: center;
	overflow: visible;
	border-radius: 0;
	box-shadow: none;
}
img.bookcard__img,
img.fan__img,
img.step__img,
img.series-link__img {
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: 100%;
	object-fit: fill;
}
img.bookcard__img {
	border-radius: 2px 5px 5px 2px;
	box-shadow: 0 18px 26px -14px rgba(43, 16, 24, 0.55), 0 4px 10px -4px rgba(43, 16, 24, 0.3);
}
img.fan__img {
	border-radius: 3px 6px 6px 3px;
	box-shadow: 0 22px 34px -18px rgba(43, 16, 24, 0.55), 0 6px 12px -6px rgba(43, 16, 24, 0.3);
}
img.step__img {
	border-radius: 2px 4px 4px 2px;
	box-shadow: 0 10px 16px -8px rgba(43, 16, 24, 0.5);
}
img.series-link__img {
	border-radius: 2px 3px 3px 2px;
	box-shadow: 0 8px 12px -6px rgba(43, 16, 24, 0.5);
}
@media (min-width: 700px) {
	img.step__img { box-shadow: 0 18px 26px -14px rgba(43, 16, 24, 0.55); }
}

/* ==========================================================================
   EMMA-ANPASSUNG 03.12. (7) – BITTE BEI THEME-UPDATES ÜBERNEHMEN
   Bücher-Übersicht: im ersten Modul keine Cover (Fächer), nur Text –
   die Bücher stehen gleich darunter (Wunsch Emma 03.12.).
   ========================================================================== */
.catalog-head[data-swap="kopf"] .catalog-head__fan { display: none !important; }
@media (min-width: 900px) {
	.catalog-head[data-swap="kopf"] { grid-template-columns: 1fr; grid-template-areas: "crumbs" "text"; }
}
/* (7b) Text im Kopf über die ganze Breite des Moduls (Wunsch Emma 03.12., 15:30) */
.catalog-head[data-swap="kopf"] .catalog-head__text,
.catalog-head[data-swap="kopf"] .catalog-head__lead,
.catalog-head[data-swap="kopf"] .catalog-head__title { max-width: none; }

/* EMMA-ANPASSUNG 04.12. (17d) (Kirill) – BITTE BEI THEME-UPDATES ÜBERNEHMEN
 * Buchkarten ohne Reihen-/Bandzeile (steht auf der Buchseite), Titel ohne Silbentrennung. */
.bookcard__series { display: none !important; }
.bookcard__title { -webkit-hyphens: manual; hyphens: manual; overflow-wrap: normal; }

/* EMMA-ANPASSUNG 04.12. (17e) (Kirill) – BITTE BEI THEME-UPDATES ÜBERNEHMEN
 * Etikett über dem Cover: „Ab 4. Mai 2027“ bordeaux und kräftig, „Neu“ zart. */
.bookcard__badge { padding: 4px 9px; font-size: 12px; font-weight: 700; letter-spacing: 0; text-transform: none; }
.bookcard__badge--bald, .bookcard__badge--neu { white-space: nowrap; }
.bookcard__status { min-width: 0; max-width: 100%; }
.bookcard__badge--aktion { white-space: normal; }
.bookcard__badge--aktion .bookcard__badge-price { margin-left: 2px; }
@media (max-width: 599px) { .bookcard__badge--aktion { font-size: 11px; padding: 4px 7px; } }
.bookcard__badge--bald { background: var(--accent-dark, #6E1630); color: #fff; box-shadow: none; }
.bookcard__badge--neu { background: var(--accent-tint, #FBEFF2); color: var(--accent-dark, #6E1630); box-shadow: inset 0 0 0 1px var(--line, #E8D3D9); }
@media (min-width: 900px) { .bookcard__badge { font-size: 13px; padding: 5px 10px; } }
.bookcard__cover { width: min(68%, 150px) !important; aspect-ratio: 2 / 3 !important; height: auto !important; justify-self: center; }
/* Spaltenbreite fest: sonst wird die Szene so breit wie ihr Inhalt und Cover werden unterschiedlich groß. */
.shelf__item, .bookcard { grid-template-columns: minmax(0, 1fr); }
.bookcard__scene, .bookcard__body { min-width: 0; }
/* (17d) Silbentrennung nur für sehr lange Wörter („Perlensommer-träume“), nicht für „Sum-mer“. */
.bookcard__title { -webkit-hyphens: auto; hyphens: auto; hyphenate-limit-chars: 12 5 5; -webkit-hyphenate-limit-before: 5; -webkit-hyphenate-limit-after: 5; overflow-wrap: break-word; }
