/**
 * PDF Flipbook — reader styles.
 *
 * The document is the thing people came for, so the chrome around it stays
 * quiet: a recessed stage, hairline controls, no competing colour.
 */

.pdffb {
	--pdffb-stage: #23262b;
	--pdffb-ink: #2c2f34;
	--pdffb-muted: #6b7079;
	--pdffb-line: rgba( 0, 0, 0, 0.12 );
	--pdffb-hover: rgba( 0, 0, 0, 0.06 );
	--pdffb-radius: 4px;

	position: relative;
	margin: 0 0 1.5em;
	max-width: 100%;
}

.pdffb-title {
	margin: 0 0 0.6em;
	font-size: 0.95em;
	line-height: 1.4;
	color: var( --pdffb-muted );
}

/* Stage --------------------------------------------------------------- */

.pdffb-stage {
	position: relative;
	padding: 18px 16px;
	background: var( --pdffb-stage );
	border-radius: var( --pdffb-radius );
	overflow: hidden;
}

.pdffb-stage:focus-visible {
	outline: 2px solid #fff;
	outline-offset: -4px;
}

.pdffb-viewport {
	position: relative;
	width: 100%;
	height: 420px; /* Replaced inline by the script once the PDF ratio is known. */
	margin: 0 auto;
}

.pdffb-book {
	width: 100%;
	height: 100%;
}

/* StPageFlip forces a min-width on its container, which overflows phones. */
.pdffb .pdffb-book.stf__parent {
	min-width: 0 !important;
	min-height: 0 !important;
}

.pdffb-page {
	background: #fff;
	overflow: hidden;
	box-shadow: 0 1px 6px rgba( 0, 0, 0, 0.28 );
}

.pdffb-page-img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	opacity: 0;
	transition: opacity 0.25s ease;
	background: #fff;
	border: 0;
	max-width: none;
}

.pdffb-page-img.is-loaded {
	opacity: 1;
}

.pdffb-page-loader {
	position: absolute;
	left: 50%;
	top: 50%;
	width: 22px;
	height: 22px;
	margin: -11px 0 0 -11px;
	border: 2px solid rgba( 0, 0, 0, 0.12 );
	border-top-color: rgba( 0, 0, 0, 0.4 );
	border-radius: 50%;
	opacity: 0;
	animation: pdffb-spin 0.9s linear infinite;
}

.pdffb-page.is-loading .pdffb-page-loader {
	opacity: 1;
}

/* One page documents have no flip engine, so centre the lone page. */
.pdffb.is-single-page .pdffb-book {
	display: flex;
	justify-content: center;
}

.pdffb.is-single-page .pdffb-page {
	position: relative;
	height: 100%;
	max-width: 100%;
}

.pdffb.is-single-page .pdffb-page-img {
	width: auto;
	height: 100%;
	max-width: 100%;
}

/* Edge navigation ------------------------------------------------------ */

.pdffb-edge {
	position: absolute;
	top: 50%;
	transform: translateY( -50% );
	width: 44px;
	height: 44px;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 0;
	border-radius: 50%;
	background: rgba( 255, 255, 255, 0.82 );
	color: #1d1f23;
	cursor: pointer;
	opacity: 0;
	transition: opacity 0.18s ease, background 0.18s ease;
	z-index: 5;
}

.pdffb-edge svg {
	width: 20px;
	height: 20px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.pdffb-edge-prev {
	left: 10px;
}

.pdffb-edge-next {
	right: 10px;
}

.pdffb-stage:hover .pdffb-edge,
.pdffb-edge:focus-visible {
	opacity: 1;
}

.pdffb-edge:hover {
	background: #fff;
}

.pdffb-edge[disabled] {
	opacity: 0 !important;
	pointer-events: none;
}

@media ( hover: none ) {
	.pdffb-edge {
		opacity: 0.75;
	}
}

/* Status --------------------------------------------------------------- */

.pdffb-status {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	font-size: 0.85rem;
	color: rgba( 255, 255, 255, 0.72 );
	background: var( --pdffb-stage );
	z-index: 6;
}

.pdffb.is-ready .pdffb-status {
	display: none;
}

.pdffb-spinner {
	width: 16px;
	height: 16px;
	border: 2px solid rgba( 255, 255, 255, 0.25 );
	border-top-color: rgba( 255, 255, 255, 0.8 );
	border-radius: 50%;
	animation: pdffb-spin 0.9s linear infinite;
}

.pdffb-status.is-error .pdffb-spinner {
	display: none;
}

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

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

.pdffb-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 8px 4px 0;
	color: var( --pdffb-ink );
}

.pdffb-bar-group {
	display: flex;
	align-items: center;
	gap: 2px;
}

.pdffb-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	padding: 0;
	border: 0;
	border-radius: var( --pdffb-radius );
	background: none;
	color: inherit;
	cursor: pointer;
	text-decoration: none;
	box-shadow: none;
}

.pdffb-btn:hover,
.pdffb-btn:focus-visible {
	background: var( --pdffb-hover );
	color: inherit;
}

.pdffb-btn[disabled] {
	opacity: 0.3;
	cursor: default;
}

.pdffb-btn svg {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.pdffb-counter {
	display: flex;
	align-items: baseline;
	gap: 5px;
	font-size: 0.85rem;
	font-variant-numeric: tabular-nums;
	color: var( --pdffb-muted );
}

.pdffb-page-input {
	width: 4.5em;
	min-height: 0;
	padding: 3px 6px;
	font: inherit;
	font-size: 0.85rem;
	text-align: center;
	color: var( --pdffb-ink );
	background: transparent;
	border: 1px solid var( --pdffb-line );
	border-radius: var( --pdffb-radius );
	box-shadow: none;
}

/* Fullscreen ----------------------------------------------------------- */

.pdffb:fullscreen {
	display: flex;
	flex-direction: column;
	justify-content: center;
	margin: 0;
	padding: 0 12px 8px;
	background: var( --pdffb-stage );
}

.pdffb:fullscreen .pdffb-stage {
	border-radius: 0;
}

.pdffb:fullscreen .pdffb-bar {
	color: rgba( 255, 255, 255, 0.85 );
}

.pdffb:fullscreen .pdffb-counter {
	color: rgba( 255, 255, 255, 0.6 );
}

.pdffb:fullscreen .pdffb-page-input {
	color: #fff;
	border-color: rgba( 255, 255, 255, 0.25 );
}

.pdffb:fullscreen .pdffb-btn:hover,
.pdffb:fullscreen .pdffb-btn:focus-visible {
	background: rgba( 255, 255, 255, 0.14 );
}

.pdffb:fullscreen .pdffb-title,
.pdffb:fullscreen .pdffb-noscript {
	display: none;
}

/* Zoom overlay --------------------------------------------------------- */

.pdffb-zoom {
	position: fixed;
	inset: 0;
	z-index: 100000;
	background: rgba( 20, 22, 25, 0.94 );
}

.pdffb-zoom-scroll {
	position: absolute;
	inset: 0;
	overflow: auto;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 16px;
	-webkit-overflow-scrolling: touch;
}

.pdffb-zoom-img {
	max-width: 100%;
	height: auto;
	cursor: zoom-in;
	background: #fff;
	box-shadow: 0 8px 40px rgba( 0, 0, 0, 0.5 );
}

.pdffb-zoom-scroll.is-zoomed {
	align-items: flex-start;
	justify-content: flex-start;
}

.pdffb-zoom-scroll.is-zoomed .pdffb-zoom-img {
	max-width: none;
	width: 220%;
	cursor: zoom-out;
}

.pdffb-zoom-close {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 0;
	border-radius: 50%;
	background: rgba( 255, 255, 255, 0.9 );
	color: #1d1f23;
	cursor: pointer;
}

.pdffb-zoom-close svg {
	width: 20px;
	height: 20px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
}

/* Misc ----------------------------------------------------------------- */

.pdffb-notice {
	padding: 10px 12px;
	border-left: 3px solid #c4443a;
	background: rgba( 196, 68, 58, 0.06 );
	font-size: 0.9em;
}

.pdffb-noscript {
	margin: 8px 0 0;
	font-size: 0.9em;
}

.pdffb .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect( 1px, 1px, 1px, 1px );
	clip-path: inset( 50% );
	white-space: nowrap;
}

@media ( max-width: 600px ) {
	.pdffb-stage {
		padding: 10px 8px;
	}

	.pdffb-edge {
		width: 36px;
		height: 36px;
	}
}

@media ( prefers-reduced-motion: reduce ) {
	.pdffb-page-img,
	.pdffb-edge {
		transition: none;
	}

	.pdffb-spinner,
	.pdffb-page-loader {
		animation-duration: 2s;
	}
}
