/*
 * Styles for the lightweight image flipbook viewer ([bweb_flipbook]).
 *
 * Kept in a real stylesheet rather than an inline <style> because LiteSpeed's
 * CSS optimisation strips inline blocks out of shortcode output and does not
 * always put them back into its combined bundle.
 */

.bweb-fb {
	--bweb-fb-height: 80vh;
	margin: 0 0 1.5em;
	background: #4a4f54;
	border-radius: 4px;
	overflow: hidden;
}

.bweb-fb .bweb-fb-stage {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	height: var(--bweb-fb-height);
	min-height: 320px;
}

.bweb-fb .bweb-fb-pages {
	position: relative;
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

/*
 * Specificity here is deliberate. WooCommerce ships
 * ".woocommerce img { height:auto; max-width:100% }" which outranks a single
 * class selector and lets a page image expand to its natural size, blowing the
 * stage out to thousands of pixels tall.
 */
.bweb-fb .bweb-fb-pages img.bweb-fb-page {
	display: none;
	width: auto;
	height: auto;
	max-width: 96%;
	max-height: 96%;
	margin: 0;
	object-fit: contain;
	background: #fff;
	box-shadow: 0 2px 18px rgba(0, 0, 0, .35);
}

.bweb-fb .bweb-fb-pages img.bweb-fb-page.is-current {
	display: block;
}

.bweb-fb .bweb-fb-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 2;
	border: 0;
	background: rgba(0, 0, 0, .28);
	color: #fff;
	font-size: 26px;
	line-height: 1;
	padding: 14px 12px;
	cursor: pointer;
	border-radius: 3px;
	transition: background .15s;
}

.bweb-fb .bweb-fb-nav:hover { background: rgba(0, 0, 0, .55); }
.bweb-fb .bweb-fb-nav[disabled] { opacity: .25; cursor: default; }
.bweb-fb .bweb-fb-prev { left: 10px; }
.bweb-fb .bweb-fb-next { right: 10px; }

.bweb-fb .bweb-fb-bar {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 10px 14px;
	background: #3c4045;
}

.bweb-fb .bweb-fb-counter {
	color: #fff;
	font-size: 13px;
	white-space: nowrap;
}

.bweb-fb .bweb-fb-range {
	flex: 1;
	accent-color: #fff;
}

.bweb-fb-error {
	padding: 10px;
	border-left: 3px solid #c00;
	background: #fff4f4;
}

@media (max-width: 600px) {
	.bweb-fb .bweb-fb-stage { height: 60vh; }
	.bweb-fb .bweb-fb-nav { font-size: 20px; padding: 10px 8px; }
}
