/* PDF pages (single-pdf_page.php): heading and buttons, then the PDF viewer or its cover. */

.th-pdf-page__head {
	display: flex;
	flex-wrap: wrap;
	gap: 24px 48px;
	align-items: flex-end;
	justify-content: space-between;
}

.th-pdf-page__head .th-intro {
	flex: 1 1 420px;
	max-width: var(--th-measure);
}

.th-pdf-page__head h1 {
	font-size: var(--th-fs-h2);
}

.th-pdf-page__actions {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.th-pdf-page__meta {
	font-size: var(--th-fs-sm);
}

.th-pdf-page__viewer {
	overflow: hidden;
	border: 1px solid var(--th-border);
	border-radius: var(--th-radius-lg);
	background: var(--th-white);
	box-shadow: 0 6px 24px rgb(2 27 91 / 0.05);
}

.th-pdf-page__viewer iframe {
	display: block;
	width: 100%;
	height: clamp(520px, 82vh, 960px);
	border: 0;
}

.th-pdf-page__viewer.is-loaded .th-pdf-page__cover {
	display: none;
}

.th-pdf-page__cover {
	position: relative;
	display: block;
	max-width: 480px;
	margin-inline: auto;
	text-decoration: none;
}

.th-pdf-page__cover img {
	display: block;
	width: 100%;
	height: auto;
}

.th-pdf-page__cover-label {
	position: absolute;
	right: 12px;
	bottom: 12px;
	padding: 10px 16px;
	border-radius: var(--th-radius-sm);
	background: var(--th-navy);
	color: var(--th-white);
	font-weight: 600;
	box-shadow: 0 4px 14px rgb(2 27 91 / 0.25);
}

.th-pdf-page__cover:hover .th-pdf-page__cover-label {
	filter: brightness(1.12);
}

.th-pdf-page__link {
	align-self: flex-start;
}

@media (max-width: 767px) {
	.th-pdf-page__actions,
	.th-pdf-page__actions .th-btn {
		width: 100%;
	}

	.th-pdf-page__actions .th-btn {
		text-align: center;
	}
}

/* No cover image (e.g. a PDF uploaded without a preview): just the button. */
.th-pdf-page__cover:not(:has(img)) .th-pdf-page__cover-label {
	position: static;
	display: inline-block;
	margin: 24px;
}
