/* The Peak — Masthead cards + staff profile pages
   Loaded only on the Masthead page and /staff/… profile pages. */

.peak-masthead,
.peak-profile {
	--pm-ink: #1f1f1f;
	--pm-muted: #6f6f6f;
	--pm-soft: #8a8a8a;
	--pm-line: #e7e7e7;
	--pm-card: #ffffff;
	--pm-serif: "IBM Plex Serif", Georgia, "Times New Roman", serif;
	--pm-sans: Montserrat, "Helvetica Neue", Arial, sans-serif;
	--pm-gap: 28px;
	box-sizing: border-box;
	background: var(--pm-card);
	border-radius: 16px;
	color: var(--pm-ink);
	font-family: var(--pm-sans);
	padding: 40px 32px 44px;
}
.peak-masthead {
	container: pm / inline-size;
	scroll-margin-top: 90px;
}
.peak-masthead *,
.peak-profile * {
	box-sizing: border-box;
}

/* The page's own "Masthead" heading moves inside the white card. */
body.peak-masthead-page .td-page-header .td-page-title {
	display: none;
}
.peak-masthead {
	margin: 4px 0 40px;
}

:is(.peak-masthead, .peak-profile) .pm-title {
	font-family: var(--pm-serif) !important;
	font-weight: 700;
	font-size: 40px;
	line-height: 1.1;
	letter-spacing: -0.01em;
	color: var(--pm-ink);
	margin: 0 0 8px;
	padding: 0;
}

/* Desk headings: small caps label with a hairline */
:is(.peak-masthead, .peak-profile) .pm-desk {
	margin-top: 32px;
}
.peak-masthead > .pm-desk:first-child {
	margin-top: 0 !important;
}
:is(.peak-masthead, .peak-profile) .pm-desk-title {
	display: flex;
	align-items: center;
	gap: 10px;
	font-family: var(--pm-sans);
	font-size: 12px;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--pm-muted);
	margin: 0 0 18px;
	padding: 0;
}
:is(.peak-masthead, .peak-profile) .pm-desk-title::after {
	content: "";
	flex: 1;
	height: 1px;
	background: var(--pm-line);
}

/* Card grid */
:is(.peak-masthead, .peak-profile) .pm-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 36px var(--pm-gap);
	margin: 0;
	padding: 0;
}
:is(.peak-masthead, .peak-profile) .pm-card {
	position: relative;
	text-align: center;
	margin: 0;
	padding: 0;
	min-width: 0;
}
:is(.peak-masthead, .peak-profile) .pm-photo {
	position: relative;
	aspect-ratio: 1 / 1;
	border-radius: 12px;
	overflow: hidden;
	background: linear-gradient(135deg, #ececec 0%, #d6d6d6 100%);
	margin: 0 0 16px;
}
:is(.peak-masthead, .peak-profile) .pm-photo img,
:is(.peak-masthead, .peak-profile) .pm-photo .pm-img {
	display: block;
	width: 100% !important;
	height: 100% !important;
	max-width: none;
	object-fit: cover;
	margin: 0;
	transition: transform 0.35s ease;
}
:is(.peak-masthead, .peak-profile) .pm-initials {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: var(--pm-serif);
	font-weight: 600;
	font-size: 44px;
	letter-spacing: 0.02em;
	color: #a3a3a3;
}
:is(.peak-masthead, .peak-profile) .pm-name {
	font-family: var(--pm-serif) !important;
	font-weight: 700;
	font-size: 19px;
	line-height: 1.25;
	color: var(--pm-ink);
	margin: 0 0 4px;
	padding: 0;
}
:is(.peak-masthead, .peak-profile) .pm-name a.pm-link,
:is(.peak-masthead, .peak-profile) .pm-name a.pm-link:visited {
	color: inherit;
	text-decoration: none;
}
/* The whole card opens the profile; Email/LinkedIn stay separately clickable. */
:is(.peak-masthead, .peak-profile) .pm-link::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	border-radius: 12px;
}
:is(.peak-masthead, .peak-profile) .pm-card:hover .pm-link {
	text-decoration: underline;
	text-underline-offset: 3px;
	text-decoration-thickness: 1px;
}
:is(.peak-masthead, .peak-profile) .pm-card:hover .pm-photo img {
	transform: scale(1.03);
}
:is(.peak-masthead, .peak-profile) .pm-link:focus-visible {
	outline: none;
}
:is(.peak-masthead, .peak-profile) .pm-link:focus-visible::after {
	outline: 2px solid #1877b8;
	outline-offset: 4px;
}
:is(.peak-masthead, .peak-profile) .pm-role {
	font-family: var(--pm-sans);
	font-size: 14px;
	line-height: 1.4;
	color: var(--pm-soft);
	margin: 0 0 12px;
	padding: 0;
}
:is(.peak-masthead, .peak-profile) .pm-pronouns {
	white-space: nowrap;
	color: #a0a0a0;
}
:is(.peak-masthead, .peak-profile) .pm-card .pm-pronouns {
	display: block;
	font-size: 0.92em;
	margin-top: 2px;
}

/* Email / LinkedIn */
:is(.peak-masthead, .peak-profile) .pm-links {
	position: relative;
	z-index: 2;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px 20px;
	margin: 0;
	padding: 0;
	font-size: 14px;
	line-height: 1.2;
}
:is(.peak-masthead, .peak-profile) .pm-links a.pm-btn,
:is(.peak-masthead, .peak-profile) .pm-links a.pm-btn:visited {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	font-family: var(--pm-sans);
	color: var(--pm-ink);
	text-decoration: none;
}
:is(.peak-masthead, .peak-profile) .pm-links a.pm-btn:hover {
	color: #1877b8;
}
:is(.peak-masthead, .peak-profile) .pm-btn svg {
	flex: none;
	display: block;
}
:is(.peak-masthead, .peak-profile) .pm-in {
	font-family: Arial, Helvetica, sans-serif;
	font-weight: 700;
	font-size: 15px;
	letter-spacing: -0.03em;
	line-height: 1;
}
:is(.peak-masthead, .peak-profile) .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	border: 0;
	white-space: nowrap;
}

/* ---------- Profile page ---------- */
.peak-profile-wrap {
	padding: 28px 0 56px;
}
.peak-profile {
	padding: 28px 40px 44px;
}
.peak-profile .pp-back,
.peak-profile .pp-back:visited {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-family: var(--pm-sans);
	font-size: 14px;
	font-weight: 500;
	color: var(--pm-muted);
	text-decoration: none;
	margin: 0 0 28px;
}
.peak-profile .pp-back:hover {
	color: var(--pm-ink);
}
.peak-profile .pp-head {
	display: grid;
	grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
	gap: 44px;
	align-items: start;
}
.peak-profile .pp-photo {
	border-radius: 14px;
	margin: 0;
}
.peak-profile .pp-photo .pm-initials {
	font-size: 72px;
}
.peak-profile .pp-desk {
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--pm-muted);
	margin: 6px 0 10px;
	padding: 0;
}
.peak-profile .pp-name {
	font-family: var(--pm-serif) !important;
	font-weight: 700;
	font-size: 40px;
	line-height: 1.1;
	letter-spacing: -0.01em;
	color: var(--pm-ink);
	margin: 0 0 10px;
	padding: 0;
}
.peak-profile .pp-role {
	font-size: 16px;
	line-height: 1.4;
	color: var(--pm-muted);
	margin: 0 0 18px;
	padding: 0;
}
.peak-profile .pp-since {
	font-size: 14px;
	line-height: 1.4;
	color: var(--pm-soft);
	margin: -10px 0 20px;
	padding: 0;
}
.peak-profile .pp-links {
	justify-content: flex-start;
	gap: 10px;
	margin: 0 0 26px;
}
.peak-profile .pp-links .pm-btn {
	border: 1px solid #dcdcdc;
	border-radius: 999px;
	padding: 9px 16px;
}
.peak-profile .pp-links .pm-btn:hover {
	border-color: #1877b8;
}
.peak-profile .pp-bio {
	max-width: 640px;
	font-family: var(--pm-serif);
	font-size: 18px;
	line-height: 1.7;
	color: #262626;
}
.peak-profile .pp-bio p,
.peak-profile .pp-bio li {
	font-family: var(--pm-serif) !important;
	font-size: inherit;
	line-height: inherit;
	margin: 0 0 1em;
}
.peak-profile .pp-bio a {
	color: #1877b8;
}

/* Narrower spots (e.g. the About page tab): 3 across */
@container pm (max-width: 820px) {
	.peak-masthead .pm-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

/* ---------- Tablet ---------- */
@media (max-width: 1018px) {
	:is(.peak-masthead, .peak-profile) .pm-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

/* ---------- Phone: one swipeable row per desk ---------- */
@media (max-width: 767px) {
	.peak-masthead,
	.peak-profile {
		--pm-pad: 18px;
		border-radius: 14px;
		padding: 26px var(--pm-pad) 30px;
	}
	:is(.peak-masthead, .peak-profile) .pm-title {
		font-size: 32px;
	}
	:is(.peak-masthead, .peak-profile) .pm-desk {
		margin-top: 26px;
	}
	:is(.peak-masthead, .peak-profile) .pm-desk-title {
		margin-bottom: 14px;
	}
	:is(.peak-masthead, .peak-profile) .pm-grid {
		display: flex;
		gap: 14px;
		overflow-x: auto;
		overscroll-behavior-x: contain;
		scroll-snap-type: x mandatory;
		scroll-padding-left: var(--pm-pad);
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
		margin: 0 calc(-1 * var(--pm-pad));
		padding: 2px var(--pm-pad) 6px;
	}
	:is(.peak-masthead, .peak-profile) .pm-grid::-webkit-scrollbar {
		display: none;
	}
	:is(.peak-masthead, .peak-profile) .pm-card {
		flex: 0 0 44%;
		scroll-snap-align: start;
	}
	:is(.peak-masthead, .peak-profile) .pm-photo {
		margin-bottom: 12px;
	}
	:is(.peak-masthead, .peak-profile) .pm-initials {
		font-size: 34px;
	}
	:is(.peak-masthead, .peak-profile) .pm-name {
		font-size: 16px;
	}
	:is(.peak-masthead, .peak-profile) .pm-role {
		font-size: 12.5px;
		margin-bottom: 10px;
	}
	:is(.peak-masthead, .peak-profile) .pm-links {
		gap: 6px 14px;
		font-size: 13px;
	}

	.peak-profile-wrap {
		padding: 16px 0 40px;
	}
	.peak-profile-wrap .td-container {
		padding-left: 12px;
		padding-right: 12px;
	}
	.peak-profile .pp-back {
		margin-bottom: 18px;
	}
	.peak-profile .pp-head {
		grid-template-columns: 1fr;
		gap: 22px;
	}
	.peak-profile .pp-photo {
		width: 70%;
		max-width: 280px;
	}
	.peak-profile .pp-name {
		font-size: 32px;
	}
	.peak-profile .pp-bio {
		font-size: 17px;
	}
}

@media (prefers-reduced-motion: reduce) {
	:is(.peak-masthead, .peak-profile) .pm-photo img {
		transition: none;
	}
	:is(.peak-masthead, .peak-profile) .pm-card:hover .pm-photo img {
		transform: none;
	}
}
