/**
 * Pixel PDF Flipbook - front-end styles.
 * Premium dark, magazine-style viewer. RTL aware.
 */

.ppf-flipbook {
	--ppf-bg: #0e1116;
	--ppf-bg-2: #161b22;
	--ppf-panel: rgba(255, 255, 255, 0.06);
	--ppf-border: rgba(255, 255, 255, 0.12);
	--ppf-text: #e8edf2;
	--ppf-muted: #9aa6b2;
	--ppf-accent: #c9a24b;
	--ppf-accent-2: #e7c873;
	--ppf-shadow: 0 30px 60px rgba(0, 0, 0, 0.55);
	--ppf-radius: 14px;

	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	min-height: 480px;
	background: radial-gradient(120% 120% at 50% 0%, #1b2230 0%, var(--ppf-bg) 60%);
	border-radius: var(--ppf-radius);
	color: var(--ppf-text);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Assistant", "Heebo", Arial, sans-serif;
	overflow: hidden;
	box-sizing: border-box;
}

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

/* ---------- Toolbar ---------- */
.ppf-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 16px;
	background: linear-gradient(180deg, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.05));
	border-bottom: 1px solid var(--ppf-border);
	backdrop-filter: blur(6px);
	z-index: 5;
}

.ppf-toolbar-group {
	display: flex;
	align-items: center;
	gap: 8px;
}

.ppf-counter-wrap {
	flex: 1;
	justify-content: center;
	color: var(--ppf-muted);
	font-size: 14px;
	letter-spacing: 0.02em;
}

.ppf-counter .ppf-current {
	color: var(--ppf-accent-2);
	font-weight: 700;
}

.ppf-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 1px solid var(--ppf-border);
	border-radius: 10px;
	background: var(--ppf-panel);
	color: var(--ppf-text);
	cursor: pointer;
	transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
	text-decoration: none;
}

.ppf-btn:hover {
	background: rgba(255, 255, 255, 0.12);
	border-color: var(--ppf-accent);
	transform: translateY(-1px);
}

.ppf-btn:active {
	transform: translateY(0);
}

.ppf-btn:disabled {
	opacity: 0.35;
	cursor: default;
	transform: none;
}

.ppf-btn:focus-visible {
	outline: 2px solid var(--ppf-accent-2);
	outline-offset: 2px;
}

/* ---------- Icons (pure CSS / SVG masks via background) ---------- */
.ppf-ico {
	width: 20px;
	height: 20px;
	display: block;
	background-color: currentColor;
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
	-webkit-mask-position: center;
	mask-position: center;
	-webkit-mask-size: contain;
	mask-size: contain;
}

.ppf-ico-prev {
	-webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M15.4 7.4 14 6l-6 6 6 6 1.4-1.4L10.8 12z'/></svg>");
	mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M15.4 7.4 14 6l-6 6 6 6 1.4-1.4L10.8 12z'/></svg>");
}

.ppf-ico-next {
	-webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M8.6 16.6 10 18l6-6-6-6-1.4 1.4L13.2 12z'/></svg>");
	mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M8.6 16.6 10 18l6-6-6-6-1.4 1.4L13.2 12z'/></svg>");
}

/* RTL: visually swap the prev/next arrow glyphs so they point naturally. */
.ppf-flipbook[dir="rtl"] .ppf-ico-prev {
	-webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M8.6 16.6 10 18l6-6-6-6-1.4 1.4L13.2 12z'/></svg>");
	mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M8.6 16.6 10 18l6-6-6-6-1.4 1.4L13.2 12z'/></svg>");
}

.ppf-flipbook[dir="rtl"] .ppf-ico-next {
	-webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M15.4 7.4 14 6l-6 6 6 6 1.4-1.4L10.8 12z'/></svg>");
	mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M15.4 7.4 14 6l-6 6 6 6 1.4-1.4L10.8 12z'/></svg>");
}

.ppf-ico-zoom-in {
	-webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M15.5 14h-.8l-.3-.3a6.5 6.5 0 1 0-.7.7l.3.3v.8l5 5 1.5-1.5-5-5zm-6 0A4.5 4.5 0 1 1 14 9.5 4.5 4.5 0 0 1 9.5 14zM9 6h1v2.5H12v1H10V12H9V9.5H6.5v-1H9z'/></svg>");
	mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M15.5 14h-.8l-.3-.3a6.5 6.5 0 1 0-.7.7l.3.3v.8l5 5 1.5-1.5-5-5zm-6 0A4.5 4.5 0 1 1 14 9.5 4.5 4.5 0 0 1 9.5 14zM9 6h1v2.5H12v1H10V12H9V9.5H6.5v-1H9z'/></svg>");
}

.ppf-ico-zoom-out {
	-webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M15.5 14h-.8l-.3-.3a6.5 6.5 0 1 0-.7.7l.3.3v.8l5 5 1.5-1.5-5-5zm-6 0A4.5 4.5 0 1 1 14 9.5 4.5 4.5 0 0 1 9.5 14zM6.5 8.5h6v1h-6z'/></svg>");
	mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M15.5 14h-.8l-.3-.3a6.5 6.5 0 1 0-.7.7l.3.3v.8l5 5 1.5-1.5-5-5zm-6 0A4.5 4.5 0 1 1 14 9.5 4.5 4.5 0 0 1 9.5 14zM6.5 8.5h6v1h-6z'/></svg>");
}

.ppf-ico-fullscreen {
	-webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M7 14H5v5h5v-2H7zm-2-4h2V7h3V5H5zm12 7h-3v2h5v-5h-2zM14 5v2h3v3h2V5z'/></svg>");
	mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M7 14H5v5h5v-2H7zm-2-4h2V7h3V5H5zm12 7h-3v2h5v-5h-2zM14 5v2h3v3h2V5z'/></svg>");
}

.ppf-ico-download {
	-webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M19 9h-4V3H9v6H5l7 7zM5 18v2h14v-2z'/></svg>");
	mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M19 9h-4V3H9v6H5l7 7zM5 18v2h14v-2z'/></svg>");
}

.ppf-ico-toc {
	-webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M4 5h2v2H4zm0 6h2v2H4zm0 6h2v2H4zM8 5h12v2H8zm0 6h12v2H8zm0 6h12v2H8z'/></svg>");
	mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M4 5h2v2H4zm0 6h2v2H4zm0 6h2v2H4zM8 5h12v2H8zm0 6h12v2H8zm0 6h12v2H8z'/></svg>");
}

.ppf-ico-close {
	-webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M19 6.4 17.6 5 12 10.6 6.4 5 5 6.4 10.6 12 5 17.6 6.4 19 12 13.4 17.6 19 19 17.6 13.4 12z'/></svg>");
	mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M19 6.4 17.6 5 12 10.6 6.4 5 5 6.4 10.6 12 5 17.6 6.4 19 12 13.4 17.6 19 19 17.6 13.4 12z'/></svg>");
}

/* ---------- Version badge (so you can confirm the loaded build) ---------- */
.ppf-ver {
	position: absolute;
	bottom: 6px;
	inset-inline-start: 8px;
	z-index: 20;
	padding: 2px 7px;
	border-radius: 6px;
	background: rgba(0, 0, 0, 0.45);
	color: var(--ppf-accent-2);
	font-size: 11px;
	letter-spacing: 0.03em;
	pointer-events: none;
	opacity: 0.75;
}

/* ---------- Stage ---------- */
.ppf-stage {
	position: relative;
	flex: 1;
	min-width: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 28px;
	overflow: hidden;
	min-height: 380px;
	perspective: 2200px;
}

.ppf-stage.ppf-zoomed {
	overflow: auto;
	cursor: grab;
}

.ppf-book {
	position: relative;
	display: grid;
	grid-template-areas: "stack";
	align-items: center;
	justify-items: center;
	max-width: 100%;
	max-height: 100%;
	transform-style: preserve-3d;
}

/* All spreads share the same centered grid cell so the outgoing and incoming
   pages overlap perfectly during a page-turn (no corner jump). */
.ppf-spread {
	grid-area: stack;
	display: flex;
	align-items: stretch;
	justify-content: center;
	gap: 0;
	max-width: 100%;
	max-height: 100%;
	transform-origin: center center;
	will-change: transform, opacity;
	filter: drop-shadow(var(--ppf-shadow));
	backface-visibility: hidden;
}

.ppf-leaf {
	position: relative;
	flex: 0 0 auto;
	min-width: 0;
	max-width: 100%;
	background: #fff;
	line-height: 0;
}

.ppf-spread.ppf-double .ppf-leaf:first-child {
	border-radius: 6px 0 0 6px;
}

.ppf-spread.ppf-double .ppf-leaf:last-child {
	border-radius: 0 6px 6px 0;
}

.ppf-spread.ppf-single .ppf-leaf {
	border-radius: 6px;
}

/* Center spine shading on double spreads */
.ppf-spread.ppf-double .ppf-leaf:first-child::after,
.ppf-spread.ppf-double .ppf-leaf:last-child::before {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	width: 26px;
	pointer-events: none;
}

.ppf-spread.ppf-double .ppf-leaf:first-child::after {
	right: 0;
	background: linear-gradient(to right, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.18));
}

.ppf-spread.ppf-double .ppf-leaf:last-child::before {
	left: 0;
	background: linear-gradient(to left, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.18));
}

.ppf-canvas {
	display: block;
	width: 100%;
	height: auto;
	border-radius: inherit;
}

.ppf-leaf-error {
	min-width: 160px;
	background: #2a2f3a;
}

/* ---------- Main area: stage + docked (sticky) TOC ---------- */
.ppf-main {
	position: relative;
	flex: 1;
	display: flex;
	min-height: 0;
	overflow: hidden;
}

/* ---------- Table of contents (full-screen overlay) ---------- */
/* Deliberately an overlay, NOT a side dock: it never resizes the stage, so it
   can neither obstruct the catalog nor re-flow the pages mid-turn. */
.ppf-toc-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.65);
	backdrop-filter: blur(2px);
	z-index: 60;
	border: 0;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.22s ease, visibility 0.22s ease;
}

.ppf-flipbook.ppf-toc-open .ppf-toc-backdrop {
	opacity: 1;
	visibility: visible;
}

.ppf-toc {
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -48%) scale(0.98);
	width: min(1040px, 92vw);
	max-height: 86vh;
	display: flex;
	flex-direction: column;
	background: #11161d;
	border: 1px solid var(--ppf-border);
	border-radius: 16px;
	box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
	overflow: hidden;
	z-index: 61;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.22s ease, visibility 0.22s ease, transform 0.22s ease;
}

.ppf-flipbook.ppf-toc-open .ppf-toc {
	opacity: 1;
	visibility: visible;
	transform: translate(-50%, -50%) scale(1);
}

.ppf-toc-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 18px;
	border-bottom: 1px solid var(--ppf-border);
	flex: 0 0 auto;
}

.ppf-toc-title {
	font-size: 16px;
	font-weight: 700;
	letter-spacing: 0.02em;
	color: var(--ppf-accent-2);
}

.ppf-toc-close {
	width: 34px;
	height: 34px;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: var(--ppf-muted);
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
}

.ppf-toc-close:hover {
	background: rgba(255, 255, 255, 0.1);
	color: #fff;
}

.ppf-toc-list {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 6px;
}

/* Grid of manual entries: real page preview + title + page number. */
.ppf-toc-thumbs {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 14px;
	padding: 14px;
}

.ppf-toc-card {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 8px;
	padding: 8px;
	border: 1px solid var(--ppf-border);
	border-radius: 12px;
	background: rgba(255, 255, 255, 0.03);
	color: var(--ppf-text);
	text-align: start;
	cursor: pointer;
	transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.ppf-toc-card:hover {
	border-color: var(--ppf-accent);
	background: rgba(201, 162, 75, 0.12);
	transform: translateY(-2px);
}

.ppf-toc-card.ppf-toc-active {
	border-color: var(--ppf-accent-2);
	background: rgba(201, 162, 75, 0.18);
}

.ppf-thumb-holder {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	aspect-ratio: 1 / 1.414;
	background: #fff;
	border-radius: 8px;
	overflow: hidden;
}

.ppf-thumb-canvas {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.ppf-toc-cap {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	min-width: 0;
}

.ppf-toc-text {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-size: 14px;
	font-weight: 600;
}

.ppf-toc-num {
	flex: 0 0 auto;
	padding: 2px 7px;
	border-radius: 6px;
	background: rgba(255, 255, 255, 0.08);
	color: var(--ppf-muted);
	font-size: 11px;
	white-space: nowrap;
}

/* The TOC button carries a text label next to its icon, so it is auto-width. */
.ppf-toc-toggle {
	width: auto;
	min-width: 0;
	padding-inline: 12px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.ppf-toc-toggle .ppf-btn-text {
	margin-inline-start: 6px;
	font-size: 13px;
	white-space: nowrap;
}

/* ---------- Loading ---------- */
.ppf-loading {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 16px;
	background: rgba(14, 17, 22, 0.85);
	color: var(--ppf-muted);
	z-index: 6;
	transition: opacity 0.4s ease, visibility 0.4s ease;
}

.ppf-loading.ppf-hidden {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}

.ppf-loading.ppf-error {
	color: #ff8a8a;
}

.ppf-spinner {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: 3px solid rgba(255, 255, 255, 0.15);
	border-top-color: var(--ppf-accent-2);
	animation: ppf-spin 0.9s linear infinite;
}

.ppf-loading-text {
	font-size: 15px;
	letter-spacing: 0.04em;
}

@keyframes ppf-spin {
	to {
		transform: rotate(360deg);
	}
}

/* ---------- Fullscreen ---------- */
.ppf-flipbook.ppf-is-fullscreen,
.ppf-flipbook:fullscreen {
	width: 100vw;
	height: 100vh;
	border-radius: 0;
}

.ppf-flipbook:fullscreen .ppf-stage {
	min-height: 0;
}

/* ---------- Responsive (mobile = single page) ---------- */
@media (max-width: 760px) {
	.ppf-flipbook {
		min-height: 78vh;
	}

	.ppf-toolbar {
		flex-wrap: wrap;
		gap: 8px;
		padding: 10px 12px;
	}

	.ppf-counter-wrap {
		order: 3;
		flex-basis: 100%;
		font-size: 13px;
	}

	.ppf-stage {
		padding: 12px;
		min-height: 0;
	}

	.ppf-btn {
		width: 38px;
		height: 38px;
	}

	/* The TOC overlay goes near-fullscreen on phones. */
	.ppf-toc {
		width: 94vw;
		max-height: 88vh;
	}

	.ppf-toc-thumbs {
		grid-template-columns: repeat(2, 1fr);
		gap: 10px;
		padding: 10px;
	}

	/* Hide the TOC button's text on narrow toolbars (icon still shows). */
	.ppf-toc-toggle .ppf-btn-text {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ppf-spread {
		transition: none;
	}
}

/* ---------- Password gate ---------- */
.ppf-locked {
	align-items: center;
	justify-content: center;
	min-height: 420px;
	padding: 40px 20px;
}

.ppf-lock-card {
	width: 100%;
	max-width: 380px;
	margin: auto;
	padding: 36px 28px 32px;
	text-align: center;
	background: var(--ppf-panel);
	border: 1px solid var(--ppf-border);
	border-radius: 16px;
	box-shadow: var(--ppf-shadow);
	backdrop-filter: blur(8px);
}

.ppf-lock-icon {
	display: inline-block;
	width: 46px;
	height: 46px;
	margin-bottom: 14px;
	background-color: var(--ppf-accent-2);
	-webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M12 1a5 5 0 0 0-5 5v3H6a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-9a2 2 0 0 0-2-2h-1V6a5 5 0 0 0-5-5zm3 8H9V6a3 3 0 0 1 6 0zm-3 5a2 2 0 0 1 1 3.7V21h-2v-3.3A2 2 0 0 1 12 14z'/></svg>") center / contain no-repeat;
	mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M12 1a5 5 0 0 0-5 5v3H6a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-9a2 2 0 0 0-2-2h-1V6a5 5 0 0 0-5-5zm3 8H9V6a3 3 0 0 1 6 0zm-3 5a2 2 0 0 1 1 3.7V21h-2v-3.3A2 2 0 0 1 12 14z'/></svg>") center / contain no-repeat;
}

.ppf-lock-title {
	margin: 0 0 6px;
	font-size: 20px;
	font-weight: 700;
	color: var(--ppf-text);
}

.ppf-lock-sub {
	margin: 0 0 20px;
	color: var(--ppf-muted);
	font-size: 14px;
}

.ppf-lock-error {
	margin: 0 0 16px;
	padding: 8px 12px;
	border-radius: 8px;
	background: rgba(255, 90, 90, 0.12);
	color: #ff9a9a;
	font-size: 13px;
}

.ppf-lock-form {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.ppf-lock-input {
	width: 100%;
	padding: 12px 14px;
	border: 1px solid var(--ppf-border);
	border-radius: 10px;
	background: rgba(0, 0, 0, 0.25);
	color: var(--ppf-text);
	font-size: 15px;
	text-align: center;
}

.ppf-lock-input:focus {
	outline: none;
	border-color: var(--ppf-accent);
	box-shadow: 0 0 0 3px rgba(201, 162, 75, 0.25);
}

.ppf-lock-submit {
	width: 100%;
	padding: 12px 16px;
	border: 0;
	border-radius: 10px;
	background: linear-gradient(180deg, var(--ppf-accent-2), var(--ppf-accent));
	color: #1a1407;
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
	transition: transform 0.15s ease, filter 0.2s ease;
}

.ppf-lock-submit:hover {
	filter: brightness(1.06);
	transform: translateY(-1px);
}

/* ---------- Shortcode embed wrapper ---------- */
.ppf-embed {
	--ppf-embed-height: 640px;
	width: 100%;
	margin: 24px 0;
}

.ppf-embed .ppf-flipbook {
	height: var(--ppf-embed-height);
	min-height: var(--ppf-embed-height);
}

/* ---------- Standalone dedicated-URL page ---------- */
body.ppf-standalone {
	margin: 0;
	padding: 0;
	min-height: 100vh;
	background: #0a0d12;
	color: #e8edf2;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Assistant", "Heebo", Arial, sans-serif;
}

.ppf-page-shell {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

.ppf-page-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 16px 28px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
	background: rgba(0, 0, 0, 0.3);
}

.ppf-page-title {
	margin: 0;
	font-size: 18px;
	font-weight: 700;
	letter-spacing: 0.01em;
	color: #f2f4f7;
}

.ppf-home-link {
	color: #c9a24b;
	text-decoration: none;
	font-size: 14px;
	font-weight: 600;
}

.ppf-home-link:hover {
	color: #e7c873;
}

.ppf-page-main {
	flex: 1;
	display: flex;
	min-height: 0;
	padding: 22px;
}

.ppf-page-main .ppf-flipbook {
	flex: 1;
	min-height: 0;
}

/* Desktop / tablet: lock the standalone viewer to the viewport height so the
   flipbook (and its two-page spread) is always fully visible, centered, and
   never requires page scrolling. */
@media (min-width: 761px) {
	html,
	body.ppf-standalone {
		height: 100%;
		overflow: hidden;
	}

	/* Fix the whole viewer to the viewport so it can never be taller than the
	   window: no page scrolling is possible, ever. */
	.ppf-page-shell {
		position: fixed;
		inset: 0;
		height: 100vh;
		min-height: 0;
	}

	.ppf-page-main {
		min-height: 0;
	}

	.ppf-page-main .ppf-flipbook {
		height: 100%;
		min-height: 0;
	}

	.ppf-page-main .ppf-stage {
		min-height: 0;
	}
}

/* Mobile: single page, natural comfortable height. */
@media (max-width: 760px) {
	.ppf-page-header {
		padding: 12px 16px;
	}

	.ppf-page-title {
		font-size: 16px;
	}

	.ppf-page-main {
		padding: 10px;
	}

	.ppf-page-main .ppf-flipbook {
		min-height: calc(100vh - 96px);
	}
}
