/*
 * Our Staff archive (staff term only — every selector scoped under
 * body.term-staff). Card pattern adapted from the theme's homepage
 * .home-team-grid / .home-team-item rules, copied here so this page never
 * depends on front-page CSS being enqueued.
 */

body.term-staff .brc-staff-archive {
	padding: 42px 0 96px;
}

/* ---- Sections ---- */

body.term-staff .brc-staff-section + .brc-staff-section {
	margin-top: 84px;
}

body.term-staff .brc-staff-section__heading {
	font-family: 'Cinzel', serif;
	font-size: 26px;
	font-weight: 400;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #242e37;
	text-align: center;
	margin: 0 0 44px;
}

body.term-staff .brc-staff-section__heading::after {
	content: "";
	display: block;
	width: 48px;
	height: 2px;
	background: #bfdcf5;
	margin: 16px auto 0;
}

/* ---- Card grid (centered flex-wrap so a partial last row centers) ---- */

body.term-staff .brc-staff-grid {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 45px;
}

body.term-staff .brc-staff-card {
	display: block;
	width: calc((100% - 90px) / 3);
	background-color: #242e37;
	color: #fff;
	text-align: center;
	text-decoration: none;
	transition: background-color 0.35s;
}

@media (max-width: 1199px) {
	body.term-staff .brc-staff-card {
		width: calc((100% - 45px) / 2);
	}
}

@media (max-width: 767px) {
	body.term-staff .brc-staff-card {
		width: 100%;
		max-width: 410px;
	}
}

body.term-staff .brc-staff-card__img {
	display: block;
}

body.term-staff .brc-staff-card__img img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 1.5;
	object-fit: cover;
	filter: saturate(0);
	transition: filter 0.35s;
}

body.term-staff .brc-staff-card__body {
	display: block;
	padding: 18px 14px 22px;
}

body.term-staff .brc-staff-card__name {
	display: block;
	font-family: var(--bs-body-font-family, "Helvetica Neue", Helvetica, Arial, sans-serif);
	font-size: 21px;
	font-weight: 300;
	line-height: 25px;
	color: #fff;
	transition: color 0.35s;
}

body.term-staff .brc-staff-card__role {
	display: block;
	margin-top: 7px;
	font-size: 11px;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	color: #bfdcf5;
	transition: color 0.35s;
}

/* Hover/focus: light tint panel + the photo blooms to color (the homepage's
   flip-to-white would vanish on this white page). */
body.term-staff .brc-staff-card:hover,
body.term-staff .brc-staff-card:focus-visible {
	background-color: #e8f2fa;
	text-decoration: none;
}

body.term-staff .brc-staff-card:hover .brc-staff-card__img img,
body.term-staff .brc-staff-card:focus-visible .brc-staff-card__img img {
	filter: none;
}

body.term-staff .brc-staff-card:hover .brc-staff-card__name,
body.term-staff .brc-staff-card:focus-visible .brc-staff-card__name {
	color: #242e37;
}

body.term-staff .brc-staff-card:hover .brc-staff-card__role,
body.term-staff .brc-staff-card:focus-visible .brc-staff-card__role {
	color: #485c6e;
}

body.term-staff .brc-staff-card:focus-visible {
	outline: 2px solid #336699;
	outline-offset: 3px;
}

/* ---- Bio dialog ---- */

body.term-staff.brc-dialog-open {
	overflow: hidden;
}

body.term-staff .brc-bio-dialog {
	width: 980px;
	max-width: calc(100vw - 40px);
	max-height: 85vh;
	padding: 0;
	border: 0;
	background: #fff;
	overflow: visible;
}

body.term-staff .brc-bio-dialog::backdrop {
	background: rgb(36 46 55 / 78%);
}

body.term-staff .brc-bio-dialog__inner {
	position: relative;
	display: flex;
	align-items: stretch;
	height: min(560px, 85vh);
	max-height: 85vh;
}

body.term-staff .brc-bio-dialog__close {
	position: absolute;
	top: 6px;
	right: 6px;
	z-index: 2;
	width: 40px;
	height: 40px;
	display: grid;
	place-items: center;
	padding: 0;
	border: 0;
	background: none;
	color: #485c6e;
	cursor: pointer;
}

/* Portrait shown in full color — continues the card-hover color bloom. */
body.term-staff .brc-bio-dialog__media {
	flex: 0 0 380px;
	min-height: 0;
	/* Shows while a photo loads (img hidden below) — reads as a deliberate
	   panel, same hue as the grid cards. */
	background: #242E37;
}

body.term-staff .brc-bio-dialog__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: 50% 20%;
	transition: opacity 0.15s ease;
}

/* While a newly assigned src is in flight the img still paints the previous
   member's portrait — keep it hidden until the load settles. */
body.term-staff .brc-bio-dialog__media--loading img {
	opacity: 0;
}

body.term-staff .brc-bio-dialog__content {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	padding: 52px 56px;
}

body.term-staff .brc-bio-dialog__name {
	font-family: 'Cinzel', serif;
	font-size: 30px;
	font-weight: 400;
	line-height: 38px;
	color: #242e37;
	margin: 0;
}

/* Prev/next moves focus here for the screen-reader announcement; the theme
   outlines any :focus, which would flash a ring on every mouse click.
   Keyboard focus (:focus-visible) keeps its indicator. */
body.term-staff .brc-bio-dialog__name:focus:not(:focus-visible) {
	outline: none;
}

body.term-staff .brc-bio-dialog__role {
	margin: 10px 0 0;
	font-size: 12px;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.14em;
	color: #485c6e;
}

body.term-staff .brc-bio-dialog__role::after {
	content: "";
	display: block;
	width: 48px;
	height: 2px;
	background: #bfdcf5;
	margin-top: 18px;
}

body.term-staff .brc-bio-dialog__bio {
	flex: 1 1 auto;
	overflow-y: auto;
	margin-top: 22px;
	padding-right: 10px;
	font-size: 16px;
	line-height: 27px;
	color: rgba(0, 0, 0, 0.85);
}

body.term-staff .brc-bio-dialog__bio p:last-child {
	margin-bottom: 0;
}

body.term-staff .brc-bio-dialog__footer {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	margin-top: 24px;
	padding-top: 18px;
	border-top: 1px solid #e8f2fa;
}

/* Padding + negative margin: ≥44px tap target without growing the footer. */
body.term-staff .brc-bio-dialog__nav {
	padding: 12px 0;
	margin: -12px 0;
	border: 0;
	background: none;
	font-size: 14px;
	color: #336699;
	cursor: pointer;
}

body.term-staff .brc-bio-dialog__nav:hover .brc-bio-dialog__nav-name {
	text-decoration: underline;
}

/* ≤768px: full-screen sheet, photo on top, whole sheet scrolls as one
   surface (Variant C) — ✕ and prev/next footer stay pinned to the viewport. */
@media (max-width: 768px) {
	body.term-staff .brc-bio-dialog {
		width: 100vw;
		height: 100dvh;
		max-width: 100vw;
		max-height: 100dvh;
		margin: 0;
		overflow-y: auto; /* C: the sheet itself is the scroll surface */
	}

	body.term-staff .brc-bio-dialog__inner {
		flex-direction: column;
		height: auto;          /* C: grow with content… */
		min-height: 100dvh;    /* …but never shorter than the screen */
		max-height: none;
	}

	/* C: ✕ pinned to the viewport while the sheet scrolls.
	   44px target + 70% chip = solid contrast over photo AND over white text. */
	body.term-staff .brc-bio-dialog__close {
		position: fixed;
		top: 6px;
		right: 6px;
		width: 44px;
		height: 44px;
		color: #fff;
		background: rgb(36 46 55 / 70%);
	}

	body.term-staff .brc-bio-dialog__media {
		flex: 0 0 auto;
		height: 38vh;
		min-height: 0;
	}

	body.term-staff .brc-bio-dialog__content {
		flex: 1;
		min-height: 0;
		padding: 26px 22px 0;
	}

	/* C: bio no longer scrolls internally; bottom padding lets the last
	   line scroll clear of the pinned footer (a11y fix #2). */
	body.term-staff .brc-bio-dialog__bio {
		flex: none;
		overflow-y: visible;
		padding-right: 0;
		padding-bottom: calc(72px + env(safe-area-inset-bottom));
	}

	/* C: prev/next pinned as a solid bar; bar ≈57px tall like the mock
	   (6 + 45px buttons + 6), buttons ≥44px tall (a11y fix #1). */
	body.term-staff .brc-bio-dialog__footer {
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		margin-top: 0;
		padding: 6px 22px calc(6px + env(safe-area-inset-bottom));
		background: #fff;
		border-top: 1px solid #e8f2fa;
	}

	body.term-staff .brc-bio-dialog__nav {
		margin: 0;
		padding: 14px 0;
	}
}
