/* PDF Flipbook – front-end styles. */

.fbp-flipbook {
	--fbp-bg: #f0f0f1;
	--fbp-accent: #2271b1;
	position: relative;
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
	margin: 1.5em 0;
	padding: 16px;
	background: var(--fbp-bg);
	border-radius: 6px;
	outline: none;
}

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

/* ---- Stage & book ---------------------------------------------------- */

.fbp-stage {
	position: relative;
	width: 100%;
}

/* Without JavaScript only the "Open the PDF" link is shown. */
.fbp-flipbook:not(.fbp-js) .fbp-stage {
	display: none;
}

/* Reserve space while loading, to limit layout shift. */
.fbp-flipbook.fbp-js:not(.is-ready) .fbp-stage {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 320px;
}

.fbp-sizer {
	position: relative;
	max-width: 100%;
	margin: 0 auto;
}

/* StPageFlip sets inline min sizes; the layout code already handles small screens. */
.fbp-flipbook .fbp-book {
	min-width: 0 !important;
	min-height: 0 !important;
}

.fbp-page {
	background: #fff;
	overflow: hidden;
}

.fbp-page-inner {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #fff;
}

.fbp-page-num {
	font: 600 14px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	color: #c3c4c7;
}

.fbp-page-inner.is-rendered .fbp-page-num {
	display: none;
}

.fbp-flipbook .fbp-canvas {
	display: block;
	max-width: none;
	margin: 0;
}

/* ---- Zoom layer ------------------------------------------------------ */

.fbp-zoom {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 20;
	display: flex;
	overflow: auto;
	background: var(--fbp-bg);
	cursor: grab;
	touch-action: pan-x pan-y; /* Pinch is handled in JS. */
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
	user-select: none;
	-webkit-user-select: none;
}

.fbp-zoom.is-panning {
	cursor: grabbing;
}

.fbp-flipbook.is-fullscreen .fbp-zoom {
	background: #2c3338;
}

/* margin:auto centres the pages when they are smaller than the layer, without clipping them when larger. */
.fbp-zoom-content {
	display: flex;
	flex-shrink: 0;
	margin: auto;
}

.fbp-zoom-page {
	position: relative;
	display: flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	background: #fff;
}

/* ---- Loading / error ------------------------------------------------- */

.fbp-loading {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	font-size: 14px;
	color: #50575e;
}

.fbp-spinner {
	width: 32px;
	height: 32px;
	border: 3px solid rgba(0, 0, 0, 0.15);
	border-top-color: var(--fbp-accent);
	border-radius: 50%;
	animation: fbp-spin 0.8s linear infinite;
}

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

@media (prefers-reduced-motion: reduce) {
	.fbp-spinner {
		animation-duration: 2.4s;
	}
}

.fbp-error {
	padding: 24px;
	text-align: center;
	color: #50575e;
}

.fbp-error p {
	margin: 0.5em 0;
}

/* The fallback link stays available to screen readers once the book works. */
.fbp-flipbook.fbp-js .fbp-fallback,
.fbp-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.fbp-flipbook.is-error .fbp-fallback {
	display: none;
}

.fbp-fallback {
	margin: 0;
}

/* ---- Toolbar --------------------------------------------------------- */

.fbp-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin-top: 12px;
	font: 14px/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	color: #1d2327;
}

.fbp-flipbook .fbp-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 38px;
	height: 38px;
	min-width: 0;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: 50%;
	background: #fff;
	color: #1d2327;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
	font-size: 0;
	line-height: 1;
	text-decoration: none;
	text-transform: none;
	cursor: pointer;
	transition: background-color 0.15s;
}

.fbp-flipbook .fbp-btn:hover:not(:disabled) {
	background: #f6f7f7;
	color: #1d2327;
}

.fbp-flipbook .fbp-btn:disabled {
	opacity: 0.4;
	cursor: default;
}

.fbp-flipbook .fbp-btn:focus-visible,
.fbp-flipbook .fbp-page-input:focus-visible {
	outline: 2px solid var(--fbp-accent);
	outline-offset: 2px;
}

.fbp-flipbook .fbp-btn svg {
	display: block;
	width: 20px;
	height: 20px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.fbp-flipbook .fbp-zoom-level {
	width: auto;
	min-width: 58px;
	padding: 0 10px;
	border-radius: 19px;
	font-size: 13px;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}

.fbp-pager {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0 4px;
	font-variant-numeric: tabular-nums;
}

.fbp-flipbook .fbp-page-input {
	box-sizing: border-box;
	width: 3.6em;
	height: 32px;
	margin: 0;
	padding: 0 4px;
	border: 1px solid rgba(0, 0, 0, 0.2);
	border-radius: 4px;
	background: #fff;
	color: #1d2327;
	box-shadow: none;
	font: inherit;
	text-align: center;
	-moz-appearance: textfield;
	appearance: textfield;
}

.fbp-flipbook .fbp-page-input::-webkit-inner-spin-button,
.fbp-flipbook .fbp-page-input::-webkit-outer-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.fbp-sep {
	width: 1px;
	height: 24px;
	margin: 0 4px;
	background: rgba(0, 0, 0, 0.15);
}

/* ---- Full screen ----------------------------------------------------- */

.fbp-flipbook.is-fullscreen {
	display: flex;
	flex-direction: column;
	justify-content: center;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	padding: 16px;
	border-radius: 0;
	background: #2c3338;
}

.fbp-flipbook.is-fullscreen .fbp-toolbar {
	color: #fff;
}

.fbp-flipbook.is-fullscreen .fbp-sep {
	background: rgba(255, 255, 255, 0.25);
}

/* Fallback for browsers without element full screen (iPhone Safari). */
.fbp-flipbook.is-pseudo-fs {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 999999;
	height: auto;
}

html.fbp-noscroll,
html.fbp-noscroll body {
	overflow: hidden;
}
