/* Unidos In Power — people and committees
   ---------------------------------------------------------------------------
   Profile cards for the leadership and committee rosters, on the design
   system's own tokens. Loaded only where the [uip_people] shortcode runs. */

.uip-people {
	display: grid;
	gap: 22px;
	margin: 0;
}

.uip-people.is-cols-1 { grid-template-columns: 1fr; }
.uip-people.is-cols-2 { grid-template-columns: repeat(2, 1fr); }
.uip-people.is-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* A lone card left over in the last row (roster count not divisible by the
   column count) spans the row and centers instead of hugging the left edge.
   is-cols-2 (Executive Committee) only ever has exactly one leftover card, so
   this nth-child rule is enough for it — left untouched. */
.uip-people.is-cols-2 .uip-person:last-child:nth-child(odd) {
	grid-column: 1 / -1;
	max-width: calc(50% - 11px);
	justify-self: center;
}
.uip-people.is-cols-4 .uip-person:last-child:nth-child(4n+1) {
	grid-column: 1 / -1;
	max-width: calc(25% - 17px);
	justify-self: center;
}

/* is-cols-3 (Steering Committee) can leave *more* than one card in the last
   row, which the nth-child trick above can't center (it only handles exactly
   one leftover) — flex + justify-content:center handles any remainder, 1–2
   cards, automatically. */
.uip-people.is-cols-3 {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 22px;
}
.uip-people.is-cols-3 .uip-person {
	flex: 0 1 calc(33.333% - 14.667px);
	max-width: calc(33.333% - 14.667px);
}

.uip-person {
	display: flex;
	gap: 18px;
	align-items: flex-start;
	background: #fff;
	border-radius: 16px;
	padding: 22px;
	box-shadow: 0 6px 18px rgba(40, 42, 113, 0.07);
	text-decoration: none;
}

a.uip-person:hover,
a.uip-person:focus-visible {
	box-shadow: 0 12px 30px rgba(40, 42, 113, 0.14);
}

.uip-person-photo {
	flex: none;
	width: 84px;
	height: 84px;
	border-radius: 14px;
	overflow: hidden;
	background: var(--uip-lavender);
	display: flex;
	align-items: center;
	justify-content: center;
}

.uip-person-photo img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* initials stand in for a missing headshot, so an unillustrated roster still
   reads as a roster rather than a row of empty boxes */
.uip-person-initials {
	font-family: var(--font-display);
	font-weight: 800;
	font-size: 24px;
	letter-spacing: 0.02em;
	color: var(--uip-indigo-400);
}

.uip-person-body {
	display: block;
	min-width: 0;
}

.uip-person-role {
	display: block;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--uip-coral);
	margin-bottom: 6px;
}

.uip-person-name {
	display: block;
	font-family: var(--font-display);
	font-weight: 700;
	font-size: 18px;
	line-height: 1.25;
	color: var(--uip-indigo);
}

.uip-person-org {
	display: block;
	font-size: 13.5px;
	line-height: 1.5;
	color: var(--text-muted);
	margin-top: 4px;
}

.uip-person-facts {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 10px;
}

.uip-person-facts .pill {
	font-size: 10px;
	padding: 0.24rem 0.55rem;
	border-width: 1px;
	gap: 0;
}

.uip-person-facts .pill::before {
	display: none;
}

.uip-person-bio {
	display: block;
	font-size: 13.5px;
	line-height: 1.6;
	color: var(--text-body);
	margin-top: 12px;
}

/* Same single breakpoint as the rest of the site. */
@media (max-width: 1080px) {
	.uip-people.is-cols-2,
	.uip-people.is-cols-4 {
		grid-template-columns: 1fr;
	}
	.uip-people.is-cols-3 {
		flex-direction: column;
	}

	/* The lone-card centering rules above set a fractional max-width (50%,
	   25%) for desktop's multi-column grid. Once the grid collapses to a
	   single column here, that same fraction squeezes the card's text
	   column down to almost nothing, wrapping it one letter per line. */
	.uip-people.is-cols-2 .uip-person:last-child:nth-child(odd),
	.uip-people.is-cols-4 .uip-person:last-child:nth-child(4n+1) {
		max-width: none;
	}
	.uip-people.is-cols-3 .uip-person {
		max-width: none;
		flex-basis: auto;
	}
}
