/* PDF Flipbook – front end */
.pdffb {
	--pdffb-bg: #2b2b2b;
	--pdffb-paper: #fff;
	--pdffb-ui: rgba(255, 255, 255, .92);
	position: relative;
	background: var(--pdffb-bg);
	border-radius: 6px;
	color: #fff;
	font: 14px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	margin: 0 0 1.5em;
	outline: none;
	-webkit-user-select: none;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
}
.pdffb *, .pdffb *::before, .pdffb *::after { box-sizing: border-box; }

.pdffb-stage {
	position: relative;
	overflow-x: hidden;
	overflow-x: clip;
	overflow-y: visible;
	padding: 24px 16px;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 240px;
}

.pdffb-book {
	position: relative;
	perspective: 2600px;
	transition: transform .6s cubic-bezier(.45, .05, .35, 1);
	touch-action: pan-y;
	cursor: grab;
}
.pdffb-book.is-portrait { overflow: hidden; }
.pdffb-book.is-dragging { cursor: grabbing; }

/* A leaf is one sheet of paper: front face (right-hand page) and back face (left-hand page). */
.pdffb-leaf {
	position: absolute;
	top: 0;
	left: 50%;
	width: 50%;
	height: 100%;
	transform-origin: left center;
	transform-style: preserve-3d;
	transform: rotateY(0deg);
	transition: transform var(--pdffb-speed, .9s) cubic-bezier(.45, .05, .35, 1);
	will-change: transform;
}
.pdffb-book.is-portrait .pdffb-leaf { left: 0; width: 100%; }
.pdffb-leaf.is-turned { transform: rotateY(-180deg); }
.pdffb-leaf.is-gone { visibility: hidden; }
.pdffb-leaf.is-dragging,
.pdffb-book.no-anim .pdffb-leaf { transition: none; }

.pdffb-face {
	position: absolute;
	inset: 0;
	background: var(--pdffb-paper);
	-webkit-backface-visibility: hidden;
	backface-visibility: hidden;
	overflow: hidden;
}
/* Only the top sheet on each side casts a shadow, so stacked pages don't darken it */
.pdffb-leaf.is-top .pdffb-face { box-shadow: 0 3px 14px rgba(0, 0, 0, .16); }
.pdffb-face.is-empty { visibility: hidden; }
.pdffb-back { transform: rotateY(180deg); }

/* Gentle shadow in the gutter so it reads as a bound book */
.pdffb-book:not(.is-portrait) .pdffb-face::after {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	width: 9%;
	pointer-events: none;
	z-index: 3;
}
.pdffb-book:not(.is-portrait) .pdffb-front::after { left: 0; background: linear-gradient(to right, rgba(0,0,0,.1), rgba(0,0,0,0)); }
.pdffb-book:not(.is-portrait) .pdffb-back::after { right: 0; background: linear-gradient(to left, rgba(0,0,0,.1), rgba(0,0,0,0)); }

/* Lighting while a page is moving */
.pdffb-shade {
	position: absolute;
	inset: 0;
	pointer-events: none;
	opacity: 0;
	z-index: 2;
	transition: opacity .35s;
}
.pdffb-front .pdffb-shade { background: linear-gradient(to left, rgba(0,0,0,.25), rgba(0,0,0,.07) 60%, rgba(0,0,0,.02)); }
.pdffb-back .pdffb-shade { background: linear-gradient(to right, rgba(0,0,0,.25), rgba(0,0,0,.07) 60%, rgba(0,0,0,.02)); }
.pdffb-leaf.is-fwd .pdffb-front .pdffb-shade { animation: pdffb-shade-in var(--pdffb-speed, .9s) linear both; }
.pdffb-leaf.is-fwd .pdffb-back .pdffb-shade { animation: pdffb-shade-out var(--pdffb-speed, .9s) linear both; }
.pdffb-leaf.is-bwd .pdffb-back .pdffb-shade { animation: pdffb-shade-in var(--pdffb-speed, .9s) linear both; }
.pdffb-leaf.is-bwd .pdffb-front .pdffb-shade { animation: pdffb-shade-out var(--pdffb-speed, .9s) linear both; }
.pdffb-leaf.is-dragging .pdffb-shade { animation: none !important; transition: none; }
@keyframes pdffb-shade-in { 0% { opacity: 0; } 50% { opacity: .9; } 100% { opacity: .9; } }
@keyframes pdffb-shade-out { 0% { opacity: .9; } 50% { opacity: .9; } 100% { opacity: 0; } }

/* Page content */
.pdffb-page {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--pdffb-paper);
}
.pdffb-page canvas {
	display: block;
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
}
.pdffb-page:not(.is-rendered)::before {
	content: "";
	width: 28px;
	height: 28px;
	border-radius: 50%;
	border: 3px solid rgba(0, 0, 0, .12);
	border-top-color: rgba(0, 0, 0, .45);
	animation: pdffb-spin .8s linear infinite;
}
@keyframes pdffb-spin { to { transform: rotate(360deg); } }

/* Loading / error */
.pdffb-status {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 20px;
	color: var(--pdffb-ui);
	z-index: 50;
}
.pdffb-status[hidden] { display: none; }
.pdffb-status a { color: #fff; text-decoration: underline; }
.pdffb-bar { width: 180px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.2); overflow: hidden; }
.pdffb-bar span { display: block; height: 100%; width: 0; background: #fff; transition: width .2s; }

/* Toolbar */
.pdffb-toolbar {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 4px;
	padding: 0 10px 14px;
	flex-wrap: wrap;
}
.pdffb-toolbar[hidden] { display: none; }
.pdffb-btn {
	appearance: none;
	-webkit-appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--pdffb-ui);
	cursor: pointer;
	text-decoration: none;
	transition: background .15s, opacity .15s;
	box-shadow: none;
	line-height: 1;
}
.pdffb-btn:hover, .pdffb-btn:focus-visible { background: rgba(255, 255, 255, .14); color: #fff; outline: none; }
.pdffb-btn:disabled { opacity: .3; cursor: default; background: transparent; }
.pdffb-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pdffb-btn.is-off svg .pdffb-wave { display: none; }
.pdffb-pages {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 0 8px;
	color: var(--pdffb-ui);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}
.pdffb .pdffb-pages input {
	width: 4.2em;
	height: 30px;
	margin: 0;
	padding: 0 4px;
	border: 1px solid rgba(255, 255, 255, .25);
	border-radius: 4px;
	background: rgba(0, 0, 0, .25);
	color: #fff;
	font: inherit;
	text-align: center;
	box-shadow: none;
}
.pdffb .pdffb-pages input:focus { border-color: rgba(255, 255, 255, .7); outline: none; }
.pdffb-sep { width: 1px; height: 22px; background: rgba(255, 255, 255, .2); margin: 0 6px; }

/* Full screen (native, plus a fallback for iPhone which has no element full screen) */
.pdffb:fullscreen { border-radius: 0; margin: 0; display: flex; flex-direction: column; justify-content: center; }
.pdffb:-webkit-full-screen { border-radius: 0; margin: 0; display: flex; flex-direction: column; justify-content: center; }
.pdffb.is-pseudo-full {
	position: fixed;
	inset: 0;
	z-index: 999999;
	border-radius: 0;
	margin: 0;
	display: flex;
	flex-direction: column;
	justify-content: center;
}
html.pdffb-lock, html.pdffb-lock body { overflow: hidden !important; }

@media (max-width: 480px) {
	.pdffb-stage { padding: 14px 8px; }
	.pdffb-btn { width: 34px; height: 34px; }
	.pdffb-btn[data-act="first"], .pdffb-btn[data-act="last"] { display: none; }
}

/* Light backgrounds (e.g. white): switch the controls and messages to dark */
.pdffb.is-light { --pdffb-ui: rgba(0, 0, 0, .72); color: #222; }
.pdffb.is-light .pdffb-btn:hover,
.pdffb.is-light .pdffb-btn:focus-visible { background: rgba(0, 0, 0, .07); color: #000; }
.pdffb.is-light .pdffb-pages input { border-color: rgba(0, 0, 0, .25); background: #fff; color: #222; }
.pdffb.is-light .pdffb-pages input:focus { border-color: rgba(0, 0, 0, .6); }
.pdffb.is-light .pdffb-sep { background: rgba(0, 0, 0, .15); }
.pdffb.is-light .pdffb-status a { color: #222; }
.pdffb.is-light .pdffb-bar { background: rgba(0, 0, 0, .12); }
.pdffb.is-light .pdffb-bar span { background: #333; }

@media (prefers-reduced-motion: reduce) {
	.pdffb { --pdffb-speed: .01s; }
	.pdffb-book { transition: none; }
}
