/**
 * Person Card Component (ontwo/person block)
 *
 * Values taken from the legacy compiled CSS (reference/old-theme/compiled-style.css):
 * .widget + .page-content .person-card + .widget__label + .news__date.
 *
 * The legacy page wrapped its cards in a .flex-grid container. Blocks have no
 * such wrapper, so the grid is put on .page-content itself, scoped with :has()
 * so it only applies on pages that actually carry person cards. Everything else
 * on such a page (headings, paragraphs) spans the full width.
 */

.page-content:has(> .person-card) {
	display: grid;
	grid-template-columns: 1fr 1fr;
	column-gap: 20px;
}

/* Only the cards sit in the two columns. Contact cards run their own identical
   grid (components/contact.css), so they stay in the columns too rather than
   being forced full-width by this rule on a page that mixes both. */
.page-content:has(> .person-card) > *:not(.person-card):not(.contact-person) {
	grid-column: 1 / -1;
}

.page-content .person-card {
	display: flex;
	flex-flow: column nowrap;
	align-items: center;
	margin-bottom: 20px;
	padding: 20px;
	background: var(--color-white);
	border-radius: 8px;
	box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.1);
}

.person-card__name {
	display: block;
	line-height: 50px;
	font-size: 22px;
	font-weight: 500;
	color: var(--color-secondary);
	text-align: left;
	padding: 0 20px;
}

.page-content .person-card__figure {
	flex: 1;
	margin: auto;
	padding-bottom: 15px;
}

/* Imported attachments have no generated sizes and no metadata, so WordPress
   prints width="1" height="1" and serves the full-size file. Size the photo
   here instead of trusting those attributes. */
.person-card__figure img {
	display: block;
	width: auto;
	height: auto;
	max-width: 150px;
}

.person-card__role {
	color: var(--color-red-light);
}

.person-card__text {
	min-width: 250px;
}

@media screen and (max-width: 875px) {
	.page-content:has(> .person-card) {
		grid-template-columns: 1fr;
	}
}
