/* ==========================================================================
   CORPORATE PROFILE FLIPBOOK
   Base structural rules (the .stf__* classes) are St. PageFlip's own —
   required for its positioning model, reproduced here rather than shipped
   as a separate file since they're a handful of lines. Everything else is
   this theme's own look, built to match the reference: a soft grey stage,
   white pages with a spine crease, round arrow buttons outside the book,
   and a dark pill toolbar underneath.
   ========================================================================== */

/* ---------------- St. PageFlip base (MIT, github.com/Nodlik/StPageFlip) ---------------- */

.stf__parent { position: relative; display: block; box-sizing: border-box; transform: translateZ(0); touch-action: pan-y; }
.stf__wrapper { position: relative; width: 100%; box-sizing: border-box; }
.stf__parent canvas { position: absolute; width: 100%; height: 100%; left: 0; top: 0; }
.stf__block { position: absolute; width: 100%; height: 100%; box-sizing: border-box; perspective: 2000px; }
.stf__item { display: none; position: absolute; transform-style: preserve-3d; }
.stf__outerShadow,
.stf__innerShadow,
.stf__hardShadow,
.stf__hardInnerShadow { position: absolute; left: 0; top: 0; }

/* ---------------- fallback card (no JS / load failure) ---------------- */

.kb-fallback {
	position: relative;
	display: block;
	max-width: 980px;
	margin: 40px auto 0;
	border-radius: 14px;
	overflow: hidden;
	border: 1px solid var(--rb-line);
	box-shadow: 0 18px 44px -24px rgba(10, 22, 40, .3);
	text-decoration: none;
	background: var(--rb-alt);
}

.kb-fallback img { display: block; width: 100%; height: auto; }

.kb-fallback__body { display: flex; flex-direction: column; gap: 4px; padding: 18px 44px 18px 18px; }
.kb-fallback__t { font-family: var(--font-display); font-size: 1rem; font-weight: 800; color: var(--rb-ink); }
.kb-fallback__s { font-size: .84rem; color: var(--rb-ink-2); }
.kb-fallback__icon { position: absolute; top: 18px; right: 18px; color: var(--color-primary); }

/* Once the viewer is live, the fallback is hidden via the [hidden] attribute
   set in flipbook.js — no extra CSS needed for that swap. */

/* ---------------- viewer shell ---------------- */

.kb-viewer { max-width: 1040px; margin: 40px auto 0; }

.kb-status {
	margin: 0 0 18px;
	text-align: center;
	font-size: .92rem;
	font-weight: 600;
	color: var(--rb-ink-2);
}

/* The grey stage the book sits on, exactly like a scanner bed — this is
   the backdrop behind the white pages. */
.kb-stagewrap {
	--kb-zoom: 1;
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 14px;
	padding: clamp(20px, 4vw, 44px) 10px;
	border-radius: 20px;
	background: linear-gradient(180deg, #c7cdd6, #aab1bd);
	box-shadow: inset 0 2px 10px rgba(0, 0, 0, .18);
}

.kb-stage {
	position: relative;
	width: 100%;
	max-width: 900px;
	aspect-ratio: 3 / 2;
	transform: scale(var(--kb-zoom));
	transform-origin: center;
	transition: transform .25s ease;
}

.kb-stagewrap.is-zoomed { overflow: auto; }

/* Each page — plain white paper, filled in by an <img> once rendered. */
.kb-page {
	background: #fff;
	box-shadow: 0 0 0 1px rgba(15, 23, 42, .06);
}

.kb-page img { display: block; width: 100%; height: 100%; object-fit: contain; background: #fff; }

/* Loading shimmer shown on a page until its render lands. */
.kb-page__shimmer {
	position: absolute;
	inset: 0;
	background: linear-gradient(100deg, #f1f3f6 30%, #fafbfc 45%, #f1f3f6 60%);
	background-size: 200% 100%;
	animation: kbShimmer 1.4s ease-in-out infinite;
}

@keyframes kbShimmer {
	0% { background-position: 200% 0; }
	100% { background-position: -200% 0; }
}

/* Round arrow buttons, outside the book on each side. */
.kb-arrow {
	flex: none;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: 0;
	background: rgba(255, 255, 255, .92);
	color: var(--rb-ink);
	box-shadow: 0 6px 18px rgba(10, 22, 40, .18);
	cursor: pointer;
	transition: transform .15s ease, background .15s ease;
}

.kb-arrow:hover { background: #fff; transform: scale(1.06); }
.kb-arrow:active { transform: scale(.96); }

/* ---------------- toolbar ---------------- */

.kb-toolbar {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	width: max-content;
	margin: 18px auto 0;
	padding: 8px 10px;
	border-radius: 999px;
	background: #2b3542;
	box-shadow: 0 10px 26px rgba(10, 22, 40, .28);
}

.kb-tbtn {
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	border: 0;
	background: transparent;
	color: #cbd3de;
	cursor: pointer;
	text-decoration: none;
	transition: background .15s ease, color .15s ease;
}

.kb-tbtn:hover { background: rgba(255, 255, 255, .12); color: #fff; }

.kb-tcount {
	padding: 0 10px;
	font-family: var(--goc-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
	font-size: .8rem;
	font-weight: 600;
	color: #e8ecf1;
	white-space: nowrap;
}

.kb-tdiv { width: 1px; height: 20px; margin: 0 4px; background: rgba(255, 255, 255, .16); }

/* ---------------- responsive ---------------- */

@media (max-width: 760px) {
	.kb-stagewrap { padding: 16px 8px; gap: 8px; }
	.kb-arrow { width: 36px; height: 36px; }
	.kb-arrow svg { width: 16px; height: 16px; }
	.kb-toolbar { flex-wrap: wrap; max-width: 92%; }
}

@media (max-width: 480px) {
	.kb-arrow { display: none; } /* swipe still works — St.PageFlip handles touch natively */
	.kb-stagewrap { padding: 12px 4px; }
}
