/*
 * A person's own page: templates/single-wprk_team.html.
 * The frame (title bar, two columns, the card at the side) comes from base.css,
 * and the people under the page are drawn as TEAM-1 draws them. This file
 * sets the role under the name and the card: the portrait, then the
 * department, the qualifications, the phone number and the email address from
 * the person's own details (Content Creation Kit, shortcode [wprk_person]),
 * and a link to their LinkedIn profile. A detail a person does not have is
 * left out, label and all. A person with no portrait and no details has no
 * card, and the words take the page.
 */

/* ---------- The role under the name ---------- */

.wprk-titlebar .wprk-single-person__role > * {
	margin: 0;
}

/* ---------- The card ---------- */

.wprk-single-person .wprk-single-person__card {
	display: grid;
	gap: var(--wp--preset--spacing--40);
	grid-template-columns: minmax(0, 1fr);
}

.wprk-single-person .wprk-single-person__card > * {
	margin: 0;
	min-width: 0;
}

/* A portrait that is taller than its frame keeps its top, so a head is never cut off. */
.wprk-single-person .wprk-single-person__photo {
	max-width: 14rem;
}

.wprk-single-person .wprk-single-person__photo img {
	border-radius: var(--wprk-picture-radius, var(--wp--custom--radius--md));
	object-position: top center;
	width: 100%;
}

.wprk-single-person .wprk-single-person__facts {
	display: grid;
	gap: var(--wp--preset--spacing--30);
}

.wprk-single-person .wprk-single-person__facts > *,
.wprk-single-person .wprk-single-person__fact > * {
	margin: 0;
	min-width: 0;
}

/* The small label, and the detail under it: a long qualification or address has the whole line. */
.wprk-single-person .wprk-single-person__label {
	color: var(--wprk-muted);
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.4;
}

.wprk-single-person :where(.wprk-person__department, .wprk-person__qualifications, .wprk-person__phone, .wprk-person__email) {
	color: var(--wprk-heading);
	line-height: 1.45;
	overflow-wrap: anywhere;
}

.wprk-single-person :where(.wprk-person__phone, .wprk-person__email) {
	font-variant-numeric: lining-nums tabular-nums;
}

/* A tap target of full height for the number and the address. */
.wprk-single-person :where(a.wprk-person__phone, a.wprk-person__email) {
	display: inline-block;
	padding-block: 0.55rem;
	text-decoration-color: var(--wprk-accent);
	text-underline-offset: 0.25em;
}

.wprk-single-person :where(a.wprk-person__phone, a.wprk-person__email):hover {
	text-decoration-color: currentColor;
}

/* A link brings room of its own over and under its words: the label sits close over it, and the next detail close under it. */
.wprk-single-person .wprk-single-person__fact:has(> a) > .wprk-single-person__label {
	margin-block-end: -0.3rem;
}

.wprk-single-person .wprk-single-person__fact:has(> a):not(:last-child) {
	margin-block-end: -0.4rem;
}

/* The link to the person's LinkedIn profile, when they have one: a tap target of full height. */
.wprk-single-person .wprk-single-person__links .wp-block-button.is-style-wprk-text > .wp-block-button__link {
	padding-block: 0.6em;
}

/* It follows the details closely: they are one list. */
.wprk-single-person .wprk-single-person__facts + .wprk-single-person__links {
	margin-block-start: calc(var(--wp--preset--spacing--20) * -1);
}

/* ---------- Where the card stands ---------- */

/* Until the two columns: the card comes first, then the words about the person. */
@media (max-width: 959px) {
	.wprk-single-person .wprk-split__side {
		order: -1;
	}
}

/* A tablet has room for the portrait beside the details. */
@media (min-width: 600px) and (max-width: 959px) {
	.wprk-single-person .wprk-single-person__card:has(> .wprk-single-person__photo) {
		align-items: start;
		grid-template-columns: 12rem minmax(0, 1fr);
	}

	.wprk-single-person .wprk-single-person__photo {
		max-width: none;
	}
}

/* In the side column the portrait is as wide as the card. */
@media (min-width: 960px) {
	.wprk-single-person .wprk-single-person__photo {
		max-width: none;
	}
}

/* No portrait and no details: no card, and the words keep a line that reads well. */
.wprk-single-person .wprk-split:not(:has(> .wprk-split__side)) {
	grid-template-columns: minmax(0, 1fr);
}

.wprk-single-person .wprk-split:not(:has(> .wprk-split__side)) > .wprk-split__main {
	max-width: 46rem;
}

@media (prefers-reduced-motion: no-preference) {
	.wprk-single-person :where(a.wprk-person__phone, a.wprk-person__email) {
		transition: text-decoration-color 0.18s ease;
	}
}
