/**
 * Nexus Team Members — [nexus_team_members] frontend styles.
 *
 * Everything is scoped to .nxtm and driven by custom properties so a site can
 * re-skin the section from the shortcode (accent="" / accent_alt="" / columns="")
 * or from theme CSS without touching this file. Deliberately no global resets:
 * the section must never clobber a client theme's typography.
 */

.nxtm {
	--nxtm-accent: #15803d;
	--nxtm-accent-dark: #0e5c2b;
	--nxtm-accent-alt: #fc932c;
	--nxtm-ink: #1f2937;
	--nxtm-muted: #6b7280;
	--nxtm-border: #e5e7eb;
	--nxtm-surface: #ffffff;
	--nxtm-surface-soft: #f3f4f6;
	--nxtm-radius: 14px;
	--nxtm-card-min: 220px;
	--nxtm-gap: 24px;

	/* No container-type here, deliberately: an inline-size query container
	   contributes zero intrinsic width, which collapses the section to a
	   sliver inside auto-width builder wrappers (Elementor flex containers
	   size widgets by content). Responsive behavior uses media queries. */
	width: 100%;

	color: var(--nxtm-ink);
}

.nxtm *,
.nxtm *::before,
.nxtm *::after {
	box-sizing: border-box;
}

.nxtm__sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.nxtm__heading {
	margin: 0 0 24px;
	text-align: center;
	color: var(--nxtm-accent-dark);
}

/* ── Toolbar ─────────────────────────────────────────────────────────────── */

.nxtm__toolbar {
	display: flex;
	flex-direction: column;
	gap: 14px;
	align-items: center;
	margin: 0 0 28px;
}

/* Sticky toolbar (sticky="true"): pins the search + chips below the site
   header while the directory scrolls. --nxtm-sticky-top compensates for a
   fixed/sticky theme header; override it from theme CSS if needed. */
.nxtm--sticky .nxtm__toolbar {
	position: sticky;
	top: var(--nxtm-sticky-top, 120px);
	z-index: 30;
	padding: 14px 16px;
	margin: 0 -16px 28px;
	background: var(--nxtm-sticky-bg, rgba(255, 255, 255, 0.96));
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	border-radius: 16px;
	box-shadow: 0 8px 22px rgba(0, 0, 0, 0.07);
}

.nxtm__search {
	position: relative;
	width: 100%;
	max-width: 420px;
}

.nxtm__search-icon {
	position: absolute;
	top: 50%;
	left: 14px;
	width: 20px;
	height: 20px;
	transform: translateY(-50%);
	fill: var(--nxtm-muted);
	pointer-events: none;
}

.nxtm__search-input {
	width: 100%;
	padding: 12px 40px 12px 42px;
	font-size: 16px;
	line-height: 1.4;
	color: var(--nxtm-ink);
	background: var(--nxtm-surface);
	border: 1px solid var(--nxtm-border);
	border-radius: 999px;
	outline: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	-webkit-appearance: none;
	appearance: none;
}

.nxtm__search-input::-webkit-search-cancel-button {
	-webkit-appearance: none;
	appearance: none;
}

.nxtm__search-input:focus {
	border-color: var(--nxtm-accent);
	box-shadow: 0 0 0 3px rgba(21, 128, 61, 0.15);
}

.nxtm__search-clear {
	position: absolute;
	top: 50%;
	right: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	padding: 0;
	font-size: 20px;
	line-height: 1;
	color: var(--nxtm-muted);
	cursor: pointer;
	background: transparent;
	border: 0;
	border-radius: 50%;
	transform: translateY(-50%);
}

.nxtm__search-clear:hover,
.nxtm__search-clear:focus-visible {
	color: var(--nxtm-ink);
	background: var(--nxtm-surface-soft);
}

.nxtm__filters {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: center;
}

.nxtm__chip {
	padding: 7px 16px;
	font-family: inherit;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.2;
	color: var(--nxtm-ink);
	cursor: pointer;
	background: var(--nxtm-surface-soft);
	border: 1px solid transparent;
	border-radius: 999px;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.nxtm__chip:hover {
	background: #e6e8ea;
}

.nxtm__chip:focus-visible {
	outline: 2px solid var(--nxtm-accent);
	outline-offset: 2px;
}

.nxtm__chip.is-active {
	color: #fff;
	background: var(--nxtm-accent);
}

.nxtm__status {
	margin: -14px 0 20px;
	font-size: 14px;
	color: var(--nxtm-muted);
	text-align: center;
}

/* ── Sections ────────────────────────────────────────────────────────────── */

.nxtm__section {
	padding: 32px 0;
	scroll-margin-top: 90px;
}

.nxtm__section:first-child {
	padding-top: 0;
}

.nxtm__section + .nxtm__section {
	border-top: 1px solid var(--nxtm-border);
}

.nxtm__section[hidden] {
	display: none;
}

.nxtm__section-title {
	margin: 0 0 6px;
	font-size: 30px;
	font-weight: 800;
	line-height: 1.2;
	color: var(--nxtm-accent-dark);
	text-align: center;
}

.nxtm__section-title::after {
	display: block;
	width: 56px;
	height: 4px;
	margin: 12px auto 0;
	content: "";
	background: var(--nxtm-accent-alt);
	border-radius: 2px;
}

.nxtm__section-desc {
	max-width: 720px;
	margin: 14px auto 0;
	font-size: 15px;
	color: var(--nxtm-muted);
	text-align: center;
}

.nxtm__subsection {
	margin-top: 32px;
}

.nxtm__subsection[hidden] {
	display: none;
}

.nxtm__subsection-title {
	margin: 0;
	font-size: 21px;
	font-weight: 800;
	line-height: 1.3;
	color: var(--nxtm-ink);
	text-align: center;
}

/* ── Grid + cards ────────────────────────────────────────────────────────── */

.nxtm__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(var(--nxtm-card-min), 1fr));
	gap: var(--nxtm-gap);
	margin-top: 28px;
}

.nxtm--fixed-cols .nxtm__grid {
	grid-template-columns: repeat(var(--nxtm-columns, 4), minmax(0, 1fr));
}

.nxtm__card {
	padding: 20px;
	text-align: center;
	background: var(--nxtm-surface);
	border: 1px solid var(--nxtm-border);
	border-radius: var(--nxtm-radius);
	transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.nxtm__card:hover {
	box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
	transform: translateY(-2px);
}

.nxtm__card[hidden] {
	display: none;
}

.nxtm__photo {
	width: 150px;
	height: 150px;
	margin: 0 auto 16px;
	overflow: hidden;
	background: var(--nxtm-surface-soft);
	border: 4px solid #ecfdf5;
	border-radius: 50%;
}

.nxtm__photo img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: top center;
}

.nxtm__photo--empty {
	display: flex;
	align-items: center;
	justify-content: center;
}

.nxtm__photo--empty span {
	font-size: 40px;
	font-weight: 800;
	color: var(--nxtm-muted);
}

.nxtm__name {
	margin: 0 0 2px;
	font-size: 18px;
	font-weight: 800;
	line-height: 1.3;
	color: var(--nxtm-ink);
}

.nxtm__role {
	margin: 0;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.4;
	color: var(--nxtm-accent);
}

.nxtm__contact {
	display: flex;
	flex-direction: column;
	gap: 4px;
	align-items: center;
	margin-top: 8px;
}

.nxtm__email,
.nxtm__phone {
	font-size: 13px;
	line-height: 1.4;
	word-break: break-word;
}

.nxtm__linkedin {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	margin-top: 2px;
	color: var(--nxtm-accent);
}

.nxtm__linkedin svg {
	width: 18px;
	height: 18px;
	fill: currentColor;
}

.nxtm__bio {
	margin: 10px 0 0;
	font-size: 13px;
	line-height: 1.6;
	color: var(--nxtm-muted);
}

.nxtm__empty,
.nxtm__no-results {
	padding: 48px 0;
	font-size: 16px;
	color: var(--nxtm-muted);
	text-align: center;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 700px) {
	.nxtm {
		--nxtm-card-min: 150px;
		--nxtm-gap: 14px;
	}

	.nxtm--fixed-cols .nxtm__grid {
		grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	}

	.nxtm__section-title {
		font-size: 24px;
	}

	.nxtm__photo {
		width: 110px;
		height: 110px;
	}

	.nxtm__name {
		font-size: 16px;
	}

	.nxtm__card {
		padding: 14px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.nxtm__card,
	.nxtm__chip,
	.nxtm__search-input {
		transition: none;
	}

	.nxtm__card:hover {
		transform: none;
	}
}
