/* PDF viewer: editorial toolbar in the theme's fonts and colours, mobile first. */
.th-pdf {
	--th-pdf-ink: var(--wp--preset--color--ink, #1f1d1a);
	--th-pdf-paper: var(--wp--preset--color--white, #fffdf8);
	--th-pdf-stone: var(--wp--preset--color--stone, #e8e1d5);
	--th-pdf-line: var(--wp--preset--color--limestone, #cfc6b8);
	--th-pdf-accent: var(--wp--preset--color--bronze, #7a4e22);
	--th-pdf-muted: var(--wp--preset--color--graphite, #5a544c);
	position: relative;
	box-sizing: border-box;
	margin-left: 0;
	margin-right: 0;
	border: 1px solid var(--th-pdf-line);
	background: var(--th-pdf-paper);
	color: var(--th-pdf-ink);
	font-family: var(--wp--preset--font-family--sans, system-ui, sans-serif);
}
.th-pdf *, .th-pdf *::before, .th-pdf *::after { box-sizing: border-box; }
.th-pdf-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 4px 8px;
	padding: 4px 6px;
	border-bottom: 1px solid var(--th-pdf-line);
	background: var(--th-pdf-paper);
}
.th-pdf-bar[hidden] { display: none; }
.th-pdf-grp { display: flex; align-items: center; gap: 2px; }
.th-pdf-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	min-width: 44px;
	margin: 0;
	padding: 0;
	border: 1px solid transparent;
	border-radius: 2px;
	background: transparent;
	color: var(--th-pdf-ink);
	cursor: pointer;
	text-decoration: none;
	-webkit-tap-highlight-color: transparent;
}
.th-pdf-btn:hover { background: var(--th-pdf-stone); color: var(--th-pdf-ink); }
.th-pdf-btn:disabled { opacity: .35; cursor: default; background: transparent; }
.th-pdf-btn:focus-visible, .th-pdf-num:focus-visible, .th-pdf-zoom:focus-visible, .th-pdf-stage:focus-visible {
	outline: 2px solid var(--th-pdf-accent);
	outline-offset: 1px;
}
.th-pdf-pageno { display: inline-flex; align-items: center; gap: 6px; font-size: .9rem; color: var(--th-pdf-muted); white-space: nowrap; }
.th-pdf-num {
	width: 3.2em;
	height: 44px;
	margin: 0;
	padding: 0 4px;
	border: 1px solid var(--th-pdf-line);
	border-radius: 0;
	background: var(--th-pdf-paper);
	color: var(--th-pdf-ink);
	font: 600 1rem/1 var(--wp--preset--font-family--sans, system-ui, sans-serif);
	text-align: center;
	-webkit-user-select: text;
	user-select: text;
}
.th-pdf-zoom {
	-webkit-appearance: none;
	appearance: none;
	height: 44px;
	min-width: 6.5em;
	margin: 0;
	padding: 0 26px 0 10px;
	border: 1px solid var(--th-pdf-line);
	border-radius: 0;
	background: var(--th-pdf-paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%235a544c' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 9px center;
	color: var(--th-pdf-ink);
	font: 400 .95rem/1 var(--wp--preset--font-family--sans, system-ui, sans-serif);
	cursor: pointer;
}
.th-pdf-i-exit, .th-pdf.is-full .th-pdf-i-full { display: none; }
.th-pdf.is-full .th-pdf-i-exit { display: inline-flex; }
.th-pdf-i-full { display: inline-flex; }
.th-pdf-stage {
	position: relative;
	height: var(--th-pdf-h, 70vh);
	min-height: 240px;
	overflow: auto;
	padding: 10px;
	background: var(--th-pdf-stone);
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
}
.th-pdf:not(.is-js) .th-pdf-stage { display: none; }
.th-pdf-page { display: flex; justify-content: center; min-width: min-content; }
.th-pdf-page canvas { display: block; flex: 0 0 auto; background: #fff; box-shadow: 0 1px 4px rgba(31, 29, 26, .18); }
.th-pdf-status { position: absolute; inset: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .4em; margin: 0; padding: 1rem; color: var(--th-pdf-muted); font-size: .95rem; text-align: center; }
.th-pdf-status[hidden] { display: none; }
.th-pdf-status a { color: var(--th-pdf-accent); }
.th-pdf.is-loading .th-pdf-status::after { content: ""; width: 1.1em; height: 1.1em; margin-left: .3em; border: 2px solid var(--th-pdf-line); border-top-color: var(--th-pdf-accent); border-radius: 50%; animation: th-pdf-spin .9s linear infinite; }
@keyframes th-pdf-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .th-pdf.is-loading .th-pdf-status::after { animation: none; } }
.th-pdf-noscript { margin: 0; padding: 1rem; }
.th-pdf-noscript a { color: var(--th-pdf-accent); }
.th-pdf .screen-reader-text { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.th-pdf.is-full { display: flex; flex-direction: column; width: 100%; height: 100%; margin: 0; border: 0; background: var(--th-pdf-stone); }
.th-pdf.is-full .th-pdf-stage { flex: 1 1 auto; height: auto; }
.th-pdf.is-fake-full { position: fixed; inset: 0; z-index: 100000; width: 100vw; height: 100vh; height: 100dvh; }
html.th-pdf-lock, html.th-pdf-lock body { overflow: hidden; }
.th-pdf-missing { padding: 1rem; border: 1px dashed var(--wp--preset--color--limestone, #cfc6b8); }
@media (min-width: 600px) {
	.th-pdf-bar { padding: 6px 10px; }
	.th-pdf-stage { padding: 16px; }
}
