/* Bromley Flipbook — see flipbook.js */

.bf {
	position: relative;
	width: 100%;
	height: 100%;
	overflow: hidden;
	background: #333;
	color: #ccc;
	-webkit-user-select: none;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
}

.bf-stage {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
}

.bf-stage canvas {
	display: block;
	touch-action: none;
	outline: none;
}

.bf button {
	font: inherit;
	line-height: 1;
	margin: 0;
	box-shadow: none;
	text-transform: none;
	letter-spacing: normal;
}

.bf [hidden] {
	display: none !important;
}

/* Loading / error */

.bf-loader {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	text-align: center;
	color: #bbb;
	font-size: 15px;
}

.bf-spinner {
	width: 42px;
	height: 42px;
	margin: 0 auto 14px;
	border: 3px solid rgba(255, 255, 255, 0.15);
	border-top-color: #ddd;
	border-radius: 50%;
	animation: bf-spin 0.9s linear infinite;
}

.bf-loader.is-error .bf-spinner {
	display: none;
}

.bf-loader p {
	margin: 0 0 10px;
}

.bf-loader a {
	color: #fff;
	text-decoration: underline;
}

@keyframes bf-spin {
	to { transform: rotate(360deg); }
}

/* Side arrows */

.bf .bf-arrow {
	position: absolute;
	top: 50%;
	width: 64px;
	height: 96px;
	margin-top: -78px; /* centred on the book, which sits above the toolbar */
	padding: 0;
	border: 0;
	background: none;
	color: #8f8f8f;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: color 0.15s;
}

.bf-arrow:hover,
.bf-arrow:focus-visible {
	color: #fff;
	background: none;
}

.bf-arrow svg {
	width: 36px;
	height: 64px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2.4;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.bf-arrow-prev { left: 22px; }
.bf-arrow-next { right: 22px; }

/* Toolbar */

.bf-bar {
	position: absolute;
	left: 50%;
	bottom: 18px;
	transform: translateX(-50%);
	display: flex;
	align-items: center;
	gap: 2px;
	max-width: calc(100% - 16px);
	padding: 5px 6px;
	box-sizing: border-box;
	background: #2a2a2a;
	border-radius: 4px;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

.bf-btn {
	flex: 0 0 auto;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	border-radius: 3px;
	background: none;
	color: #8a8a8a;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: color 0.15s, background-color 0.15s;
}

.bf-btn svg {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.bf-btn:hover:not(:disabled),
.bf-btn:focus-visible {
	color: #fff;
	background: rgba(255, 255, 255, 0.08);
}

.bf-btn.is-on {
	color: #ddd;
}

.bf-btn:disabled {
	opacity: 0.35;
	cursor: default;
}

.bf-pages {
	display: flex;
	flex: 0 0 auto;
	margin: 0 6px;
	border-radius: 3px;
	overflow: hidden;
}

.bf-page,
.bf-total {
	width: 48px;
	height: 22px;
	padding: 0;
	border: 0;
	border-radius: 0;
	box-sizing: border-box;
	font-size: 14px;
	font-weight: 700;
	line-height: 22px;
	text-align: center;
	color: #222;
}

.bf-page {
	background: #9a9a9a;
	outline: none;
}

.bf-page:focus {
	background: #d6d6d6;
}

.bf-total {
	display: inline-block;
	background: #7c7c7c;
}

/* Thumbnails panel */

.bf-thumbs {
	position: absolute;
	top: 16px;
	left: 16px;
	bottom: 76px;
	width: 220px;
	display: flex;
	flex-direction: column;
	background: rgba(34, 34, 34, 0.96);
	border-radius: 4px;
	box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
	z-index: 2;
}

.bf-thumbs-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 6px 6px 6px 14px;
	font-size: 14px;
	font-weight: 600;
	color: #ddd;
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.bf-thumbs-grid {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 12px;
	display: grid;
	grid-template-columns: 1fr;
	gap: 12px;
	align-content: start;
}

.bf-thumb {
	display: block;
	width: 100%;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
	color: #999;
	text-align: center;
}

.bf-thumb-frame {
	position: relative;
	display: block;
	background: #444;
	outline: 2px solid transparent;
	outline-offset: 2px;
	transition: outline-color 0.15s;
}

.bf-thumb-frame.is-loaded {
	background: #fff;
}

.bf-thumb-frame canvas {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
}

.bf-thumb:hover .bf-thumb-frame {
	outline-color: rgba(255, 255, 255, 0.4);
}

.bf-thumb.is-current .bf-thumb-frame {
	outline-color: #fff;
}

.bf-thumb-label {
	display: block;
	margin-top: 5px;
	font-size: 12px;
}

.bf-thumb.is-current .bf-thumb-label {
	color: #fff;
}

/* Small screens */

@media (max-width: 600px) {
	.bf-hide-sm {
		display: none !important;
	}

	.bf-bar {
		bottom: 12px;
	}

	.bf .bf-arrow {
		width: 44px;
		height: 72px;
		margin-top: -63px;
		background: rgba(0, 0, 0, 0.25);
		border-radius: 4px;
	}

	.bf-arrow svg {
		width: 24px;
		height: 44px;
	}

	.bf-arrow-prev { left: 6px; }
	.bf-arrow-next { right: 6px; }

	.bf-thumbs {
		top: 8px;
		left: 8px;
		right: 8px;
		bottom: 68px;
		width: auto;
	}

	.bf-thumbs-grid {
		grid-template-columns: 1fr 1fr;
	}
}
