@import url("./pdfjs/pdf_viewer.css");

/* CCL manual reader */

.ccl-viewer {
	--ccl-v-bg: #e8ebee;
	--ccl-v-bar: #1f2933;
	--ccl-v-bar-ink: #e6eaee;
	--ccl-v-accent: #1dd19b;
	--ccl-v-height: 82vh;
	position: relative;
	display: flex;
	flex-direction: column;
	/* About one page tall: opens at "Whole page" zoom, so a full page fits. */
	height: clamp(480px, var(--ccl-v-height), 1100px);
	height: clamp(480px, 82dvh, 1100px);
	border-radius: 6px;
	overflow: hidden;
	background: var(--ccl-v-bg);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
	margin: 0 0 32px;
	user-select: none;
	-webkit-user-select: none;
	-webkit-touch-callout: none;
}

.ccl-viewer.is-fullscreen,
.ccl-viewer.is-expanded {
	height: 100vh;
	height: 100dvh;
	min-height: 0;
	border-radius: 0;
	margin: 0;
}
.ccl-viewer.is-expanded {
	position: fixed;
	inset: 0;
	z-index: 100000;
}
html.ccl-viewer-expanded,
html.ccl-viewer-expanded body {
	overflow: hidden;
}

/* Toolbar */
.ccl-viewer__toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 14px;
	padding: 6px 10px;
	background: var(--ccl-v-bar);
	color: var(--ccl-v-bar-ink);
	font-size: 14px;
	flex: 0 0 auto;
}
.ccl-viewer__group {
	display: flex;
	align-items: center;
	gap: 4px;
	margin: 0;
}
.ccl-viewer__group--end {
	margin-left: auto;
}
.ccl-viewer .ccl-viewer__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: 4px;
	background: transparent;
	color: inherit;
	box-shadow: none;
	transform: none;
	cursor: pointer;
}
.ccl-viewer .ccl-viewer__btn:hover,
.ccl-viewer .ccl-viewer__btn:focus-visible,
.ccl-viewer .ccl-viewer__btn[aria-pressed="true"] {
	background: rgba(255, 255, 255, 0.14);
	color: #fff;
}
.ccl-viewer .ccl-viewer__btn:disabled {
	opacity: 0.35;
	cursor: default;
	background: transparent;
}
.ccl-viewer__toolbar input,
.ccl-viewer__toolbar select {
	height: 30px;
	margin: 0;
	padding: 2px 8px;
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 4px;
	background: rgba(255, 255, 255, 0.08);
	color: #fff;
	font-size: 14px;
}
.ccl-viewer__toolbar select option {
	color: #1f2933;
}
.ccl-viewer__page input {
	width: 3.6em;
	text-align: center;
}
.ccl-viewer__of {
	white-space: nowrap;
	opacity: 0.8;
}
.ccl-viewer__search input {
	width: 190px;
}
.ccl-viewer__matches {
	font-size: 12px;
	opacity: 0.8;
	white-space: nowrap;
}

/* Body */
.ccl-viewer__body {
	position: relative;
	display: flex;
	flex: 1 1 auto;
	min-height: 0;
}
.ccl-viewer__stage {
	position: relative;
	flex: 1 1 auto;
	min-width: 0;
}
/* PDF.js requires an absolutely positioned scroll container. */
.ccl-viewer__container {
	position: absolute;
	inset: 0;
	overflow: auto;
	outline: none;
}
.ccl-viewer .pdfViewer .page {
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
	border: 0;
	margin: 12px auto;
}
.ccl-viewer__status {
	position: absolute;
	top: 40%;
	left: 50%;
	transform: translate(-50%, -50%);
	padding: 12px 18px;
	border-radius: 6px;
	background: rgba(31, 41, 51, 0.88);
	color: #fff;
	font-size: 15px;
	text-align: center;
	max-width: 90%;
	pointer-events: none;
}
.ccl-viewer__noscript {
	padding: 24px;
}

/* Sidebar */
.ccl-viewer__sidebar {
	flex: 0 0 180px;
	display: flex;
	flex-direction: column;
	background: #2b3640;
	color: var(--ccl-v-bar-ink);
	min-height: 0;
}
.ccl-viewer__sidebar[hidden] {
	display: none;
}
.ccl-viewer__tabs {
	display: flex;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.ccl-viewer__tabs button {
	flex: 1;
	margin: 0;
	padding: 8px 4px;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: inherit;
	font-size: 13px;
	box-shadow: none;
	transform: none;
	cursor: pointer;
}
.ccl-viewer__tabs button[aria-selected="true"] {
	box-shadow: inset 0 -2px 0 var(--ccl-v-accent);
	color: #fff;
}
.ccl-viewer__thumbs,
.ccl-viewer__outline {
	flex: 1 1 auto;
	overflow: auto;
	padding: 10px;
}
.ccl-viewer__thumbs[hidden],
.ccl-viewer__outline[hidden] {
	display: none;
}
.ccl-viewer .ccl-viewer__thumb {
	display: block;
	width: 100%;
	margin: 0 0 10px;
	padding: 4px;
	border: 2px solid transparent;
	border-radius: 4px;
	background: transparent;
	color: inherit;
	box-shadow: none;
	transform: none;
	cursor: pointer;
}
.ccl-viewer .ccl-viewer__thumb.is-current {
	border-color: var(--ccl-v-accent);
}
.ccl-viewer__thumb-img {
	display: block;
	width: 100%;
	background: #fff;
}
.ccl-viewer__thumb-img canvas {
	display: block;
	width: 100%;
	height: auto;
}
.ccl-viewer__thumb-num {
	display: block;
	font-size: 12px;
	margin-top: 3px;
	opacity: 0.8;
}
.ccl-viewer__outline ul {
	list-style: none;
	margin: 0;
	padding: 0;
}
.ccl-viewer__outline ul ul {
	padding-left: 12px;
}
.ccl-viewer__outline button {
	display: block;
	width: 100%;
	margin: 0;
	padding: 5px 4px;
	border: 0;
	background: transparent;
	color: inherit;
	text-align: left;
	font-size: 13px;
	line-height: 1.3;
	box-shadow: none;
	transform: none;
	cursor: pointer;
}
.ccl-viewer__outline button:hover {
	color: #fff;
	background: rgba(255, 255, 255, 0.08);
}

@media (max-width: 700px) {
	.ccl-viewer {
		height: clamp(420px, 78dvh, 900px);
		border-radius: 0;
	}
	.ccl-viewer__toolbar {
		gap: 4px 8px;
		padding: 4px 6px;
	}
	.ccl-viewer__search {
		order: 10;
		flex: 1 1 100%;
	}
	.ccl-viewer__search input {
		flex: 1;
		width: auto;
		min-width: 0;
	}
	.ccl-viewer__sidebar {
		position: absolute;
		inset: 0 auto 0 0;
		width: 150px;
		z-index: 5;
		box-shadow: 2px 0 8px rgba(0, 0, 0, 0.3);
	}
}

/* Never print a manual. */
@media print {
	.ccl-viewer {
		display: none !important;
	}
}
