/**
 * Viora Team widget.
 *
 * Portrait plates on the editorial grid, with the name in the display face and
 * the role in the letter-spaced label.
 */

.viora-team {
	position: relative;
	padding-block: clamp(3.5rem, 7.64vw, 6.875rem);
	overflow: hidden;
}

.viora-team__inner {
	position: relative;
	width: min(1082px, 100% - 2 * var(--viora-layout-container-pad));
	margin-inline: auto;
}

/*
 * Columns follow the number of people, written inline by the view. Two hops,
 * because an inline value cannot be reached by the breakpoints below.
 */
.viora-team__grid {
	--viora-team-cols-default: var(--viora-team-auto, 3);

	display: grid;
	grid-template-columns: repeat(var(--viora-team-cols, var(--viora-team-cols-default)), minmax(0, 1fr));
	gap: clamp(2rem, 3.5vw, 3rem) clamp(1.5rem, 2.78vw, 2.5rem);
	margin: clamp(2.5rem, 4.86vw, 4.375rem) 0 0;
	padding: 0;
	list-style: none;
}

.viora-team__person {
	min-width: 0;
}

.viora-team__link {
	display: block;
	color: inherit;
	text-decoration: none;
}

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

.viora-team__person .viora-team__media {
	position: relative;
	width: 100%;
	margin: 0;
	aspect-ratio: 0.78;
	overflow: hidden;
	background-color: var(--viora-color-surface-alt);
}

.viora-team__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 1.1s var(--viora-motion-easing);
}

.viora-team__link:hover .viora-team__media img {
	transform: scale(1.04);
}

.viora-team__overlay {
	position: absolute;
	inset: 0;
	background-color: rgba(0, 0, 0, 0.08);
	pointer-events: none;
}

.viora-team__index {
	position: absolute;
	left: clamp(0.75rem, 1.1vw, 1rem);
	top: clamp(0.75rem, 1.1vw, 1rem);
	color: var(--viora-color-on-invert);
}

/* -------------------------------------------------- *
 * Copy
 * -------------------------------------------------- */

/*
 * The gap under the portrait sits here rather than on the figure above it.
 * Elementor's frontend reset zeroes every `figure` inside a widget at a
 * specificity this file cannot reach, so the portrait's own margin-bottom was
 * silently dropped and the name sat against the photo. This block is a div,
 * which that reset does not touch.
 */
.viora-team__body {
	margin-top: clamp(1rem, 1.53vw, 1.375rem);
}

.viora-team__name {
	margin: 0;
	color: var(--viora-ink, var(--viora-color-heading));
	font-family: var(--viora-font-display);
	font-size: clamp(1.25rem, 1.8vw, 1.625rem);
	font-weight: 400;
	line-height: 1.16;
	letter-spacing: -0.03em;
}

.viora-team__role {
	margin: 0.3rem 0 0;
	color: var(--viora-color-accent);
	font-size: 0.625rem;
	line-height: 1.8;
	letter-spacing: 0.28em;
}

.viora-team__text {
	margin: clamp(0.6rem, 0.9vw, 0.8rem) 0 0;
	color: var(--viora-ink-soft, var(--viora-color-heading-soft));
	font-family: var(--viora-font-ui);
	font-size: 0.9375rem;
	line-height: 1.643;
}

/* -------------------------------------------------- *
 * Reveal
 * -------------------------------------------------- */

.viora-team.is-animated .viora-team__item {
	opacity: 0;
	transform: translateY(26px);
}

.viora-team.is-animated .viora-team__item.is-in {
	opacity: 1;
	transform: none;
	transition:
		opacity 0.9s var(--viora-motion-easing),
		transform 0.9s var(--viora-motion-easing);
}

/* The person is what the observer watches, so clipping the plate inside it
   cannot suppress an intersection. */
.viora-team.is-animated .viora-team__media {
	clip-path: inset(0 0 100% 0);
}

.viora-team.is-animated .viora-team__person.is-in .viora-team__media.is-loaded {
	clip-path: inset(0 0 0 0);
	transition: clip-path 0.9s var(--viora-motion-easing) 0.1s;
}

/* -------------------------------------------------- *
 * Tablet
 * -------------------------------------------------- */

@media (max-width: 1024px) {
	.viora-team {
		padding-block: clamp(3rem, 6vw, 4.5rem);
	}

	.viora-team__grid {
		--viora-team-cols-default: 2;
	}
}

/* -------------------------------------------------- *
 * Mobile
 * -------------------------------------------------- */

@media (max-width: 600px) {
	.viora-team__grid {
		--viora-team-cols-default: 1;
	}

	.viora-team__person .viora-team__media {
		aspect-ratio: 0.9;
	}
}

@media (prefers-reduced-motion: reduce) {
	.viora-team.is-animated .viora-team__item {
		opacity: 1;
		transform: none;
		transition: none;
	}

	.viora-team.is-animated .viora-team__media {
		clip-path: none;
	}

	.viora-team__media img {
		transition: none;
	}
}
