/*!
 * CUCTAA Flipbook
 * A dependency-free flip book viewer used for the 68th Souvenir book.
 * Pairs with js/flipbook.js
 */

.cuctaa-flipbook {
	--fb-accent: #0d6efd;
	--fb-bg: #eceff4;
	--fb-paper: #ffffff;
	--fb-ink: #1f2937;
	--fb-muted: #6b7280;
	--fb-line: #e5e7eb;
	--fb-panel: #ffffff;
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	height: clamp(520px, 78vh, 760px);
	background: var(--fb-bg);
	border-radius: 14px;
	overflow: hidden;
	box-shadow: 0 10px 30px rgba(15, 23, 42, .12);
	color: var(--fb-ink);
	font-size: 15px;
	line-height: 1.4;
	-webkit-tap-highlight-color: transparent;
}

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

.fb-toolbar {
	display: flex;
	align-items: center;
	gap: .5rem;
	flex-wrap: wrap;
	padding: .5rem .6rem;
	background: var(--fb-panel);
	border-bottom: 1px solid var(--fb-line);
	position: relative;
	z-index: 20;
}

.fb-toolbar-title {
	display: flex;
	align-items: center;
	gap: .5rem;
	margin-right: auto;
	font-weight: 700;
	font-size: .95rem;
	color: var(--fb-ink);
	min-width: 0;
}

.fb-toolbar-title span {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.fb-group {
	display: flex;
	align-items: center;
	gap: .2rem;
}

.fb-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 1px solid transparent;
	border-radius: 9px;
	background: #f1f5f9;
	color: var(--fb-ink);
	cursor: pointer;
	text-decoration: none;
	transition: background .15s ease, color .15s ease, transform .1s ease;
}

.fb-btn:hover:not(:disabled) {
	background: var(--fb-accent);
	color: #fff;
}

.fb-btn:active:not(:disabled) {
	transform: translateY(1px);
}

.fb-btn:disabled {
	opacity: .35;
	cursor: not-allowed;
}

.fb-btn.is-on {
	background: var(--fb-accent);
	color: #fff;
}

.fb-btn.is-wide {
	width: auto;
	padding: 0 .75rem;
	gap: .4rem;
	font-size: .85rem;
	font-weight: 600;
}

.fb-counter {
	display: flex;
	align-items: center;
	gap: .3rem;
	padding: 0 .35rem;
	font-size: .85rem;
	color: var(--fb-muted);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.fb-page-input {
	width: 56px;
	padding: .3rem .35rem;
	text-align: center;
	border: 1px solid var(--fb-line);
	border-radius: 8px;
	color: var(--fb-ink);
	font-size: .85rem;
}

.fb-page-input:focus {
	outline: 0;
	border-color: var(--fb-accent);
	box-shadow: 0 0 0 3px rgba(13, 110, 253, .15);
}

.fb-range {
	font-weight: 700;
	color: var(--fb-ink);
	font-size: .9rem;
}

.fb-goto-icon {
	color: var(--fb-muted);
	font-size: .8rem;
}

/* ------------------------------------------------------------ cover panels */

.fb-cover-panel {
	position: absolute;
	top: 0;
	width: 50%;
	height: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: .6rem;
	padding: 1rem;
	text-align: center;
	background: linear-gradient(145deg, #0b2e5c 0%, #123f78 55%, #0a2647 100%);
	color: rgba(255, 255, 255, .85);
	font-weight: 600;
	font-size: .95rem;
	letter-spacing: .02em;
	box-shadow: inset 0 0 40px rgba(0, 0, 0, .35);
	transform: translateZ(-2px);
	z-index: 1;
	opacity: 0;
	visibility: hidden;
	transition: opacity .25s ease;
}

.fb-cover-panel i {
	font-size: 2rem;
	opacity: .6;
}

.fb-cover-panel.is-visible {
	opacity: 1;
	visibility: visible;
}

.fb-panel-left {
	left: 0;
}

.fb-panel-right {
	left: 50%;
}

/* ------------------------------------------------------------------ main */

.fb-main {
	display: flex;
	flex: 1 1 auto;
	min-height: 0;
}

/* --------------------------------------------------------------- sidebar */

.fb-sidebar {
	flex: 0 0 auto;
	width: 0;
	overflow: hidden;
	background: var(--fb-panel);
	border-right: 1px solid var(--fb-line);
	transition: width .25s ease;
}

.cuctaa-flipbook.show-thumbs .fb-sidebar {
	width: 168px;
}

.fb-sidebar-head {
	padding: .5rem .6rem;
	font-size: .75rem;
	font-weight: 700;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: var(--fb-muted);
	border-bottom: 1px solid var(--fb-line);
}

.fb-thumbs {
	height: calc(100% - 38px);
	overflow-y: auto;
	overflow-x: hidden;
	padding: .5rem;
	display: flex;
	flex-direction: column;
	gap: .4rem;
	scrollbar-width: thin;
}

.fb-thumb {
	position: relative;
	display: block;
	width: 100%;
	padding: 0;
	border: 2px solid transparent;
	border-radius: 7px;
	overflow: hidden;
	background: #fff;
	box-shadow: 0 1px 4px rgba(15, 23, 42, .18);
	cursor: pointer;
	transition: border-color .15s ease, transform .15s ease;
}

.fb-thumb:hover {
	transform: translateY(-1px);
}

.fb-thumb img {
	display: block;
	width: 100%;
	height: auto;
	background: #fff;
}

.fb-thumb .fb-thumb-no {
	position: absolute;
	right: 0;
	bottom: 0;
	padding: .05rem .3rem;
	background: rgba(15, 23, 42, .7);
	color: #fff;
	font-size: .65rem;
	border-radius: 5px 0 0 0;
}

.fb-thumb.is-active {
	border-color: var(--fb-accent);
}

/* ----------------------------------------------------------------- stage */

.fb-stage {
	position: relative;
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 14px;
}

.fb-stage.is-zoomed {
	overflow: auto;
	align-items: flex-start;
	justify-content: flex-start;
}

.fb-zoomwrap {
	position: relative;
	margin: auto;
	flex: 0 0 auto;
}

.fb-scaler {
	position: relative;
	transform-origin: top left;
}

.fb-book {
	position: relative;
	width: 100%;
	height: 100%;
	perspective: 2600px;
	transform-style: preserve-3d;
	touch-action: pan-y;
}

.fb-spine {
	position: absolute;
	top: 0;
	left: 50%;
	width: 56px;
	height: 100%;
	transform: translateX(-50%);
	background: linear-gradient(to right,
			rgba(15, 23, 42, 0) 0%,
			rgba(15, 23, 42, .05) 38%,
			rgba(15, 23, 42, .11) 49%,
			rgba(15, 23, 42, .14) 50%,
			rgba(15, 23, 42, .11) 51%,
			rgba(15, 23, 42, .05) 62%,
			rgba(15, 23, 42, 0) 100%);
	pointer-events: none;
	z-index: 4000;
}

.cuctaa-flipbook.is-single .fb-spine {
	display: none;
}

/* ----------------------------------------------------------------- leafs */

.fb-leaf {
	position: absolute;
	top: 0;
	left: 50%;
	width: 50%;
	height: 100%;
	transform-origin: 0% 50%;
	transform-style: preserve-3d;
	transition: transform .85s cubic-bezier(.22, .61, .24, 1);
	will-change: transform;
}

.fb-leaf.is-turned {
	transform: rotateY(-180deg);
}

.fb-leaf.is-animating {
	z-index: 5000;
}

.fb-face {
	position: absolute;
	inset: 0;
	overflow: hidden;
	background: var(--fb-paper);
	backface-visibility: hidden;
	-webkit-backface-visibility: hidden;
	box-shadow: 0 1px 10px rgba(15, 23, 42, .12);
}

.fb-face-back {
	transform: rotateY(180deg);
}

.fb-face img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	background: var(--fb-paper);
	user-select: none;
	-webkit-user-drag: none;
}

.fb-face::after {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background: linear-gradient(to left, rgba(15, 23, 42, .30), rgba(15, 23, 42, 0) 42%);
	opacity: 0;
	transition: opacity .3s ease;
}

.fb-leaf.is-animating .fb-face-front::after {
	opacity: 1;
}

/* ------------------------------------------------------------ single page */

.fb-sheet {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	transform-origin: 0% 50%;
	transform-style: preserve-3d;
	transition: transform .7s cubic-bezier(.22, .61, .24, 1);
	will-change: transform;
}

.fb-sheet.is-turned {
	transform: rotateY(-180deg);
}

.fb-sheet.is-animating {
	z-index: 5000;
}

.fb-sheet .fb-face {
	box-shadow: 0 1px 10px rgba(15, 23, 42, .12);
}

/* ------------------------------------------------------------ click zones */

.fb-zone {
	position: absolute;
	top: 0;
	bottom: 0;
	width: 20%;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
	z-index: 30;
}

.fb-zone-prev {
	left: 0;
}

.fb-zone-next {
	right: 0;
}

.fb-zone i {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	margin: auto;
	border-radius: 50%;
	background: rgba(15, 23, 42, .55);
	color: #fff;
	font-size: 1.1rem;
	opacity: 0;
	transition: opacity .2s ease, background .2s ease;
}

.fb-zone:hover i {
	opacity: 1;
}

.fb-zone:disabled {
	cursor: default;
}

.fb-zone:disabled i {
	display: none;
}

/* ---------------------------------------------------------------- footer */

.fb-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: .5rem;
	padding: .4rem .7rem;
	background: var(--fb-panel);
	border-top: 1px solid var(--fb-line);
	font-size: .78rem;
	color: var(--fb-muted);
}

.fb-footer .fb-mode-tag {
	display: none;
}

/* ---------------------------------------------------------------- loader */

.fb-loader {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, .9);
	z-index: 100;
	transition: opacity .35s ease;
}

.fb-loader.is-hidden {
	opacity: 0;
	pointer-events: none;
}

.fb-loader .spinner-border {
	width: 2.6rem;
	height: 2.6rem;
}

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

@media (max-width: 767.98px) {
	.cuctaa-flipbook {
		height: clamp(420px, 68vh, 620px);
		border-radius: 10px;
	}

	.fb-toolbar {
		padding: .4rem;
		gap: .3rem;
	}

	.fb-toolbar-title {
		font-size: .8rem;
		width: 100%;
		margin-bottom: .15rem;
	}

	.fb-btn {
		width: 32px;
		height: 32px;
	}

	.cuctaa-flipbook.show-thumbs .fb-sidebar {
		position: absolute;
		top: 0;
		bottom: 0;
		left: 0;
		width: 140px;
		z-index: 60;
		box-shadow: 4px 0 18px rgba(15, 23, 42, .18);
	}

	.fb-footer .fb-hint {
		display: none;
	}
}

/* fullscreen */

.cuctaa-flipbook:fullscreen {
	border-radius: 0;
	height: 100vh;
	width: 100vw;
}

.cuctaa-flipbook:-webkit-full-screen {
	border-radius: 0;
	height: 100vh;
	width: 100vw;
}
