/**
 * Team Members — frontend styles.
 *
 * Every colour is mixed from currentColor, so the plugin borrows whatever
 * palette the active theme sets and works in light and dark without a second
 * set of rules. Tweak the tokens below to restyle everything at once.
 */

.tm-details,
.tm-grid,
.tm-meta,
.tm-empty,
.tm-pagination {
	--tm-surface: color-mix(in srgb, currentColor 5%, transparent);
	--tm-surface-hover: color-mix(in srgb, currentColor 8%, transparent);
	--tm-border: color-mix(in srgb, currentColor 14%, transparent);
	--tm-border-strong: color-mix(in srgb, currentColor 28%, transparent);
	--tm-muted: color-mix(in srgb, currentColor 62%, transparent);
	--tm-shadow: color-mix(in srgb, currentColor 14%, transparent);

	--tm-gap: clamp(1rem, 2.5vw, 1.75rem);
	--tm-pad: 1.5rem;
	--tm-radius: 14px;
	--tm-photo-ratio: 4 / 4;
}


/* Department chips --------------------------------------------------------- */

/* Terms arrive as plain links; the chip styling is entirely presentational. */

.tm-details__value--terms a {
	border: 1px solid var(--tm-border);
	border-radius: 999px;
	display: inline-block;
	font-size: 0.75em;
	font-weight: 600;
	letter-spacing: 0.02em;
	line-height: 1.6;
	margin: 0 0.25rem 0.25rem 0;
	padding: 0.1rem 0.6rem;
	text-decoration: none;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}


.tm-details__value--terms a:hover {
	background-color: var(--tm-surface);
	border-color: var(--tm-border-strong);
}

/* Shortcode grid ----------------------------------------------------------- */

/**
 * The requested column count is a ceiling, not a promise. Each track is the
 * larger of --tm-col-min and an even 1/N share, so a grid dropped into a narrow
 * container reflows to fewer columns on its own. This reacts to the container's
 * width rather than the viewport's, which a media query cannot do.
 */
.tm-grid {
	--tm-cols: 3;
	--tm-col-min: 230px;

	display: grid;
	gap: var(--tm-gap);
	grid-template-columns: repeat(
		auto-fill,
		minmax(
			max(
				var(--tm-col-min),
				calc((100% - (var(--tm-cols) - 1) * var(--tm-gap)) / var(--tm-cols))
			),
			1fr
		)
	);
	list-style: none;
	margin: 0;
	padding: 0;
	scroll-margin-top: 2rem;
}

.tm-grid--cols-1 { --tm-cols: 1; --tm-col-min: 0; }
.tm-grid--cols-2 { --tm-cols: 2; }
.tm-grid--cols-3 { --tm-cols: 3; }
.tm-grid--cols-4 { --tm-cols: 4; }
.tm-grid--cols-5 { --tm-cols: 5; --tm-col-min: 200px; }
.tm-grid--cols-6 { --tm-cols: 6; --tm-col-min: 180px; }

/* width="full" runs edge to edge, so it needs its own gutters. */
.tm-grid.alignfull {
	padding-inline: clamp(1rem, 4vw, 3rem);
}

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

.tm-card {
	background-color: var(--tm-surface);
	container-type: inline-size;
	border: 1px solid var(--tm-border);
	border-radius: var(--tm-radius);
	display: flex;
	flex-direction: column;
	margin: 0;
	overflow: hidden;
	padding: 0 0 var(--tm-pad);
	text-align: center;
	transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.tm-card:hover {
	border-color: var(--tm-border-strong);
	box-shadow: 0 10px 24px -14px var(--tm-shadow);
	transform: translateY(-3px);
}

/* The photo runs edge to edge; everything else is inset. */
.tm-card > :not(.tm-card__media) {
	padding-inline: var(--tm-pad);
}

.tm-card__media {
	display: block;
	margin: 0 0 var(--tm-pad);
	overflow: hidden;
}

.tm-card__photo {
	aspect-ratio: var(--tm-photo-ratio);
	display: block;
	height: auto;
	object-fit: cover;
	transition: transform 0.4s ease;
	width: 100%;

}

.tm-card:hover .tm-card__photo {
	transform: scale(1.04);
}

/* Stand-in for members with no featured image, so rows stay even. */
.tm-card__media--empty {
	align-items: center;
	aspect-ratio: var(--tm-photo-ratio);
	background-color: var(--tm-surface-hover);
	display: flex;
	justify-content: center;
	text-decoration: none;
}

.tm-card__avatar {
	color: color-mix(in srgb, currentColor 20%, transparent);
	display: block;
	height: auto;
	width: 52%;
}

.tm-card__name {
	font-size: 1.125em;
	font-weight: 600;
	letter-spacing: -0.015em;
	line-height: 1.25;
	margin: 0;
	padding-top: var(--tm-pad);
}

/* With a photo above, the image already provides the breathing room. */
.tm-card__media + .tm-card__name {
	padding-top: 0;
	font-size: 20px;
}

.tm-card__name a {
	color: inherit;
	text-decoration: none!important;
}

.tm-card__name a:hover {
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

.tm-card__designation {
	color: var(--tm-muted);
	font-size: 0.75em;
	font-weight: 600;
	letter-spacing: 0.07em;
	margin: 0.3rem 0 0;
	text-transform: uppercase;
}

/*.tm-card__dept {*/
/*	margin: 0.7rem 0 0;*/
/*}*/

.tm-card__phone {
	color: black;
	font-size: 0.875em;
	font-variant-numeric: tabular-nums;
	margin: 0.6rem 0 0;
}

.tm-card__phone a {
	color: inherit;
	text-decoration: none;
}

.tm-card__phone a:hover {
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

/* Single member details ---------------------------------------------------- */

.tm-details {
	background-color: var(--tm-surface);
	border: 1px solid var(--tm-border);
	border-radius: var(--tm-radius);
	display: grid;
	gap: 0;
	grid-template-columns: max-content 1fr;
	margin: 0 0 1.75rem;
	padding: 0.35rem 1.35rem;
}

.tm-details__label,
.tm-details__value {
	border-top: 1px solid var(--tm-border);
	margin: 0;
	padding: 0.7rem 0;
}

/* No rule above the first pair. */
.tm-details__label:first-of-type,
.tm-details__value:first-of-type {
	border-top: 0;
}

.tm-details__label {
	color: var(--tm-muted);
	font-size: 0.75em;
	font-weight: 600;
	letter-spacing: 0.07em;
	padding-right: 1.75rem;
	text-transform: uppercase;
	/* Nudge the small label onto the value's baseline. */
	padding-top: 0.85rem;
}

/* Archive summary line ----------------------------------------------------- */

.tm-meta {
	align-items: center;
	color: var(--tm-muted);
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0.25rem 0 0.75rem;
}

.tm-meta__designation {
	font-size: 0.75em;
	font-weight: 600;
	letter-spacing: 0.07em;
	text-transform: uppercase;
}

/* Empty state -------------------------------------------------------------- */

.tm-empty {
	border: 1px dashed var(--tm-border-strong);
	border-radius: var(--tm-radius);
	color: var(--tm-muted);
	margin: 0;
	padding: 1.75rem 1.25rem;
	text-align: center;
}

/* Accessibility ------------------------------------------------------------ */

.tm-card a:focus-visible,
.tm-details a:focus-visible,
.tm-meta a:focus-visible {
	border-radius: 4px;
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
	.tm-card,
	.tm-card__photo a {
		transition: none;
	}

	.tm-card:hover {
		transform: none;
	}

	.tm-card:hover .tm-card__photo {
		transform: none;
	}
}

/* Pagination --------------------------------------------------------------- */

.tm-pagination {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	justify-content: center;
	margin-top: clamp(1.5rem, 4vw, 2.5rem);
}

.tm-pagination .page-numbers {
	align-items: center;
	border: 1px solid var(--tm-border);
	border-radius: 8px;
	display: inline-flex;
	font-size: 0.9375em;
	justify-content: center;
	line-height: 1;
	min-width: 2.5rem;
	padding: 0.55rem 0.7rem;
	text-decoration: none;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

.tm-pagination a.page-numbers:hover {
	background-color: var(--tm-surface);
	border-color: var(--tm-border-strong);
}

.tm-pagination .page-numbers.current {
	background-color: var(--tm-surface-hover);
	border-color: var(--tm-border-strong);
	font-weight: 600;
}

/* The ellipsis is a label, not a control. */
.tm-pagination .page-numbers.dots {
	border-color: transparent;
	color: var(--tm-muted);
}

.tm-pagination a.page-numbers:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
	.tm-pagination .page-numbers {
		transition: none;
	}
}
