/**
 * TMC Team Grid — frontend CSS.
 *
 * Style variants on `<div class="tmc-team-grid tmc-team-grid--<variant>">`:
 *   - classic  — photo on top, meta stacked below
 *   - circle   — round portrait centered, name / role below
 *   - profile  — photo left, meta right
 *   - minimal  — text-only list, no photo
 */

.tmc-team-grid {
	--tmc-team-cols: 3;
	display: grid;
	grid-template-columns: repeat( var( --tmc-team-cols ), minmax( 0, 1fr ) );
	gap: 24px;
}
.tmc-team-grid__empty {
	margin: 0;
	padding: 24px;
	text-align: center;
	color: #646970;
	border: 1px dashed #dcdcde;
	border-radius: 6px;
	background: #f6f7f7;
}
@media ( max-width: 900px ) {
	.tmc-team-grid {
		grid-template-columns: repeat( min( var( --tmc-team-cols ), 2 ), minmax( 0, 1fr ) );
	}
}
@media ( max-width: 560px ) {
	.tmc-team-grid { grid-template-columns: 1fr; }
}

/* ── Card (shared base) ───────────────────────────────────────────── */

.tmc-team-card {
	/* Set here, read by the parts below, and replaced by the Alignment and
	   Photo width / Aspect ratio controls (the layout styles set their own). */
	--tmc-team-align: flex-start;
	--tmc-team-photo-w: 100%;
	--tmc-team-photo-ratio: 1 / 1;
	background: #fff;
	border: 1px solid #e4e4e7;
	border-radius: 8px;
	padding: 20px;
	min-width: 0;
	height: 100%;
	display: flex;
	flex-direction: column;
	transition: background-color 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.tmc-team-card__inner {
	display: flex;
	flex-direction: column;
	gap: 12px;
	flex: 1;
	min-width: 0;
}
/* Spacing between the name, role, bio and contact is each element's own
   bottom margin, so each "Spacing below" control replaces exactly one. */
.tmc-team-card__body {
	display: flex;
	flex-direction: column;
	min-width: 0;
	flex: 1;
}
.tmc-team-card__body > * {
	margin: 0 0 6px;
}
.tmc-team-card__body > :last-child {
	margin-bottom: 0;
}

/* Photo */
.tmc-team-card__photo-wrap {
	flex-shrink: 0;
	width: var( --tmc-team-photo-w );
	max-width: 100%;
	align-self: var( --tmc-team-align );
}
.tmc-team-card__photo {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: var( --tmc-team-photo-ratio );
	object-fit: cover;
	object-position: center top;
	border-radius: 6px;
	background: #f6f7f7;
	transition: opacity 0.3s, filter 0.3s;
}
.tmc-team-card__photo--initials {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 1.8em;
	font-weight: 600;
	letter-spacing: 0.02em;
	color: #1d2327;
	background: linear-gradient(
		135deg,
		rgba( 34, 113, 177, 0.15 ) 0%,
		rgba( 34, 113, 177, 0.35 ) 100%
	);
}

/* Text */
.tmc-team-card__name {
	font-size: 1.1em;
	line-height: 1.3;
	color: #1d2327;
}
.tmc-team-card__name a {
	color: inherit;
	text-decoration: none;
}
.tmc-team-card__name a:hover,
.tmc-team-card__name a:focus {
	text-decoration: underline;
}
.tmc-team-card__role {
	font-size: 0.9em;
	font-weight: 600;
	color: #2271b1;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}
.tmc-team-card__excerpt {
	padding-top: 4px;
	font-size: 0.95em;
	color: #3c434a;
	line-height: 1.55;
}

/* Contact */
.tmc-team-card__contact {
	font-size: 0.9em;
	color: #646970;
}
.tmc-team-card__contact a {
	color: inherit;
	text-decoration: none;
}
.tmc-team-card__contact a:hover,
.tmc-team-card__contact a:focus {
	text-decoration: underline;
}

/* Socials */
.tmc-team-card__socials {
	display: flex;
	flex-wrap: wrap;
	justify-content: var( --tmc-team-align );
	gap: 10px;
	margin-top: auto;   /* pin to bottom so cards align across the grid */
	padding-top: 8px;
}
.tmc-team-card__social {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2em;
	height: 2em;
	color: #646970;
	font-size: 16px;
	text-decoration: none;
	border-radius: 50%;
	transition: color 0.15s, background 0.15s;
}
/* Inline SVG icon: sized by the link's font-size (the widget's Icon size
   control) and coloured by its color (Colour / Hover colour controls). */
.tmc-team-card__social-icon {
	display: block;
	width: 1em;
	height: 1em;
}
.tmc-team-card__social:hover,
.tmc-team-card__social:focus {
	color: #2271b1;
}
/* Keyboard focus keeps a ring (border audit, Oct 2026): the colour change
   was the only sign of focus. Drawn in the link colour unless the Social
   links section's Keyboard focus outline sets one; a mouse click shows none. */
.tmc-team-card__social:focus:not(:focus-visible) {
	outline: none;
}
.tmc-team-card__social:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* ── Variant: Circle ──────────────────────────────────────────────── */

.tmc-team-grid--circle .tmc-team-card {
	--tmc-team-align: center;
	--tmc-team-photo-w: 120px;
}
.tmc-team-grid--circle .tmc-team-card__inner {
	text-align: center;
}
.tmc-team-grid--circle .tmc-team-card__photo {
	border-radius: 50%;
}

/* ── Variant: Profile (photo left, meta right) ────────────────────── */

.tmc-team-grid--profile .tmc-team-card {
	--tmc-team-photo-w: 120px;
}
.tmc-team-grid--profile .tmc-team-card__inner {
	flex-direction: row;
	align-items: flex-start;
	gap: 18px;
}
.tmc-team-grid--profile .tmc-team-card__photo-wrap {
	flex: 0 0 auto;
	align-self: flex-start;
}

/* ── Variant: Minimal (no photo, no card) ─────────────────────────── */

/* No line under the cards: that is the widget's Divider control. A built-in
   border-bottom here could not be removed from the editor, and :last-child
   only spared the final card, not the bottom row of a grid (Oct 2026). */
.tmc-team-grid--minimal .tmc-team-card {
	background: transparent;
	border: none;
	border-radius: 0;
	padding: 14px 0;
	height: auto;
}
.tmc-team-grid--minimal .tmc-team-card__photo-wrap {
	display: none;
}
