/* Wig_Flipbook reader. @since 1.0.0 */

.wig-flipbook {
	--wig-fb-height: 640px;
	--wig-fb-bg: #2b2b30;
	--wig-fb-bar: #1f1f24;
	--wig-fb-ink: #f3eee5;
	--wig-fb-accent: #c5973b;
	position: relative;
	display: flex;
	flex-direction: column;
	background: var(--wig-fb-bg);
	border-radius: 10px;
	overflow: hidden;
	color: var(--wig-fb-ink);
	box-shadow: 0 10px 30px rgba(0,0,0,.28);
	margin: 1.25rem 0;
}

.wig-flipbook__title {
	font: 600 1rem/1.3 Georgia, serif;
	padding: .7rem 1rem;
	background: rgba(0,0,0,.18);
}

/* ── Toolbar ─────────────────────────────────────────────────────────── */
.wig-flipbook__toolbar {
	display: flex;
	align-items: center;
	gap: .35rem;
	padding: .45rem .7rem;
	background: var(--wig-fb-bar);
	order: 2; /* toolbar under the stage */
}
.wig-fb-btn {
	all: unset;
	box-sizing: border-box;
	width: 34px; height: 34px;
	display: inline-flex; align-items: center; justify-content: center;
	border-radius: 7px;
	cursor: pointer;
	color: var(--wig-fb-ink);
	transition: background .15s ease;
}
.wig-fb-btn:hover { background: rgba(255,255,255,.12); }
.wig-fb-btn:focus-visible { outline: 2px solid var(--wig-fb-accent); }
.wig-fb-btn svg {
	width: 19px; height: 19px; fill: none; stroke: currentColor;
	stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.wig-fb-counter {
	min-width: 5ch; text-align: center;
	font: 500 .82rem/1 system-ui, sans-serif;
	opacity: .85; padding: 0 .35rem;
}
.wig-fb-full { margin-left: auto; }

/* ── Stage / book ────────────────────────────────────────────────────── */
.wig-flipbook__stage {
	order: 1;
	position: relative;
	flex: 1;
	min-height: var(--wig-fb-height);
	height: var(--wig-fb-height);
	display: flex; align-items: center; justify-content: center;
	overflow: hidden;
	background:
		radial-gradient(120% 90% at 50% 0%, rgba(255,255,255,.05), transparent 60%),
		var(--wig-fb-bg);
}
.wig-fb-book { transform-origin: center; transition: transform .2s ease; }
.wig-fb-book--scroll {
	width: min(720px, 92%); height: 100%;
	overflow-y: auto; background: #fff; color: #1c1c1c;
	border-radius: 4px;
}

.wig-fb-page {
	background: #fff; color: #1c1c1c;
	box-shadow: 0 0 14px rgba(0,0,0,.4);
	overflow: hidden;
}
.wig-fb-page__ph {
	width: 100%; height: 100%;
	display: flex; align-items: center; justify-content: center;
	background: #efe9df;
}
.wig-fb-canvas { width: 100%; height: 100%; display: block; }

/* Clickable link/annotation overlays. */
.wig-fb-link {
	position: absolute; display: block;
	background: transparent; border: 0; cursor: pointer;
	padding: 0; margin: 0;
}
.wig-fb-link:hover { background: rgba(197,151,59,.18); }

/* ── Word (.docx) pages ──────────────────────────────────────────────── */
.wig-fb-page--doc { background: #fff; }
.wig-fb-page--doc .wig-fb-doccol,
.wig-fb-page--scroll .wig-fb-docflow {
	color: #1c1c1c;
}
.wig-fb-doccol h1, .wig-fb-docflow h1 { font: 700 1.5rem/1.25 Georgia, serif; margin: 0 0 .6em; }
.wig-fb-doccol h2, .wig-fb-docflow h2 { font: 700 1.2rem/1.3 Georgia, serif; margin: 1em 0 .5em; }
.wig-fb-doccol h3, .wig-fb-docflow h3 { font: 600 1.05rem/1.3 Georgia, serif; margin: 1em 0 .4em; }
.wig-fb-doccol p, .wig-fb-docflow p { margin: 0 0 .85em; }
.wig-fb-doccol img, .wig-fb-docflow img { max-width: 100%; height: auto; }
.wig-fb-doccol a, .wig-fb-docflow a { color: #7a1f2b; }
.wig-fb-page--scroll .wig-fb-docflow { max-width: 70ch; margin: 0 auto; }

/* ── Loading / error ─────────────────────────────────────────────────── */
.wig-flipbook__loading { display: flex; align-items: center; justify-content: center; }
.wig-flipbook__spinner {
	width: 34px; height: 34px; border-radius: 50%;
	border: 3px solid rgba(255,255,255,.25);
	border-top-color: var(--wig-fb-accent);
	animation: wig-fb-spin .8s linear infinite;
}
@keyframes wig-fb-spin { to { transform: rotate(360deg); } }
.wig-flipbook__fail {
	padding: 2rem; text-align: center; opacity: .8;
	font: 500 .95rem/1.5 system-ui, sans-serif;
}
.wig-flipbook-error {
	padding: .75rem 1rem; border-radius: 8px;
	background: #fff4e5; color: #7a4b00; border: 1px solid #f0c98a;
}

/* ── Contents drawer ─────────────────────────────────────────────────── */
.wig-flipbook__toc {
	position: absolute; top: 0; left: 0; bottom: 0;
	width: min(300px, 80%);
	background: #16161a;
	transform: translateX(-100%);
	transition: transform .25s ease;
	z-index: 5; overflow-y: auto;
	padding: 1rem 1.1rem;
	box-shadow: 4px 0 18px rgba(0,0,0,.4);
}
.wig-flipbook.is-toc-open .wig-flipbook__toc { transform: translateX(0); }
.wig-flipbook__toc h4 {
	margin: 0 0 .6rem; font: 600 .8rem/1 system-ui, sans-serif;
	text-transform: uppercase; letter-spacing: .08em; opacity: .7;
}
.wig-flipbook__toc ul { list-style: none; margin: 0; padding: 0; }
.wig-flipbook__toc li { margin: 0 0 .15rem; }
.wig-flipbook__toc a {
	display: block; padding: .4rem .5rem; border-radius: 6px;
	color: var(--wig-fb-ink); text-decoration: none;
	font: 500 .88rem/1.35 Georgia, serif;
}
.wig-flipbook__toc a:hover { background: rgba(255,255,255,.1); }

/* ── Fullscreen ──────────────────────────────────────────────────────── */
.wig-flipbook.is-fs { border-radius: 0; }
.wig-flipbook.is-fs .wig-flipbook__stage { height: calc(100vh - 50px); }

/* ── Lightbox (bookcase) ─────────────────────────────────────────────── */
.wig-flipbook-noscroll { overflow: hidden; }
.wig-flipbook-lightbox {
	position: fixed; inset: 0; z-index: 100000;
	background: rgba(12,12,16,.86);
	display: flex; align-items: center; justify-content: center;
	padding: 2.5rem 1.25rem;
	animation: wig-fb-fade .2s ease;
}
@keyframes wig-fb-fade { from { opacity: 0; } to { opacity: 1; } }
.wig-flipbook-lightbox__inner {
	position: relative;
	width: min(1100px, 96vw);
	max-height: 92vh;
}
.wig-flipbook-lightbox .wig-flipbook { margin: 0; }
.wig-flipbook-lightbox__close {
	position: absolute; top: -2.5rem; right: 0;
	all: unset; cursor: pointer;
	color: #fff; font-size: 2rem; line-height: 1;
	width: 2.5rem; height: 2.5rem; text-align: center;
}
.wig-flipbook-lightbox__close:hover { color: var(--wig-fb-accent); }

/* Protected book (copy protection): nothing to select or drag; blank while the site's Copy Guard shield is up. */
.wig-fb--protected { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.wig-fb--protected .wig-fb-canvas { pointer-events: none; }
.wig-fb--blank .wig-fb-canvas { visibility: hidden; }
@media print { .wig-fb--protected .wig-fb-canvas { visibility: hidden !important; } }

/* ── Contents beside the book on wide screens; marked chapter (31 Oct 2026) ── */
.wig-flipbook { position: relative; }
.wig-flipbook.is-toc-dock { padding-left: 270px; }
.wig-flipbook.is-toc-dock .wig-flipbook__toc { width: 262px; transform: none; box-shadow: none; border-right: 1px solid rgba(255,255,255,.08); }
.wig-flipbook__toc a { display: flex; gap: .5rem; align-items: baseline; }
.wig-fb-toc-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.wig-fb-toc-p { flex: none; opacity: .55; font: 500 .75rem/1 system-ui, sans-serif; }
.wig-flipbook__toc li.is-sub a { font-size: .82rem; opacity: .9; }
.wig-flipbook__toc a.is-current { background: rgba(255,255,255,.14); box-shadow: inset 3px 0 0 #c9a227; }
@media (max-width: 899px) { .wig-flipbook.is-toc-dock { padding-left: 0; } }
.wig-flipbook__toc a { font-family: "Times New Roman", Times, serif; }   /* every Yorùbá letter shows */
