/*
 * TEAM-6: directory cards.
 * Everyone by name, each on a card: a small portrait, the name, the role and
 * the department, then a direct phone number and an email address from the
 * person's own details (Content Creation Kit, shortcode [wprk_person]). A
 * detail a person does not have is left out, label and all. One card across
 * on a phone, two on a tablet, three on a desktop.
 */

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

.wprk-team-6 .wprk-team-6__list {
	display: grid;
	gap: var(--wp--preset--spacing--30);
	grid-template-columns: minmax(0, 1fr);
	list-style: none;
	margin: 0;
	padding: 0;
}

.wprk-team-6 .wprk-team-6__list > li {
	display: flex;
	margin: 0;
	min-width: 0;
}

/* ---------- One card ---------- */

/* Cards of one line are equally tall. */
.wprk-team-6 .wprk-team-6__card {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: var(--wp--preset--spacing--30);
	min-width: 0;
}

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

/* The portrait beside the name. */
.wprk-team-6 .wprk-team-6__who {
	align-items: center;
	display: flex;
	gap: var(--wp--preset--spacing--30);
}

.wprk-team-6 .wprk-team-6__who > * {
	margin: 0;
	min-width: 0;
}

.wprk-team-6 .wprk-team-6__who > .wprk-team-6__photo {
	flex: 0 0 4.5rem;
	width: 4.5rem;
}

/* A portrait that is taller than its frame keeps its top, so a head is never cut off. */
.wprk-team-6 .wprk-team-6__photo img {
	border-radius: var(--wprk-picture-radius, var(--wp--custom--radius--md));
	object-position: top center;
	width: 100%;
}

.wprk-team-6 .wprk-team-6__name {
	flex: 1 1 0%;
}

.wprk-team-6 .wprk-team-6__name > * {
	margin-block: 0;
}

.wprk-team-6 .wprk-team-6__name > .wp-block-post-title {
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.25;
	overflow-wrap: break-word;
}

.wprk-team-6 .wprk-team-6__name > .wprk-team-6__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;
}

/* Front end only: a person without a role leaves no gap. In the editor the empty field stays, so it can be reached. */
.wprk-team-6 .wprk-team-6__name > .wprk-team-6__role:not(.block-editor-block-list__block):empty {
	display: none;
}

.wprk-team-6 .wprk-team-6__name > .wprk-team-6__dept {
	color: var(--wprk-muted);
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.4;
	margin-block-start: 0.15rem;
	overflow-wrap: break-word;
}

.wprk-team-6 .wprk-team-6__dept > * {
	margin: 0;
}

/* ---------- Phone and email ---------- */

.wprk-team-6 .wprk-team-6__card > .wprk-team-6__reach {
	border-block-start: 1px solid var(--wprk-border);
	display: grid;
	gap: 0;
	padding-block-start: var(--wp--preset--spacing--10);
}

.wprk-team-6 .wprk-team-6__reach > * {
	margin: 0;
	min-width: 0;
}

/* The small label, then the detail on the same line. */
.wprk-team-6 .wprk-team-6__fact {
	align-items: baseline;
	column-gap: var(--wp--preset--spacing--20);
	display: grid;
	grid-template-columns: 3.75rem minmax(0, 1fr);
}

.wprk-team-6 .wprk-team-6__fact > * {
	margin: 0;
	min-width: 0;
}

.wprk-team-6 .wprk-team-6__label {
	color: var(--wprk-muted);
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.4;
}

.wprk-team-6 :where(.wprk-person__phone, .wprk-person__email) {
	color: var(--wprk-heading);
	font-variant-numeric: lining-nums tabular-nums;
	line-height: 1.4;
	overflow-wrap: anywhere;
}

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

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

/* A number that cannot be dialled is plain words: it keeps the height of a link. */
.wprk-team-6 :where(span.wprk-person__phone) {
	display: inline-block;
	padding-block: 0.7rem;
}

/*
 * Side by side, the cards of one line share their two rows: the names in the
 * first, the phone and email in the second. The hairline over the phone then
 * stands at one height across the line, however long a name or a department
 * runs. A browser that does not know subgrid keeps cards of equal height.
 */
@supports (grid-template-rows: subgrid) {
	.wprk-team-6 .wprk-team-6__list > li,
	.wprk-team-6 .wprk-team-6__card {
		display: grid;
		grid-row: span 2;
		grid-template-rows: subgrid;
		row-gap: var(--wp--preset--spacing--30);
	}

	.wprk-team-6 .wprk-team-6__list > li {
		grid-template-columns: minmax(0, 1fr);
	}

	.wprk-team-6 .wprk-team-6__card > .wprk-team-6__who {
		align-self: start;
	}

	.wprk-team-6 .wprk-team-6__card > .wprk-team-6__reach {
		align-self: start;
	}
}

/* ---------- Wider screens ---------- */

@media (min-width: 700px) {
	.wprk-team-6 .wprk-team-6__list {
		gap: var(--wp--preset--spacing--40);
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 1100px) {
	.wprk-team-6 .wprk-team-6__list {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

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