/* Issue Flipbook viewer */
.ifb {
	--ifb-bg: rgb(81, 85, 88);
	--ifb-bg-image: none;
	--ifb-btn-size: 18px;
	--ifb-btn-margin: 0px;
	--ifb-btn-radius: 0px;
	--ifb-btn-color: #333;
	--ifb-btn-color-hover: #000;
	--ifb-btn-bg: transparent;
	--ifb-menu-bg: #fff;
	--ifb-arrow-color: #fff;
	--ifb-arrow-color-hover: #fff;
	--ifb-arrow-bg: rgba(0, 0, 0, 0.25);
	--ifb-arrow-bg-hover: rgba(0, 0, 0, 0.45);
	--ifb-arrow-size: 40px;
	--ifb-link: rgba(0, 0, 0, 0);
	--ifb-link-hover: rgba(255, 255, 0, 1);
	--ifb-gutter: 12px;
	--ifb-gutter-l: #7f7f7f;
	--ifb-gutter-r: #aaaaaa;
	position: relative;
	width: 100%;
	box-sizing: border-box;
	background: var(--ifb-bg) var(--ifb-bg-image) center / cover no-repeat;
	font: 14px/1.3 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
	color: #222;
	outline: none;
	user-select: none;
	-webkit-user-select: none;
	-webkit-tap-highlight-color: transparent;
	overflow: hidden;
}
.ifb *,
.ifb *::before,
.ifb *::after {
	box-sizing: border-box;
}
.ifb:focus-visible {
	box-shadow: inset 0 0 0 2px #4a90e2;
}
.ifb-skin-dark {
	--ifb-btn-color: #ddd;
	--ifb-btn-color-hover: #fff;
	--ifb-menu-bg: #222;
	color: #eee;
}

/* stage */
.ifb-stage {
	position: relative;
	height: 480px;
	min-height: 200px;
}
.ifb-scroller {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	touch-action: pan-y pinch-zoom;
}
.ifb-zoomed .ifb-scroller {
	display: block;
	overflow: auto;
	touch-action: pan-x pan-y;
	cursor: grab;
}
.ifb-zoomed .ifb-spread {
	margin: 0 auto;
}
.ifb-spread {
	position: relative;
	display: flex;
	flex: 0 0 auto;
	box-shadow: 0 4px 22px rgba(0, 0, 0, 0.35);
}
.ifb-page {
	position: relative;
	flex: 0 0 auto;
	background: #fff;
	overflow: hidden;
}
.ifb-page .ifb-canvas {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	display: block;
	pointer-events: none;
}
img.ifb-canvas {
	object-fit: contain;
}
.ifb-page-error {
	background: #f3f3f3 repeating-linear-gradient(45deg, transparent 0 10px, rgba(0, 0, 0, 0.04) 10px 20px);
}
/* spine shadow */
.ifb-page-left::after,
.ifb-page-right::after {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	width: var(--ifb-gutter);
	pointer-events: none;
	opacity: 0.45;
	z-index: 3;
}
.ifb-page-left::after {
	right: 0;
	background: linear-gradient(to left, var(--ifb-gutter-l), transparent);
}
.ifb-page-right::after {
	left: 0;
	background: linear-gradient(to right, var(--ifb-gutter-r), transparent);
}

/* links and text layer */
.ifb-links {
	position: absolute;
	inset: 0;
	z-index: 4;
	pointer-events: none;
}
.ifb-link {
	position: absolute;
	display: block;
	pointer-events: auto;
	background: var(--ifb-link);
	border-radius: 2px;
	transition: background-color 0.15s;
}
.ifb-link:hover,
.ifb-link:focus-visible {
	background: var(--ifb-link-hover);
}
.ifb .textLayer {
	position: absolute;
	inset: 0;
	width: 100% !important;
	height: 100% !important;
	overflow: hidden;
	line-height: 1;
	text-align: initial;
	opacity: 1;
	z-index: 2;
	transform-origin: 0 0;
	-webkit-text-size-adjust: none;
	text-size-adjust: none;
	forced-color-adjust: none;
	--min-font-size: 1;
	--text-scale-factor: calc(var(--total-scale-factor) * var(--min-font-size));
	--min-font-size-inv: calc(1 / var(--min-font-size));
}
.ifb .textLayer span,
.ifb .textLayer br {
	color: transparent;
	position: absolute;
	white-space: pre;
	cursor: text;
	transform-origin: 0% 0%;
	user-select: text;
	-webkit-user-select: text;
}
.ifb .textLayer > :not(.markedContent),
.ifb .textLayer .markedContent span:not(.markedContent) {
	z-index: 1;
	--font-height: 0;
	font-size: calc(var(--text-scale-factor) * var(--font-height));
	--scale-x: 1;
	--rotate: 0deg;
	transform: rotate(var(--rotate)) scaleX(var(--scale-x)) scale(var(--min-font-size-inv));
}
.ifb .textLayer .markedContent {
	display: contents;
}
.ifb .textLayer ::selection {
	background: rgba(0, 100, 255, 0.25);
}
.ifb .textLayer .endOfContent {
	display: block;
	position: absolute;
	inset: 100% 0 0;
	z-index: 0;
	cursor: default;
	user-select: none;
}

/* loader */
.ifb-loader {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 14px;
	padding: 16px;
	color: #fff;
	font-size: 15px;
	text-align: center;
	z-index: 6;
}
.ifb-loader-text::before {
	content: "";
	display: inline-block;
	width: 16px;
	height: 16px;
	margin-right: 10px;
	vertical-align: -3px;
	border: 2px solid rgba(255, 255, 255, 0.35);
	border-top-color: #fff;
	border-radius: 50%;
	animation: ifb-spin 0.8s linear infinite;
}
.ifb-loader-bar {
	width: min(260px, 70%);
	height: 4px;
	border-radius: 2px;
	background: rgba(255, 255, 255, 0.2);
	overflow: hidden;
	visibility: hidden;
}
.ifb-has-progress .ifb-loader-bar {
	visibility: visible;
}
.ifb-loader-fill {
	display: block;
	width: 0;
	height: 100%;
	background: #fff;
	transition: width 0.2s ease-out;
}
.ifb-loader[hidden] {
	display: none;
}
.ifb-loader.ifb-error .ifb-loader-text::before,
.ifb-loader.ifb-error .ifb-loader-bar {
	display: none;
}
@keyframes ifb-spin {
	to {
		transform: rotate(360deg);
	}
}
@media (prefers-reduced-motion: reduce) {
	.ifb-loader-text::before {
		animation-duration: 2.4s;
	}
}

/* buttons */
.ifb-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	margin: 0 var(--ifb-btn-margin);
	padding: 0;
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 50%;
	background: var(--ifb-btn-bg);
	color: var(--ifb-btn-color);
	cursor: pointer;
	line-height: 0;
	transition: background-color 0.15s, color 0.15s, opacity 0.15s;
}
.ifb-btn svg {
	width: calc(var(--ifb-btn-size) + 6px);
	height: calc(var(--ifb-btn-size) + 6px);
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}
.ifb-btn:hover,
.ifb-btn:focus-visible {
	color: var(--ifb-btn-color-hover);
	background: rgba(0, 0, 0, 0.07);
	outline: none;
}
.ifb-skin-dark .ifb-btn:hover,
.ifb-skin-dark .ifb-btn:focus-visible {
	background: rgba(255, 255, 255, 0.12);
}
.ifb-btn:focus-visible,
.ifb-menu-item:focus-visible,
.ifb-thumb:focus-visible {
	box-shadow: 0 0 0 2px #4a90e2;
}
.ifb-btn:disabled {
	opacity: 0.3;
	cursor: default;
	background: transparent;
}
.ifb-btn[hidden],
.ifb-hidden {
	display: none !important;
}

/* side arrows */
.ifb-arrow {
	position: absolute;
	top: calc(50% - var(--ifb-reserve, 0px) / 2);
	z-index: 5;
	transform: translateY(-50%);
	width: calc(var(--ifb-arrow-size) + 12px);
	height: calc(var(--ifb-arrow-size) + 12px);
	margin: 0;
	border-radius: 50%;
	background: var(--ifb-arrow-bg);
	color: var(--ifb-arrow-color);
	opacity: 0.8;
}
.ifb-arrow:hover,
.ifb-arrow:focus-visible {
	background: var(--ifb-arrow-bg-hover);
	color: var(--ifb-arrow-color-hover);
	opacity: 1;
}
.ifb-arrow svg {
	width: calc(var(--ifb-arrow-size) * 0.75);
	height: calc(var(--ifb-arrow-size) * 0.75);
	stroke-width: 2.2;
}
.ifb-arrow-prev {
	left: 12px;
}
.ifb-arrow-next {
	right: 12px;
}
.ifb-arrow-prev svg {
	margin-left: -3px;
}
.ifb-arrow-next svg {
	margin-right: -3px;
}
.ifb-arrow:disabled {
	opacity: 0;
	pointer-events: none;
}

/* toolbar */
.ifb-toolbar {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 6px;
	min-height: 52px;
	padding: 6px 10px;
	background: var(--ifb-menu-bg);
	color: var(--ifb-btn-color);
	z-index: 7;
}
.ifb-bar-floating .ifb-toolbar {
	position: absolute;
	left: 50%;
	bottom: 14px;
	transform: translateX(-50%);
	max-width: calc(100% - 28px);
	padding: 4px 8px;
	border-radius: 28px;
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.28), 0 1px 3px rgba(0, 0, 0, 0.2);
	gap: 14px;
}
.ifb-group {
	display: flex;
	align-items: center;
	gap: 2px;
	min-width: 0;
}
.ifb-bar-floating .ifb-group-tools {
	padding-left: 12px;
	border-left: 1px solid rgba(0, 0, 0, 0.1);
}
.ifb-skin-dark.ifb-bar-floating .ifb-group-tools {
	border-left-color: rgba(255, 255, 255, 0.15);
}
.ifb-minimal .ifb-toolbar .ifb-secondary {
	display: none;
}
.ifb-page-number {
	display: inline-flex;
	align-items: baseline;
	gap: 5px;
	margin: 0 6px;
	color: var(--ifb-btn-color);
	font-size: 15px;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
	cursor: text;
}
.ifb-page-input {
	width: 4.6em;
	padding: 5px 4px;
	border: 1px solid transparent;
	border-radius: 6px;
	background: rgba(0, 0, 0, 0.05);
	color: inherit;
	font: inherit;
	font-weight: 600;
	text-align: center;
	transition: border-color 0.15s, background-color 0.15s;
}
.ifb-page-input:hover {
	border-color: rgba(0, 0, 0, 0.15);
}
.ifb-page-input:focus {
	outline: none;
	border-color: #4a90e2;
	background: transparent;
}
.ifb-skin-dark .ifb-page-input {
	background: rgba(255, 255, 255, 0.08);
}
.ifb-page-total {
	opacity: 0.65;
}

/* "More" menu */
.ifb-menu {
	position: absolute;
	right: 4px;
	bottom: calc(100% + 10px);
	display: none;
	flex-direction: column;
	min-width: 220px;
	padding: 6px;
	background: var(--ifb-menu-bg);
	color: var(--ifb-btn-color);
	border-radius: 12px;
	box-shadow: 0 10px 32px rgba(0, 0, 0, 0.3);
	z-index: 9;
}
.ifb-menu-open .ifb-menu {
	display: flex;
}
.ifb-menu-item {
	display: none;
	align-items: center;
	gap: 12px;
	width: 100%;
	padding: 10px 12px;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: inherit;
	font: inherit;
	font-size: 15px;
	text-align: left;
	cursor: pointer;
}
.ifb-menu-item:not(.ifb-secondary-item),
.ifb-minimal .ifb-menu-item {
	display: flex;
}
.ifb-menu-item:hover,
.ifb-menu-item:focus-visible {
	background: rgba(0, 0, 0, 0.07);
	outline: none;
}
.ifb-skin-dark .ifb-menu-item:hover {
	background: rgba(255, 255, 255, 0.1);
}
.ifb-menu-item svg {
	width: 20px;
	height: 20px;
	flex: 0 0 auto;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* all pages panel */
.ifb-thumbs {
	position: absolute;
	inset: 0;
	display: none;
	flex-direction: column;
	background: rgba(32, 34, 36, 0.96);
	color: #fff;
	z-index: 8;
}
.ifb-thumbs-open .ifb-thumbs {
	display: flex;
}
.ifb-thumbs-open .ifb-arrow {
	display: none;
}
.ifb-thumbs-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 12px 10px 20px;
	font-size: 16px;
	font-weight: 600;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.ifb-thumbs-close {
	color: #fff;
}
.ifb-thumbs-close:hover,
.ifb-thumbs-close:focus-visible {
	color: #fff;
	background: rgba(255, 255, 255, 0.15);
}
.ifb-thumbs-grid {
	flex: 1 1 auto;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
	gap: 18px 14px;
	padding: 18px 20px calc(18px + var(--ifb-reserve, 0px));
	/* Rows sized by their content: otherwise the grid squeezes the cells into the panel height. */
	align-content: start;
	grid-auto-rows: max-content;
	overflow-y: auto;
	overscroll-behavior: contain;
}
.ifb-thumb {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	padding: 6px;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: rgba(255, 255, 255, 0.85);
	font: inherit;
	font-size: 13px;
	cursor: pointer;
}
.ifb-thumb:hover {
	background: rgba(255, 255, 255, 0.08);
}
.ifb-thumb-img {
	position: relative;
	display: block;
	width: 100%;
	background: rgba(255, 255, 255, 0.08);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
	overflow: hidden;
}
.ifb-thumb-canvas {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: contain;
	background: #fff;
}
.ifb-thumb-current .ifb-thumb-img {
	outline: 3px solid #4a90e2;
	outline-offset: 2px;
}
.ifb-thumb-current .ifb-thumb-label {
	color: #fff;
	font-weight: 700;
}

/* fullscreen */
.ifb:fullscreen,
.ifb.ifb-fs {
	width: 100vw;
	height: 100vh;
	display: flex;
	flex-direction: column;
}
.ifb:-webkit-full-screen {
	width: 100vw;
	height: 100vh;
}
.ifb:fullscreen .ifb-stage,
.ifb.ifb-fs .ifb-stage {
	flex: 1 1 auto;
}
.ifb.ifb-fs {
	position: fixed;
	inset: 0;
	z-index: 2147483000;
}
html.ifb-fs-lock,
html.ifb-fs-lock body {
	overflow: hidden !important;
}

/* narrow screens: full-width bar under the book, bigger touch targets */
.ifb-minimal .ifb-toolbar {
	gap: 4px;
	padding: 4px 6px;
}
.ifb-minimal .ifb-btn {
	width: 44px;
	height: 44px;
}
.ifb-minimal .ifb-arrow {
	width: 40px;
	height: 40px;
}
.ifb-minimal .ifb-arrow svg {
	width: 26px;
	height: 26px;
}
.ifb-minimal .ifb-menu {
	right: 6px;
	bottom: calc(100% + 6px);
	min-width: 230px;
}
.ifb-minimal .ifb-thumbs-grid {
	grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
	gap: 14px 10px;
	padding: 14px;
}

/* Isolation from theme styles (themes style input[type=text], button, label… with higher specificity). */
.ifb .ifb-page-number {
	margin: 0 6px;
	padding: 0;
	font-size: 15px;
	line-height: 1.3;
	font-weight: 400;
	text-transform: none;
	letter-spacing: normal;
}
.ifb input.ifb-page-input,
.ifb input.ifb-page-input[type="text"] {
	display: inline-block;
	box-sizing: border-box;
	width: 4.6em;
	min-width: 0;
	max-width: none;
	height: auto;
	min-height: 0;
	margin: 0;
	padding: 5px 4px;
	border: 1px solid transparent;
	border-radius: 6px;
	background: rgba(0, 0, 0, 0.05);
	box-shadow: none;
	color: inherit;
	font: inherit;
	font-weight: 600;
	line-height: 1.3;
	text-align: center;
	-webkit-appearance: none;
	appearance: none;
}
.ifb input.ifb-page-input:hover {
	border-color: rgba(0, 0, 0, 0.15);
}
.ifb input.ifb-page-input:focus {
	outline: none;
	border-color: #4a90e2;
	background: transparent;
	box-shadow: none;
}
.ifb-skin-dark input.ifb-page-input {
	background: rgba(255, 255, 255, 0.08);
}
.ifb .ifb-btn,
.ifb .ifb-menu-item,
.ifb .ifb-thumb {
	min-height: 0;
	box-shadow: none;
	text-transform: none;
	letter-spacing: normal;
	text-shadow: none;
	line-height: 1.2;
	font-weight: 400;
	-webkit-appearance: none;
	appearance: none;
}
.ifb .ifb-btn {
	width: 40px;
	min-width: 40px;
	height: 40px;
	padding: 0;
	line-height: 0;
}
.ifb.ifb-minimal .ifb-btn {
	width: 44px;
	min-width: 44px;
	height: 44px;
}
.ifb .ifb-arrow {
	width: calc(var(--ifb-arrow-size) + 12px);
	min-width: 0;
	height: calc(var(--ifb-arrow-size) + 12px);
}
.ifb.ifb-minimal .ifb-arrow {
	width: 40px;
	height: 40px;
}
.ifb .ifb-menu-item {
	padding: 10px 12px;
	margin: 0;
	font-size: 15px;
	line-height: 1.3;
}
.ifb .ifb-btn:focus-visible,
.ifb .ifb-menu-item:focus-visible,
.ifb .ifb-thumb:focus-visible {
	box-shadow: 0 0 0 2px #4a90e2;
}
.ifb.ifb-minimal .ifb-page-number {
	margin: 0 2px;
}
.ifb.ifb-minimal input.ifb-page-input {
	width: 4em;
}
.ifb .ifb-thumb {
	width: auto;
	height: auto;
	min-height: 0;
	max-height: none;
	padding: 6px;
	margin: 0;
	border: 0;
	background: transparent;
	color: rgba(255, 255, 255, 0.85);
	font-size: 13px;
}
.ifb .ifb-thumb:hover {
	background: rgba(255, 255, 255, 0.08);
}
.ifb .ifb-thumb-img {
	display: block;
	flex: none;
	width: 100%;
	height: auto;
	min-height: auto;
}
.ifb .ifb-thumb-label {
	display: block;
	line-height: 1.3;
}
