/**
 * Mueen Team — interactive team grid.
 *
 * Colours intentionally inherit the Monogram theme tokens (--jkd-*) so the
 * section follows the site's light/dark switch without any extra work.
 */

.mn-team {
	--mn-cols: 4;
	--mn-gap: 28px;
	--mn-ratio: 3 / 4;
	--mn-radius: var(--jkd-br-lg, 15px);
	--mn-accent: var(--jkd-accent, #E8BC32);
	--mn-name: var(--jkd-heading, #1a1a1f);
	--mn-role: var(--jkd-heading, #1a1a1f);
	--mn-media-bg: var(--jkd-bg-secondary, #1c1c1c);
	--mn-overlay: 0.62;
	--mn-ease: cubic-bezier(0.4, 0, 0.2, 1);
	--mn-dur: 0.45s;

	/* Pointer position inside the hovered card, written by GSAP. */
	--mn-mx: 50%;
	--mn-my: 50%;

	display: block;
	width: 100%;
}

/*
 * Deliberately NOT a container query context.
 *
 * `container-type: inline-size` here applied inline-size + layout containment,
 * and inside Elementor's column-flex `.e-con-inner` that made the widget
 * wrapper resolve to a stale height (1380px against 2674px of content). The
 * section then overlapped the following section on mobile by ~1265px.
 * The responsive column count already comes from the widget's Elementor
 * breakpoints, so the container context bought nothing.
 */

/* ══════════════════════════════════════════════════════
 * HEADER
 * ══════════════════════════════════════════════════════ */

.mn-team__head {
	display: flex;
	flex-direction: column;
	gap: 18px;
	margin-bottom: clamp(36px, 5vw, 72px);
	max-width: 46ch;
}

/* The alignment control writes text-align + margin-inline together, so the
   constrained block itself moves with the text. */

.mn-team__eyebrow {
	align-items: center;
	color: var(--jkd-heading, #1a1a1f);
	display: inline-flex;
	font-size: var(--jkd-font-xs-size, 13px);
	font-weight: var(--jkd-m-fw, 500);
	gap: 10px;
	letter-spacing: 0.14em;
	opacity: var(--jkd-op-md, 0.62);
	text-transform: uppercase;
}

.mn-team__dot {
	background-color: var(--mn-accent);
	border-radius: 50%;
	box-shadow: 0 0 0 4px rgba(var(--jkd-accent-rgb, 232, 188, 50), 0.18);
	display: inline-block;
	flex: none;
	height: 7px;
	width: 7px;
}

.mn-team__title {
	color: var(--jkd-heading, #1a1a1f);
	font-size: var(--jkd-font-h2-size, clamp(32px, 4.2vw, 56px));
	font-weight: var(--jkd-b-fw, 600);
	letter-spacing: var(--jkd-font-h2-track, -0.02em);
	line-height: var(--jkd-font-h2-line, 1.1);
	margin: 0;
	text-wrap: balance;
}

.mn-team__intro {
	color: var(--jkd-heading, #1a1a1f);
	font-size: var(--jkd-font-body-size, 16px);
	line-height: var(--jkd-font-body-line, 1.6);
	margin: 0;
	opacity: var(--jkd-op-md, 0.62);
}

/* Masked line wrapper created by the SplitText reveal. */
.mn-team__tmask {
	display: block;
	overflow: hidden;
	padding-bottom: 0.08em;
}

/* ══════════════════════════════════════════════════════
 * GRID
 * ══════════════════════════════════════════════════════ */

.mn-team__grid {
	display: grid;
	gap: var(--mn-gap);
	grid-template-columns: repeat(var(--mn-cols), minmax(0, 1fr));
}

.mn-team__card {
	min-width: 0;
	perspective: 1100px;
}

.mn-team__inner {
	display: flex;
	flex-direction: column;
	gap: 18px;
	transform-style: preserve-3d;
	will-change: transform;
}

/* ══════════════════════════════════════════════════════
 * MEDIA
 * ══════════════════════════════════════════════════════ */

.mn-team__media {
	aspect-ratio: var(--mn-ratio);
	background-color: var(--mn-media-bg);
	border-radius: var(--mn-radius);
	isolation: isolate;
	overflow: hidden;
	position: relative;
	width: 100%;
}

/*
 * Flush with the top of the frame, with the spare height hanging off the
 * bottom. The parallax only ever drifts upward into that slack, so the top of
 * the portrait — where the face is — is never cropped on entry.
 */
.mn-team__fill {
	height: 114%;
	left: 0;
	position: absolute;
	top: 0;
	width: 100%;
	will-change: transform;
}

.mn-team__fill img,
.mn-team__fill picture,
.mn-team__img {
	display: block;
	height: 100%;
	object-fit: cover;
	/* Anchor on the subject's head rather than the middle of the photo. */
	object-position: 50% var(--mn-focus, top);
	width: 100%;
}

.mn-team__placeholder {
	align-items: center;
	color: var(--jkd-heading, #fff);
	display: flex;
	font-size: clamp(28px, 6vw, 56px);
	font-weight: var(--jkd-b-fw, 600);
	height: 100%;
	justify-content: center;
	letter-spacing: 0.04em;
	opacity: var(--jkd-op-lg, 0.42);
	width: 100%;
}

/* Bottom scrim: readable text on hover, invisible at rest. */
.mn-team__scrim {
	background: linear-gradient(
		to top,
		rgba(10, 10, 12, 0.92) 0%,
		rgba(10, 10, 12, 0.55) 38%,
		rgba(10, 10, 12, 0) 72%
	);
	inset: 0;
	opacity: 0;
	pointer-events: none;
	position: absolute;
	transition: opacity var(--mn-dur) var(--mn-ease);
	z-index: 1;
}

/* Accent glow that tracks the pointer. */
.mn-team__glow {
	background: radial-gradient(
		42% 42% at var(--mn-mx) var(--mn-my),
		rgba(var(--jkd-accent-rgb, 232, 188, 50), 0.32) 0%,
		rgba(var(--jkd-accent-rgb, 232, 188, 50), 0) 70%
	);
	inset: 0;
	mix-blend-mode: screen;
	opacity: 0;
	pointer-events: none;
	position: absolute;
	z-index: 2;
}

/* Kept off mix-blend-mode: over saturated photography "difference" turns the
   number an unpredictable colour. A shadow reads cleanly on any image. */
.mn-team__index {
	color: #fff;
	font-size: 12px;
	font-variant-numeric: tabular-nums;
	font-weight: var(--jkd-m-fw, 500);
	inset-inline-start: 16px;
	letter-spacing: 0.12em;
	opacity: 0.85;
	position: absolute;
	text-shadow: 0 1px 6px rgba(0, 0, 0, 0.55);
	top: 14px;
	z-index: 3;
}

/* Anchored to the bottom of the frame, where the scrim is darkest, and lifted
   clear of the social row when one is present. */
.mn-team__bio {
	bottom: 18px;
	color: rgba(255, 255, 255, 0.86);
	font-size: 14px;
	inset-inline: 18px;
	line-height: 1.5;
	margin: 0;
	opacity: 0;
	pointer-events: none;
	position: absolute;
	transform: translateY(10px);
	transition: opacity var(--mn-dur) var(--mn-ease), transform var(--mn-dur) var(--mn-ease);
	z-index: 3;
}

.mn-team__media:has(.mn-team__socials) .mn-team__bio {
	bottom: 68px;
}

.mn-team__socials {
	bottom: 16px;
	display: flex;
	gap: 8px;
	inset-inline-start: 16px;
	list-style: none;
	margin: 0;
	padding: 0;
	position: absolute;
	z-index: 4;
}

.mn-team__social a {
	align-items: center;
	backdrop-filter: blur(6px);
	background-color: rgba(255, 255, 255, 0.12);
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 50%;
	color: #fff;
	display: flex;
	height: 34px;
	justify-content: center;
	transition: background-color 0.25s var(--mn-ease), color 0.25s var(--mn-ease), border-color 0.25s var(--mn-ease);
	width: 34px;
}

/* Brand marks are solid shapes. Stated explicitly (two classes, to outrank the
   theme's `svg:not(...){fill:currentColor}`) so the icons never pick up a
   stray stroke from elsewhere in the cascade. */
.mn-team .mn-team__icon,
.mn-team .mn-team__icon * {
	fill: currentColor;
	stroke: none;
}

.mn-team__icon {
	display: block;
	height: 15px;
	width: 15px;
}

.mn-team__social a:hover,
.mn-team__social a:focus-visible {
	background-color: var(--mn-accent);
	border-color: var(--mn-accent);
	color: var(--jkd-on-accent, #0f0f0f);
}

.mn-team__social a:focus-visible {
	outline: 2px solid var(--mn-accent);
	outline-offset: 3px;
}

.mn-team__overlay-link {
	inset: 0;
	position: absolute;
	z-index: 3;
}

.mn-team__overlay-link:focus-visible {
	outline: 2px solid var(--mn-accent);
	outline-offset: -4px;
}

/* ══════════════════════════════════════════════════════
 * META
 * ══════════════════════════════════════════════════════ */

.mn-team__meta {
	display: flex;
	flex-direction: column;
	gap: 4px;
	position: relative;
}

.mn-team__name {
	color: var(--mn-name);
	font-size: var(--mn-name-size, 20px);
	font-weight: var(--jkd-b-fw, 600);
	letter-spacing: var(--jkd-font-h5-track, -0.01em);
	line-height: 1.25;
	margin: 0;
}

.mn-team__role {
	color: var(--mn-role);
	font-size: var(--jkd-font-small-size, 14px);
	line-height: var(--jkd-font-small-line, 1.5);
	opacity: var(--jkd-op-md, 0.62);
}

.mn-team__rule {
	background-color: var(--mn-accent);
	display: block;
	height: 2px;
	margin-top: 12px;
	transform: scaleX(0);
	transform-origin: left center;
	width: 100%;
}

[dir="rtl"] .mn-team__rule {
	transform-origin: right center;
}

/* ══════════════════════════════════════════════════════
 * HOVER — CSS drives the non-transform parts, GSAP the rest
 * ══════════════════════════════════════════════════════ */

@media (hover: hover) and (pointer: fine) {

	.mn-team__card:hover .mn-team__scrim,
	.mn-team__card:focus-within .mn-team__scrim {
		opacity: var(--mn-overlay);
	}

	.mn-team__card:hover .mn-team__bio,
	.mn-team__card:focus-within .mn-team__bio {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Touch devices get the readable state permanently — nothing depends on hover. */
@media (hover: none) {

	.mn-team__scrim {
		opacity: calc(var(--mn-overlay) * 0.85);
	}

	.mn-team__bio {
		opacity: 1;
		transform: none;
	}

	.mn-team__socials {
		opacity: 1;
	}
}

/* ══════════════════════════════════════════════════════
 * PRE-ANIMATION STATE
 * Applied only when motion is enabled; JS hands these values over to GSAP
 * inline styles and then drops the class, so a missing GSAP never hides
 * content. The <noscript> block in the widget covers JS being off entirely.
 * ══════════════════════════════════════════════════════ */

.mn-team--reveal .mn-team__media {
	clip-path: inset(0 0 100% 0);
}

.mn-team--reveal .mn-team__meta > *,
.mn-team--reveal .mn-team__head > * {
	opacity: 0;
}

.mn-team--reveal .mn-team__rule {
	opacity: 1;
}

@media (prefers-reduced-motion: reduce) {

	.mn-team--reveal .mn-team__media {
		clip-path: none;
	}

	.mn-team--reveal .mn-team__meta > *,
	.mn-team--reveal .mn-team__head > * {
		opacity: 1;
	}
}

/* ══════════════════════════════════════════════════════
 * RESPONSIVE SAFETY NET
 * The column count itself comes from the widget's Elementor breakpoints
 * (--mn-cols). These viewport rules only stop the grid from staying too
 * dense if those controls are ever changed to something unreadable.
 * ══════════════════════════════════════════════════════ */

@media (max-width: 900px) {

	.mn-team__grid {
		grid-template-columns: repeat(min(var(--mn-cols), 2), minmax(0, 1fr));
	}
}

@media (max-width: 600px) {

	.mn-team__grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.mn-team__head {
		margin-bottom: 32px;
	}
}
