/*
 * Digital Space Consortium, people listings.
 *
 * Built for the dark navy DSC theme. Colours are sampled from the DSC logo
 * assets. A light modifier is provided for any surface that is not dark.
 *
 * Every rule is scoped under .dscp-people, which raises specificity to 0,2,0.
 * That is deliberate: a theme rule such as .entry-content h3 scores 0,1,1 and
 * would otherwise win, which is how the names ended up with inherited heading
 * margins and the wrong colour.
 */

.dscp-people {
	/* Consumes the DSC theme tokens by their real names, with fallbacks so the
	   block still reads correctly under any other theme. */
	--dscp-plate: var(--navy-800, #0d1e3c);
	--dscp-surface: var(--navy-850, #0b1730);
	--dscp-surface-hover: var(--navy-700, #103a64);
	--dscp-line: var(--line, rgba(157, 195, 232, 0.16));
	--dscp-line-strong: var(--line-strong, rgba(157, 195, 232, 0.30));
	--dscp-name: var(--white, #ffffff);
	--dscp-body: var(--fg, #e7eef8);
	--dscp-muted: var(--fg-dim, #9fb2cc);
	--dscp-accent: var(--blue-300, #9dc3e8);
	--dscp-accent-deep: var(--blue-500, #1c5f96);

	--dscp-font-display: var(--font-display, "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif);
	--dscp-font-body: var(--font-body, "Inter", system-ui, -apple-system, "Segoe UI", sans-serif);
	--dscp-font-mono: var(--font-mono, "IBM Plex Mono", ui-monospace, "SFMono-Regular", monospace);

	--dscp-gap: 2rem;
	--dscp-radius: var(--radius, 14px);
	--dscp-col: 18rem;

	font-family: var(--dscp-font-body);
	color: var(--dscp-body);
}

/* Light surfaces. Add scheme="light" to the shortcode. */
.dscp-people.dscp-people--light {
	--dscp-surface: #ffffff;
	--dscp-surface-hover: #ffffff;
	--dscp-line: rgba(13, 30, 60, 0.16);
	--dscp-line-strong: rgba(13, 30, 60, 0.28);
	--dscp-name: #0d1e3c;
	--dscp-body: #26324a;
	--dscp-muted: #5a6577;
	--dscp-accent: #103a64;
}

/* Group sections
   ------------------------------------------------------------------------- */

.dscp-people .dscp-group + .dscp-group {
	margin-top: 4rem;
	padding-top: 2.75rem;
	border-top: 1px solid var(--dscp-line);
}

.dscp-people .dscp-group__heading {
	font-family: var(--dscp-font-display);
	font-weight: 700;
	font-size: clamp(1.4rem, 1.1rem + 1vw, 1.95rem);
	line-height: 1.15;
	letter-spacing: -0.01em;
	color: var(--dscp-name);
	margin: 0 0 0.7rem;
	padding: 0;
}

.dscp-people .dscp-group__intro {
	max-width: 62ch;
	margin: 0 0 2rem;
	font-size: 1.0125rem;
	line-height: 1.6;
	color: var(--dscp-muted);
}

.dscp-people .dscp-group__empty {
	margin: 0;
	padding: 1.1rem 1.4rem;
	background: var(--dscp-surface);
	border-left: 3px solid var(--dscp-accent);
	border-radius: 0;
	color: var(--dscp-muted);
	font-size: 0.95rem;
}

/* Card grid
   -------------------------------------------------------------------------
   Sized by the container, not the viewport. The previous build keyed the
   column count to a viewport media query, so a 700px content column inside a
   1200px window was forced to three columns and the biographies became
   unreadable ribbons. auto-fit against a min track solves it at any width. */

.dscp-people .dscp-cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--dscp-col)), 1fr));
	gap: var(--dscp-gap);
	margin: 0;
	padding: 0;
	list-style: none;
}

.dscp-people .dscp-cards[data-columns="2"] { --dscp-col: 21rem; }
.dscp-people .dscp-cards[data-columns="4"] { --dscp-col: 15rem; }

.dscp-people .dscp-card {
	display: flex;
	flex-direction: column;
	background: var(--dscp-surface);
	border: 1px solid var(--dscp-line);
	border-radius: var(--dscp-radius);
	overflow: hidden;
	margin: 0;
	padding: 0;
	list-style: none;
	transition: background-color 160ms ease, border-color 160ms ease;
}

.dscp-people .dscp-card::before,
.dscp-people .dscp-card::marker {
	content: none;
}

.dscp-people .dscp-card:hover {
	background: var(--dscp-surface-hover);
	border-color: rgba(157, 195, 232, 0.45);
}

/* Portrait
   -------------------------------------------------------------------------
   The theme grants .dsc-block a clean image treatment, so this only has to
   describe the crop rather than defend it. */

.dscp-people .dscp-card__portrait {
	position: relative;
	aspect-ratio: 1 / 1;
	background: var(--dscp-plate);
	overflow: hidden;
	line-height: 0;
}

.dscp-people .dscp-card__portrait img,
.dscp-people .dscp-card__portrait svg {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	object-fit: cover;
	object-position: center 20%;
}

.dscp-people .dscp-card__portrait::after {
	content: "";
	position: absolute;
	inset: auto 0 0 0;
	height: 3px;
	background: linear-gradient(90deg, var(--dscp-accent-deep), var(--dscp-accent));
}

/* Wide rows. Portrait beside the text, one person per row.
   -------------------------------------------------------------------------
   Built for a narrow content column. Three people in a 740px measure become
   cramped as cards but read well as rows. */

.dscp-people .dscp-rows {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.dscp-people .dscp-card--row {
	display: grid;
	grid-template-columns: 10.5rem minmax(0, 1fr);
	align-items: stretch;
}

.dscp-people .dscp-card--row .dscp-card__portrait::after {
	inset: 0 0 0 auto;
	width: 3px;
	height: auto;
	background: linear-gradient(180deg, var(--dscp-accent-deep), var(--dscp-accent));
}

@media (max-width: 34rem) {
	.dscp-people .dscp-card--row {
		grid-template-columns: minmax(0, 1fr);
	}
	.dscp-people .dscp-card--row .dscp-card__portrait::after {
		inset: auto 0 0 0;
		width: auto;
		height: 3px;
		background: linear-gradient(90deg, var(--dscp-accent-deep), var(--dscp-accent));
	}
}

/* Card body
   ------------------------------------------------------------------------- */

.dscp-people .dscp-card__body {
	display: flex;
	flex-direction: column;
	padding: 1.25rem 1.3rem 1.45rem;
}

.dscp-people .dscp-card__name {
	font-family: var(--dscp-font-display);
	font-weight: 700;
	font-size: 1.1875rem;
	line-height: 1.25;
	letter-spacing: -0.005em;
	color: var(--dscp-name);
	margin: 0 0 0.45rem;
	padding: 0;
	text-transform: none;
}

.dscp-people .dscp-card__role {
	font-family: var(--dscp-font-mono);
	font-size: 0.6875rem;
	font-weight: 400;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--dscp-accent);
	margin: 0 0 0.55rem;
	padding: 0;
}

.dscp-people .dscp-card__org {
	font-size: 0.9375rem;
	line-height: 1.45;
	color: var(--dscp-body);
	margin: 0 0 0.25rem;
	padding: 0;
}

.dscp-people .dscp-card__org a {
	color: inherit;
	text-decoration: none;
	border-bottom: 1px solid rgba(157, 195, 232, 0.35);
	box-shadow: none;
}

.dscp-people .dscp-card__org a:hover,
.dscp-people .dscp-card__org a:focus {
	color: var(--dscp-accent);
	border-bottom-color: var(--dscp-accent);
}

.dscp-people .dscp-card__location {
	font-size: 0.8125rem;
	line-height: 1.4;
	color: var(--dscp-muted);
	margin: 0;
	padding: 0;
}

.dscp-people .dscp-card__bio {
	margin: 0.9rem 0 0;
	font-size: 0.9125rem;
	line-height: 1.6;
	color: var(--dscp-muted);
}

.dscp-people .dscp-card__bio p {
	margin: 0 0 0.7rem;
	padding: 0;
	font-size: inherit;
	line-height: inherit;
	color: inherit;
}

.dscp-people .dscp-card__bio p:last-child {
	margin-bottom: 0;
}

.dscp-people .dscp-card__links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem 1.1rem;
	margin: 0.95rem 0 0;
	padding: 0.8rem 0 0;
	border-top: 1px solid var(--dscp-line);
	font-size: 0.875rem;
}

.dscp-people .dscp-card__links a {
	color: var(--dscp-accent);
	text-decoration: none;
	font-weight: 500;
	border-bottom: 1px solid transparent;
	box-shadow: none;
}

.dscp-people .dscp-card__links a:hover,
.dscp-people .dscp-card__links a:focus {
	border-bottom-color: currentColor;
}

.dscp-people .dscp-link--site::before {
	content: "\2197";
	margin-right: 0.3em;
	opacity: 0.75;
}

/* Placeholder state, used while an appointment is still to be confirmed.
   ------------------------------------------------------------------------- */

.dscp-people .dscp-card--placeholder {
	background: transparent;
	border-style: dashed;
	border-color: rgba(157, 195, 232, 0.32);
}

.dscp-people .dscp-card--placeholder .dscp-card__portrait {
	background: rgba(28, 95, 150, 0.22);
}

.dscp-people .dscp-card--placeholder .dscp-card__portrait svg {
	opacity: 0.5;
}

.dscp-people .dscp-card--placeholder .dscp-card__name {
	color: var(--dscp-muted);
	font-style: italic;
}

/* Compact list, used for member categories
   ------------------------------------------------------------------------- */

.dscp-people .dscp-list {
	margin: 0;
	padding: 0;
	list-style: none;
	border-top: 1px solid var(--dscp-line);
}

.dscp-people .dscp-row {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.3rem 1.25rem;
	margin: 0;
	padding: 0.9rem 0;
	border-bottom: 1px solid var(--dscp-line);
	list-style: none;
}

.dscp-people .dscp-row__name {
	font-family: var(--dscp-font-display);
	font-weight: 700;
	font-size: 1rem;
	color: var(--dscp-name);
	flex: 0 0 auto;
	min-width: 15rem;
}

.dscp-people .dscp-row__name a {
	color: inherit;
	text-decoration: none;
	border-bottom: 1px solid rgba(157, 195, 232, 0.35);
}

.dscp-people .dscp-row__meta {
	font-size: 0.9375rem;
	color: var(--dscp-muted);
}

/* Legal entity block. Neutral translucency so it reads on either scheme.
   ------------------------------------------------------------------------- */

.dsc-entity {
	padding: 1.05rem 1.3rem;
	background: rgba(127, 145, 175, 0.14);
	border-left: 3px solid #1c5f96;
	border-radius: 0;
	line-height: 1.6;
	color: inherit;
}

/* Accessibility helper, in case the theme does not define it. */
.dscp-people .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

@media (prefers-reduced-motion: reduce) {
	.dscp-people .dscp-card {
		transition: none;
	}
}
