/* IAFR PDF Flipbook */
.iafr-flipbook {
	--fb-accent: var(--iafr-primary, #c90100);
	--fb-bg: #f3f3f3;
	position: relative;
	margin: 0 0 1em;
	padding: 20px 16px 12px;
	background: var(--fb-bg);
	outline: none;
}
.iafr-flipbook:focus-visible { box-shadow: 0 0 0 2px var(--fb-accent); }

.iafr-fb-stage { position: relative; }
.iafr-fb-book { margin: 0 auto; }
.iafr-flipbook:not(.is-ready) .iafr-fb-stage { min-height: 360px; }

/* StPageFlip base styles (normally shipped as a separate stylesheet) */
.iafr-flipbook .stf__parent { position: relative; display: block; box-sizing: border-box; transform: translateZ(0); touch-action: pan-y; }
.iafr-flipbook .stf__wrapper { position: relative; width: 100%; height: 100%; box-sizing: border-box; }
.iafr-flipbook .stf__parent canvas { position: absolute; width: 100%; height: 100%; left: 0; top: 0; }
.iafr-flipbook .stf__block { position: absolute; width: 100%; height: 100%; box-sizing: border-box; perspective: 2000px; }
.iafr-flipbook .stf__item { display: none; position: absolute; transform-style: preserve-3d; }
.iafr-flipbook .stf__outerShadow,
.iafr-flipbook .stf__innerShadow,
.iafr-flipbook .stf__hardShadow,
.iafr-flipbook .stf__hardInnerShadow { position: absolute; left: 0; top: 0; }

.iafr-fb-page {
	background: #fff;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
	overflow: hidden;
	cursor: grab;
}
.iafr-fb-page:not(.is-rendered) {
	background: #fff linear-gradient(90deg, #fff 0, #f4f4f4 50%, #fff 100%) 0 0 / 200% 100%;
	animation: iafr-fb-shimmer 1.4s linear infinite;
}
.iafr-fb-page img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	user-select: none;
	-webkit-user-drag: none;
}
.iafr-fb-page img:not([src]) { visibility: hidden; }

.iafr-fb-status {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	font-size: 0.9rem;
	color: #5a5a5a;
	text-align: center;
	padding: 0 16px;
}
.iafr-fb-status a { color: var(--fb-accent); margin-left: 0.25em; }
.iafr-flipbook.is-error .iafr-fb-spinner { display: none; }
.iafr-fb-spinner {
	width: 18px;
	height: 18px;
	border: 2px solid #d5d5d5;
	border-top-color: var(--fb-accent);
	border-radius: 50%;
	animation: iafr-fb-spin 0.8s linear infinite;
}

/* Controls */
.iafr-fb-bar {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 14px;
	margin-top: 12px;
	position: relative;
}
.iafr-fb-bar[hidden] { display: none; }
.iafr-fb-bar button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 1px solid #d5d5d5;
	border-radius: 50%;
	background: #fff;
	color: #2a2525;
	cursor: pointer;
	transition: border-color 0.15s, color 0.15s;
}
.iafr-fb-bar button:hover:not(:disabled),
.iafr-fb-bar button:focus-visible { border-color: var(--fb-accent); color: var(--fb-accent); outline: none; }
.iafr-fb-bar button:disabled { opacity: 0.35; cursor: default; }
.iafr-fb-bar button[hidden] { display: none; }
.iafr-fb-bar svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.iafr-fb-full { position: absolute; right: 0; }
.iafr-fb-count {
	min-width: 72px;
	text-align: center;
	font-size: 0.85rem;
	letter-spacing: 0.04em;
	color: #5a5a5a;
	font-variant-numeric: tabular-nums;
}

/* Full screen */
.iafr-flipbook.is-fullscreen {
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: 16px;
	background: #2a2525;
}
.iafr-flipbook.is-fullscreen .iafr-fb-count { color: #ddd; }

@media (max-width: 575.98px) {
	.iafr-flipbook { padding: 12px 0 8px; margin-left: -4px; margin-right: -4px; }
}

@keyframes iafr-fb-spin { to { transform: rotate(360deg); } }
@keyframes iafr-fb-shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) {
	.iafr-fb-page:not(.is-rendered), .iafr-fb-spinner { animation: none; }
}
