/* PDF Flipbook viewer — minimal chrome, inherits the theme around it. */

.pdf-flipbook-wrap {
	--pfb-accent: #333333;
	position: relative;
	margin: 1.5em 0;
	outline: none;
}

/* Loading state */
.pfb-loading {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.75em;
	padding: 3em 1em;
	background: rgba(0, 0, 0, 0.03);
	border-radius: 6px;
}
.pfb-progress {
	width: min(320px, 80%);
	height: 4px;
	background: rgba(0, 0, 0, 0.1);
	border-radius: 2px;
	overflow: hidden;
}
.pfb-progress-bar {
	width: 0;
	height: 100%;
	background: var(--pfb-accent);
	transition: width 0.2s ease;
}
.pfb-loading-text {
	font-size: 0.85em;
	opacity: 0.7;
}

/* Stage: arrows + book */
.pfb-stage {
	display: flex;
	align-items: center;
	gap: 8px;
}
.pfb-book-box {
	flex: 1;
	min-width: 0;
	display: flex;
	justify-content: center;
}
.pfb-book img {
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

.pfb-nav {
	flex: 0 0 auto;
	width: 38px;
	height: 60px;
	border: none;
	border-radius: 4px;
	background: rgba(0, 0, 0, 0.06);
	color: var(--pfb-accent);
	font-size: 1.1em;
	cursor: pointer;
	transition: background 0.15s ease;
}
.pfb-nav:hover,
.pfb-nav:focus-visible {
	background: rgba(0, 0, 0, 0.14);
}

/* Toolbar under the book */
.pfb-toolbar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-top: 0.6em;
	font-size: 0.85em;
}
.pfb-counter {
	opacity: 0.75;
}
.pfb-tools {
	display: flex;
	gap: 6px;
}
.pfb-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border: none;
	border-radius: 4px;
	background: rgba(0, 0, 0, 0.06);
	color: var(--pfb-accent);
	font-size: 1em;
	cursor: pointer;
	text-decoration: none;
	transition: background 0.15s ease;
}
.pfb-btn:hover,
.pfb-btn:focus-visible {
	background: rgba(0, 0, 0, 0.14);
	color: var(--pfb-accent);
}

/* Fullscreen mode */
.pfb-is-fullscreen {
	background: #1a1a1a;
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: 2vh 2vw;
	margin: 0;
}
.pfb-is-fullscreen .pfb-toolbar {
	color: #eee;
}
.pfb-is-fullscreen .pfb-nav,
.pfb-is-fullscreen .pfb-btn {
	background: rgba(255, 255, 255, 0.12);
	color: #eee;
}

/* Error state */
.pfb-error {
	padding: 2em 1em;
	text-align: center;
	background: rgba(0, 0, 0, 0.03);
	border-radius: 6px;
}

/* Mobile: hide side arrows (swipe + toolbar remain), tighten spacing */
@media (max-width: 600px) {
	.pfb-nav {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.pfb-progress-bar {
		transition: none;
	}
}

/* Zoom overlay (v1.0.2) */
.pfb-zoom-overlay {
	position: fixed;
	inset: 0;
	z-index: 99999;
	background: rgba(15, 15, 15, 0.95);
	display: flex;
	flex-direction: column;
	outline: none;
}
.pfb-zoom-overlay[hidden] {
	display: none;
}
.pfb-zoom-bar {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 10px;
	color: #eee;
	font-size: 0.9em;
}
.pfb-zoom-bar .pfb-btn {
	background: rgba(255, 255, 255, 0.12);
	color: #eee;
}
.pfb-zoom-bar .pfb-btn:hover,
.pfb-zoom-bar .pfb-btn:focus-visible {
	background: rgba(255, 255, 255, 0.25);
	color: #fff;
}
.pfb-zoom-counter {
	min-width: 64px;
	text-align: center;
	opacity: 0.85;
}
.pfb-zoom-close {
	margin-left: 12px;
}
.pfb-zoom-scroll {
	flex: 1;
	overflow: auto;
	text-align: center;
	padding: 0 10px 20px;
	-webkit-overflow-scrolling: touch;
}
.pfb-zoom-img {
	display: inline-block;
	max-width: none;
	height: auto;
	box-shadow: 0 4px 24px rgba(0, 0, 0, 0.6);
	background: #fff;
}
.pfb-no-scroll {
	overflow: hidden;
}

/* HTML-mode pages (v1.0.3) */
.pfb-page {
	background: #fff;
	overflow: hidden;
	box-shadow: 0 0 6px rgba(0, 0, 0, 0.25);
}
.pfb-page img {
	width: 100%;
	height: 100%;
	object-fit: fill;
	display: block;
	max-width: none;   /* defend against theme img rules */
	margin: 0;
	user-select: none;
	-webkit-user-drag: none;
}
