/* ------------------------------------------------------------------
   Truthscape — Glass-Box study reader
   Chrome only. The study document supplies its own typography and
   layout; this file adds the return control, print behaviour, and a
   few fixes the standalone document could not know about.
   ------------------------------------------------------------------ */

/* Return control — deliberately floating, so it never collides with the
   study's own sticky header or sidebar. */
.ts-gb-back {
	position: fixed;
	left: 16px;
	bottom: 16px;
	z-index: 99999;
	display: inline-block;
	padding: 9px 16px;
	border: 1px solid #C79A3B;
	border-radius: 999px;
	background: #071A2D;
	color: #F7F2E8;
	font-family: 'Source Sans 3', system-ui, -apple-system, sans-serif;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .1em;
	text-transform: uppercase;
	text-decoration: none;
	box-shadow: 0 4px 14px rgba(7, 26, 45, .28);
	transition: background .18s, color .18s;
}

.ts-gb-back:hover,
.ts-gb-back:focus {
	background: #C79A3B;
	color: #071A2D;
}

.ts-gb-back:focus-visible {
	outline: 2px solid #C79A3B;
	outline-offset: 3px;
}

/* The admin bar shifts the document down by 32px; the study's sticky
   header and sidebar were authored assuming a viewport starting at 0. */
body.ts-glassbox-reader.admin-bar header.top {
	top: 32px;
}

body.ts-glassbox-reader.admin-bar nav.side {
	top: 88px;
	height: calc(100vh - 88px);
}

@media screen and (max-width: 782px) {
	body.ts-glassbox-reader.admin-bar header.top {
		top: 46px;
	}
	body.ts-glassbox-reader.admin-bar nav.side {
		top: 102px;
		height: calc(100vh - 102px);
	}
}

/* Print: give the reader a real printed document rather than a clipped
   frame. This is not possible while the study is inside an iframe. */
@media print {

	.ts-gb-back,
	body.ts-glassbox-reader nav.side {
		display: none !important;
	}

	body.ts-glassbox-reader header.top {
		position: static !important;
	}

	body.ts-glassbox-reader main {
		padding: 0 !important;
		display: block !important;
	}

	body.ts-glassbox-reader .wrap {
		display: block !important;
	}

	body.ts-glassbox-reader .view {
		display: block !important;
	}
}
