/*
 * TEAM-4: leadership with biographies.
 * A few people, one under another: a portrait, then the name, the role, the
 * letters after the name, the biography and a link to LinkedIn. The portrait
 * stands above the text on a phone. A person without a portrait takes the
 * full width.
 */

/* ---------- The list ---------- */

.wprk-team-4 .wprk-team-4__list > li {
	margin-block: 0;
}

.wprk-team-4 .wprk-team-4__list > li + li {
	border-block-start: 1px solid var(--wprk-border);
	margin-block-start: var(--wp--preset--spacing--50);
	padding-block-start: var(--wp--preset--spacing--50);
}

/* ---------- One person ---------- */

.wprk-team-4 .wprk-team-4__person {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--30);
}

.wprk-team-4 .wprk-team-4__person > * {
	margin: 0;
	min-width: 0;
}

/* Stacked, the portrait keeps a modest size instead of filling the screen. */
.wprk-team-4 .wprk-team-4__person > .wp-block-post-featured-image {
	max-width: 11rem;
	width: 100%;
}

/* A portrait that is taller than its frame keeps its top, so a head is never cut off. */
.wprk-team-4 .wp-block-post-featured-image img {
	object-position: top center;
	width: 100%;
}

.wprk-team-4 .wprk-team-4__body > * {
	margin-block: 0;
}

.wprk-team-4 .wprk-team-4__body > .wp-block-post-title {
	font-size: var(--wp--preset--font-size--x-large);
	line-height: 1.2;
	overflow-wrap: break-word;
}

.wprk-team-4 .wprk-team-4__body > .wprk-team-4__role {
	color: var(--wprk-accent-text);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	line-height: 1.4;
	margin-block-start: var(--wp--preset--spacing--10);
	overflow-wrap: break-word;
}

.wprk-team-4 .wprk-team-4__body > .wprk-team-4__letters {
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.4;
	margin-block-start: 0.15rem;
	overflow-wrap: break-word;
}

/*
 * Front end only: a person without a role or without letters leaves no gap.
 * In the editor the empty field stays in place, so it can still be reached.
 */
.wprk-team-4 .wprk-team-4__body > :where(.wprk-team-4__role, .wprk-team-4__letters):not(.block-editor-block-list__block):empty {
	display: none;
}

/* ---------- The biography ---------- */

/* A readable line length, also when there is no portrait beside the text. */
.wprk-team-4 .wprk-team-4__body > .wp-block-post-content {
	margin-block-start: var(--wp--preset--spacing--30);
	max-width: 44rem;
	overflow-wrap: break-word;
}

.wprk-team-4 .wprk-team-4__body > .wp-block-post-content > * {
	margin-block: 0;
}

.wprk-team-4 .wprk-team-4__body > .wp-block-post-content > * + * {
	margin-block-start: var(--wp--preset--spacing--20);
}

/* ---------- The LinkedIn link ---------- */

.wprk-team-4 .wprk-team-4__body > .wp-block-buttons {
	margin-block-start: var(--wp--preset--spacing--20);
}

/* The text link gets a tap target of full height. */
.wprk-team-4 .wp-block-button.is-style-wprk-text > .wp-block-button__link {
	padding-block: 0.8em;
}

/*
 * Front end only: a person without a LinkedIn address shows no link.
 * In the editor a button never carries an href, so it stays visible there.
 * The second rule covers browsers that do not know :has().
 */
.wprk-team-4 .wprk-team-4__body > .wp-block-buttons:not(.block-editor-block-list__block):not(:has(.wp-block-button__link[href]:not([href=""]))) {
	display: none;
}

.wprk-team-4 .wp-block-button:not(.block-editor-block-list__block) > .wp-block-button__link:not([href]),
.wprk-team-4 .wp-block-button:not(.block-editor-block-list__block) > .wp-block-button__link[href=""] {
	display: none;
}

/* ---------- From a tablet up: the portrait beside the text ---------- */

@media (min-width: 782px) {
	.wprk-team-4 .wprk-team-4__person {
		align-items: flex-start;
		flex-direction: row;
		gap: var(--wp--preset--spacing--50);
	}

	.wprk-team-4 .wprk-team-4__person > .wp-block-post-featured-image {
		flex: 0 0 24%;
		max-width: 16rem;
	}

	.wprk-team-4 .wprk-team-4__body {
		flex: 1 1 0%;
	}
}
