/* HPN article PDF reader. Uses the HPN theme tokens, with fallbacks. */

.hpn-doc {
	margin: 2rem 0;
	border: 1px solid var(--hpn-line, #e3e6ea);
	border-radius: var(--hpn-radius, 6px);
	background: var(--hpn-surface, #f5f7f8);
	font-family: var(--hpn-font-sans, system-ui, sans-serif);
	font-size: 1rem;
	line-height: 1.4;
}

.hpn-doc__bar {
	position: sticky;
	top: 0;
	z-index: 2;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.6rem 0.9rem;
	padding: 0.75rem 0.9rem;
	border-bottom: 1px solid var(--hpn-line, #e3e6ea);
	border-radius: var(--hpn-radius, 6px) var(--hpn-radius, 6px) 0 0;
	background: var(--hpn-white, #fff);
}

.admin-bar .hpn-doc__bar {
	top: 32px;
}

.hpn-doc__icon {
	display: grid;
	flex: none;
	place-items: center;
	width: 40px;
	height: 40px;
	border-radius: 8px;
	background: #e8f3e6;
	color: var(--hpn-brand-dark, #1f7a1a);
}

.hpn-doc__meta {
	display: grid;
	flex: 1;
	min-width: 12rem;
}

.hpn-doc__title {
	overflow: hidden;
	color: var(--hpn-ink, #16191d);
	font-size: 0.9375rem;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.hpn-doc__info {
	color: var(--hpn-muted, #5b6470);
	font-size: 0.8125rem;
	font-variant-numeric: tabular-nums;
}

.hpn-doc__tools {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
}

.hpn-doc__btn {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	min-height: 38px;
	padding: 0.4rem 0.75rem;
	border: 1px solid var(--hpn-line, #d5d9de);
	border-radius: 999px;
	background: var(--hpn-white, #fff);
	color: var(--hpn-ink, #16191d);
	font: inherit;
	font-size: 0.8125rem;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
}

.hpn-doc a.hpn-doc__btn {
	text-decoration: none;
}

.hpn-doc__btn[hidden] {
	display: none;
}

.hpn-doc__btn:hover,
.hpn-doc__btn[aria-pressed="true"] {
	border-color: var(--hpn-brand-dark, #1f7a1a);
	color: var(--hpn-brand-dark, #1f7a1a);
}

/* .hpn-doc prefix: wins over the theme's article link colour. */
.hpn-doc .hpn-doc__btn--primary,
.hpn-doc .hpn-doc__btn--primary:hover {
	border-color: var(--hpn-brand-dark, #1f7a1a);
	background: var(--hpn-brand-dark, #1f7a1a);
	color: #fff;
}

.hpn-doc .hpn-doc__btn--primary:hover {
	border-color: #175f14;
	background: #175f14;
}

.hpn-doc__btn:focus-visible {
	outline: 3px solid rgb(31 122 26 / 0.35);
	outline-offset: 2px;
}

.hpn-doc__pages-wrap {
	display: grid;
	gap: 0.75rem;
	padding: 0.75rem;
	overflow-x: auto;
}

.hpn-doc__page {
	position: relative;
	width: 100%;
	overflow: hidden;
	border-radius: 2px;
	background: #fff linear-gradient(110deg, #f1f3f4 30%, #fafbfb 50%, #f1f3f4 70%) 0 0 / 300% 100%;
	box-shadow: 0 1px 4px rgb(0 0 0 / 0.12);
	animation: hpn-doc-shimmer 1.4s linear infinite;
}

.hpn-doc__page.is-ready {
	background: #fff;
	animation: none;
}

.hpn-doc__page img {
	display: block;
	width: 100%;
	height: auto;
	max-width: none;
	border-radius: 0;
}

@keyframes hpn-doc-shimmer {
	to { background-position: -150% 0; }
}

@media (prefers-reduced-motion: reduce) {
	.hpn-doc__page { animation: none; }
}

/* Zoom: pages at 160%, scroll sideways. */
.hpn-doc.is-zoomed .hpn-doc__page {
	width: 160%;
}

.hpn-doc__status {
	margin: 1.5rem 0;
	color: var(--hpn-muted, #5b6470);
	text-align: center;
}

/* Full screen */
.hpn-doc:fullscreen {
	overflow-y: auto;
	border: 0;
	border-radius: 0;
	background: #2a2f35;
}

.hpn-doc:fullscreen .hpn-doc__bar {
	top: 0;
	border-radius: 0;
}

.hpn-doc:fullscreen .hpn-doc__pages-wrap {
	max-width: 1000px;
	margin-inline: auto;
}

/* Visitors on a members-only article */
.hpn-doc-note {
	display: flex;
	gap: 0.9rem;
	align-items: center;
	margin: 1.5rem 0;
	padding: 1rem 1.15rem;
	border: 1px solid var(--hpn-line, #e3e6ea);
	border-radius: var(--hpn-radius, 6px);
	background: var(--hpn-surface, #f5f7f8);
	color: #3a414a;
	font-family: var(--hpn-font-sans, system-ui, sans-serif);
	font-size: 0.9375rem;
	line-height: 1.45;
}

.hpn-doc-note svg {
	flex: none;
	box-sizing: content-box;
	padding: 0.6rem;
	border-radius: 10px;
	background: #e8f3e6;
	color: var(--hpn-brand-dark, #1f7a1a);
}

.hpn-doc-note strong {
	display: block;
	color: var(--hpn-ink, #16191d);
}

@media (max-width: 599px) {
	.hpn-doc__btn span {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
	}

	.hpn-doc__btn {
		width: 38px;
		justify-content: center;
		padding: 0;
	}

	.hpn-doc__pages-wrap {
		padding: 0.4rem;
		gap: 0.4rem;
	}
}

/* Flipbook (HPN Flipbook's viewer) for PDFs in articles, e.g. CPD modules. */
.hpn-doc-flip {
	margin: 2rem 0;
	font-family: var(--hpn-font-sans, system-ui, sans-serif);
	line-height: 1.4;
}

.hpn-doc-flip__bar {
	display: flex;
	align-items: center;
	gap: 0.9rem;
	padding: 0.75rem 0.9rem;
	border: 1px solid var(--hpn-line, #e3e6ea);
	border-bottom: 0;
	border-radius: 10px 10px 0 0;
	background: var(--hpn-white, #fff);
}

.hpn-doc-flip .hpn-fb {
	margin: 0;
	border-radius: 0 0 10px 10px;
}
