/*
 * BlogMagazin – Buchseite (Vorlage „Buch“, template-parts/content-book.php).
 * Ergänzt das Theme-CSS, nur auf Buchseiten geladen.
 */

.book-hero {
	display: grid;
	gap: clamp(1.75rem, 4vw, 2.5rem);
	margin-bottom: clamp(2.5rem, 6vw, 4.5rem);
	padding-bottom: clamp(2rem, 5vw, 3.5rem);
	border-bottom: var(--rule) solid var(--ink);
}

@media (min-width: 700px) {
	.book-hero {
		grid-template-columns: minmax(12rem, 22rem) minmax(0, 1fr);
		gap: clamp(2.5rem, 6vw, 5rem);
		align-items: start;
	}
}

/* Cover: wie ein Buch auf dem Tisch – leichter Schatten, Falz am Rücken. */
.book-cover {
	position: relative;
	width: min(100%, 62vw);
	max-width: 22rem;
	margin-inline: auto;
}

@media (min-width: 700px) {
	.book-cover {
		width: 100%;
		margin: 0;
		position: sticky;
		top: 2rem;
	}
}

.book-cover-img,
.book-cover-placeholder {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 2px 5px 5px 2px;
	box-shadow:
		0 1px 1px rgba(15, 17, 25, 0.08),
		0 12px 24px -10px rgba(15, 17, 25, 0.35),
		0 36px 70px -28px rgba(15, 17, 25, 0.45);
}

.book-cover::after {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	width: 7%;
	border-radius: 2px 0 0 2px;
	background: linear-gradient(90deg, rgba(0, 0, 0, 0.16), rgba(255, 255, 255, 0.14) 45%, rgba(0, 0, 0, 0.04) 70%, transparent);
	pointer-events: none;
}

.book-cover-placeholder {
	display: flex;
	align-items: flex-end;
	aspect-ratio: 5 / 8;
	padding: 12% 11%;
	background:
		linear-gradient(var(--marker), var(--marker)) 11% 14% / 28% 0.35rem no-repeat,
		var(--ink);
	color: var(--paper);
	font-family: var(--font-display);
	font-size: clamp(1.25rem, 3vw, 2rem);
	font-weight: 850;
	line-height: 0.95;
	letter-spacing: -0.03em;
	hyphens: auto;
}

.book-info {
	container-type: inline-size;
	min-width: 0;
}

.book-info .page-kicker {
	margin-bottom: 0.5rem;
	color: var(--ink-soft);
}

.page .book-title {
	margin: 0;
	font-size: var(--step-4);
	font-weight: 850;
	line-height: 0.92;
	letter-spacing: -0.045em;
	hyphens: manual;
	-webkit-hyphens: manual;
	padding-top: 0.06em;
	text-wrap: balance;
}

@supports (width: 1cqi) {
	.page .book-title {
		font-size: clamp(2rem, calc(min(100cqi / var(--fit-word, 8), 170cqi / var(--fit-total, 12)) * 0.97), 6.5rem);
	}
}

.book-subtitle {
	max-width: 36rem;
	margin: 1rem 0 0;
	color: var(--ink-soft);
	font-family: var(--font-text);
	font-size: var(--step-1);
	line-height: 1.35;
	text-wrap: balance;
}

.book-author {
	margin: 1.1rem 0 0;
	font-family: var(--font-display);
	font-size: var(--step-0);
	font-weight: 600;
}

.book-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	margin-top: clamp(1.5rem, 3vw, 2.25rem);
}

.book-read,
.book-shop {
	display: inline-flex;
	align-items: center;
	gap: 0.55rem;
	min-height: 3.25rem;
	padding: 0.75rem 1.4rem;
	border: 2px solid var(--ink);
	border-radius: 0;
	font-family: var(--font-display);
	font-size: 1.0625rem;
	font-weight: 750;
	line-height: 1.1;
	text-decoration: none;
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.book-read {
	background: var(--ink);
	color: var(--paper);
	padding-inline: 1.6rem 1.75rem;
}

.book-read:hover,
.book-read:focus-visible {
	border-color: var(--marker);
	background: var(--marker);
	color: var(--marker-ink);
}

.book-read .icon {
	width: 1.35rem;
	height: 1.35rem;
}

.book-read-meta {
	padding-left: 0.6rem;
	border-left: 1px solid currentColor;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	opacity: 0.8;
}

.book-read-meta[hidden] {
	display: none;
}

.book-shop {
	background: transparent;
	color: var(--ink);
}

.book-shop:hover,
.book-shop:focus-visible {
	background: var(--fog);
	color: var(--ink);
}

.book-shop .icon {
	width: 1rem;
	height: 1rem;
	opacity: 0.6;
}

.book-notice {
	margin: 1rem 0 0;
	padding: 0.65rem 0.9rem;
	border-left: 4px solid var(--marker);
	background: var(--fog);
	font-family: var(--font-display);
	font-size: 0.9375rem;
	line-height: 1.4;
}

.book-facts {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
	gap: 1.1rem 1.75rem;
	margin: clamp(1.75rem, 4vw, 2.75rem) 0 0;
	max-width: 46rem;
}

.book-facts div {
	padding-top: 0.6rem;
	border-top: 1px solid var(--hairline);
}

.book-facts dt {
	color: var(--ink-soft);
	font-family: var(--font-display);
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.07em;
	text-transform: uppercase;
}

.book-facts dd {
	margin: 0.25rem 0 0;
	font-family: var(--font-display);
	font-size: 1.0625rem;
	font-weight: 650;
}

.book-info .edit-link {
	display: inline-block;
	margin-top: 1.25rem;
}

/* Beschreibung und Inhaltsverzeichnis nebeneinander (breit) bzw. untereinander. */
.book-body {
	display: grid;
	gap: clamp(2.5rem, 6vw, 4rem);
}

@media (min-width: 64rem) {
	.book-body.has-toc {
		grid-template-columns: minmax(0, var(--measure)) minmax(16rem, 22rem);
		justify-content: space-between;
		align-items: start;
	}
}

.book-toc {
	font-family: var(--font-display);
}

@media (min-width: 64rem) {
	.book-toc {
		position: sticky;
		top: 2rem;
	}
}

.book-toc-title,
.book-more-title {
	margin: 0 0 0.75rem;
	font-family: var(--font-display);
	font-size: var(--step-1);
	font-weight: 800;
	letter-spacing: -0.02em;
}

.book-toc-list {
	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: book-toc;
	border-top: 2px solid var(--ink);
}

.book-toc-list li {
	display: flex;
	align-items: baseline;
	gap: 0.75rem;
	padding: 0.7rem 0;
	border-bottom: 1px solid var(--hairline);
	counter-increment: book-toc;
	line-height: 1.3;
}

.book-toc-list li::before {
	content: counter(book-toc, decimal-leading-zero);
	flex: none;
	min-width: 1.6rem;
	color: var(--ink-soft);
	font-size: 0.8125rem;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}

.book-toc-name {
	flex: 1;
	min-width: 0;
	color: var(--ink);
	font-weight: 600;
	text-decoration: none;
}

a.book-toc-name:hover,
a.book-toc-name:focus-visible {
	background: var(--marker);
	color: var(--marker-ink);
}

.book-toc-meta {
	display: inline-flex;
	flex: none;
	gap: 0.3rem;
	align-items: center;
	color: var(--ink-soft);
	font-size: 0.8125rem;
}

.book-toc-meta .icon {
	width: 0.85rem;
	height: 0.85rem;
}

.book-toc-list li.is-locked .book-toc-name {
	color: var(--ink-soft);
	font-weight: 500;
}

/* Weitere Bücher */
.book-more {
	margin-top: clamp(3.5rem, 8vw, 6rem);
	padding-top: clamp(1.5rem, 3vw, 2rem);
	border-top: var(--rule) solid var(--ink);
}

.book-shelf {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
	gap: clamp(1.25rem, 3vw, 2.25rem);
	margin: 1.25rem 0 0;
	padding: 0;
	list-style: none;
}

.book-shelf a {
	display: block;
	color: var(--ink);
	text-decoration: none;
}

.book-shelf-cover {
	display: block;
	margin-bottom: 0.75rem;
	transition: transform 0.2s ease;
}

.book-shelf-cover img,
.book-shelf-cover .book-cover-placeholder {
	width: 100%;
	height: auto;
	border-radius: 2px 4px 4px 2px;
	box-shadow: 0 1px 1px rgba(15, 17, 25, 0.08), 0 10px 22px -10px rgba(15, 17, 25, 0.4);
}

.book-shelf-cover img {
	display: block;
}

.book-shelf-cover .book-cover-placeholder {
	font-size: 1.1rem;
}

.book-shelf a:hover .book-shelf-cover,
.book-shelf a:focus-visible .book-shelf-cover {
	transform: translateY(-4px);
}

.book-shelf-title {
	font-family: var(--font-display);
	font-size: 0.9375rem;
	font-weight: 700;
	line-height: 1.25;
}

.book-shelf a:hover .book-shelf-title {
	background: var(--marker);
	color: var(--marker-ink);
}

@media (prefers-reduced-motion: reduce) {
	.book-shelf-cover {
		transition: none;
	}
}
