/**
 * TechBBQ People Section — people cards with optional tabs.
 *
 * Figma refs in widget PHP.
 *
 * Breakpoints (mobile-first): 0–767 (base), 768–1023, 1024–1440, 1440+.
 */

.techbbq-people-section,
.techbbq-partners-inquiries {
	--techbbq-people-section-gap: var(--techbbq-space-7);
	--techbbq-people-section-intro-gap: 12px;
	--techbbq-people-section-title-size: 30px;
	--techbbq-people-section-desc-max-width: 576px;
	--techbbq-people-section-list-gap: var(--techbbq-space-1);
	--techbbq-people-section-card-radius: 12px;
	--techbbq-people-section-card-padding: 12px;
	--techbbq-people-section-card-width: 100%;
	--techbbq-people-section-photo-width: 92px;
	--techbbq-people-section-photo-height: 100px;
	--techbbq-people-section-name-size: 20px;
	--techbbq-people-section-tab-height: 44px;
	--techbbq-people-section-tab-size: var(--techbbq-text-paragraph-m-size);

	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--techbbq-people-section-gap);
	width: 100%;
	color: var(--techbbq-content-primary);
	background-color: var(--techbbq-bg-main);
}

.techbbq-people-section__header,
.techbbq-people-section__tabs-wrap,
.techbbq-people-section__panels,
.techbbq-people-section__list {
	width: 100%;
}

.techbbq-people-section__header {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
}

.techbbq-people-section__intro {
	display: flex;
	flex-direction: column;
	gap: var(--techbbq-people-section-intro-gap);
	align-items: center;
	width: 100%;
}

.techbbq-people-section__title {
	margin: 0;
	font-size: var(--techbbq-people-section-title-size);
}

.techbbq-people-section__description {
	max-width: var(--techbbq-people-section-desc-max-width);
	margin: 0;
	color: var(--techbbq-content-secondary);
}

.techbbq-people-section__tabs-scroll {
	width: 100%;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	text-align: center;
}

.techbbq-people-section__tabs-scroll::-webkit-scrollbar {
	display: none;
}

.techbbq-people-section__tabs {
	display: inline-flex;
	flex-wrap: nowrap;
	gap: var(--techbbq-space-1);
	justify-content: flex-start;
	padding-bottom: 2px;
	vertical-align: top;
}

.techbbq-people-section__tab {
	display: inline-flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	min-height: var(--techbbq-people-section-tab-height);
	padding: 8px 24px;
	border: 1px solid var(--techbbq-border-tertiary);
	border-radius: var(--techbbq-radius-pill);
	background: transparent;
	font-family: var(--techbbq-font-family-body);
	font-size: var(--techbbq-people-section-tab-size);
	font-weight: 400;
	line-height: 1.4;
	letter-spacing: 0.02em;
	color: var(--techbbq-content-primary);
	white-space: nowrap;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

/* ── Two-level tabs ────────────────────────────────────────── */
/* Primary row is TechBBQ / Board; the departments sit under it as a quieter,
 * smaller row. Only the Team widget with Include Board on renders this. */

.techbbq-people-section__subtabs {
	margin-top: var(--techbbq-space-1);
}

.techbbq-people-section__tab--sub {
	min-height: 0;
	padding: 5px 14px;
	font-size: var(--techbbq-text-caption-s-size);
	letter-spacing: var(--techbbq-text-caption-s-letter-spacing);
	color: var(--techbbq-content-secondary);
}

.techbbq-people-section__tab--sub.is-active {
	color: var(--techbbq-content-oncolor-primary);
}

.techbbq-people-section__tab.is-active {
	border-color: var(--techbbq-btn-primary-fill-default);
	background-color: var(--techbbq-btn-primary-fill-default);
	color: var(--techbbq-content-oncolor-primary);
}

.techbbq-people-section__tab:focus-visible {
	outline: 2px solid var(--techbbq-content-primary);
	outline-offset: 2px;
}

.techbbq-people-section__panels {
	display: flex;
	flex-direction: column;
	gap: 0;
}

.techbbq-people-section__panel[hidden] {
	display: none;
}

/* One-column grid rather than a flex column, so the Grid Columns control
 * applies at mobile too. Identical rendering for full-width children with
 * the same gap. Tracker item 13. */
.techbbq-people-section__list {
	--techbbq-ps-grid-columns: 1;

	display: grid;
	grid-template-columns: repeat(var(--techbbq-ps-grid-columns), minmax(0, 1fr));
	gap: var(--techbbq-people-section-list-gap);
}

/* Board bio. Only the board feed sends a description, so this never appears on a
 * staff card. Clamped rather than left to run: the bios are 110 to 310 characters
 * today and one long one would otherwise stretch its whole row. */
.techbbq-people-section__bio {
	margin: 0;
	color: var(--techbbq-content-secondary);
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 5;
	line-clamp: 5;
	overflow: hidden;
}

/* Seven board members as 4 on top and 3 centred underneath, every card the same
 * width. Not a grid: grid cannot place a part-filled last row, because
 * justify-content moves the whole track set rather than the items inside that
 * row, so three leftover cards would sit hard left with an empty fourth slot.
 * This is the same flex-wrap trick the Card Alignment modes use above, with a
 * basis of exactly one four-column track, which lays the full row out
 * identically to a grid and only moves the leftovers.
 *
 * Specificity is load-bearing. The Grid Columns control prints
 * `.elementor-element-<id> .techbbq-people-section__list` at (0,2,0) from a
 * <style> in the body, which is later in source order than this file, so a
 * matching (0,2,0) selector here would lose and /team/'s 6 columns would reach
 * the board. Scoping to the section root makes it (0,3,0) and settles it
 * without !important.
 *
 * Below 768px the list is a single column and none of this applies. */
@media (min-width: 768px) {
	.techbbq-people-section .techbbq-people-section__panel--split-4-3 .techbbq-people-section__list {
		--techbbq-ps-grid-columns: 4;

		display: flex;
		flex-wrap: wrap;
		justify-content: center;
	}

	.techbbq-people-section .techbbq-people-section__panel--split-4-3 .techbbq-people-section__list > * {
		flex: 0 0 calc(
			(100% - (var(--techbbq-ps-grid-columns) - 1) * var(--techbbq-people-section-list-gap)) /
			var(--techbbq-ps-grid-columns)
		);
		min-width: 0;
	}
}

.techbbq-people-section__card {
	--techbbq-people-section-card-hover-bg: url("../../images/speakers/card-hover.svg");

	position: relative;
	box-sizing: border-box;
	display: flex;
	flex-shrink: 0;
	gap: var(--techbbq-space-2);
	align-items: flex-start;
	width: var(--techbbq-people-section-card-width);
	padding: var(--techbbq-people-section-card-padding);
	overflow: hidden;
	border-radius: var(--techbbq-people-section-card-radius);
	background: var(--techbbq-bg-surface);
	isolation: isolate;
}

.techbbq-people-section__card::before {
	content: "";
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 0;
	height: 55%;
	background-color: transparent;
	background-image: var(--techbbq-people-section-card-hover-bg);
	background-repeat: no-repeat;
	background-position: center bottom;
	background-size: 100% auto;
	opacity: 0;
	transition: opacity 0.3s ease;
	pointer-events: none;
}

.techbbq-people-section__card:hover::before,
.techbbq-people-section__card:focus-within::before {
	opacity: 1;
}

.techbbq-people-section__photo {
	position: relative;
	z-index: 2;
	flex-shrink: 0;
	width: var(--techbbq-people-section-photo-width);
	height: var(--techbbq-people-section-photo-height);
	overflow: hidden;
	border-radius: 4px;
	background:
		radial-gradient(
			120% 120% at 66% 0%,
			#5a5a5a 0%,
			#373737 32%,
			#262626 52%,
			#151515 72%
		);
}

/*
 * TODO: agree one source size for people photos.
 *
 * The box is a fixed 306 x 332 (roughly 1:1.085) and the image is cropped to
 * fill it, so whatever gets uploaded is cut to that shape. Nothing anywhere
 * says what to upload, so photos arrive at whatever size Airtable or the media
 * library happens to hold and they do not fit: wide shots lose the sides,
 * short ones lose the top of the head. `object-position: center top` is a
 * guess that suits a portrait headshot and nothing else, which is why single
 * pages have been patching it in Custom CSS.
 *
 * Needed: one stated pixel size and crop for every people photo, ideally
 * 612 x 664 at 2x, written into the brand guide and applied at the source.
 */
.techbbq-people-section__photo-image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center top;
}

.techbbq-people-section__meta {
	position: relative;
	z-index: 1;
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: var(--techbbq-space-1);
	justify-content: space-between;
	min-width: 0;
	align-self: stretch;
}

.techbbq-people-section__identity {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.techbbq-people-section__name {
	margin: 0;
	font-size: var(--techbbq-people-section-name-size);
}

.techbbq-people-section__role {
	margin: 0;
	color: var(--techbbq-content-secondary);
}

.techbbq-people-section__links {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.techbbq-people-section__link {
	display: inline-flex;
	gap: 4px;
	align-items: center;
	width: fit-content;
	font-family: var(--techbbq-font-family-body);
	font-size: var(--techbbq-text-paragraph-xs-size);
	line-height: 1.4;
	letter-spacing: 0.02em;
	color: var(--techbbq-content-secondary);
	text-decoration: none;
	white-space: nowrap;
}

.techbbq-people-section__description--html a {
	color: var(--techbbq-content-accent-2);
	text-decoration: none;
}

/* ── Tablet (768–1023) ──────────────────────────────────────── */
@media (min-width: 768px) {
	.techbbq-people-section,
	.techbbq-partners-inquiries {
		--techbbq-people-section-title-size: 41px;
		--techbbq-people-section-desc-max-width: 660px;
		--techbbq-people-section-tab-size: var(--techbbq-text-paragraph-l-size);
	}

	.techbbq-people-section__list {
		--techbbq-ps-grid-columns: 3;
		gap: var(--techbbq-space-1);
	}

	.techbbq-people-section__card {
		flex-direction: column;
		width: auto;
		padding: var(--techbbq-space-2);
	}

	.techbbq-people-section__photo {
		width: 100%;
		height: auto;
		aspect-ratio: 306 / 332;
	}

	.techbbq-people-section__meta {
		gap: 6px;
	}

	.techbbq-people-section__name {
		font-size: 24px;
	}
}

/* ── Desktop (1024–1440) ──────────────────────────────────────── */
@media (min-width: 1024px) {
	.techbbq-people-section,
	.techbbq-partners-inquiries {
		--techbbq-people-section-title-size: 44px;
	}

	.techbbq-people-section__list {
		--techbbq-ps-grid-columns: 4;
	}
}

/* ── Large desktop (1440+) ──────────────────────────────────────── */
@media (min-width: 1440px) {
	.techbbq-people-section,
	.techbbq-partners-inquiries {
		--techbbq-people-section-title-size: var(--techbbq-text-h3-size);
	}

	.techbbq-people-section__list {
		--techbbq-ps-grid-columns: 5;
	}
}

/* Tabs above mobile: tighter pills, and wrap rather than scroll out of sight.
 *
 * The row is a nowrap flex line inside a scroller with the scrollbar hidden,
 * which is right on mobile: a pill row you swipe. On a desktop it has no
 * affordance at all, so a row that does not fit simply loses its last tab with
 * nothing to say so. Ten department tabs at 24px side padding need 1400px
 * inside a 1392px content width, which clipped Program by 8px.
 *
 * 20px side padding brings the same ten to 1320px, so they sit on one line at
 * wide screen with 72px to spare. Wrapping is still on, deliberately: where the
 * row does fit it is a no-op and you get the single line, and where it does not
 * (a narrower desktop, or an eleventh tab later) it wraps and centres instead
 * of losing a tab. Mobile keeps the swipe row and the roomier 24px pills. */
@media (min-width: 768px) {
	.techbbq-people-section__tabs-scroll {
		overflow-x: visible;
	}

	.techbbq-people-section__tabs {
		display: flex;
		flex-wrap: wrap;
		justify-content: center;
	}

	.techbbq-people-section__tab {
		padding-right: 20px;
		padding-left: 20px;
	}
}

/* Card alignment — places a part-filled last row instead of stretching it.
 *
 * The default grid uses 1fr tracks, so every row spans the full width and a
 * lone card on the last row sits hard left with four empty slots beside it.
 * Grid cannot place that leftover: justify-content moves the whole track set,
 * not the items inside the last row. Flex wrap can, and with an explicit basis
 * of exactly one track it lays full rows out identically to the grid, same
 * widths and same gap. Only the leftovers move. */
.techbbq-people-section--align-center .techbbq-people-section__list,
.techbbq-people-section--align-left .techbbq-people-section__list,
.techbbq-people-section--align-right .techbbq-people-section__list {
	display: flex;
	flex-wrap: wrap;
}

.techbbq-people-section--align-center .techbbq-people-section__list > *,
.techbbq-people-section--align-left .techbbq-people-section__list > *,
.techbbq-people-section--align-right .techbbq-people-section__list > * {
	flex: 0 0 calc(
		(100% - (var(--techbbq-ps-grid-columns) - 1) * var(--techbbq-people-section-list-gap)) /
		var(--techbbq-ps-grid-columns)
	);
	min-width: 0;
}

.techbbq-people-section--align-center .techbbq-people-section__list {
	justify-content: center;
}

.techbbq-people-section--align-left .techbbq-people-section__list {
	justify-content: flex-start;
}

.techbbq-people-section--align-right .techbbq-people-section__list {
	justify-content: flex-end;
}

/* Single centered contact card — Figma section / contacts (7166:88157, 7164:70801) */
.techbbq-people-section--single-centered {
	--techbbq-people-section-gap: var(--techbbq-space-3);
	--techbbq-people-section-list-gap: 0;
}

.techbbq-people-section--single-centered .techbbq-people-section__list {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
}

.techbbq-people-section--single-centered .techbbq-contact-card {
	align-self: stretch;
	width: 100%;
	max-width: none;
}

@media (min-width: 768px) {
	.techbbq-people-section--single-centered {
		--techbbq-people-section-gap: var(--techbbq-space-5);
	}

	.techbbq-people-section--single-centered .techbbq-contact-card {
		align-self: center;
		width: 342px;
		max-width: 100%;
	}
}

/* Contact card grid — Figma section / contacts (7366:74606, 7366:75486, 7366:75659) */
.techbbq-people-section--contact-grid {
	--techbbq-people-section-gap: var(--techbbq-space-3);
	--techbbq-people-section-list-gap: var(--techbbq-space-1);
}

.techbbq-people-section--contact-grid .techbbq-people-section__list {
	display: flex;
	flex-direction: column;
	gap: var(--techbbq-people-section-list-gap);
	align-items: stretch;
	width: 100%;
}

.techbbq-people-section--contact-grid .techbbq-contact-card {
	align-self: stretch;
	width: 100%;
	max-width: none;
}

@media (min-width: 768px) {
	.techbbq-people-section--contact-grid {
		--techbbq-people-section-gap: var(--techbbq-space-5);
	}

	.techbbq-people-section--contact-grid .techbbq-people-section__list {
		flex-direction: row;
		flex-wrap: wrap;
		justify-content: center;
		align-items: stretch;
	}

	.techbbq-people-section--contact-grid .techbbq-contact-card {
		flex: 1 1 calc(50% - 4px);
		align-self: stretch;
		width: auto;
		max-width: 342px;
	}
}

@media (min-width: 1024px) {
	.techbbq-people-section--contact-grid .techbbq-contact-card {
		flex: 0 1 342px;
		width: 342px;
		max-width: none;
	}
}

@media (min-width: 1440px) {
	.techbbq-people-section--contact-grid .techbbq-people-section__list {
		flex-wrap: nowrap;
	}

	.techbbq-people-section--contact-grid .techbbq-contact-card {
		flex: 0 0 342px;
		width: 342px;
	}
}

/* ── Card opens LinkedIn when profile URL is present (no photo icon) ── */

.techbbq-people-section__card--linkedin,
.techbbq-contact-card--linkedin {
	cursor: pointer;
}
