/* Home tiles: the heading links look exactly like the headings */
.pg-tile-link a {
	color: inherit;
	font: inherit;
	letter-spacing: inherit;
	text-transform: inherit;
}

.pg-tile-link a:hover {
	color: inherit;
	text-decoration: underline;
}

/* PDF overlay */
html:has(dialog.pg-pdf[open]) {
	overflow: hidden;
}

.pg-pdf {
	display: none;
	box-sizing: border-box;
	width: min(1100px, calc(100vw - 2rem));
	height: calc(100dvh - 2rem);
	max-width: none;
	max-height: none;
	padding: 0;
	border: 0;
	border-radius: 4px;
	overflow: hidden;
	background: var(--wp--preset--color--base, #fff);
	color: var(--wp--preset--color--contrast, #111);
}

.pg-pdf[open] {
	display: flex;
	flex-direction: column;
}

.pg-pdf::backdrop {
	background: rgb(0 0 0 / 70%);
}

.pg-pdf__bar {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.35rem 0.75rem;
	font-size: 0.95rem;
	background: var(--wp--preset--color--accent-1, #003a5d);
	color: #fff;
}

.pg-pdf__title {
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
	font-weight: 600;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.pg-pdf .pg-pdf__tab {
	flex: none;
	color: #fff;
	font-size: inherit;
	text-decoration: underline;
}

.pg-pdf .pg-pdf__tab:hover {
	color: #fff;
}

.pg-pdf__close {
	flex: none;
	padding: 0.15rem 0.6rem;
	border: 1px solid #fff;
	border-radius: 4px;
	background: transparent;
	color: #fff;
	font: inherit;
	cursor: pointer;
}

.pg-pdf__close:hover {
	background: #fff;
	color: var(--wp--preset--color--accent-1, #003a5d);
}

.pg-pdf :focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.pg-pdf__frame {
	flex: 1 1 auto;
	width: 100%;
	min-height: 0;
	border: 0;
}

@media (max-width: 600px) {
	.pg-pdf {
		width: 100vw;
		height: 100dvh;
		border-radius: 0;
	}
}

/* Staff list: names, detail overlay, letter bar. The source table shows only if site.js never runs. */
figure.pg-staff {
	visibility: hidden;
	animation: pg-reveal 0s 2s forwards;
}

@keyframes pg-reveal {
	to {
		visibility: visible;
	}
}

.pg-staff-panel {
	margin-bottom: 1rem;
}

.pg-staff-panel.has-index {
	padding-right: 2.75rem; /* room for the letter bar on narrow screens */
}

.pg-staff-letter {
	margin: 2rem 0 0.25rem;
	padding-bottom: 0.15rem;
	border-bottom: 1px solid var(--wp--preset--color--accent-6, #ddd);
	color: var(--wp--preset--color--accent-1, #003a5d);
	scroll-margin-top: 1rem;
}

.pg-staff-letter:first-child {
	margin-top: 0;
}

.pg-staff-names {
	margin: 0;
	padding: 0;
	list-style: none;
}

.pg-staff-names button {
	width: 100%;
	padding: 0.5rem 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	text-align: left;
	cursor: pointer;
}

.pg-staff-names button:hover {
	color: var(--wp--preset--color--accent-1, #003a5d);
	text-decoration: underline;
}

.pg-staff-names button:focus-visible,
.pg-alpha a:focus-visible {
	outline: 2px solid var(--wp--preset--color--accent-1, #003a5d);
	outline-offset: 2px;
}

.pg-alpha {
	--pg-letter: min(1.5rem, calc((100dvh - 1rem) / 26));
	position: fixed;
	top: 50%;
	right: 0.5rem;
	z-index: 40;
	visibility: hidden;
	padding: 0 0.25rem;
	border-radius: 999px;
	background: var(--wp--preset--color--accent-1, #003a5d);
	transform: translateY(-50%);
	touch-action: none;
	user-select: none;
	-webkit-user-select: none;
}

.pg-alpha.is-active {
	visibility: visible;
}

.pg-alpha ol {
	margin: 0;
	padding: 0;
	list-style: none;
}

.pg-alpha li > * {
	display: block;
	width: 1.5rem;
	height: var(--pg-letter);
	color: rgb(255 255 255 / 45%);
	font-size: calc(var(--pg-letter) * 0.68);
	font-weight: 600;
	line-height: var(--pg-letter);
	text-align: center;
	border-radius: 50%;
}

.pg-alpha li > a {
	color: #fff;
	text-decoration: none;
}

.pg-alpha li > a:hover {
	color: #fff;
	text-decoration: underline;
}

.pg-alpha li > a[aria-current],
.pg-alpha li > a[aria-current]:hover {
	background: #fff;
	color: var(--wp--preset--color--accent-1, #003a5d);
	text-decoration: none;
}

.pg-alpha__bubble {
	position: fixed;
	top: 50%;
	left: 50%;
	z-index: 50;
	display: none;
	width: 6rem;
	height: 6rem;
	margin: -3rem 0 0 -3rem;
	border-radius: 0.75rem;
	background: rgb(0 58 93 / 90%);
	color: #fff;
	font-size: 3.5rem;
	font-weight: 700;
	line-height: 6rem;
	text-align: center;
	pointer-events: none;
}

.pg-alpha__bubble.is-visible {
	display: block;
}

html:has(dialog.pg-card[open]) {
	overflow: hidden;
}

.pg-card {
	box-sizing: border-box;
	width: min(34rem, calc(100vw - 2rem));
	max-height: calc(100dvh - 2rem);
	padding: 0;
	border: 0;
	border-radius: 4px;
	background: var(--wp--preset--color--base, #fff);
	color: var(--wp--preset--color--contrast, #111);
}

.pg-card::backdrop {
	background: rgb(0 0 0 / 70%);
}

.pg-card__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.75rem 1rem;
	background: var(--wp--preset--color--accent-1, #003a5d);
	color: #fff;
}

.pg-card .pg-card__title {
	margin: 0;
	color: #fff;
	font-size: 1.15rem;
	font-weight: 600;
	letter-spacing: 0;
	line-height: 1.35;
	text-transform: none;
}

.pg-card__close {
	flex: none;
	padding: 0.15rem 0.6rem;
	border: 1px solid #fff;
	border-radius: 4px;
	background: transparent;
	color: #fff;
	font: inherit;
	font-size: 0.95rem;
	cursor: pointer;
}

.pg-card__close:hover {
	background: #fff;
	color: var(--wp--preset--color--accent-1, #003a5d);
}

.pg-card__close:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.pg-card__body {
	display: flex;
	gap: 1rem;
	padding: 1rem;
}

.pg-card__photo {
	flex: 0 0 9rem;
}

.pg-card__photo img {
	display: block;
	width: 100%;
	height: auto;
}

.pg-card__list {
	flex: 1 1 auto;
	min-width: 0;
	margin: 0;
}

@media (max-width: 480px) {
	.pg-card__body {
		flex-direction: column;
	}

	.pg-card__photo {
		flex: none;
		width: 9rem;
		margin: 0 auto;
	}
}

.pg-card__list dt {
	margin-top: 0.75rem;
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--wp--preset--color--accent-1, #003a5d);
}

.pg-card__list dt:first-child {
	margin-top: 0;
}

.pg-card__list dd {
	margin: 0;
}

/* Search field below the menu */
.pg-search {
	max-width: 20rem;
	margin: 0.5rem 0 0 auto;
}

.pg-search .wp-block-search__input {
	padding: 0.25rem 0.5rem;
	border: 1px solid var(--wp--preset--color--accent-4, #686868);
	border-radius: 4px;
	font: inherit;
	font-size: 0.95rem;
}

.pg-search .wp-block-search__button {
	margin-left: 0.35rem;
	padding: 0.25rem;
	border: 0;
	border-radius: 4px;
	background: var(--wp--preset--color--accent-1, #003a5d);
	color: #fff;
}

/* Links in running text must be recognisable; the global link style has no underline and a fixed size */
.wp-block-post-content :is(p, li, td) a:not(.wp-element-button, .pg-alpha a) {
	font-size: inherit;
	text-decoration: underline;
}

/* Search within a document page */
.pg-find {
	position: sticky;
	top: 0;
	z-index: 10;
	margin: 1rem 0;
	padding: 0.5rem 0;
	border-bottom: 1px solid var(--wp--preset--color--accent-6, #ddd);
	background: var(--wp--preset--color--base, #fff);
}

.pg-find label {
	display: block;
	margin-bottom: 0.2rem;
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--wp--preset--color--accent-1, #003a5d);
}

.pg-find__row {
	display: flex;
	align-items: center;
	gap: 0.35rem;
}

.pg-find input {
	flex: 1 1 auto;
	min-width: 0;
	padding: 0.3rem 0.5rem;
	border: 1px solid var(--wp--preset--color--accent-4, #686868);
	border-radius: 4px;
	font: inherit;
}

.pg-find__count {
	flex: none;
	min-width: 4.5rem;
	font-size: 0.9rem;
	text-align: right;
}

.pg-find button {
	flex: none;
	width: 2.25rem;
	height: 2.25rem;
	border: 0;
	border-radius: 4px;
	background: var(--wp--preset--color--accent-1, #003a5d);
	color: #fff;
	font: inherit;
	cursor: pointer;
}

.pg-find :focus-visible {
	outline: 2px solid var(--wp--preset--color--accent-1, #003a5d);
	outline-offset: 2px;
}

mark.pg-hit {
	background: #ffe08a;
	color: inherit;
	scroll-margin-top: 6rem;
}

mark.pg-hit.is-current {
	background: #f59e0b;
}
