/* Godar PDF flipbook */
.gpm-book {
	--gpm-b-stage: #f3f1ee;
	--gpm-b-bar: #fff;
	--gpm-b-ink: #1d1d1f;
	--gpm-b-accent: #1d1d1f;
	--gpm-b-radius: 16px;
	--gpm-b-max-h: 80vh;
	--gpm-b-speed: 750ms;

	position: relative;
	box-sizing: border-box;
	width: 100%;
	display: flex;
	flex-direction: column;
	background: var(--gpm-b-stage);
	border-radius: var(--gpm-b-radius);
	overflow: hidden;
	outline: none;
	color: var(--gpm-b-ink);
	font-family: inherit;
	-webkit-tap-highlight-color: transparent;
	user-select: none;
}
.gpm-book *, .gpm-book *::before, .gpm-book *::after { box-sizing: border-box; }
.gpm-book:focus-visible { box-shadow: 0 0 0 2px var(--gpm-b-accent); }

.gpm-book__probe { position: absolute; visibility: hidden; pointer-events: none; height: var(--gpm-b-max-h); width: 0; }

/* Stage */
.gpm-book__stage { position: relative; min-height: 380px; padding: 28px 16px; display: flex; align-items: center; justify-content: center; transition: height .3s; }
.gpm-book__viewport { position: relative; width: 100%; height: 100%; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.gpm-book.is-zoomed .gpm-book__viewport { overflow: auto; display: block; cursor: grab; touch-action: pan-x pan-y; }
.gpm-book.is-zoomed .gpm-book__viewport.is-panning { cursor: grabbing; }
.gpm-book.is-zoomed .gpm-book__spread { margin: 0 auto; }

.gpm-book__spread {
	position: relative;
	flex: 0 0 auto;
	perspective: 2600px;
	transition: transform var(--gpm-b-speed) cubic-bezier(.645, .045, .355, 1);
	opacity: 0;
}
.gpm-book.is-loaded .gpm-book__spread { opacity: 1; transition: transform var(--gpm-b-speed) cubic-bezier(.645, .045, .355, 1), opacity .4s; }

.gpm-book__half,
.gpm-book__leaf { position: absolute; top: 0; height: 100%; width: 50%; }
.gpm-book__half--L { left: 0; }
.gpm-book__half--R { left: 50%; }
.gpm-book__half { background: #fff; box-shadow: 0 10px 30px rgba(0, 0, 0, .14), 0 2px 6px rgba(0, 0, 0, .08); cursor: pointer; }
.gpm-book__half.is-empty { visibility: hidden; }
.gpm-book__half canvas,
.gpm-book__face canvas { display: block; width: 100%; height: 100%; }

/* Inner shadow along the spine */
.gpm-book__half::after { content: ""; position: absolute; top: 0; bottom: 0; width: 9%; pointer-events: none; }
.gpm-book__half--L::after { right: 0; background: linear-gradient(to left, rgba(0, 0, 0, .16), rgba(0, 0, 0, 0)); }
.gpm-book__half--R::after { left: 0; background: linear-gradient(to right, rgba(0, 0, 0, .16), rgba(0, 0, 0, 0)); }

/* Page placeholder while rendering */
.gpm-book__half.is-pending,
.gpm-book__face.is-pending { background: linear-gradient(100deg, #fff 30%, #f2f2f2 50%, #fff 70%) 0 0 / 300% 100%; animation: gpm-shimmer 1.4s linear infinite; }
@keyframes gpm-shimmer { to { background-position: -150% 0; } }

/* The turning leaf */
.gpm-book__leaf { z-index: 5; transform-style: preserve-3d; display: none; pointer-events: none; }
.gpm-book__leaf.is-on { display: block; }
.gpm-book__leaf.on-L { left: 0; transform-origin: 100% 50%; }
.gpm-book__leaf.on-R { left: 50%; transform-origin: 0 50%; }
.gpm-book__leaf.is-animating { transition: transform var(--gpm-b-speed) cubic-bezier(.645, .045, .355, 1); }
.gpm-book__face { position: absolute; inset: 0; background: #fff; backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden; }
.gpm-book__face--back { transform: rotateY(180deg); }
.gpm-book__face::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity var(--gpm-b-speed) cubic-bezier(.645, .045, .355, 1); }
.gpm-book__leaf.on-R .gpm-book__face--front::after,
.gpm-book__leaf.on-L .gpm-book__face--back::after { background: linear-gradient(to right, rgba(0, 0, 0, .25), rgba(0, 0, 0, 0) 40%); }
.gpm-book__leaf.on-L .gpm-book__face--front::after,
.gpm-book__leaf.on-R .gpm-book__face--back::after { background: linear-gradient(to left, rgba(0, 0, 0, .25), rgba(0, 0, 0, 0) 40%); }
.gpm-book__leaf.is-mid .gpm-book__face--front::after { opacity: 1; }
.gpm-book__leaf .gpm-book__face--back::after { opacity: 1; }
.gpm-book__leaf.is-mid .gpm-book__face--back::after { opacity: 0; }
.gpm-book__leaf { box-shadow: 0 0 40px rgba(0, 0, 0, .12); }

/* Single-page mode: one slot, the leaf turns away around the spine edge */
.gpm-book.is-single .gpm-book__half--L { display: none; }
.gpm-book.is-single .gpm-book__half--R,
.gpm-book.is-single .gpm-book__leaf { left: 0; width: 100%; }
.gpm-book.is-single .gpm-book__half--R::after { display: none; }
.gpm-book.is-single .gpm-book__leaf.on-R { transform-origin: 0 50%; }
.gpm-book.is-single .gpm-book__leaf.on-L { transform-origin: 100% 50%; }
.gpm-book.is-single .gpm-book__face--back { display: none; }

/* Stage arrows */
.gpm-book__nav {
	position: absolute;
	top: 50%;
	z-index: 8;
	width: 44px;
	height: 44px;
	margin-top: -22px;
	padding: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .92);
	color: var(--gpm-b-ink);
	box-shadow: 0 4px 14px rgba(0, 0, 0, .14);
	cursor: pointer;
	opacity: 0;
	transition: opacity .2s, transform .2s;
}
.gpm-book__nav .gpm-i { width: 22px; height: 22px; }
.gpm-book__nav--left { left: 12px; }
.gpm-book__nav--right { right: 12px; }
.gpm-book.is-loaded .gpm-book__nav { opacity: .9; }
.gpm-book__nav:hover { opacity: 1; transform: scale(1.06); }
.gpm-book__nav[disabled] { opacity: 0 !important; pointer-events: none; }
@media (hover: none) { .gpm-book__nav { display: none; } }

/* Loader / error */
.gpm-book__loader { position: absolute; inset: 0; z-index: 9; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; font-size: 14px; color: #6b6b6b; transition: opacity .3s; }
.gpm-book.is-loaded .gpm-book__loader { opacity: 0; pointer-events: none; }
.gpm-book__loader-ring { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(0, 0, 0, .1); border-top-color: var(--gpm-b-accent); animation: gpm-spin .8s linear infinite; }
.gpm-book__loader-bar { width: 160px; height: 3px; border-radius: 3px; background: rgba(0, 0, 0, .08); overflow: hidden; }
.gpm-book__loader-bar i { display: block; height: 100%; width: 0; background: var(--gpm-b-accent); transition: width .2s; }
@keyframes gpm-spin { to { transform: rotate(360deg); } }
.gpm-book__error { position: absolute; inset: 0; z-index: 10; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: var(--gpm-b-stage); font-size: 14px; }
.gpm-book__error[hidden] { display: none; }
.gpm-book__error a { color: var(--gpm-b-accent); font-weight: 600; }

/* Toolbar */
.gpm-book__bar { display: flex; align-items: center; gap: 12px; padding: 8px 12px; background: var(--gpm-b-bar); border-top: 1px solid rgba(0, 0, 0, .06); }
.gpm-book__group { display: flex; align-items: center; gap: 2px; flex: 0 0 auto; }
.gpm-book__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: 10px;
	background: transparent;
	color: var(--gpm-b-ink);
	cursor: pointer;
	text-decoration: none;
	transition: background .15s;
}
.gpm-book__btn:hover, .gpm-book__btn:focus-visible { background: rgba(0, 0, 0, .06); outline: none; color: var(--gpm-b-ink); }
.gpm-book__btn[disabled] { opacity: .3; pointer-events: none; }
.gpm-book__btn .gpm-i { width: 20px; height: 20px; }
.gpm-book .gpm-i-shrink, .gpm-book.is-fs .gpm-i-expand { display: none; }
.gpm-book.is-fs .gpm-i-shrink { display: block; }

.gpm-book__pageno { display: inline-flex; align-items: center; gap: 4px; margin: 0 4px; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.gpm-book__input { width: 46px; height: 30px; padding: 0 4px; text-align: center; border: 1px solid rgba(0, 0, 0, .12); border-radius: 8px; background: transparent; color: inherit; font: inherit; }
.gpm-book__input:focus { outline: none; border-color: var(--gpm-b-accent); }
.gpm-book__total { opacity: .7; }

.gpm-book__scrub { -webkit-appearance: none; appearance: none; flex: 1 1 auto; min-width: 40px; height: 4px; margin: 0; border-radius: 4px; background: rgba(0, 0, 0, .1); cursor: pointer; }
.gpm-book__scrub::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--gpm-b-accent); border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .25); }
.gpm-book__scrub::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--gpm-b-accent); border: 3px solid #fff; }

/* Shield from theme resets (Hello Elementor colours every button/input on hover and focus). */
.gpm-book [hidden] { display: none !important; }
.gpm-book button { font-family: inherit; text-transform: none; letter-spacing: normal; line-height: 1; min-height: 0; }
.gpm-book .gpm-book__nav,
.gpm-book .gpm-book__nav:hover,
.gpm-book .gpm-book__nav:focus { background: rgba(255, 255, 255, .92); color: var(--gpm-b-ink); border: 0; padding: 0; }
.gpm-book .gpm-book__nav:focus-visible { outline: 2px solid var(--gpm-b-accent); outline-offset: 2px; }
.gpm-book .gpm-book__btn,
.gpm-book .gpm-book__btn:focus { background: transparent; color: var(--gpm-b-ink); border: 0; padding: 0; }
.gpm-book .gpm-book__btn:hover,
.gpm-book .gpm-book__btn:focus-visible { background: rgba(0, 0, 0, .06); color: var(--gpm-b-ink); }
.gpm-book .gpm-book__input { width: 52px; max-width: 52px; height: 30px; padding: 0 4px; margin: 0; border: 1px solid rgba(0, 0, 0, .12); border-radius: 8px; font-size: 13px; line-height: 28px; background: transparent; color: inherit; box-shadow: none; }
.gpm-book .gpm-book__input:focus { border-color: var(--gpm-b-accent); outline: none; }

.gpm-book__sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Fullscreen (native and the iOS fallback) */
.gpm-book.is-fs { border-radius: 0; }
.gpm-book:fullscreen { width: 100vw; height: 100vh; border-radius: 0; }
.gpm-book.is-pseudo-fs { position: fixed; inset: 0; z-index: 999999; width: 100vw; height: 100vh; height: 100dvh; border-radius: 0; }
.gpm-book.is-fs .gpm-book__stage { flex: 1 1 auto; }

@media (max-width: 600px) {
	.gpm-book__stage { padding: 16px 8px; min-height: 300px; }
	.gpm-book__bar { gap: 6px; padding: 6px; flex-wrap: wrap; justify-content: center; }
	.gpm-book__scrub { order: 3; flex-basis: 100%; }
	.gpm-book__btn { width: 34px; height: 34px; }
}

@media (prefers-reduced-motion: reduce) {
	.gpm-book { --gpm-b-speed: 1ms; }
}
