/* book-app/turnjs/css/docs.css */
/* ----- */

#canvas {
	width: 100%;
	margin: 0 auto;
	padding: 0;
	background-color: var(--canvas-bg-color);
	display: flex;
	flex-direction: column;
	justify-content: start;
	align-items: center;
	overflow-x: hidden;
}

#canvas.fullscreen {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 10001;
}

.book-zoom-wrapper {
	width: 100%;
	margin: 1rem 0;
	display: flex;
	justify-content: center;
	align-items: center;
}

#book-zoom {
	-webkit-transition: -webkit-transform 1s;
	transition: transform 1s;
}

#book-zoom.draggable {
	cursor: grab;
}

#book-zoom.dragging {
	cursor: grabbing;
	transition: none;
}

#book-zoom.fullscreen {
	flex-grow: 1;
	display: flex;
	justify-content: center;
	align-items: center;
	padding-bottom: 100px;
}

.animated {
	-webkit-transition: margin-left 0.2s ease-in-out;
	transition: margin-left 0.2s ease-in-out;
}

.sample-docs {
	margin: 0 auto;
	width: 960px;
	height: 679px;
	font-size: 0;
	position: relative;
}

.sample-docs .page {
	width: 100%;
	height: 100%;
	background-color: white;
	/* 'background'から変更し、turn.jsのグラデーションを妨げないようにする */
	-webkit-box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
	box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
	display: flex;
	justify-content: center;
	align-items: center;
}

#book-container .sample-docs .page img {
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: contain;
}

.sample-docs .hard {
	display: none;
}

.sample-docs .even .gradient {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-image: url(../pics/right-border.png);
	background-position: right top;
	background-repeat: repeat-y;
}

.sample-docs .odd .gradient {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-image: url(../pics/left-border.png);
	background-position: left top;
	background-repeat: repeat-y;
}

.sample-docs .page-wrapper {
	-webkit-perspective: 2000px;
	perspective: 2000px;
}

.sample-docs .loader {
	background-image: url(../pics/loader.gif);
	width: 22px;
	height: 22px;
	position: absolute;
	top: 280px;
	left: 219px;
}

/* singleモードとdoubleモードの両方でブックの影を適切に表示するためのスタイル 
  - .sample-docs.shadow: singleモード時にブック本体に適用される影
  - .sample-docs > .shadow: doubleモード時に裏表紙として表示されるdiv要素の影
*/
.sample-docs.shadow,
.sample-docs > .shadow {
	-webkit-transition: -webkit-box-shadow 0.5s;
	transition: box-shadow 0.5s;
	-webkit-box-shadow: 0 0 20px rgba(0,0,0,0.3);
	box-shadow: 0 0 20px rgba(0,0,0,0.3);
}

/* * WordPressテーマとの競合による影の幅の問題を修正します。
 * turn.jsがインラインスタイルで不正なwidthを指定しても、
 * min-widthによって最小幅（ブックの半分の幅）を維持します。
*/
.sample-docs > .shadow {
	min-width: 50% !important;
	max-width: none !important; /* 念のためmax-widthも無効化 */
}


/* スライダー */
#slider .ui-slider-handle {
	z-index: 10000;
	background-color: rgb(90, 203, 255);
	pointer-events: all;
	opacity: 0.7;
}

#slider .ui-slider-handle:hover {
	background-color: rgb(0, 174, 255);
	cursor: grab;
}

/* ブックコンテナ */
#book-container {
	width: 100%;
	height: auto;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: start;
	overflow: hidden;
}

#book-title {
	width: 100%;
	text-align: center;
	padding: 1rem 0;
	font-size: 1.5rem;
	font-weight: bold;
	color: var(--text-color);
	background-color: var(--canvas-bg-color);
}

/* コントローラー */
#controler {
	z-index: 10000;
	position: relative;
	width: 100%;
	flex-shrink: 0;
	left: 0;
	bottom: 0;
	margin: 0;
	padding: 1rem;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	background-color: var(--controler-bg-color);
	border-top: 1px solid var(--controler-border-color);
}

#canvas.fullscreen #controler {
	position: fixed;
	bottom: 0;
	left: 0;
	width: 100%;
	z-index: 10002;
}

.control-grid {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 10px;
}

.control-buttons,
.zoom-controls {
	margin: 0 !important;
	padding: 2px 4px;
	display: flex;
	justify-content: center;
	gap: 5px;
	margin-top: 10px;
	border: 1px solid var(--controler-border-color);
	border-radius: 8px;
	background-color: var(--button-bg-color);
}

.zoom-controls {
	margin: 0 !important;
}

.control-grid .btn {
	margin: 4px 2px;
	padding: 8px 12px;
	text-align: center;
	text-decoration: none;
	display: inline-block;
	color: var(--text-color);
	font-size: 16px;
	cursor: pointer;
	border-radius: 5px;
	border: 1px solid var(--button-border-color);
	background-color: var(--button-bg-color);
	transition: background-color 0.3s;
}

.control-grid .btn:hover {
	background-color: var(--button-hover-bg-color);
}

.page-display {
	height: 100%;
	padding: 8px 12px;
	display: flex;
	justify-content: center;
	align-items: center;
	font-weight: bold;
	color: var(--text-color);
}

@media (max-width: 767.98px) {
	.control-grid {
		flex-direction: column;
		gap: 5px;
	}

	.control-grid .page-display {
		margin: 0;
		padding: 0;
	}

	#slider-bar {
		display: none;
	}
}

@media (min-width: 768px) and (max-width: 991.98px) {
	.control-grid {
		flex-direction: column;
	}
}

#table-of-contents {
	width: 100%;
	background-color: var(--bg-color);
	color: var(--text-color);
	padding: 1rem;
	overflow-y: auto;
}

#table-of-contents .attention-container {
	margin: 0 auto;
	width: 100%;
}

#table-of-contents h1#book-title {
	margin: 0 0 0.5rem 0;
	font-size: 2rem;
	font-weight: 400;
	text-align: start;
}

#table-of-contents h4.book-table-of-contents {
	margin: 0 0 0.5rem 0;
	font-size: 1.5rem;
	font-weight: 400;
}

#toc-list {
	list-style: none;
	padding: 0;
	margin: 0;
}

#toc-list li {
	margin-bottom: 0.5rem;
}

#toc-list a {
	color: var(--text-color);
	text-decoration: none;
	transition: color 0.3s;
}

#toc-list a:hover {
	color: #007bff;
}

@media (max-width: 767.98px) {
	#table-of-contents .attention-container {
		display: block;
		width: 100%;
		margin: 0;
		padding: 1rem;
	}
}

@media (min-width: 768px) and (max-width: 991.98px) {
	#table-of-contents .attention-container {
		display: block;
		width: 100%;
		margin: 0;
		padding: 1rem;
	}
}

@media (min-width: 992px) {
	#table-of-contents .attention-container {
		display: block;
		width: 960px;
		margin: 0 auto;
		padding: 1rem;
	}
}

#print-container {
	display: none;
}

@media print {
	@page {
		size: A4 portrait;
		margin: 0;
	}

	html,
	body {
		width: 100%;
		height: 100%;
		margin: 0;
		padding: 0;
	}

	body>div:not(#print-container) {
		display: none !important;
	}

	#print-container {
		display: block !important;
	}

	.print-page {
		width: 210mm;
		height: 297mm;
		padding: 10mm;
		box-sizing: border-box;
		display: flex;
		justify-content: center;
		align-items: center;
		page-break-after: always;
		overflow: hidden;
	}

	.print-page:last-child {
		page-break-after: auto;
	}

	.print-page img {
		max-width: 100%;
		max-height: 100%;
		width: auto;
		height: auto;
		object-fit: contain;
	}
}