/* BlackDoctor Staff Popup
   ------------------------------------------------------------------
   Colors, radii and sizes read from custom properties set by the
   settings panel. Override them in your theme to go further.
   ------------------------------------------------------------------ */

:root {
	--bdsp-overlay: rgba(28, 28, 28, 0.9);
	--bdsp-panel: #f2efe9;
	--bdsp-text: #1c1c1c;
	--bdsp-muted: #6f6f6f;
	--bdsp-rule: #ddd8cf;
	--bdsp-nav-bg: rgba(255, 255, 255, 1);
	--bdsp-nav-shadow: 0 1px 6px rgba(0, 0, 0, 0.14);
	--bdsp-nav-icon: #1c1c1c;
	--bdsp-close-bg: rgba(255, 255, 255, 1);
	--bdsp-close-shadow: 0 1px 6px rgba(0, 0, 0, 0.14);
	--bdsp-close-icon: #1c1c1c;
	--bdsp-close-r: 50%;
	--bdsp-nav-r: 2px;
	--bdsp-close-size: 34px;
	--bdsp-nav-size: 38px;
	--bdsp-close-op: 1;
	--bdsp-nav-op: 1;
	--bdsp-hover-op: 1;
	--bdsp-nav-inset: 14px;
	--bdsp-close-icon-s: 40%;
	--bdsp-nav-icon-s: 40%;
	--bdsp-max-w: 1000px;
	--bdsp-max-h: 575px;
	--bdsp-panel-r: 2px;
	--bdsp-media-w: 42%;
	--bdsp-bio-h: 220px;
	--bdsp-focus-y: 22%;
	--bdsp-m-photo-h: 340px;

	--bdsp-font-display: Georgia, "Times New Roman", serif;
	--bdsp-font-body: inherit;
	--bdsp-gutter: 24px;
	--bdsp-pad: 44px;
	--bdsp-z: 99999;
}

/* Source markup stays in the document for crawlers but never paints. */
.bdsp-source {
	display: none !important;
}

[data-staff-id] {
	cursor: pointer;
}

/* Shell ------------------------------------------------------------ */

.bdsp-modal[hidden] {
	display: none;
}

.bdsp-modal {
	position: fixed;
	inset: 0;
	z-index: var(--bdsp-z);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: var(--bdsp-gutter);
	font-family: var(--bdsp-font-body);
	-webkit-font-smoothing: antialiased;
}

.bdsp-overlay {
	position: absolute;
	inset: 0;
	background: var(--bdsp-overlay);
	opacity: 0;
	transition: opacity 200ms ease;
	cursor: pointer;
}

.bdsp-stage {
	position: relative;
	width: 100%;
	max-width: var(--bdsp-max-w);
	opacity: 0;
	transform: translateY(8px);
	transition: opacity 220ms ease, transform 220ms ease;
}

.bdsp-modal.is-open .bdsp-overlay {
	opacity: 1;
}

.bdsp-modal.is-open .bdsp-stage {
	opacity: 1;
	transform: none;
}

/* Panel ------------------------------------------------------------ */

.bdsp-panel {
	position: relative;
	display: flex;
	width: 100%;
	height: min(var(--bdsp-max-h), 88vh);
	background: var(--bdsp-panel);
	border-radius: var(--bdsp-panel-r);
	overflow: hidden;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.bdsp-body {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
}

.bdsp-scroll {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: var(--bdsp-pad);
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
	scrollbar-color: var(--bdsp-rule) transparent;
}

.bdsp-scroll::-webkit-scrollbar {
	width: 5px;
}

.bdsp-scroll::-webkit-scrollbar-track {
	background: transparent;
}

.bdsp-scroll::-webkit-scrollbar-thumb {
	background: var(--bdsp-rule);
	border-radius: 3px;
}

.bdsp-scroll::-webkit-scrollbar-thumb:hover {
	background: var(--bdsp-muted);
}

/* Photo ------------------------------------------------------------ */

.bdsp-modal .bdsp-media {
	position: relative;
	display: flex;
	align-self: stretch;
	flex: 0 0 var(--bdsp-media-w);
	margin: 0;
	padding: 0;
	overflow: hidden;
	background: #e6e2db;
}

/* Three classes so theme rules like `.breakdance img { height: auto }`
   do not win and collapse the photo. */
.bdsp-modal .bdsp-media .bdsp-img {
	display: block;
	flex: 1 1 auto;
	width: 100%;
	height: 100%;
	min-height: 0;
	max-width: none;
	object-fit: cover;
	object-position: center var(--bdsp-focus-y);
}

.bdsp-panel[data-layout="image-left"] {
	flex-direction: row-reverse;
}

/* Type ------------------------------------------------------------- */

.bdsp-head {
	margin: 0 0 20px;
	padding-right: calc(var(--bdsp-close-size) + 8px);
}

.bdsp-name {
	font-family: var(--bdsp-font-display);
	font-weight: 400;
	font-size: clamp(23px, 2.1vw, 30px);
	line-height: 1.12;
	letter-spacing: -0.015em;
	color: var(--bdsp-text);
	margin: 0 0 7px;
}

.bdsp-role {
	font-size: 10.5px;
	font-weight: 500;
	line-height: 1.4;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--bdsp-muted);
	margin: 0;
}

.bdsp-role:empty {
	display: none;
}

.bdsp-bio {
	position: relative;
	font-size: 13.5px;
	line-height: 1.68;
	color: var(--bdsp-text);
}

.bdsp-bio p {
	margin: 0 0 1.15em;
}

.bdsp-bio p:last-child {
	margin-bottom: 0;
}

.bdsp-bio a {
	color: inherit;
	text-underline-offset: 2px;
}

/* Read more -------------------------------------------------------- */

.bdsp-bio-wrap {
	position: relative;
}

.bdsp-bio-wrap.is-collapsed .bdsp-bio {
	max-height: var(--bdsp-bio-max, var(--bdsp-bio-h));
	overflow: hidden;
}

.bdsp-bio-wrap.is-collapsed::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 72px;
	pointer-events: none;
	background: linear-gradient(to bottom, transparent, var(--bdsp-panel) 85%);
}

.bdsp-more {
	display: none;
	align-items: center;
	gap: 7px;
	margin-top: 14px;
	padding: 8px 14px;
	border: 1px solid var(--bdsp-rule);
	border-radius: 2px;
	background: transparent;
	font-family: var(--bdsp-font-body);
	font-size: 10.5px;
	font-weight: 500;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--bdsp-text);
	cursor: pointer;
	transition: background 160ms ease, border-color 160ms ease;
}

.bdsp-bio-wrap.has-overflow + .bdsp-more,
.bdsp-more.is-visible {
	display: inline-flex;
}

.bdsp-more:hover {
	background: rgba(0, 0, 0, 0.04);
	border-color: var(--bdsp-muted);
}

.bdsp-more svg {
	width: 9px;
	height: 9px;
	transition: transform 200ms ease;
}

.bdsp-more[aria-expanded="true"] svg {
	transform: rotate(180deg);
}

/* Affiliations and societies --------------------------------------- */

.bdsp-lists[hidden],
.bdsp-col[hidden] {
	display: none;
}

.bdsp-lists {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 26px;
	margin-top: 26px;
	padding-top: 22px;
	border-top: 1px solid var(--bdsp-rule);
}

.bdsp-lists.is-single {
	grid-template-columns: minmax(0, 1fr);
}

.bdsp-col h4 {
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: var(--bdsp-text);
	margin: 0 0 11px;
}

.bdsp-col ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.bdsp-col li {
	font-size: 11.5px;
	line-height: 1.6;
	color: var(--bdsp-muted);
	margin: 0 0 5px;
}

/* Buttons ---------------------------------------------------------- */

.bdsp-nav,
.bdsp-close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 0;
	cursor: pointer;
	appearance: none;
	transition: transform 150ms ease, opacity 180ms ease, background 150ms ease;
}

/* Close sits inside the panel, top right. */
.bdsp-close {
	position: absolute;
	top: 14px;
	right: 14px;
	z-index: 4;
	width: var(--bdsp-close-size);
	height: var(--bdsp-close-size);
	border-radius: var(--bdsp-close-r);
	background: var(--bdsp-close-bg);
	color: var(--bdsp-close-icon);
	box-shadow: var(--bdsp-close-shadow);
	opacity: var(--bdsp-close-op);
}

.bdsp-close:hover,
.bdsp-close:focus-visible {
	opacity: var(--bdsp-hover-op);
	transform: scale(1.08);
}

/* Arrow placement ---------------------------------------------------
   All variants live inside .bdsp-media, so insets are measured from
   the photo edges rather than the panel. */

.bdsp-navs {
	position: absolute;
	z-index: 3;
	display: flex;
	gap: 6px;
}

.bdsp-navs[hidden] {
	display: none;
}

.bdsp-navs[data-pos="bottom-right"] {
	right: var(--bdsp-nav-inset);
	bottom: var(--bdsp-nav-inset);
}

.bdsp-navs[data-pos="bottom-left"] {
	left: var(--bdsp-nav-inset);
	bottom: var(--bdsp-nav-inset);
}

/* Pushed clear of the close button, which owns the top right corner. */
.bdsp-navs[data-pos="top-right"] {
	right: var(--bdsp-nav-inset);
	top: calc(var(--bdsp-nav-inset) + var(--bdsp-close-size) + 12px);
}

.bdsp-navs[data-pos="sides"] {
	inset: 0;
	align-items: center;
	justify-content: space-between;
	padding: 0 var(--bdsp-nav-inset);
	pointer-events: none;
}

.bdsp-navs[data-pos="sides"] .bdsp-nav {
	pointer-events: auto;
}


.bdsp-nav {
	width: var(--bdsp-nav-size);
	height: var(--bdsp-nav-size);
	border-radius: var(--bdsp-nav-r);
	background: var(--bdsp-nav-bg);
	color: var(--bdsp-nav-icon);
	box-shadow: var(--bdsp-nav-shadow);
	opacity: var(--bdsp-nav-op);
}

.bdsp-nav:hover,
.bdsp-nav:focus-visible {
	opacity: var(--bdsp-hover-op);
	transform: translateY(-1px);
}

.bdsp-nav[disabled] {
	opacity: 0.35;
	cursor: default;
	pointer-events: none;
}

.bdsp-nav svg,
.bdsp-close svg,
.bdsp-nav img,
.bdsp-close img {
	display: block;
	pointer-events: none;
}

.bdsp-close svg,
.bdsp-close img {
	width: var(--bdsp-close-icon-s);
	height: var(--bdsp-close-icon-s);
}

.bdsp-nav svg,
.bdsp-nav img {
	width: var(--bdsp-nav-icon-s);
	height: var(--bdsp-nav-icon-s);
}

.bdsp-nav:focus-visible,
.bdsp-close:focus-visible,
.bdsp-more:focus-visible {
	outline: 2px solid var(--bdsp-text);
	outline-offset: 2px;
}

.bdsp-counter {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
}

/* Scroll lock ------------------------------------------------------ */

html.bdsp-locked,
body.bdsp-locked {
	overflow: hidden;
}

/* Tablet ----------------------------------------------------------- */

@media (max-width: 980px) {
	:root {
		--bdsp-pad: 32px;
	}

	.bdsp-panel {
		height: min(var(--bdsp-max-h), 84vh);
	}
}

/* Mobile ----------------------------------------------------------- */

@media (max-width: 760px) {
	:root {
		--bdsp-pad: 24px;
		--bdsp-gutter: 14px;
		--bdsp-bio-h: 180px;
	}

	/* Anchored to the top so the name and the start of the bio are the
	   first things in view, on every screen height. */
	.bdsp-modal {
		align-items: flex-start;
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
	}

	.bdsp-modal[data-m-align="center"] {
		align-items: center;
	}

	.bdsp-stage {
		max-width: 100%;
		margin: 0 auto;
	}

	.bdsp-panel,
	.bdsp-panel[data-layout="image-left"] {
		flex-direction: column;
		height: auto;
		max-height: calc(100vh - (var(--bdsp-gutter) * 2));
		max-height: calc(100dvh - (var(--bdsp-gutter) * 2));
		border-radius: 4px;
	}

	/* Portrait headshots need height here or the crop lands mid-chest.
	   Capped against the viewport so the name stays above the fold. */
	.bdsp-modal .bdsp-media {
		flex: 0 0 auto;
		align-self: auto;
		height: min(var(--bdsp-m-photo-h), 55vh);
		height: min(var(--bdsp-m-photo-h), 55dvh);
		order: -1;
	}

	.bdsp-body {
		min-height: 0;
	}

	.bdsp-scroll {
		padding: 26px var(--bdsp-pad) 30px;
	}

	.bdsp-head {
		padding-right: 0;
	}

	.bdsp-name {
		font-size: 25px;
	}

	.bdsp-lists {
		grid-template-columns: minmax(0, 1fr);
		gap: 20px;
	}

	.bdsp-close {
		top: 10px;
		right: 10px;
	}

	/* Placement is respected at every width; only the inset tightens. */
	:root {
		--bdsp-nav-inset: 10px;
	}
}

@media (max-width: 400px) {
	:root {
		--bdsp-pad: 20px;
		--bdsp-nav-size: 34px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.bdsp-overlay,
	.bdsp-stage,
	.bdsp-nav,
	.bdsp-close,
	.bdsp-more,
	.bdsp-more svg {
		transition: none;
	}

	.bdsp-stage {
		transform: none;
	}
}
