.pmv {
	--pmv-page: #ffffff;
	--pmv-surface: rgba(0, 0, 0, 0.045);
	--pmv-line: rgba(0, 0, 0, 0.14);
	--pmv-radius: 6px;
	--pmv-ratio: 1.4142;
	--pmv-shadow: 0 18px 38px rgba(0, 0, 0, 0.16), 0 2px 8px rgba(0, 0, 0, 0.08);
}

@supports ( color: color-mix( in srgb, red 50%, blue ) ) {
	.pmv {
		--pmv-surface: color-mix( in srgb, currentColor 6%, transparent );
		--pmv-line: color-mix( in srgb, currentColor 20%, transparent );
	}
}

.pmv__inner {
	max-width: var( --pmv-max, none );
	margin-inline: auto;
}

.pmv__title {
	margin-block-start: 0;
}

.pmv__meta {
	margin-block: 0 0.75em;
	font-size: 0.8125em;
	opacity: 0.72;
	letter-spacing: 0.01em;
}

.pmv__viewer {
	position: relative;
}

.pmv__toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	margin-block-end: 0.6rem;
}

.pmv__viewer.is-loading .pmv__toolbar,
.pmv__viewer.is-error .pmv__toolbar {
	visibility: hidden;
}

.pmv__group {
	display: flex;
	align-items: center;
	gap: 0.25rem;
}

.pmv__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.25rem;
	height: 2.25rem;
	padding: 0;
	margin: 0;
	border: 1px solid var( --pmv-line );
	border-radius: var( --pmv-radius );
	background: transparent;
	color: inherit;
	line-height: 0;
	cursor: pointer;
	transition: background-color 0.15s ease, opacity 0.15s ease;
}

.pmv__btn:hover:not( :disabled ) {
	background: var( --pmv-surface );
}

.pmv__btn:disabled {
	opacity: 0.32;
	cursor: default;
}

.pmv__btn:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.pmv__icon {
	display: block;
}

.pmv__pager {
	display: inline-flex;
	align-items: baseline;
	gap: 0.35rem;
	margin-inline: 0.35rem;
	font-size: 0.875rem;
	font-variant-numeric: tabular-nums;
}

.pmv__page-input {
	width: 3rem;
	padding: 0.25rem 0.35rem;
	border: 1px solid var( --pmv-line );
	border-radius: var( --pmv-radius );
	background: transparent;
	color: inherit;
	font: inherit;
	font-size: 0.875rem;
	text-align: center;
	line-height: 1.3;
}

.pmv__page-total {
	opacity: 0.7;
}

.pmv__stage {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: clamp( 260px, 46vh, 560px );
	padding: clamp( 10px, 2.2vw, 26px );
	border: 1px solid var( --pmv-line );
	border-radius: 10px;
	background: var( --pmv-surface );
	overflow: auto;
	overscroll-behavior: contain;
	touch-action: pan-y;
}

.pmv__stage.is-zoomed {
	touch-action: auto;
	justify-content: safe center;
	align-items: safe center;
}

.pmv__stage:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.pmv__placeholder {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.75rem;
	font-size: 0.875rem;
	opacity: 0.7;
}

.pmv__spinner {
	width: 26px;
	height: 26px;
	border: 2px solid var( --pmv-line );
	border-top-color: currentColor;
	border-radius: 50%;
	animation: pmv-spin 0.9s linear infinite;
}

@keyframes pmv-spin {
	to {
		transform: rotate( 360deg );
	}
}

.pmv__error {
	max-width: 32rem;
	text-align: center;
	font-size: 0.9375rem;
}

.pmv__error-title {
	margin: 0 0 0.35em;
	font-weight: 600;
}

.pmv__error-hint {
	margin: 0;
	opacity: 0.75;
}

.pmv__book {
	position: relative;
	flex: none;
	margin: 0 auto;
	perspective: 2400px;
	perspective-origin: 50% 42%;
	filter: drop-shadow( 0 16px 26px rgba( 0, 0, 0, 0.18 ) );
}

.pmv__leaf {
	position: absolute;
	top: 0;
	width: 50%;
	height: 100%;
	z-index: 1;
	overflow: hidden;
	background: var( --pmv-page );
	box-shadow: 0 1px 2px rgba( 0, 0, 0, 0.16 );
}

.pmv__leaf--left {
	left: 0;
	border-radius: var( --pmv-radius ) 0 0 var( --pmv-radius );
}

.pmv__leaf--right {
	right: 0;
	border-radius: 0 var( --pmv-radius ) var( --pmv-radius ) 0;
}

.pmv__book[ data-mode='single' ] .pmv__leaf--left {
	display: none;
}

.pmv__book[ data-mode='single' ] .pmv__leaf--right {
	width: 100%;
	border-radius: var( --pmv-radius );
}

.pmv__leaf.is-empty {
	background: linear-gradient( 135deg, rgba( 0, 0, 0, 0.05 ), rgba( 0, 0, 0, 0.02 ) ), var( --pmv-page );
}

.pmv__leaf.is-empty .pmv__img {
	display: none;
}

.pmv__img {
	display: block;
	width: 100%;
	height: 100%;
	margin: 0;
	object-fit: contain;
	background: var( --pmv-page );
	user-select: none;
	-webkit-user-drag: none;
}

.pmv__gutter {
	position: absolute;
	top: 0;
	bottom: 0;
	width: 7%;
	max-width: 44px;
	z-index: 4;
	pointer-events: none;
}

.pmv__leaf--left .pmv__gutter {
	right: 0;
	background: linear-gradient( to left, rgba( 0, 0, 0, 0.15 ), rgba( 0, 0, 0, 0 ) );
}

.pmv__leaf--right .pmv__gutter {
	left: 0;
	background: linear-gradient( to right, rgba( 0, 0, 0, 0.15 ), rgba( 0, 0, 0, 0 ) );
}

.pmv__book[ data-mode='single' ] .pmv__gutter {
	display: none;
}

.pmv__spine {
	position: absolute;
	top: 0;
	bottom: 0;
	left: calc( 50% - 1px );
	width: 2px;
	z-index: 2;
	pointer-events: none;
	background: linear-gradient( to bottom, rgba( 0, 0, 0, 0.05 ), rgba( 0, 0, 0, 0.22 ), rgba( 0, 0, 0, 0.05 ) );
}

.pmv__book[ data-mode='single' ] .pmv__spine {
	display: none;
}

.pmv__cast {
	position: absolute;
	top: 0;
	width: 50%;
	height: 100%;
	z-index: 3;
	opacity: 0;
	pointer-events: none;
}

.pmv__cast[ data-side='left' ] {
	left: 0;
	background: linear-gradient( to left, rgba( 0, 0, 0, 0.55 ), rgba( 0, 0, 0, 0 ) 72% );
}

.pmv__cast[ data-side='right' ] {
	left: 50%;
	background: linear-gradient( to right, rgba( 0, 0, 0, 0.55 ), rgba( 0, 0, 0, 0 ) 72% );
}

.pmv__book[ data-mode='single' ] .pmv__cast {
	display: none;
}

.pmv__flip {
	position: absolute;
	top: 0;
	height: 100%;
	z-index: 5;
	transform-style: preserve-3d;
	pointer-events: none;
}

.pmv__flip[ hidden ] {
	display: none;
}

.pmv__flip:not( [ hidden ] ) {
	will-change: transform;
}

.pmv__face {
	position: absolute;
	inset: 0;
	overflow: hidden;
	background: var( --pmv-page );
	backface-visibility: hidden;
	-webkit-backface-visibility: hidden;
	box-shadow: 0 2px 10px rgba( 0, 0, 0, 0.22 );
}

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

.pmv__face.is-blank .pmv__img {
	display: none;
}

.pmv__face.is-blank {
	background: linear-gradient( 135deg, rgba( 0, 0, 0, 0.06 ), rgba( 0, 0, 0, 0.02 ) ), var( --pmv-page );
}

.pmv__glare {
	position: absolute;
	inset: 0;
	opacity: 0;
	pointer-events: none;
}

.pmv__flip[ data-side='right' ] .pmv__face--front .pmv__glare,
.pmv__flip[ data-side='full' ] .pmv__face--front .pmv__glare {
	background: linear-gradient( to right, rgba( 0, 0, 0, 0.65 ), rgba( 0, 0, 0, 0 ) 62% );
}

.pmv__flip[ data-side='right' ] .pmv__face--back .pmv__glare,
.pmv__flip[ data-side='full' ] .pmv__face--back .pmv__glare {
	background: linear-gradient( to left, rgba( 0, 0, 0, 0.65 ), rgba( 0, 0, 0, 0 ) 62% );
}

.pmv__flip[ data-side='left' ] .pmv__face--front .pmv__glare {
	background: linear-gradient( to left, rgba( 0, 0, 0, 0.65 ), rgba( 0, 0, 0, 0 ) 62% );
}

.pmv__flip[ data-side='left' ] .pmv__face--back .pmv__glare {
	background: linear-gradient( to right, rgba( 0, 0, 0, 0.65 ), rgba( 0, 0, 0, 0 ) 62% );
}

.pmv__edge {
	position: absolute;
	top: 0;
	bottom: 0;
	width: 15%;
	max-width: 96px;
	min-width: 44px;
	z-index: 4;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 0;
	background: transparent;
	color: inherit;
	cursor: pointer;
	opacity: 0;
	transition: opacity 0.18s ease;
}

.pmv__edge[ hidden ] {
	display: none;
}

.pmv__edge--prev {
	left: 0;
}

.pmv__edge--next {
	right: 0;
}

.pmv__book:hover .pmv__edge {
	opacity: 1;
}

.pmv__book.is-dragging .pmv__edge {
	opacity: 0;
}

.pmv__edge-icon {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: rgba( 255, 255, 255, 0.86 );
	box-shadow: 0 2px 8px rgba( 0, 0, 0, 0.24 );
	position: relative;
}

.pmv__edge-icon::before {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 9px;
	height: 9px;
	border-style: solid;
	border-color: #1a1a1a;
	border-width: 2px 2px 0 0;
}

.pmv__edge--next .pmv__edge-icon::before {
	transform: translate( -65%, -50% ) rotate( 45deg );
}

.pmv__edge--prev .pmv__edge-icon::before {
	transform: translate( -35%, -50% ) rotate( -135deg );
}

.pmv__text {
	position: absolute;
	inset: 0;
	z-index: 2;
	overflow: hidden;
	line-height: 1;
	text-align: initial;
	text-size-adjust: none;
	forced-color-adjust: none;
	transform-origin: 0 0;
}

.pmv__text > span,
.pmv__text br {
	position: absolute;
	color: transparent;
	white-space: pre;
	cursor: text;
	transform-origin: 0 0;
}

.pmv__text ::selection {
	background: rgba( 56, 120, 255, 0.32 );
}

.pmv__text .endOfContent {
	display: block;
	position: absolute;
	inset: 100% 0 0;
	z-index: -1;
	cursor: default;
	user-select: none;
}

.pmv__text .endOfContent.active {
	top: 0;
}

.pmv__links {
	position: absolute;
	inset: 0;
	z-index: 3;
	pointer-events: none;
}

.pmv__link {
	position: absolute;
	display: block;
	pointer-events: auto;
	border-radius: 2px;
	box-shadow: none;
	background: transparent;
	text-decoration: none;
}

.pmv__link:hover {
	background: rgba( 56, 120, 255, 0.16 );
	outline: 1px solid rgba( 56, 120, 255, 0.5 );
}

.pmv__thumbs {
	display: flex;
	gap: 8px;
	margin-block-start: 0.6rem;
	padding: 10px;
	border: 1px solid var( --pmv-line );
	border-radius: 10px;
	background: var( --pmv-surface );
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scrollbar-width: thin;
}

.pmv__thumbs[ hidden ] {
	display: none;
}

.pmv__thumb {
	display: flex;
	flex: none;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	width: 74px;
	padding: 4px;
	border: 0;
	border-radius: 6px;
	background: transparent;
	color: inherit;
	font: inherit;
	font-size: 0.75rem;
	line-height: 1.4;
	cursor: pointer;
}

.pmv__thumb:hover {
	background: var( --pmv-line );
}

.pmv__thumb:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 1px;
}

.pmv__thumb-frame {
	display: block;
	width: 100%;
	aspect-ratio: var( --pmv-thumb-ar, 0.707 );
	border-radius: 2px;
	background: var( --pmv-page );
	box-shadow: 0 1px 4px rgba( 0, 0, 0, 0.24 );
	overflow: hidden;
}

.pmv__thumb-img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.pmv__thumb.is-current .pmv__thumb-frame {
	outline: 2px solid currentColor;
	outline-offset: 1px;
}

.pmv__thumb.is-current .pmv__thumb-num {
	font-weight: 700;
}

.pmv__thumb-num {
	font-variant-numeric: tabular-nums;
	opacity: 0.75;
}

.pmv__viewer.is-loading .pmv__thumbs,
.pmv__viewer.is-error .pmv__thumbs {
	display: none;
}

.pmv__hint {
	margin: 0.55rem 0 0;
	font-size: 0.8125rem;
	opacity: 0.65;
}

.pmv__viewer.is-loading .pmv__hint,
.pmv__viewer.is-error .pmv__hint {
	visibility: hidden;
}

.pmv__status {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect( 0, 0, 0, 0 );
	white-space: nowrap;
	border: 0;
}

.pmv .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect( 0, 0, 0, 0 );
	white-space: nowrap;
	border: 0;
}

.pmv__actions {
	display: flex;
	flex-wrap: wrap;
	margin-block-start: 1.1rem;
}

.pmv__actions--left {
	justify-content: flex-start;
}

.pmv__actions--center {
	justify-content: center;
}

.pmv__actions--right {
	justify-content: flex-end;
}

.pmv__noscript {
	margin-block-start: 0.75rem;
}

.pmv__viewer:fullscreen,
.pmv__viewer.is-pseudo-full {
	display: flex;
	flex-direction: column;
	box-sizing: border-box;
	width: 100%;
	height: 100%;
	padding: clamp( 8px, 1.6vw, 20px );
	background: var( --wp--preset--color--base, #ffffff );
}

.pmv__viewer.is-pseudo-full {
	position: fixed;
	inset: 0;
	z-index: 999999;
	overflow: auto;
}

html.pmv-locked,
html.pmv-locked body {
	overflow: hidden;
}

.pmv__viewer:fullscreen .pmv__stage,
.pmv__viewer.is-pseudo-full .pmv__stage {
	flex: 1;
	min-height: 0;
}

.pmv__viewer:fullscreen .pmv__hint,
.pmv__viewer.is-pseudo-full .pmv__hint {
	display: none;
}

.pmv__viewer:fullscreen .pmv__thumbs,
.pmv__viewer.is-pseudo-full .pmv__thumbs {
	flex: none;
}

@media ( max-width: 600px ) {
	.pmv__toolbar {
		justify-content: center;
	}

	.pmv__hint {
		display: none;
	}
}

@media ( prefers-reduced-motion: reduce ) {
	.pmv__edge,
	.pmv__btn {
		transition: none;
	}

	.pmv__spinner {
		animation-duration: 2.4s;
	}
}

@media print {
	.pmv__toolbar,
	.pmv__hint,
	.pmv__status,
	.pmv__edge,
	.pmv__cast,
	.pmv__flip,
	.pmv__thumbs {
		display: none !important;
	}

	.pmv__stage {
		border: 0;
		background: none;
		overflow: visible;
		min-height: 0;
	}

	.pmv__book {
		filter: none;
	}
}
