/* Brochure Flipbook – Front-end Viewer */

.bf-single-brochure {
	margin: 0;
	padding: 0;
	background: #1a1a2e;
	min-height: 100vh;
	min-height: 100dvh;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.bf-single-header {
	flex-shrink: 0;
	padding: 12px 24px;
	text-align: center;
	background: rgba(0, 0, 0, 0.3);
}

.bf-single-header__title {
	margin: 0;
	font-size: 1.1rem;
	font-weight: 500;
	color: #fff;
}

.bf-single-main {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 8px 8px 28px;
	min-height: 0;
	overflow: hidden;
}

.bf-viewer {
	position: relative;
	width: 100%;
	height: 100%;
	max-width: 100%;
	max-height: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
}

.bf-viewer--standalone {
	max-width: 100%;
	margin: 0 auto;
	height: 100%;
}

.bf-viewer--embedded {
	padding: 8px 0;
	max-height: 94vh;
}

.bf-viewer__stage {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	flex: 1;
	min-height: 0;
}

.bf-viewer__book {
	width: 100%;
	max-width: 100%;
	max-height: calc(100vh - 84px);
	max-height: calc(100dvh - 84px);
	touch-action: none;
}

.bf-viewer--embedded .bf-viewer__book {
	max-height: 94vh;
	max-height: 94dvh;
}

.bf-viewer__empty {
	color: rgba(255, 255, 255, 0.7);
	text-align: center;
	font-size: 1rem;
	margin-top: 24px;
}

.bf-viewer--embedded .bf-viewer__empty {
	color: #50575e;
}

.bf-viewer--has-cover .bf-viewer__book {
	max-width: 100%;
}

.bf-viewer--has-cover .stf__parent {
	margin-left: auto;
	margin-right: auto;
}

.bf-viewer--has-cover .bf-page:not(.bf-page--filler) img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.bf-page--blank,
.bf-viewer .stf__item.bf-stf-page--blank {
	background: #1a1a2e;
	box-shadow: none !important;
}

.bf-viewer--embedded .bf-page--blank,
.bf-viewer--embedded .stf__item.bf-stf-page--blank {
	background: #f0f0f1;
}

.bf-page--blank img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.bf-page--filler,
.bf-viewer .stf__item.bf-stf-page--filler {
	background: #ffffff;
}

.bf-page--filler img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Navigation – overlaid at page edges */
.bf-viewer__nav {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 2px;
	pointer-events: none;
	z-index: 20;
}

.bf-viewer__nav-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border: none;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.14);
	color: #fff;
	font-size: 1.75rem;
	line-height: 1;
	cursor: pointer;
	pointer-events: auto;
	transition: background 0.2s ease, transform 0.15s ease, opacity 0.2s ease;
	-webkit-tap-highlight-color: transparent;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

.bf-viewer__nav-btn:hover:not(:disabled) {
	background: rgba(255, 255, 255, 0.26);
	transform: scale(1.05);
}

.bf-viewer__nav-btn:disabled {
	opacity: 0.3;
	cursor: default;
}

.bf-viewer--embedded .bf-viewer__nav-btn {
	background: rgba(0, 0, 0, 0.1);
	color: #1a1a2e;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.bf-viewer--embedded .bf-viewer__nav-btn:hover:not(:disabled) {
	background: rgba(0, 0, 0, 0.16);
}

/* StPageFlip – GPU-friendly rendering */
.bf-viewer .stf__parent {
	margin: 0 auto;
	transform: translateZ(0);
	-webkit-transform: translateZ(0);
}

.bf-viewer .stf__wrapper {
	transform: translateZ(0);
	-webkit-transform: translateZ(0);
}

.bf-viewer .stf__block {
	background: transparent;
	will-change: transform;
	backface-visibility: hidden;
	-webkit-backface-visibility: hidden;
}

.bf-viewer .stf__item {
	background: #fff;
	box-shadow: 0 4px 18px rgba(0, 0, 0, 0.28);
	backface-visibility: hidden;
	-webkit-backface-visibility: hidden;
}

.bf-viewer .stf__item canvas {
	display: block;
	width: 100% !important;
	height: 100% !important;
}

/* Corner fold hint on hover (desktop) */
@media (hover: hover) and (pointer: fine) {
	.bf-viewer .stf__parent {
		cursor: grab;
	}

	.bf-viewer .stf__parent:active {
		cursor: grabbing;
	}
}

/* Mobile – single page, near full-screen */
@media (max-width: 767px) {
	.bf-single-header {
		padding: 6px 12px;
	}

	.bf-single-header__title {
		font-size: 0.9rem;
	}

	.bf-single-main {
		padding: 0;
	}

	.bf-viewer--standalone,
	.bf-viewer--standalone .bf-viewer__stage {
		height: 100%;
	}

	.bf-viewer__book {
		max-height: calc(100vh - 64px);
		max-height: calc(100dvh - 64px);
	}

	.bf-viewer--mobile.bf-viewer--standalone .bf-viewer__book {
		max-height: calc(100vh - 64px);
		max-height: calc(100dvh - 64px);
	}

	.bf-viewer__nav-btn {
		width: 40px;
		height: 40px;
		font-size: 1.5rem;
		background: rgba(255, 255, 255, 0.18);
	}
}
