/* DSK PDF Viewer for Download Manager */

/* View + Download as an even pair: side by side (View first), and they
   wrap instead of overflowing when the space is too narrow. */
.dsk-pdfv-wrap {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-end;
	gap: 10px;
	max-width: 100%;
}
.dsk-pdfv-wrap > a {
	display: flex !important;
	align-items: center;
	justify-content: center;
	flex: 0 1 140px;
	width: 140px;
	min-width: 0;
	max-width: 100%;
	text-align: center;
	margin: 0 !important;
	box-sizing: border-box;
	overflow: hidden;
	text-overflow: ellipsis;
}
.dsk-pdfv-wrap > .dsk-pdfv-btn {
	order: -1; /* before the Download button */
}
/* Bigger, easier-to-read text on both buttons (Download Manager's own is ~9px). */
.dsk-pdfv-wrap > a,
.dsk-pdfv-wrap > a span {
	font-size: 14px !important;
	font-weight: 600 !important;
	line-height: 1.2 !important;
}

/* Download Manager list table (desktop): reserve room for both buttons so they
   never overlap the date – the other columns get a little narrower. */
@media (min-width: 800px) {
	.wpdm-all-packages-table td:has(> .dsk-pdfv-wrap),
	.wpdm-all-packages-table .__dt_col_download_link {
		width: 310px;
		min-width: 310px;
	}
	.wpdm-all-packages-table td:has(> .dsk-pdfv-wrap) {
		white-space: nowrap;
	}
	.wpdm-all-packages-table .dsk-pdfv-wrap {
		flex-wrap: nowrap;
	}
	.wpdm-all-packages-table .dsk-pdfv-wrap > a {
		flex: 0 0 140px;
		width: 140px;
	}
}

/* Card / mobile layout: two equal halves that fill the card. */
@media (max-width: 799px) {
	.dsk-pdfv-wrap {
		justify-content: stretch;
		width: 100%;
	}
	.dsk-pdfv-wrap > a {
		flex: 1 1 120px;
		width: auto;
	}
}

/* Default look = same pill shape as the Download Manager button.
   viewer.js additionally copies the exact size/font/border of the Download
   button next to it, so both always match whatever template is used. */
.dsk-pdfv-btn,
.dsk-pdfv-btn:visited {
	gap: 6px;
	min-height: 36px;
	padding: 0 22px;
	border: 2px solid var(--dsk-primary, #08529e);
	border-radius: 30px;
	background: #fff;
	color: var(--dsk-primary, #08529e) !important;
	font-size: 12px;
	font-weight: 500;
	line-height: 1.2;
	text-decoration: none !important;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.dsk-pdfv-btn:hover,
.dsk-pdfv-btn:focus-visible {
	background: var(--dsk-primary, #08529e) !important;
	border-color: var(--dsk-primary, #08529e) !important;
	color: #fff !important;
}
/* Colours copied from the Download button by viewer.js */
.dsk-pdfv-btn.dsk-pdfv-btn--matched,
.dsk-pdfv-btn.dsk-pdfv-btn--matched:visited {
	background: var(--dsk-btn-bg) !important;
	color: var(--dsk-btn-fg) !important;
	border-color: var(--dsk-btn-bd) !important;
}
.dsk-pdfv-btn.dsk-pdfv-btn--matched:hover,
.dsk-pdfv-btn.dsk-pdfv-btn--matched:focus-visible {
	filter: brightness(.92);
	box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
}
.dsk-pdfv-btn.dsk-pdfv-btn--matched.dsk-pdfv-btn--outline:hover,
.dsk-pdfv-btn.dsk-pdfv-btn--matched.dsk-pdfv-btn--outline:focus-visible {
	filter: none;
	background: var(--dsk-btn-bd) !important;
	border-color: var(--dsk-btn-bd) !important;
	color: #fff !important;
}

html.dsk-pdfv-open { overflow: hidden; }

.dsk-pdfv[hidden],
.dsk-pdfv__frame[hidden],
.dsk-pdfv__pages[hidden] { display: none !important; }
.dsk-pdfv {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
}
.dsk-pdfv__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(10, 20, 35, .72);
	animation: dsk-pdfv-fade .15s ease-out;
}
.dsk-pdfv__dialog {
	position: relative;
	display: flex;
	flex-direction: column;
	width: min(1000px, 100%);
	height: min(88vh, 1100px);
	background: #fff;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
	animation: dsk-pdfv-pop .18s ease-out;
}
.dsk-pdfv__bar {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 12px 10px 18px;
	background: var(--dsk-primary, #08529e);
	color: #fff;
}
.dsk-pdfv__title {
	flex: 1 1 auto;
	margin: 0;
	font-size: 16px;
	line-height: 1.3;
	font-weight: 600;
	color: #fff;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.dsk-pdfv__action {
	flex: 0 0 auto;
	color: #fff !important;
	font-size: 14px;
	padding: 6px 12px;
	border: 1px solid rgba(255, 255, 255, .45);
	border-radius: 999px;
	text-decoration: none !important;
	white-space: nowrap;
}
.dsk-pdfv__action:hover { background: rgba(255, 255, 255, .15); }
.dsk-pdfv__close {
	flex: 0 0 auto;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #fff;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
}
.dsk-pdfv__close:hover, .dsk-pdfv__close:focus-visible { background: rgba(255, 255, 255, .15); }

.dsk-pdfv__body {
	position: relative;
	flex: 1 1 auto;
	background: #525659;
	overflow: hidden;
}
.dsk-pdfv__frame {
	width: 100%;
	height: 100%;
	border: 0;
	display: block;
}
.dsk-pdfv__pages {
	height: 100%;
	overflow: auto;
	-webkit-overflow-scrolling: touch;
	padding: 8px;
	text-align: center;
}
.dsk-pdfv__pages canvas {
	display: block;
	max-width: 100%;
	margin: 0 auto 8px;
	background: #fff;
	box-shadow: 0 1px 4px rgba(0, 0, 0, .3);
}
.dsk-pdfv__status {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	color: #fff;
	font-size: 15px;
	text-align: center;
	max-width: 80%;
	pointer-events: none;
}
.dsk-pdfv__status[hidden] { display: none; }

@media (max-width: 640px) {
	.dsk-pdfv { padding: 0; }
	.dsk-pdfv__dialog { width: 100%; height: 100%; border-radius: 0; }
	.dsk-pdfv__action { padding: 5px 10px; font-size: 13px; }
}

@keyframes dsk-pdfv-fade { from { opacity: 0; } }
@keyframes dsk-pdfv-pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

@media (prefers-reduced-motion: reduce) {
	.dsk-pdfv__backdrop, .dsk-pdfv__dialog { animation: none; }
}
