/*
 * Team page and team member profiles (components C17 and C18).
 * Markup comes from inc/components/team.php and templates/single-nlc_person.html.
 * Motion is one 150ms colour change on a card's panel; nothing zooms or slides.
 */

/* ------------------------------------------------------------ Filter chips */

/* Radio buttons from nlc/team-filter, shown as chips. The inputs are hidden but stay focusable. */
.nlc-team-filter {
	position: relative;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: .5rem;
	min-width: 0;
	margin: 0 0 var(--wp--preset--spacing--50);
	padding: 0;
	border: 0;
}
.nlc-team-filter__input {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
	pointer-events: none;
}
.nlc-team-filter__chip {
	display: inline-flex;
	align-items: center;
	gap: .5rem;
	box-sizing: border-box;
	min-height: 2.75rem;
	padding: .5rem 1.1rem;
	border: 1px solid var(--wp--preset--color--silver);
	border-radius: var(--wp--custom--radius--control);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 500;
	line-height: 1.2;
	cursor: pointer;
	user-select: none;
	transition: background-color var(--nlc-t), border-color var(--nlc-t), color var(--nlc-t);
}
/* On phones the chips sit two to a row, evenly, rather than wrapping raggedly. */
@media (max-width: 600px) {
	.nlc-team-filter { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.nlc-team-filter__chip { justify-content: center; }
}
@media (hover: hover) and (pointer: fine) {
	.nlc-team-filter__chip:hover { border-color: var(--wp--preset--color--copper); }
}
.nlc-team-filter__input:checked + .nlc-team-filter__chip {
	background: var(--wp--preset--color--copper);
	border-color: var(--wp--preset--color--copper);
	color: var(--wp--preset--color--white);
}
.nlc-team-filter__input:focus-visible + .nlc-team-filter__chip { outline: 2px solid var(--wp--preset--color--copper); outline-offset: 3px; }

/* ------------------------------------------------------------------ Groups */

.nlc-team-group + .nlc-team-group { margin-top: var(--wp--preset--spacing--50); }
.nlc-team-group__title {
	margin: 0 0 var(--wp--preset--spacing--40);
	padding-bottom: .75rem;
	border-bottom: 1px solid var(--wp--preset--color--line);
}

/* Four cards a row on desktop, three on tablets, two on large phones; core's own rule gives one a row from 600px down, as on the live site. */
.nlc-team .wp-block-post-template {
	gap: var(--wp--preset--spacing--40);
	margin: 0;
	padding: 0;
	list-style: none;
}
@media (max-width: 1023px) {
	.nlc-team .wp-block-post-template { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
	.nlc-team .wp-block-post-template { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* The closing note sits under the brand's "//" mark, as on live. */
.nlc-team-mark { margin-block: 0 1.25rem; }
.nlc-team-mark img { display: block; width: 50px; height: auto; }
.nlc-team-note { margin-top: 0; text-align: center; }

/* -------------------------------------------------------------------- Card */

/* A square photo with a rounded top over a near-black panel edged in light copper on
   its top and right, as on live. The panels of a row share a height. */
.nlc-person {
	--nlc-person-panel: #1f1e1e;
	--nlc-person-edge: #df9876;
	position: relative;
	display: flex;
	flex-direction: column;
	height: 100%;
}
.nlc-person > *,
.nlc-person__panel > * { margin-block: 0; }
.nlc-person__photo img {
	display: block;
	width: 100%;
	aspect-ratio: 1;
	object-fit: cover;
	background: var(--wp--preset--color--mist);
	border-radius: var(--wp--custom--radius--portrait) var(--wp--custom--radius--portrait) 0 0;
}
.nlc-person__panel {
	flex: 1;
	padding: 1.25rem 1rem 1.5rem;
	border-top: 3px solid var(--nlc-person-edge);
	border-right: 3px solid var(--nlc-person-edge);
	background: var(--nlc-person-panel);
	color: var(--wp--preset--color--white);
	text-align: center;
	transition: background-color var(--nlc-t), color var(--nlc-t);
}
.nlc-person__panel > * + * { margin-top: .4rem; }

.nlc-person__name {
	font-size: var(--wp--preset--font-size--medium);
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: .04em;
	text-transform: uppercase;
	text-wrap: balance;
}
.nlc-person__role { font-size: var(--wp--preset--font-size--small); font-weight: 600; line-height: 1.4; }
.nlc-person__label { margin-top: 1rem !important; font-size: var(--wp--preset--font-size--small); }
.nlc-person__previous { font-size: var(--wp--preset--font-size--x-small); line-height: 1.5; }
/* No firms on record: no label either. */
.nlc-person__label:has(+ .nlc-person__previous:empty),
.nlc-person__previous:empty { display: none; }

/* The name is the card's one link, stretched over the whole card. */
.nlc-person__name a { display: inline-block; padding-block: .3rem; margin-block: -.3rem; color: inherit; text-decoration: none; }
.nlc-person__name a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.nlc-person__name a:hover { color: inherit; }
.nlc-person__name a:focus-visible { outline: none; }
.nlc-person__name a:focus-visible::after {
	outline: 2px solid var(--wp--preset--color--copper);
	outline-offset: 3px;
	border-radius: var(--wp--custom--radius--portrait) var(--wp--custom--radius--portrait) 0 0;
}

/* Hover: a hint of copper in the panel; white text stays above 10:1. */
@media (hover: hover) and (pointer: fine) {
	.nlc-person:hover .nlc-person__panel { background: color-mix(in srgb, var(--nlc-person-panel) 82%, var(--wp--preset--color--copper)); }
}

/* Two a row on large phones: a tighter panel. */
@media (min-width: 601px) and (max-width: 767px) {
	.nlc-person__panel { padding: 1rem .6rem 1.25rem; }
	.nlc-person__name { font-size: var(--wp--preset--font-size--small); letter-spacing: .02em; }
	.nlc-person__role { font-size: var(--wp--preset--font-size--x-small); }
}

/* ----------------------------------------------------------------- Profile */

.nlc-bio-page .nlc-bio__back { max-width: 70rem; margin-bottom: var(--wp--preset--spacing--30); }
.nlc-bio__back a {
	display: inline-block;
	padding-block: .75rem;
	color: var(--wp--preset--color--copper);
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 600;
	letter-spacing: var(--wp--custom--tracking--label);
	text-transform: uppercase;
	text-decoration: none;
	transition: color var(--nlc-t);
}
.nlc-bio__back a::before { content: "«\00a0"; content: "«\00a0" / ""; }
.nlc-bio__back a:hover { color: var(--wp--preset--color--copper-deep); }

/* Live's profile: the photo with the name, role and contact lines beside it, and the
   biography full width below. On phones it all stacks. */
.nlc-bio-page > .alignwide { max-width: 70rem; }
.nlc-bio { gap: var(--wp--preset--spacing--40); margin: 0; }
.nlc-bio__photo { margin: 0; }
.nlc-bio__photo img {
	display: block;
	width: 100%;
	aspect-ratio: 1;
	object-fit: cover;
	background: var(--wp--preset--color--line);
	border-radius: var(--wp--custom--radius--portrait) 0 0 0;
}
@media (min-width: 782px) {
	.nlc-bio__main { padding-top: var(--wp--preset--spacing--50); }
}
.nlc-bio__main > * { margin-block: 0; }
.nlc-bio__name { font-weight: 600; letter-spacing: .04em; }
.nlc-bio__main > .nlc-bio__role { margin-top: .35rem; }
.nlc-bio__main > .is-style-copper { margin-top: 1rem; }
.nlc-bio__main > .nlc-bio__contact { margin-top: 1rem; }

/* Contact: "E:" and "T:" before each link; a line with no value is not shown. */
.nlc-bio__contact { display: grid; gap: .25rem; font-size: var(--wp--preset--font-size--small); }
.nlc-bio__line { display: flex; gap: .4em; align-items: baseline; margin: 0; }
.nlc-bio__line > * { margin: 0; }
.nlc-bio__line:has(.nlc-bio__value:empty) { display: none; }
.nlc-bio__label { font-weight: 700; }
.nlc-bio__label abbr { text-decoration: none; }
.nlc-bio__value { min-width: 0; overflow-wrap: anywhere; }
/* Each link is at least 24px tall to tap, 44px on touch screens (the margin keeps the rows where they were). */
.nlc-bio__value a { display: inline-block; min-height: 1.5rem; line-height: 1.6; text-underline-offset: .2em; transition: color var(--nlc-t); }
@media (pointer: coarse) {
	.nlc-bio__value a { padding-block: .625rem; margin-block: -.625rem; }
}

.nlc-bio-page .nlc-bio__text { margin-top: var(--wp--preset--spacing--50); }
.nlc-bio__text > * { margin-block: 0; }
/* Doubled up to beat the page-content reset in theme.css (.nlc-main > .wp-block-post-content). */
.nlc-bio__text.wp-block-post-content > * + * { margin-top: 1em; }
@media (min-width: 782px) {
	.nlc-bio__text { text-align: justify; }
}
