/* Kadence keeps the site header and footer; the chapter owns its reading area. */
body.single-noir_chapter #inner-wrap {
	width: 100%;
	max-width: none;
	margin: 0;
	padding: 0;
	background: #101116;
	color: #f4f4f6;
}

.noir-reader,
.noir-reader *,
.noir-reader-fullscreen,
.noir-reader-fullscreen * {
	box-sizing: border-box;
}

.noir-reader {
	width: min(100%, 960px);
	margin: 0 auto;
	padding: 24px 8px 48px;
	color: #f4f4f6;
}

.noir-reader-header {
	padding: 0 8px 24px;
}

.noir-reader-work {
	margin: 0 0 8px;
	color: #d5d5dc;
	font-size: 0.95rem;
}

.noir-reader h1 {
	margin: 0 0 12px;
	color: inherit;
	font-size: clamp(1.5rem, 5vw, 2.5rem);
	line-height: 1.2;
	overflow-wrap: anywhere;
}

.noir-reader-number {
	margin: 0 0 20px;
	color: #d5d5dc;
	font-size: 1rem;
}

.noir-reader-link,
.noir-reader-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 10px 14px;
	border: 1px solid #777887;
	border-radius: 4px;
	background: #22232b;
	color: #fff;
	font: inherit;
	font-size: 1rem;
	line-height: 1.3;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
}

.noir-reader-link:hover,
.noir-reader-link:focus-visible,
.noir-reader-button:hover:not(:disabled),
.noir-reader-button:focus-visible {
	border-color: #fff;
	background: #343641;
	color: #fff;
	text-decoration: underline;
}

.noir-reader-link:focus-visible,
.noir-reader-button:focus-visible,
.noir-reader-stage:focus-visible,
.noir-reader-fullscreen-close:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 3px;
}

.noir-reader-button:disabled {
	border-color: #454650;
	background: #1b1c22;
	color: #92939e;
	cursor: not-allowed;
}

.noir-reader-toolbar,
.noir-reader-navigation {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 0 8px;
}

.noir-reader-toolbar {
	margin-bottom: 12px;
}

.noir-reader-counter {
	margin: 0;
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.4;
}

.noir-reader-stage {
	display: flex;
	width: 100%;
	min-height: 200px;
	margin: 0;
	padding: 0;
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	overscroll-behavior-inline: contain;
	-webkit-overflow-scrolling: touch;
	touch-action: pan-x pan-y pinch-zoom;
	background: #0a0b0f;
	direction: ltr;
}

.noir-reader-stage.noir-reader--zoomed {
	overflow-x: hidden !important;
	scroll-snap-type: none !important;
	overscroll-behavior-inline: auto;
}

.noir-reader-stage.noir-reader--desktop-zoomed {
	overflow-x: hidden;
	scroll-snap-type: none;
}

.noir-reader--desktop-zoomed .noir-reader-slide {
	overflow: hidden;
}

.noir-reader--desktop-zoomed .noir-reader-image {
	transform-origin: center center;
	cursor: grab;
	user-select: none;
	-webkit-user-drag: none;
}

.noir-reader--desktop-dragging .noir-reader-image {
	cursor: grabbing;
}

.noir-reader-stage-placeholder {
	width: 100%;
	background: #0a0b0f;
}

.noir-reader-stage::-webkit-scrollbar {
	display: none;
}

.noir-reader-slide {
	position: relative;
	display: flex;
	flex: 0 0 100%;
	align-items: center;
	justify-content: center;
	min-width: 0;
	min-height: 200px;
	scroll-snap-align: center;
	scroll-snap-stop: always;
}

.noir-reader-image {
	display: block;
	width: auto;
	max-width: 100%;
	height: auto;
	max-height: min(75dvh, 900px);
	margin: 0 auto;
	object-fit: contain;
}

.noir-reader-loading {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	color: #d5d5dc;
}

.noir-reader-error,
.noir-reader-empty {
	margin: 0;
	padding: 24px 8px;
	line-height: 1.5;
}

.noir-reader-navigation {
	margin-top: 16px;
}

.noir-reader-navigation .noir-reader-button {
	flex: 1 1 0;
	min-width: 0;
	min-height: 48px;
}

.noir-reader-footer {
	padding: 24px 8px 0;
}

.noir-reader-fullscreen {
	width: 100%;
}

.noir-reader-desktop-zoom[hidden] {
	display: none !important;
}

.noir-reader-desktop-zoom {
	display: flex;
	justify-content: flex-end;
	align-items: center;
	gap: 4px;
	padding: 0 8px 8px;
}

.noir-reader-desktop-zoom button {
	display: grid;
	place-items: center;
	min-width: 36px;
	height: 36px;
	padding: 0 6px;
	border: 1px solid #777887;
	border-radius: 4px;
	background: #22232b;
	color: #fff;
	font: inherit;
	font-size: 1rem;
	cursor: pointer;
}

.noir-reader-desktop-zoom button:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.noir-reader-desktop-zoom button:disabled {
	color: #92939e;
	cursor: not-allowed;
}

#noir-reader-zoom-reset {
	min-width: 58px;
	font-size: 0.85rem;
}

.noir-reader-fullscreen.is-open {
	position: fixed;
	z-index: 99999;
	inset: 0;
	display: flex;
	width: 100%;
	height: 100vh;
	height: 100dvh;
	background: #000;
	touch-action: auto;
}

.noir-reader-fullscreen.is-open .noir-reader-desktop-zoom {
	position: fixed;
	z-index: 2;
	right: 12px;
	bottom: max(12px, env(safe-area-inset-bottom));
	padding: 4px;
	border: 1px solid #454650;
	border-radius: 6px;
	background: rgb(15 16 20 / 88%);
}

.noir-reader-fullscreen.is-open .noir-reader-stage {
	flex: 1 1 auto;
	width: 100%;
	height: 100%;
	min-height: 0;
	background: #000;
}

.noir-reader-fullscreen.is-open .noir-reader-slide {
	height: 100%;
	min-height: 0;
}

.noir-reader-fullscreen.is-open .noir-reader-image {
	max-width: 100%;
	max-height: 100%;
}

.noir-reader-fullscreen-close[hidden] {
	display: none !important;
}

.noir-reader-fullscreen-close {
	position: fixed;
	z-index: 1;
	top: max(8px, env(safe-area-inset-top));
	right: max(8px, env(safe-area-inset-right));
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1px solid #777887;
	border-radius: 50%;
	background: rgb(15 16 20 / 85%);
	color: #fff;
	font: inherit;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
}

@media (max-width: 767px), (hover: none) and (pointer: coarse) {
	.noir-reader-navigation {
		display: none;
	}
}

@media (min-width: 480px) {
	.noir-reader {
		padding: 32px 16px 56px;
	}
}

@media (min-width: 768px) {
	.noir-reader {
		padding: 40px 24px 64px;
	}

	.noir-reader-header {
		padding-bottom: 32px;
	}
}

@media (min-width: 1024px) {
	.noir-reader {
		padding: 48px 32px 80px;
	}
}

@media (orientation: landscape) and (max-height: 500px) {
	.noir-reader-image {
		max-height: calc(100dvh - 120px);
	}

	.noir-reader-stage,
	.noir-reader-slide {
		min-height: 0;
	}
}

.noir-reader-fullscreen-arrow[hidden], .noir-reader-fullscreen-counter[hidden] { display: none !important; }
.noir-reader-fullscreen-arrow {
	position: absolute;
	z-index: 3;
	top: 50%;
	transform: translateY(-50%);
	display: grid;
	place-items: center;
	width: 44px;
	height: 56px;
	padding: 0;
	border: 1px solid #777887;
	border-radius: 6px;
	background: rgb(15 16 20 / 75%);
	color: #fff;
	font: inherit;
	font-size: 36px;
	line-height: 1;
	cursor: pointer;
}
.noir-reader-fullscreen-arrow-left { left: max(8px, env(safe-area-inset-left)); }
.noir-reader-fullscreen-arrow-right { right: max(8px, env(safe-area-inset-right)); }
.noir-reader-fullscreen-arrow:disabled { opacity: .3; cursor: default; }
.noir-reader-fullscreen-arrow:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.noir-reader-fullscreen-counter {
	position: absolute;
	z-index: 2;
	left: 50%;
	bottom: max(12px, env(safe-area-inset-bottom));
	transform: translateX(-50%);
	margin: 0;
	padding: 6px 12px;
	border-radius: 4px;
	background: rgb(15 16 20 / 75%);
	color: #fff;
	font-size: 12px;
	pointer-events: none;
}

/* Touch readers navigate by swiping, including phones in landscape. */
@media (max-width: 767px), (hover: none) and (pointer: coarse) {
	.noir-reader-fullscreen-arrow { display: none !important; }
}
