.pdfjs-viewer {
	border: 0 none;
	box-shadow: 0px 3px 5px 0px #eee;
	display: block;
	max-width: 100%;
}

.pdf-viewer-block-wrapper {
	display: inline-block;
	max-width: 100%;
}

/* Current-document heading, shown above the viewer (and above the
   directory's shared viewer panel). A real h6 so the theme's own
   heading typography applies. */
.pdf-viewer-block-doc-title {
	margin: 0 0 10px;
	color: var(--kenta-link-initial-color, var(--kenta-primary-color, #007cba));
}

/* Category filter: single-select chips plus a "Display All" option.
   Accent colors reference the active theme's own design tokens where a
   recognizable one exists (currently Kenta's --kenta-* custom
   properties), falling back to a neutral blue on other themes.
   Explicit sizing/reset properties guard against theme button styles
   bleeding in. */
.pdf-viewer-block-filters {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	margin-bottom: 12px;
}

/* The !important flags are deliberate: themes commonly restyle bare
   <button> elements with higher-specificity selectors, which turned
   these controls into full-size theme buttons. */
.pdf-viewer-block-chip {
	background: #f0f0f0 !important;
	border: 1px solid #ccc !important;
	border-radius: 999px !important;
	padding: 5px 14px !important;
	margin: 0 !important;
	width: auto !important;
	height: auto !important;
	min-width: 0 !important;
	min-height: 0 !important;
	box-sizing: border-box;
	font-size: 13px !important;
	line-height: 1.4 !important;
	font-family: inherit !important;
	font-weight: 400 !important;
	text-transform: none !important;
	text-decoration: none !important;
	box-shadow: none !important;
	color: #333 !important;
	cursor: pointer;
}

.pdf-viewer-block-chip:hover {
	background: #e4e4e4 !important;
	color: #333 !important;
}

.pdf-viewer-block-chip.is-active {
	background: var(--kenta-tax-bg-initial, var(--kenta-primary-color, #007cba)) !important;
	border-color: var(--kenta-tax-bg-initial, var(--kenta-primary-color, #007cba)) !important;
	color: var(--kenta-tax-text-initial, #fff) !important;
}

/* Compact variant used when there are many categories: a labeled
   dropdown instead of a wall of chips, styled as a theme-blue pill so
   it reads as the primary control rather than fine print. */
.pdf-viewer-block-filters-select {
	justify-content: center;
	align-items: center;
}

.pdf-viewer-block-filter-label {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 8px 10px 8px 18px;
	border-radius: 999px;
	background: #025ac3;
	color: #fff;
	font-size: 14px;
	font-weight: 700;
	white-space: nowrap;
	box-shadow: 0 2px 6px rgba(2, 90, 195, 0.35);
}

.pdf-viewer-block-filter-select {
	max-width: 320px;
	min-width: 0;
	padding: 5px 12px !important;
	font-size: 14px !important;
	font-weight: 700 !important;
	font-family: inherit !important;
	line-height: 1.4 !important;
	border: 1px solid rgba(255, 255, 255, 0.7) !important;
	border-radius: 999px !important;
	background: #fff !important;
	color: #025ac3 !important;
	cursor: pointer;
}

/* Document-switcher: prev/next arrows and a dropdown of document
   titles, sitting above the viewer directly under the category filter
   and doubling as the current document's title. Intentionally distinct
   from PDF.js's own toolbar (inside the iframe), which handles
   page-by-page navigation within a single PDF. */
.pdf-viewer-block-nav {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 12px;
}

.pdf-viewer-block-doc-picker {
	display: inline-flex;
	align-items: center;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	max-width: 100%;
	padding: 8px 14px 8px 18px;
	border-radius: 999px;
	background: #025ac3;
	box-shadow: 0 2px 6px rgba(2, 90, 195, 0.35);
}

.pdf-viewer-block-doc-picker-label {
	font-size: 14px;
	font-weight: 700;
	color: #fff;
	white-space: nowrap;
}

/* On the blue pill the arrows invert: white discs, blue glyphs. */
.pdf-viewer-block-doc-picker .pdf-viewer-block-arrow {
	width: 26px !important;
	height: 26px !important;
	background: #fff !important;
	border-color: rgba(255, 255, 255, 0.7) !important;
	color: #025ac3 !important;
}

.pdf-viewer-block-doc-picker .pdf-viewer-block-arrow:hover:not(:disabled) {
	background: #e9eef6 !important;
	color: #025ac3 !important;
}

.pdf-viewer-block-doc-picker .pdf-viewer-block-label {
	color: #fff;
	font-weight: 700;
}

.pdf-viewer-block-arrow {
	background: #f0f0f0 !important;
	border: 1px solid #ccc !important;
	border-radius: 50% !important;
	width: 30px !important;
	height: 30px !important;
	min-width: 0 !important;
	min-height: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	box-sizing: border-box;
	line-height: 1 !important;
	font-size: 16px !important;
	font-family: inherit !important;
	box-shadow: none !important;
	color: #333 !important;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
}

.pdf-viewer-block-arrow:hover:not(:disabled) {
	background: #e0e0e0 !important;
	color: #333 !important;
}

.pdf-viewer-block-arrow:disabled {
	opacity: 0.35;
	cursor: default;
}

.pdf-viewer-block-doc-select {
	flex: 0 1 auto;
	max-width: 480px;
	min-width: 0;
	padding: 5px 12px !important;
	font-size: 14px !important;
	font-weight: 700 !important;
	font-family: inherit !important;
	line-height: 1.4 !important;
	border: 1px solid rgba(255, 255, 255, 0.7) !important;
	border-radius: 999px !important;
	background: #fff !important;
	color: #025ac3 !important;
	cursor: pointer;
}

.pdf-viewer-block-doc-select:disabled {
	cursor: default;
	opacity: 1;
}

.pdf-viewer-block-label {
	font-size: 12px;
	color: #555;
	white-space: nowrap;
}

/* Directory mode: category filters + a table-of-contents grid. */

.pdf-viewer-block-directory {
	max-width: 100%;
}

.pdf-viewer-block-count {
	font-size: 13px;
	color: #555;
	margin-bottom: 14px;
}

.pdf-viewer-block-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
	gap: 18px;
	text-align: left;
}

.pdf-viewer-block-card {
	display: flex;
	flex-direction: column;
	border: 1px solid #e0e0e0;
	border-radius: 10px;
	padding: 14px;
	cursor: pointer;
	background: #fff;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
	transition: box-shadow 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.pdf-viewer-block-card:hover,
.pdf-viewer-block-card:focus {
	border-color: var(--kenta-primary-color, #007cba);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
	transform: translateY(-2px);
	outline: none;
}

.pdf-viewer-block-card.is-active {
	border-color: var(--kenta-primary-color, #007cba);
	box-shadow: 0 0 0 2px var(--kenta-primary-color, #007cba);
}

.pdf-viewer-block-card.is-hidden {
	display: none;
}

/* Card title: an h6 at the top of the card, so the theme's heading
   typography applies. Reserved at a constant four-line height (and
   clamped there) so thumbnails line up across a row regardless of how
   many lines each title wraps to; the full title is in the tooltip. */
.pdf-viewer-block-card-title {
	margin: 0 0 10px;
	line-height: 1.3;
	text-align: center;
	color: var(--kenta-link-initial-color, var(--kenta-primary-color, #007cba));
	min-height: calc(4 * 1.3em);
	display: -webkit-box;
	-webkit-line-clamp: 4;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.pdf-viewer-block-thumb {
	width: 100%;
	aspect-ratio: 160 / 207;
	background: #f3f3f3;
	border: 1px solid #e5e5e5;
	border-radius: 6px;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	margin-bottom: 10px;
}

.pdf-viewer-block-thumb canvas {
	max-width: 100%;
	max-height: 100%;
	display: block;
}

.pdf-viewer-block-thumb.pdf-viewer-block-thumb-unavailable {
	background-color: #f3f3f3;
	background-repeat: no-repeat;
	background-position: center;
	background-size: 40px 40px;
	background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='%23aaaaaa' d='M2.25 1h15.5c.69 0 1.25.56 1.25 1.25v15.5c0 .69-.56 1.25-1.25 1.25H2.25C1.56 19 1 18.44 1 17.75V2.25C1 1.56 1.56 1 2.25 1zM17 17V3H3v14h14zM10 6c0-1.1-.9-2-2-2s-2 .9-2 2 .9 2 2 2 2-.9 2-2zm3 5s0-6 3-6v10c0 .55-.45 1-1 1H5c-.55 0-1-.45-1-1V8c2 0 3 4 3 4s1-3 3-3 3 2 3 2z'/%3E%3C/svg%3E");
}

/* 30-word excerpt from the PDF's Subject metadata, below the image. */
.pdf-viewer-block-card-excerpt {
	font-size: 13px;
	color: var(--kenta-primary-color, #555);
	line-height: 1.45;
	margin-bottom: 10px;
	text-align: center;
}

.pdf-viewer-block-card-cats {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 4px;
	margin-bottom: 10px;
}

.pdf-viewer-block-tag {
	background: var(--kenta-tax-bg-initial, #007cba);
	color: var(--kenta-tax-text-initial, #fff);
	border-radius: var(--kenta-tax-item-radius, 999px);
	font-size: 11px;
	line-height: 1.4;
	padding: 0.3em 0.75em;
}

.pdf-viewer-block-card-actions {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-top: auto;
}

.pdf-viewer-block-view-btn {
	font-size: 12px;
	font-weight: 700;
	color: var(--kenta-link-initial-color, var(--kenta-primary-color, #007cba));
}

.pdf-viewer-block-view-btn::after {
	content: " \2192";
}

.pdf-viewer-block-download-btn {
	font-size: 12px;
	text-decoration: none;
	background: #f0f0f0;
	border: 1px solid #ccc;
	border-radius: var(--kenta-button-radius, 3px);
	padding: 4px 10px;
	color: #333;
}

.pdf-viewer-block-download-btn:hover {
	background: #e4e4e4;
	color: #333;
}

.pdf-viewer-block-active-doc {
	margin-top: 22px;
	border-top: 1px solid #e0e0e0;
	padding-top: 16px;
}

.pdf-viewer-block-active-doc[hidden] {
	display: none;
}
