/* TEAM-1: team grid. Quiet cards: photo, name, role. */

.wprk-team-1 .wprk-team-1__card > * {
	margin-block: 0;
}

/*
 * Portraits: when a photo is taller than its frame, the frame keeps the top of
 * the photo, so a head is never cut off. To show a photo whole, set the image's
 * aspect ratio to the shape of the photos (2/3 for most studio portraits).
 */
.wprk-team-1 .wprk-team-1__card > .wp-block-post-featured-image img {
	object-position: top center;
	width: 100%;
}

/* A person without a photo gets a calm block of the same shape, so the rows stay level. */
.wprk-team-1 .wprk-team-1__card:not(:has(.wp-block-post-featured-image))::before {
	aspect-ratio: 4 / 5;
	background-color: var(--wprk-soft);
	border-radius: var(--wp--custom--radius--md);
	content: "";
	display: block;
}

.wprk-team-1 .wprk-team-1__card > .wp-block-post-title {
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.25;
	margin-block-start: var(--wp--preset--spacing--30);
	overflow-wrap: break-word;
}

.wprk-team-1 .wprk-team-1__card > p {
	line-height: 1.45;
	margin-block-start: 0.25rem;
	overflow-wrap: break-word;
}

/* A person without a role leaves no gap. */
.wprk-team-1 .wprk-team-1__card > p:empty {
	display: none;
}

/*
 * Phones: two people side by side, which halves the scrolling.
 * From 600px up the columns follow the minimum width set on the block.
 */
@media (max-width: 599px) {
	.wprk-team-1 .wp-block-post-template.wprk-cards {
		gap: var(--wp--preset--spacing--40) var(--wp--preset--spacing--30);
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.wprk-team-1 .wprk-team-1__card > .wp-block-post-title {
		font-size: var(--wp--preset--font-size--medium);
		margin-block-start: var(--wp--preset--spacing--20);
	}

	.wprk-team-1 .wprk-team-1__card > p {
		font-size: var(--wp--preset--font-size--small);
	}
}
