/* ESPA Flipbook - deliberately unbranded. Neutral chrome so the brochure
   and the surrounding page supply all identity. Inherits theme typography. */

.espa-flipbook {
	--espa-fb-height: 80vh;
	--espa-fb-maxwidth: 960px;
	width: 100%;
	max-width: 100%;
	margin: 0 auto;
	outline: none;
	box-sizing: border-box;
}

.espa-fb-stage {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	max-width: 100%;
	margin: 0 auto;
	overflow: hidden;
}

/* Give the spinner room before the book has a measured height. */
.espa-flipbook:not(.is-ready) .espa-fb-stage {
	min-height: min( var(--espa-fb-height), 640px );
}

.espa-fb-book {
	width: 100%;
	max-width: var(--espa-fb-maxwidth);
	margin: 0 auto;
	touch-action: pan-y;
}

/* Individual pages (HTML render path). The image fills the page rectangle. */
.espa-fb-page {
	background: #ffffff;
	overflow: hidden;
}

.espa-fb-page img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	pointer-events: none;
	-webkit-user-select: none;
	user-select: none;
}

/* Navigation buttons. Scoped + !important so the site theme and Elementor's
   global button styles cannot repaint or resize them. */
.espa-flipbook .espa-fb-nav {
	position: absolute !important;
	top: 50% !important;
	transform: translateY(-50%) !important;
	z-index: 5 !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	box-sizing: border-box !important;
	width: 44px !important;
	height: 44px !important;
	min-width: 0 !important;
	min-height: 0 !important;
	max-width: none !important;
	padding: 0 !important;
	margin: 0 !important;
	border: 0 !important;
	border-radius: 50% !important;
	cursor: pointer;
	color: #ffffff !important;
	background: rgba(30, 30, 30, 0.55) !important;
	background-image: none !important;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22) !important;
	text-shadow: none !important;
	transition: background 0.15s ease, opacity 0.15s ease, transform 0.15s ease;
	-webkit-appearance: none !important;
	appearance: none !important;
	line-height: 1 !important;
	font-size: 0 !important;
}

.espa-flipbook .espa-fb-nav:hover {
	background: rgba(30, 30, 30, 0.82) !important;
}

.espa-flipbook .espa-fb-nav:focus-visible {
	outline: 2px solid rgba(0, 0, 0, 0.6);
	outline-offset: 2px;
}

.espa-flipbook .espa-fb-nav:disabled {
	opacity: 0.25;
	cursor: default;
}

/* Chevron drawn from borders. No icon file, so nothing for a theme to hide. */
.espa-flipbook .espa-fb-nav .espa-fb-chev {
	display: block !important;
	width: 10px !important;
	height: 10px !important;
	border-top: 2.5px solid #ffffff !important;
	border-right: 2.5px solid #ffffff !important;
	border-bottom: 0 !important;
	border-left: 0 !important;
	background: none !important;
	box-sizing: border-box !important;
}

.espa-flipbook .espa-fb-prev {
	left: 8px;
}

.espa-flipbook .espa-fb-next {
	right: 8px;
}

.espa-flipbook .espa-fb-prev .espa-fb-chev {
	transform: rotate(-135deg);
	margin-left: 4px;
}

.espa-flipbook .espa-fb-next .espa-fb-chev {
	transform: rotate(45deg);
	margin-right: 4px;
}

/* Loading state. */
.espa-fb-loading {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
	text-align: center;
	color: #6b7280;
	font-size: 0.9em;
}

.espa-fb-spinner {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	border: 3px solid rgba(0, 0, 0, 0.12);
	border-top-color: rgba(0, 0, 0, 0.45);
	animation: espa-fb-spin 0.9s linear infinite;
}

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

@media (prefers-reduced-motion: reduce) {
	.espa-fb-spinner {
		animation-duration: 2.4s;
	}
	.espa-fb-nav {
		transition: none;
	}
}

/* Optional meta row (agent contact / download). Inherits theme fonts. */
.espa-fb-meta {
	margin-top: 0.75em;
	text-align: center;
}

.espa-fb-meta:empty {
	display: none;
}

.espa-fb-agent {
	font-size: 0.95em;
	line-height: 1.5;
}

.espa-fb-agent .espa-fb-sep {
	margin: 0 0.5em;
	opacity: 0.5;
}

.espa-fb-agent-name {
	font-weight: 600;
}

.espa-fb-download {
	margin-top: 0.4em;
	font-size: 0.85em;
}

/* Editor-only setup notice (visitors never see this). */
.espa-fb-setup-notice {
	padding: 10px 14px;
	border: 1px dashed #c33;
	border-radius: 6px;
	color: #a00;
	font-size: 0.9em;
	background: #fff5f5;
}

@media ( max-width: 640px ) {
	.espa-fb-nav {
		width: 38px;
		height: 38px;
	}
	.espa-fb-prev {
		left: 2px;
	}
	.espa-fb-next {
		right: 2px;
	}
}

/* ------------------------------------------------------------------ */
/* Toolbar: zoom / download / print / fullscreen + page counter.       */
/* Neutral styling, hardened so the theme cannot repaint the buttons.  */
/* ------------------------------------------------------------------ */
.espa-fb-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin: 10px auto 0;
	max-width: var(--espa-fb-maxwidth);
	padding: 5px 8px;
	border-radius: 10px;
	background: rgba(30, 30, 30, 0.9);
	color: #ffffff;
	box-sizing: border-box;
}

.espa-fb-count {
	font-size: 13px;
	color: #ffffff;
	font-variant-numeric: tabular-nums;
	padding-left: 6px;
	white-space: nowrap;
}

.espa-fb-tools {
	display: flex;
	align-items: center;
	gap: 2px;
}

.espa-flipbook .espa-fb-btn {
	box-sizing: border-box !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	width: 38px !important;
	height: 38px !important;
	min-width: 0 !important;
	min-height: 0 !important;
	max-width: none !important;
	padding: 0 !important;
	margin: 0 !important;
	border: 0 !important;
	border-radius: 8px !important;
	cursor: pointer;
	color: #ffffff !important;
	background: transparent !important;
	background-image: none !important;
	box-shadow: none !important;
	text-decoration: none !important;
	line-height: 1 !important;
	-webkit-appearance: none !important;
	appearance: none !important;
	transition: background 0.15s ease;
}

.espa-flipbook .espa-fb-btn:hover {
	background: rgba(255, 255, 255, 0.16) !important;
}

.espa-flipbook .espa-fb-btn:focus-visible {
	outline: 2px solid rgba(255, 255, 255, 0.7);
	outline-offset: 1px;
}

.espa-flipbook .espa-fb-btn .espa-fb-ico-txt {
	font-size: 22px !important;
	font-weight: 400 !important;
	line-height: 1 !important;
	color: #ffffff !important;
}

.espa-flipbook .espa-fb-toolbar svg {
	width: 20px !important;
	height: 20px !important;
	fill: none !important;
	stroke: currentColor !important;
	stroke-width: 2 !important;
	stroke-linecap: round !important;
	stroke-linejoin: round !important;
	display: block !important;
}

/* Zoom / pan cursor. */
.espa-flipbook.is-zoomed .espa-fb-book {
	cursor: grab;
}
.espa-flipbook.is-zoomed .espa-fb-book:active {
	cursor: grabbing;
}
.espa-flipbook .espa-fb-book {
	transform-origin: center center;
	will-change: transform;
}

/* Fullscreen: fill the screen, keep book + toolbar centered on dark bg. */
.espa-flipbook:fullscreen,
.espa-flipbook:-webkit-full-screen {
	width: 100%;
	height: 100%;
	max-width: none;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 16px;
	background: #111111;
	box-sizing: border-box;
}
.espa-flipbook:fullscreen .espa-fb-stage,
.espa-flipbook:-webkit-full-screen .espa-fb-stage {
	flex: 0 1 auto;
}
