/* ==========================================================================
   Nhà Tổ online book reader
   ========================================================================== */

.nhato-flipbook {
	background: #160f0b;
	border: 1px solid rgba(200, 155, 60, 0.42);
	box-shadow: 0 30px 80px rgba(49, 27, 13, 0.2);
	margin: 0 auto;
	max-width: 1260px;
	overflow: hidden;
	position: relative;
	width: 100%;
}

.nhato-reader-stage {
	align-items: center;
	background:
		radial-gradient(circle at 50% 12%, rgba(214, 170, 75, 0.13), transparent 27%),
		linear-gradient(135deg, #21150f, #0d0907);
	display: flex;
	justify-content: center;
	min-height: 760px;
	overflow: hidden;
	padding: 44px 34px;
	position: relative;
}

.nhato-reader-stage::before {
	background-image: url("../images/pattern-dongson.svg");
	content: "";
	inset: 0;
	opacity: 0.045;
	pointer-events: none;
	position: absolute;
}

.nhato-reader-stage::after {
	background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 38%, rgba(0, 0, 0, 0.42) 100%);
	content: "";
	inset: 0;
	pointer-events: none;
	position: absolute;
}

.nhato-reader-loading {
	align-items: center;
	color: rgba(255, 253, 247, 0.78);
	display: flex;
	flex-direction: column;
	gap: 17px;
	inset: 0;
	justify-content: center;
	padding: 30px;
	position: absolute;
	text-align: center;
	transition: opacity 240ms ease, visibility 240ms ease;
	z-index: 8;
}

.nhato-reader-loading.is-hidden {
	opacity: 0;
	pointer-events: none;
	visibility: hidden;
}

.nhato-reader-loading.is-error {
	color: #ffd2c9;
}

.nhato-reader-seal {
	align-items: center;
	border: 1px solid var(--nhato-gold, #c89b3c);
	border-radius: 50%;
	color: var(--nhato-gold-bright, #e3bd68);
	display: flex;
	font-family: serif;
	font-size: 25px;
	height: 72px;
	justify-content: center;
	position: relative;
	width: 72px;
}

.nhato-reader-seal::after {
	animation: nhato-reader-pulse 1.7s ease-in-out infinite;
	border: 1px solid rgba(227, 189, 104, 0.32);
	border-radius: 50%;
	content: "";
	inset: -8px;
	position: absolute;
}

.nhato-reader-loading strong {
	font-size: 12px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.nhato-reader-progress {
	background: rgba(255, 255, 255, 0.12);
	height: 2px;
	overflow: hidden;
	width: 180px;
}

.nhato-reader-progress i {
	background: var(--nhato-gold, #c89b3c);
	display: block;
	height: 100%;
	transition: width 180ms ease;
	width: 12%;
}

@keyframes nhato-reader-pulse {
	0%,
	100% {
		opacity: 0.35;
		transform: scale(0.95);
	}
	50% {
		opacity: 1;
		transform: scale(1.05);
	}
}

.nhato-flipbook-pages {
	margin: 0 auto;
	max-width: 100%;
	position: relative;
	z-index: 2;
}

.nhato-flipbook-pages .stf__parent {
	margin: auto;
}

.nhato-flipbook-pages .stf__wrapper {
	box-shadow: 0 24px 55px rgba(0, 0, 0, 0.48);
}

.nhato-flipbook-pages .stf__block {
	background: transparent !important;
}

.nhato-reader-page {
	background:
		linear-gradient(90deg, rgba(92, 63, 34, 0.07), transparent 6%),
		#fffdf7;
	box-shadow: inset 0 0 28px rgba(87, 58, 32, 0.055);
	overflow: hidden;
	position: relative;
}

.nhato-reader-page::after {
	border: 1px solid rgba(120, 84, 43, 0.12);
	content: "";
	inset: 12px;
	pointer-events: none;
	position: absolute;
	z-index: 4;
}

.nhato-reader-page canvas {
	display: block;
	height: 100%;
	object-fit: contain;
	width: 100%;
}

.nhato-pdf-page-placeholder {
	align-items: center;
	color: #9a8978;
	display: flex;
	font-family: var(--nhato-serif, serif);
	font-size: 12px;
	inset: 0;
	justify-content: center;
	letter-spacing: 0.08em;
	position: absolute;
	text-transform: uppercase;
	z-index: 1;
}

.nhato-reader-page.is-rendered .nhato-pdf-page-placeholder {
	display: none;
}

.nhato-reader-page.is-cover {
	background:
		linear-gradient(135deg, rgba(119, 29, 25, 0.97), rgba(40, 16, 11, 0.99)),
		url("../images/pattern-dongson.svg") center / 340px repeat;
	color: #fff;
}

.nhato-reader-page.is-cover::before {
	border: 1px solid rgba(227, 189, 104, 0.48);
	content: "";
	inset: 24px;
	position: absolute;
}

.nhato-reader-page.is-cover img {
	height: 100%;
	object-fit: cover;
	width: 100%;
}

.nhato-reader-cover-content {
	align-items: center;
	display: flex;
	flex-direction: column;
	inset: 0;
	justify-content: center;
	padding: 58px;
	position: absolute;
	text-align: center;
}

.nhato-reader-cover-mark {
	align-items: center;
	border: 1px solid rgba(227, 189, 104, 0.62);
	border-radius: 50%;
	color: var(--nhato-gold-bright, #e3bd68);
	display: flex;
	font-family: var(--nhato-serif, serif);
	font-size: 20px;
	height: 74px;
	justify-content: center;
	letter-spacing: 0.06em;
	margin-bottom: 38px;
	width: 74px;
}

.nhato-reader-cover-content h3 {
	color: #fff;
	font-family: var(--nhato-serif, serif);
	font-size: 35px;
	line-height: 1.35;
	margin: 0 0 28px;
}

.nhato-reader-cover-content p {
	color: var(--nhato-gold-bright, #e3bd68);
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.14em;
	margin: 0;
	text-transform: uppercase;
}

.nhato-docx-content {
	color: #362c24;
	font-family: var(--nhato-serif, Georgia, serif);
	font-size: 15px;
	height: 100%;
	line-height: 1.72;
	overflow: hidden;
	padding: 52px 50px 58px;
	position: relative;
	z-index: 2;
}

.nhato-docx-content::after {
	bottom: 25px;
	color: #9b8b7b;
	content: attr(data-page);
	font-family: var(--nhato-sans, sans-serif);
	font-size: 9px;
	left: 0;
	letter-spacing: 0.08em;
	position: absolute;
	right: 0;
	text-align: center;
}

.nhato-docx-content h1,
.nhato-docx-content h2,
.nhato-docx-content h3,
.nhato-docx-content h4 {
	color: #491d17;
	font-family: var(--nhato-serif, Georgia, serif);
	line-height: 1.35;
	margin: 0 0 0.75em;
}

.nhato-docx-content h1 {
	font-size: 28px;
}

.nhato-docx-content h2 {
	font-size: 23px;
}

.nhato-docx-content h3 {
	font-size: 19px;
}

.nhato-docx-content p {
	margin: 0 0 1em;
	text-align: justify;
}

.nhato-docx-content ul,
.nhato-docx-content ol {
	margin: 0 0 1em 1.3em;
	padding: 0;
}

.nhato-docx-content img {
	display: block;
	height: auto;
	margin: 1em auto;
	max-height: 330px;
	max-width: 100%;
	object-fit: contain;
}

.nhato-docx-content table {
	border-collapse: collapse;
	font-size: 11px;
	margin-bottom: 1em;
	width: 100%;
}

.nhato-docx-content th,
.nhato-docx-content td {
	border: 1px solid #d4c7b5;
	padding: 5px;
}

.nhato-docx-content blockquote {
	border-left: 2px solid var(--nhato-gold, #c89b3c);
	color: #674c3d;
	font-style: italic;
	margin: 1em 0;
	padding-left: 1em;
}

.nhato-reader-toolbar {
	align-items: center;
	background: #0e0a08;
	border-top: 1px solid rgba(200, 155, 60, 0.3);
	color: #fff;
	display: flex;
	gap: 7px;
	min-height: 64px;
	padding: 10px 18px;
	position: relative;
	z-index: 10;
}

.nhato-reader-button {
	align-items: center;
	background: rgba(255, 255, 255, 0.055);
	border: 1px solid rgba(255, 255, 255, 0.13);
	border-radius: 0;
	color: rgba(255, 255, 255, 0.82);
	display: inline-flex;
	font-size: 24px;
	height: 40px;
	justify-content: center;
	line-height: 1;
	margin: 0;
	padding: 0;
	transition: background-color 170ms ease, border-color 170ms ease, color 170ms ease;
	width: 42px;
}

.nhato-reader-button:hover {
	background: rgba(200, 155, 60, 0.16);
	border-color: rgba(227, 189, 104, 0.46);
	color: var(--nhato-gold-bright, #e3bd68);
}

.nhato-reader-button:disabled {
	cursor: not-allowed;
	opacity: 0.3;
}

.nhato-reader-button svg {
	fill: none;
	height: 19px;
	stroke: currentColor;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 1.6;
	width: 19px;
}

.nhato-reader-counter {
	color: rgba(255, 255, 255, 0.64);
	font-size: 11px;
	font-variant-numeric: tabular-nums;
	letter-spacing: 0.08em;
	min-width: 70px;
	text-align: center;
}

.nhato-reader-spacer {
	flex: 1;
}

.nhato-reader-download {
	text-decoration: none;
}

.nhato-reader-noscript {
	background: #fff4dc;
	color: #4a281d;
	margin: 0;
	padding: 18px;
	text-align: center;
}

.nhato-flipbook:fullscreen,
.nhato-flipbook.is-fullscreen {
	background: #0d0907;
	height: 100vh;
	max-width: none;
	width: 100vw;
}

.nhato-flipbook:fullscreen .nhato-reader-stage,
.nhato-flipbook.is-fullscreen .nhato-reader-stage {
	height: calc(100vh - 64px);
	min-height: 0;
}

.nhato-flipbook:fullscreen .nhato-reader-toolbar,
.nhato-flipbook.is-fullscreen .nhato-reader-toolbar {
	bottom: 0;
	left: 0;
	position: absolute;
	right: 0;
}

@media (max-width: 900px) {
	.nhato-reader-stage {
		min-height: 660px;
		padding: 32px 18px;
	}
}

@media (max-width: 600px) {
	.nhato-flipbook {
		border-left: 0;
		border-right: 0;
		margin-left: -18px;
		width: calc(100% + 36px);
	}

	.nhato-reader-stage {
		min-height: 570px;
		padding: 24px 8px;
	}

	.nhato-reader-toolbar {
		min-height: 58px;
		padding: 8px 10px;
	}

	.nhato-reader-button {
		height: 38px;
		width: 39px;
	}

	.nhato-reader-counter {
		min-width: 58px;
	}

	.nhato-docx-content {
		font-size: 12px;
		line-height: 1.58;
		padding: 34px 27px 42px;
	}

	.nhato-docx-content h1 {
		font-size: 22px;
	}

	.nhato-docx-content h2 {
		font-size: 19px;
	}

	.nhato-reader-page::after {
		inset: 7px;
	}

	.nhato-reader-page.is-cover::before {
		inset: 14px;
	}

	.nhato-reader-cover-content {
		padding: 30px;
	}

	.nhato-reader-cover-content h3 {
		font-size: 25px;
	}

	.nhato-reader-cover-mark {
		height: 58px;
		margin-bottom: 22px;
		width: 58px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.nhato-reader-seal::after {
		animation: none;
	}
}
