/* ── Team Members – front-end styles ─────────────────────────────────────── */

/* ── Grid container ────────────────────────────────────────────────────────── */

.tm-grid {
	display: grid;
	/* --tm-columns is set inline by the shortcode so any column count works */
	grid-template-columns: repeat(var(--tm-columns, 4), 1fr);
	gap: 2rem;
	margin: 2rem 0;
	padding: 0;
	list-style: none;
}

/* Tablet: cap at 2 columns regardless of the shortcode value */
@media (max-width: 900px) {
	.tm-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

/* Mobile: single-column stack */
@media (max-width: 480px) {
	.tm-grid {
		grid-template-columns: 1fr;
	}
}

/* ── Card ─────────────────────────────────────────────────────────────────── */

.tm-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	background: #ffffff;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	padding: 1.75rem 1.25rem 1.5rem;
	box-sizing: border-box;
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.tm-card:hover {
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.09);
	transform: translateY(-3px);
}

/* ── Photo ────────────────────────────────────────────────────────────────── */

.tm-card__photo {
	margin-bottom: 1.1rem;
}

.tm-card__img {
	display: block;
	width: 110px;
	height: 110px;
	border-radius: 50%;
	object-fit: cover;
	/* Ensure WP's responsive images fill the circle */
	max-width: none;
}

/* SVG placeholder when no featured image is set */
.tm-card__img--placeholder {
	width: 110px;
	height: 110px;
	border-radius: 50%;
	background-color: #e5e7eb;
	display: flex;
	align-items: center;
	justify-content: center;
}

.tm-card__img--placeholder svg {
	width: 56px;
	height: 56px;
	fill: #9ca3af;
}

/* ── Card body ────────────────────────────────────────────────────────────── */

.tm-card__body {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.35rem;
	width: 100%;
}

.tm-card__name {
	font-size: 1.075rem;
	font-weight: 700;
	line-height: 1.3;
	margin: 0;
}

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

.tm-card__name a:hover,
.tm-card__name a:focus {
	text-decoration: underline;
}

.tm-card__role {
	font-size: 0.85rem;
	color: #6b7280;
	font-style: italic;
	margin: 0;
}

.tm-card__description {
	font-size: 0.875rem;
	color: #374151;
	line-height: 1.55;
	margin: 0.4rem 0 0;
}

/* ── Social links ─────────────────────────────────────────────────────────── */

.tm-card__social {
	display: flex;
	gap: 0.45rem;
	flex-wrap: wrap;
	justify-content: center;
	list-style: none;
	margin: 0.8rem 0 0;
	padding: 0;
}

.tm-social-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background-color: #f3f4f6;
	color: #374151;
	transition: background-color 0.15s ease, color 0.15s ease;
	text-decoration: none;
}

.tm-social-link:hover,
.tm-social-link:focus {
	background-color: #1d4ed8;
	color: #ffffff;
	outline: none;
}

.tm-social-link:focus-visible {
	box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.4);
}

.tm-social-link svg {
	width: 17px;
	height: 17px;
	display: block;
	pointer-events: none;
}

/* ── Single-member detail page ────────────────────────────────────────────── */

.tm-single {
	max-width: 780px;
	margin: 2.5rem auto;
	padding: 0 1.25rem;
}

.tm-single__header {
	display: flex;
	align-items: flex-start;
	gap: 2rem;
	margin-bottom: 2rem;
}

.tm-single__photo img {
	display: block;
	width: 150px;
	height: 150px;
	border-radius: 50%;
	object-fit: cover;
	flex-shrink: 0;
}

.tm-single__info {
	flex: 1;
}

.tm-single__name {
	font-size: 2rem;
	font-weight: 700;
	line-height: 1.25;
	margin: 0 0 0.3rem;
}

.tm-single__role {
	font-size: 1rem;
	color: #6b7280;
	font-style: italic;
	margin: 0 0 0.75rem;
}

.tm-single__social {
	display: flex;
	flex-wrap: wrap;
	gap: 0.45rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.tm-single__bio {
	font-size: 1rem;
	line-height: 1.75;
	color: #374151;
}

.tm-single__back {
	display: inline-block;
	margin-top: 2rem;
	font-size: 0.9rem;
	color: #1d4ed8;
	text-decoration: none;
}

.tm-single__back:hover {
	text-decoration: underline;
}

/* Responsive adjustments for the detail page */
@media (max-width: 600px) {
	.tm-single__header {
		flex-direction: column;
		align-items: center;
		text-align: center;
	}

	.tm-single__social {
		justify-content: center;
	}
}
