/**
 * upcomer/team-member-grid
 *
 * Editorial masthead. Full-bleed dark canvas, a header band sandwiched between
 * two hairline rules (title + subtitle on the left, accent CTA on the right),
 * then a 4 / 2 / 1-col grid of portrait cards. Photos get a unified treatment
 * (slight desaturation + dim) so a roster of mismatched headshots reads as a
 * single set.
 *
 * No-new-colors compliance (CLAUDE.md → Design conventions):
 *  - `--team-canvas-bg` defaults to `#0a0a0a` — same dark surface shared with
 *    page-hero-intro and feature-module-with-tags. Editor-overridable via the
 *    `background_color` Color Picker.
 *  - `--team-accent` defaults to `#c81e1e` — same red shared with
 *    highlight-card-row. Editor-overridable via the `accent_color` Color
 *    Picker.
 *  - White / muted-white text on the dark canvas — minimal text-contrast
 *    constants, not brand additions.
 *  - All hairlines and muted text derive from `currentColor` via `color-mix`.
 */

.upcomer-block--team-member-grid {
	/* Surfaces */
	--team-canvas-bg: #0a0a0a;

	/* Foreground */
	--team-fg: #ffffff;
	--team-fg-muted: color-mix(in srgb, currentColor 60%, transparent);
	--team-fg-subtle: color-mix(in srgb, currentColor 75%, transparent);

	/* Accent — editor-overridable */
	--team-accent: #c81e1e;
	--team-accent-fg: #ffffff;
	--team-accent-hover: color-mix(in srgb, var(--team-accent) 85%, #000);

	/* Hairlines */
	--team-rule: color-mix(in srgb, currentColor 14%, transparent);
	--team-rule-strong: color-mix(in srgb, currentColor 22%, transparent);

	/* Photo treatment — applied to all portraits so a roster of mismatched
	   headshots reads as a single set. */
	--team-portrait-filter: grayscale(0.2) contrast(0.95) brightness(0.92);
	--team-portrait-bg: color-mix(in srgb, currentColor 6%, transparent);

	/* Geometry */
	--team-grid-gap-x: clamp(1.25rem, 2.25vw, 2rem);
	--team-grid-gap-y: clamp(2rem, 4vw, 3rem);
	--team-card-photo-gap: clamp(1rem, 1.75vw, 1.5rem);

	/* Shared content column with the rest of the site (matches gamurs footer). */
	--page-hero-content-max: calc(1px * var(--wp--custom--bottom-nav--container--desktop--max-width, 1200));

	background: var(--team-canvas-bg);
	color: var(--team-fg);
	padding-block: clamp(3rem, 7vw, 5.5rem);
	margin: 0;
	box-sizing: border-box;
}

.upcomer-block--team-member-grid *,
.upcomer-block--team-member-grid *::before,
.upcomer-block--team-member-grid *::after {
	box-sizing: border-box;
}

/* ---- Content column --------------------------------------------------- */

.upcomer-block--team-member-grid .upcomer-block__inner {
	max-width: var(--page-hero-content-max);
	margin-inline: auto;
}

@media (min-width: 992px) and (max-width: 1248px) {
	.upcomer-block--team-member-grid .upcomer-block__inner {
		max-width: calc(1px * var(--wp--custom--bottom-nav--container--latpop--max-width, 1200));
	}
}

@media (max-width: 991px) {
	.upcomer-block--team-member-grid .upcomer-block__inner {
		max-width: calc(1px * var(--wp--custom--bottom-nav--container--mobile--max-width, 720));
		/* Match the gamurs site-wide mobile gutter (theme.css uses 15px). */
		padding-inline: 15px;
	}
}

/* ---- Header band ------------------------------------------------------ */

.upcomer-block--team-member-grid .team-grid__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: clamp(1rem, 3vw, 2.5rem);
	padding-block: clamp(1.25rem, 2.25vw, 2rem);
	margin-block-end: clamp(2rem, 4.5vw, 3.5rem);
	border-block: 1px solid var(--team-rule);
}

@media (max-width: 599px) {
	.upcomer-block--team-member-grid .team-grid__header {
		flex-direction: column;
		align-items: flex-start;
		gap: 1.25rem;
	}
}

.upcomer-block--team-member-grid .team-grid__title-block {
	display: flex;
	flex-direction: column;
	gap: 0.375rem;
	min-width: 0;
}

.upcomer-block--team-member-grid .team-grid__title {
	margin: 0;
	font-family: "Barlow Condensed", "Barlow", "Helvetica Neue", system-ui, sans-serif;
	font-size: clamp(1.5rem, 2.75vw, 2.25rem);
	font-weight: 700;
	line-height: 1;
	letter-spacing: 0.005em;
	text-transform: uppercase;
	color: var(--team-fg);
}

.upcomer-block--team-member-grid .team-grid__subtitle {
	margin: 0;
	font-family: "Barlow", "Helvetica Neue", system-ui, sans-serif;
	font-size: 0.9375rem;
	font-weight: 400;
	line-height: 1.4;
	color: var(--team-fg-muted);
	max-width: 56ch;
}

/* ---- CTA button ------------------------------------------------------- */

.upcomer-block--team-member-grid .team-grid__cta {
	display: inline-flex;
	align-items: center;
	gap: 0.625rem;
	padding: 0.875rem 1.25rem;
	background: var(--team-accent);
	color: var(--team-accent-fg);
	font-family: "Barlow", "Helvetica Neue", system-ui, sans-serif;
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	line-height: 1;
	text-transform: uppercase;
	text-decoration: none;
	border-radius: 0;
	white-space: nowrap;
	transition: background-color 180ms ease, transform 180ms ease;
}

.upcomer-block--team-member-grid .team-grid__cta:hover,
.upcomer-block--team-member-grid .team-grid__cta:focus-visible {
	background: var(--team-accent-hover);
	color: var(--team-accent-fg);
	transform: translateY(-1px);
}

.upcomer-block--team-member-grid .team-grid__cta:focus-visible {
	outline: 2px solid var(--team-accent-fg);
	outline-offset: 2px;
}

.upcomer-block--team-member-grid .team-grid__cta-chevron {
	width: 14px;
	height: 14px;
	flex-shrink: 0;
}

/* ---- Grid ------------------------------------------------------------- */

.upcomer-block--team-member-grid .team-grid {
	display: grid;
	gap: var(--team-grid-gap-y) var(--team-grid-gap-x);
	margin: 0;
	padding: 0;
	list-style: none;
	align-items: stretch;
}

.upcomer-block--team-member-grid .team-grid--cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.upcomer-block--team-member-grid .team-grid--cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 991px) {
	.upcomer-block--team-member-grid .team-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 599px) {
	.upcomer-block--team-member-grid .team-grid {
		grid-template-columns: minmax(0, 1fr);
	}
}

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

.upcomer-block--team-member-grid .team-grid__card {
	display: flex;
	flex-direction: column;
	gap: var(--team-card-photo-gap);
	margin: 0;
	min-width: 0;
}

/* ---- Portrait --------------------------------------------------------- */

.upcomer-block--team-member-grid .team-grid__portrait {
	position: relative;
	aspect-ratio: 1 / 1;
	width: 100%;
	overflow: hidden;
	background: var(--team-portrait-bg);
	display: flex;
	align-items: center;
	justify-content: center;
}

.upcomer-block--team-member-grid .team-grid__portrait img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	filter: var(--team-portrait-filter);
	transition: filter 320ms ease, transform 420ms ease;
}

.upcomer-block--team-member-grid .team-grid__card:hover .team-grid__portrait img,
.upcomer-block--team-member-grid .team-grid__card:focus-within .team-grid__portrait img {
	filter: grayscale(0) contrast(1) brightness(1);
	transform: scale(1.02);
}

/* Initials fallback when no photo is uploaded. */
.upcomer-block--team-member-grid .team-grid__initials {
	font-family: "Barlow Condensed", "Barlow", "Helvetica Neue", system-ui, sans-serif;
	font-size: clamp(2.5rem, 6vw, 4rem);
	font-weight: 700;
	letter-spacing: 0.02em;
	color: var(--team-fg-muted);
	line-height: 1;
}

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

.upcomer-block--team-member-grid .team-grid__body {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	flex: 1;
	min-width: 0;
}

.upcomer-block--team-member-grid .team-grid__name {
	margin: 0;
	font-family: "Barlow Condensed", "Barlow", "Helvetica Neue", system-ui, sans-serif;
	font-size: clamp(1.125rem, 1.75vw, 1.375rem);
	font-weight: 700;
	line-height: 1.1;
	letter-spacing: 0.01em;
	text-transform: uppercase;
	color: var(--team-fg);
}

.upcomer-block--team-member-grid .team-grid__role {
	margin: 0;
	font-family: "Barlow", "Helvetica Neue", system-ui, sans-serif;
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	line-height: 1.2;
	color: var(--team-accent);
}

.upcomer-block--team-member-grid .team-grid__bio {
	margin: 0.25rem 0 0;
	font-family: "Barlow", "Helvetica Neue", system-ui, sans-serif;
	font-size: 0.9375rem;
	font-weight: 400;
	line-height: 1.55;
	color: var(--team-fg-subtle);
	text-wrap: pretty;
}

.upcomer-block--team-member-grid .team-grid__bio em {
	font-style: italic;
}

.upcomer-block--team-member-grid .team-grid__bio strong {
	font-weight: 700;
	color: var(--team-fg);
}

/* ---- Per-card "Read profile" link ------------------------------------ */

.upcomer-block--team-member-grid .team-grid__profile-link {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	margin-block-start: auto;
	padding-block-start: 0.75rem;
	font-family: "Barlow", "Helvetica Neue", system-ui, sans-serif;
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	line-height: 1;
	color: var(--team-accent);
	text-decoration: none;
	transition: color 180ms ease, gap 180ms ease;
}

.upcomer-block--team-member-grid .team-grid__profile-link svg {
	width: 12px;
	height: 12px;
	flex-shrink: 0;
}

.upcomer-block--team-member-grid .team-grid__profile-link:hover,
.upcomer-block--team-member-grid .team-grid__profile-link:focus-visible {
	color: var(--team-fg);
	gap: 0.75rem;
}

.upcomer-block--team-member-grid .team-grid__profile-link:focus-visible {
	outline: 2px solid var(--team-accent);
	outline-offset: 4px;
}

/* ---- Reduced motion --------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	.upcomer-block--team-member-grid .team-grid__cta,
	.upcomer-block--team-member-grid .team-grid__profile-link,
	.upcomer-block--team-member-grid .team-grid__portrait img {
		transition: none;
	}
	.upcomer-block--team-member-grid .team-grid__card:hover .team-grid__portrait img,
	.upcomer-block--team-member-grid .team-grid__card:focus-within .team-grid__portrait img {
		transform: none;
	}
}
