/* turn.js additional*/

.bookViewer{
	margin: 5px auto 0 auto;
}

.bookViewer .page{
	background: #FFF;
}

/* PDF.js additional */

.secondaryToolbarButton.bookFlip::before {
	content: url(secondaryToolbarButton-bookFlip.png);
}

@media screen and (-webkit-min-device-pixel-ratio: 1.1), screen and (min-resolution: 1.1dppx) {
	.secondaryToolbarButton.bookFlip::before {
		content: url(secondaryToolbarButton-bookFlip@2x.png);
	}
}

/* Side navigation buttons */
.sideNavButton {
	display: none;
	position: absolute;
	top: 0;
	width: 60px;
	height: 100%;
	background: rgba(0, 0, 0, 0.15);
	color: #fff;
	border: none;
	font-size: 36px;
	cursor: pointer;
	z-index: 100;
	opacity: 0.5;
	transition: opacity 0.2s, background 0.2s;
	padding: 0;
	outline: none;
}

.sideNavButton:hover {
	opacity: 1;
	background: rgba(0, 0, 0, 0.35);
}

.sideNavPrev {
	left: 0;
}

.sideNavNext {
	right: 0;
}

/* Show side nav buttons when bookFlip is active */
.bookFlipActive .sideNavButton {
	display: block;
}

/* Hide Current View (bookmark) buttons and the Tools menu button */
#viewBookmark,
#secondaryViewBookmark,
#secondaryToolbarToggle {
	display: none !important;
}

/* Also hide the separator adjacent to the Tools button so there isn't a dangling divider */
#secondaryToolbarToggle + .verticalToolbarSeparator,
.verticalToolbarSeparator:has(+ #secondaryToolbarToggle) {
	display: none !important;
}

/* Use the thumbnail icon for the Grid View (formerly Toggle Sidebar) button */
html[dir='ltr'] .toolbarButton#sidebarToggle::before,
html[dir='rtl'] .toolbarButton#sidebarToggle::before {
	content: url(toolbarButton-viewThumbnail.png);
}

@media screen and (-webkit-min-device-pixel-ratio: 1.1), screen and (min-resolution: 1.1dppx) {
	html[dir='ltr'] .toolbarButton#sidebarToggle::before,
	html[dir='rtl'] .toolbarButton#sidebarToggle::before {
		content: url(toolbarButton-viewThumbnail@2x.png);
	}
}

/* ===== Full-page thumbnail grid overlay ===== */

#outerContainer.thumbnailGridActive #sidebarContainer {
	width: 100% !important;
	z-index: 200;
	transition: none !important;
	visibility: visible !important;
}

html[dir='ltr'] #outerContainer.thumbnailGridActive #sidebarContainer {
	left: 0 !important;
}

/* Hide the sidebar tab bar (Thumbnails/Outline/Attachments) */
#outerContainer.thumbnailGridActive #toolbarSidebar {
	display: none;
}

#outerContainer.thumbnailGridActive #sidebarContent {
	top: 0;
	background-color: #2b2b2b;
	box-shadow: none !important;
}

#outerContainer.thumbnailGridActive #thumbnailView {
	width: 100%;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-content: flex-start;
	gap: 20px;
	padding: 20px;
	box-sizing: border-box;
}

#outerContainer.thumbnailGridActive #thumbnailView > a {
	display: block;
	float: none !important;
}

#outerContainer.thumbnailGridActive .thumbnail {
	float: none !important;
	margin: 0 !important;
}

#outerContainer.thumbnailGridActive .thumbnail:not([data-loaded]) {
	margin: 0 !important;
}

/* Page number label below each thumbnail */
#outerContainer.thumbnailGridActive .thumbnail::after {
	content: attr(data-page-number);
	display: block;
	text-align: center;
	color: #aaa;
	font-size: 11px;
	margin-top: 4px;
}

/* Prevent viewer from shifting when grid overlay is active */
html[dir='ltr'] #outerContainer.sidebarOpen.thumbnailGridActive #viewerContainer:not(.pdfPresentationMode) {
	left: 0 !important;
}
