/* Catalog reader (catalog-reader.php, reader.js): the brand's header bar, pages on a grey desk. */

html, body { height: 100%; margin: 0; }
.dp-reader {
	display: grid; grid-template-rows: auto minmax(0, 1fr); height: 100vh; height: 100dvh; overflow: hidden;
	background: #3B4048; color: #FFFFFF; font-family: var(--f-body, system-ui, sans-serif);
	-webkit-font-smoothing: antialiased;
}
.dp-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Bar */
.dp-reader__bar {
	position: relative; z-index: 2; display: flex; align-items: center; gap: 8px 16px; min-height: 60px; padding: 8px 16px; box-sizing: border-box;
	background: var(--c-header-bg, #0E1219); color: var(--c-header-fg, #FFFFFF); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}
.dp-reader__home { flex: none; display: flex; align-items: center; color: inherit; font-weight: 800; text-decoration: none; }
.dp-reader__home img { display: block; height: 40px; width: auto; max-width: 150px; object-fit: contain; }
.dp-reader__title {
	flex: 1 1 auto; min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
	font-size: 15px; font-weight: 800; line-height: 1.25;
}
.dp-reader__title small { display: block; overflow: hidden; text-overflow: ellipsis; font-size: 12px; font-weight: 500; opacity: 0.7; }
.dp-reader__pager, .dp-reader__zoom, .dp-reader__actions { flex: none; display: flex; align-items: center; gap: 4px; }
.dp-reader__count { display: flex; align-items: center; gap: 6px; padding: 0 4px; font-size: 14px; font-variant-numeric: tabular-nums; }
.dp-reader__input {
	width: 3ch; min-width: 36px; height: 36px; box-sizing: border-box; padding: 0 4px; text-align: center;
	font: inherit; font-weight: 700; color: inherit; background: transparent;
	border: 1px solid color-mix(in srgb, currentColor 35%, transparent); border-radius: 4px;
}
.dp-reader__input:focus { outline: 2px solid var(--c-focus, #C7481B); outline-offset: 1px; }
.dp-reader__btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 36px; height: 36px; box-sizing: border-box; padding: 0 10px;
	font: inherit; font-size: 15px; font-weight: 800; line-height: 1; color: inherit; text-decoration: none;
	background: transparent; border: 1px solid color-mix(in srgb, currentColor 35%, transparent); border-radius: 4px; cursor: pointer;
}
.dp-reader__btn:hover { background: color-mix(in srgb, currentColor 12%, transparent); }
.dp-reader__btn:focus-visible { outline: 2px solid var(--c-focus, #C7481B); outline-offset: 2px; }
.dp-reader__btn[disabled] { opacity: 0.35; cursor: default; background: transparent; }
.dp-reader__btn[data-style="solid"] { background: var(--c-btn, #C7481B); color: var(--c-btn-fg, #FFFFFF); border-color: transparent; }
.dp-reader__btn[data-style="solid"]:hover { background: color-mix(in srgb, var(--c-btn, #C7481B) 85%, #000000); }

/* Pages: a scrolling column, centered; wider than the screen when zoomed (scrolls sideways). */
.dp-reader__pages { position: relative; overflow: auto; padding: 20px 16px 40px; outline: none; overscroll-behavior: contain; --page-w: 900px; }
.dp-reader__page {
	position: relative; width: var(--page-w); margin: 0 auto 20px; aspect-ratio: 612 / 792;
	background: #FFFFFF; box-shadow: 0 2px 14px rgba(0, 0, 0, 0.35); scroll-margin-top: 20px;
}
.dp-reader__page canvas { display: block; width: 100%; height: 100%; }
.dp-reader__status { position: fixed; top: 40%; left: 16px; right: 16px; z-index: 1; margin: 0 auto; max-width: 32em; text-align: center; font-size: 15px; line-height: 1.5; color: #E6E8EB; }
.dp-reader__status a { color: #FFFFFF; font-weight: 700; }

/* Phones and narrow windows: title and zoom give way to the pager. */
@media (width < 900px) {
	.dp-reader__zoom { display: none; }
}
@media (width < 640px) {
	.dp-reader__bar { flex-wrap: wrap; gap: 8px; min-height: 0; padding: 8px 12px; }
	.dp-reader__home img { height: 30px; max-width: 90px; }
	.dp-reader__title { order: 3; flex-basis: 100%; font-size: 13px; }
	.dp-reader__title small { display: none; }
	.dp-reader__pager { margin-left: auto; }
	.dp-reader__label { display: none; }
	.dp-reader__pages { padding: 12px 8px 32px; }
	.dp-reader__page { margin-bottom: 12px; scroll-margin-top: 12px; }
}
