/* Zenesis v2 — "Team" section.
   Layout, content, colours and typography are set in Elementor / Site Settings.
   This file adds the banner layer stack, the carousel (native scroll + drag), the portrait treatment,
   the controls and the scroll reveal. States are set by team.js. */

.zn-team {
	--zn-ease-out: cubic-bezier(.16, 1, .3, 1);
	position: relative;
}
.zn-team p:last-child { margin-bottom: 0; }

/* ── Banner layers: photo → gradient → text ── */
.zn-team .zn-team__hero { position: relative; isolation: isolate; }
.zn-team .zn-team__hero > .zn-team__media {
	position: absolute; left: 0; top: -8%; width: 100%; height: 116%; min-height: 0; margin: 0;
	z-index: 0; scale: 1.04; will-change: transform;
	filter: grayscale(.25) contrast(1.04);
}
.zn-team .zn-team__hero > .zn-team__shade { position: absolute; inset: 0; width: auto; height: auto; min-height: 0; margin: 0; z-index: 1; pointer-events: none; }
.zn-team .zn-team__hero > .zn-team__content { position: relative; z-index: 2; }
.zn-team .zn-team__deck { position: relative; z-index: 3; }

/* ── Carousel track: native horizontal scroll (touch, trackpad, keyboard) + mouse drag from team.js ──
   The row is exactly the boxed column and the cards share it evenly (--zn-per whole portraits, never a cut one):
   6 / 5 / 4 per view on desktop by width, 3 on tablet, 2 on large phones, 1 on small ones. */
.zn-team .zn-team__track {
	--zn-per: 6; --zn-gap: 24px;
	width: 100%; column-gap: var(--zn-gap);
	overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory; scroll-behavior: smooth;
	scrollbar-width: none;
	padding: 14px 0 28px;                        /* room for the hover lift and shadow */
	margin-top: -14px; margin-bottom: -28px;
	cursor: grab;
}
.zn-team .zn-team__track > .e-con.zn-team__card {
	--width: calc((100% - (var(--zn-per) - 1) * var(--zn-gap)) / var(--zn-per));
	width: var(--width); flex: 0 0 var(--width); min-width: 0;
}
@media (max-width: 1599px) { .zn-team .zn-team__track { --zn-per: 5; } }
@media (max-width: 1366px) { .zn-team .zn-team__track { --zn-per: 4; } }
@media (max-width: 1024px) { .zn-team .zn-team__track { --zn-per: 3; --zn-gap: 20px; } }
@media (max-width: 767px)  { .zn-team .zn-team__track { --zn-per: 2; --zn-gap: 16px; } }
@media (max-width: 479px)  { .zn-team .zn-team__track { --zn-per: 1; } }
.zn-team .zn-team__track::-webkit-scrollbar { display: none; }
.zn-team .zn-team__track:focus-visible { outline: 1px solid var(--e-global-color-primary); outline-offset: 4px; }
.zn-team .zn-team__track.is-dragging { cursor: grabbing; scroll-snap-type: none; scroll-behavior: auto; }
.zn-team .zn-team__track.is-dragging * { pointer-events: none; user-select: none; }
/* motion goes on the card's contents, never the snap target itself (a moved card shifts Chrome's snap positions) */
.zn-team .zn-team__card { scroll-snap-align: start; }
.zn-team .zn-team__card > * { transition: translate .7s var(--zn-ease-out); }

/* ── Portrait card ── */
.zn-team .zn-team__photo {
	position: relative; overflow: hidden; isolation: isolate;
	aspect-ratio: 4 / 5;
	box-shadow: 0 22px 44px -30px rgb(0 0 0 / .45);
	transition: box-shadow .7s ease;
}
/* soft gold light behind each cut-out portrait */
.zn-team .zn-team__photo::before {
	content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
	background:
		radial-gradient(120% 70% at 50% 100%, color-mix(in srgb, var(--e-global-color-primary) 22%, transparent), transparent 70%),
		linear-gradient(180deg, var(--e-global-color-zn_white), var(--e-global-color-zn_light));
	transition: opacity .7s ease;
}
/* gold line drawn along the bottom edge on hover */
.zn-team .zn-team__photo::after {
	content: ""; position: absolute; left: 0; bottom: 0; z-index: 2;
	width: 100%; height: 2px; background: var(--e-global-color-primary);
	scale: 0 1; transform-origin: 0 50%;
	transition: scale .8s var(--zn-ease-out);
}
.zn-team .zn-team__img,
.zn-team .zn-team__img .elementor-widget-container { height: 100%; }
.zn-team .zn-team__img img {
	display: block; width: 100%; height: 100%;
	object-fit: cover; object-position: 50% 100%;
	transform-origin: 50% 100%;
	filter: grayscale(1); /* black & white by default, full colour on hover / keyboard focus */
	transition: scale 1.1s var(--zn-ease-out), filter .9s cubic-bezier(.4, 0, .2, 1);
	-webkit-user-drag: none;
}
.zn-team .zn-team__name .elementor-heading-title { transition: color .5s ease; }

.zn-team .zn-team__card:hover > * { translate: 0 -8px; }
.zn-team .zn-team__card:hover .zn-team__photo { box-shadow: 0 30px 50px -28px rgb(0 0 0 / .5); }
.zn-team .zn-team__card:hover .zn-team__photo::after { scale: 1 1; }
.zn-team .zn-team__card:hover .zn-team__img img { scale: 1.05; filter: grayscale(0); }
.zn-team .zn-team__card:focus-within .zn-team__img img { filter: grayscale(0); }
/* the rest of the row steps back a little while one portrait is in focus */
@media (hover: hover) {
	.zn-team .zn-team__track:hover .zn-team__card:not(:hover) .zn-team__info { opacity: .6; }
}
.zn-team .zn-team__info { transition: opacity .6s ease; }

/* ── Progress hairline + controls ── */
.zn-team .zn-team__progress { position: relative; overflow: hidden; }
.zn-team .zn-team__progress::after {
	content: ""; position: absolute; top: 0; bottom: 0; left: 0;
	width: calc(var(--zn-w, .25) * 100%);
	translate: calc(var(--zn-x, 0) * (100% / var(--zn-w, .25) - 100%)) 0;
	background: var(--e-global-color-primary);
	transition: translate .25s linear;
}
/* prev / next: circled arrows like the site's .zn-link (circle fills gold, arrow nudges). The theme's global
   button:hover / :focus styles (square corners, white or blue fill) are locked out for every state. */
.zn-team .zn-team__controls .zn-team__nav,
.zn-team .zn-team__controls .zn-team__nav:is(:hover, :focus, :active) {
	position: relative; flex: 0 0 auto; width: 48px; height: 48px; padding: 0; margin: 0;
	display: inline-flex; align-items: center; justify-content: center;
	border-radius: 50%; box-shadow: none; outline: 0; cursor: pointer;
	background-color: transparent; color: var(--e-global-color-text);
	border: 1px solid var(--e-global-color-zn_line);
	transition: border-color .4s ease, background-color .4s ease, color .4s ease, opacity .4s ease;
}
.zn-team .zn-team__nav svg { width: 14px; height: 14px; fill: currentColor; transition: translate .5s var(--zn-ease-out); }
.zn-team .zn-team__nav--prev svg { rotate: 180deg; }
.zn-team .zn-team__controls .zn-team__nav:not(:disabled):focus-visible {
	background-color: var(--e-global-color-primary); border-color: var(--e-global-color-primary); color: var(--e-global-color-zn_white);
}
@media (hover: hover) {
	.zn-team .zn-team__controls .zn-team__nav:not(:disabled):hover {
		background-color: var(--e-global-color-primary); border-color: var(--e-global-color-primary); color: var(--e-global-color-zn_white);
	}
	.zn-team .zn-team__nav--next:not(:disabled):hover svg { translate: 3px 0; }
	.zn-team .zn-team__nav--prev:not(:disabled):hover svg { translate: -3px 0; }
}
.zn-team .zn-team__controls .zn-team__nav:disabled { opacity: .35; cursor: default; }

@media (max-width: 767px) {
	.zn-team .zn-team__controls .zn-team__nav,
	.zn-team .zn-team__controls .zn-team__nav:is(:hover, :focus, :active) { width: 40px; height: 40px; }
	.zn-team .zn-team__track { scroll-snap-type: x mandatory; }
}

/* ── Scroll reveal (armed by team.js; without JS everything is visible) ── */
.zn-team.is-armed .zn-team__hero > .zn-team__media { clip-path: inset(0 0 100% 0); scale: 1.16; }
.zn-team.is-armed .zn-team__hero > .zn-team__shade { opacity: 0; }
.zn-team.is-armed .zn-team__accent { scale: 1 0; transform-origin: 50% 0; }
.zn-team.is-armed .zn-team-rv { opacity: 0; translate: 0 28px; }
.zn-team.is-armed .zn-team__card > * { opacity: 0; translate: 60px 0; }
.zn-team.is-armed .zn-team__progress,
.zn-team.is-armed .zn-team__controls { opacity: 0; }

.zn-team.is-in .zn-team__hero > .zn-team__media {
	clip-path: inset(0 0 0 0); scale: 1.04;
	transition: clip-path 1.6s var(--zn-ease-out), scale 2.4s var(--zn-ease-out);
}
.zn-team.is-in .zn-team__hero > .zn-team__shade { opacity: 1; transition: opacity 1.2s ease .2s; }
.zn-team.is-in .zn-team__accent { scale: 1 1; transition: scale 1s var(--zn-ease-out) .4s; }
.zn-team.is-in .zn-team-rv { opacity: 1; translate: 0 0; transition: opacity 1s ease, translate 1.2s var(--zn-ease-out); transition-delay: var(--zn-d, 0s); }
.zn-team .zn-team__card.is-in > * { opacity: 1; translate: 0 0; transition: opacity 1s ease var(--zn-d, 0s), translate 1.3s var(--zn-ease-out) var(--zn-d, 0s); }
.zn-team .zn-team__card.is-in > .zn-team__info { transition-delay: calc(var(--zn-d, 0s) + .08s); }
.zn-team .zn-team__card.is-in.is-settled > * { transition: translate .7s var(--zn-ease-out), opacity .6s ease; }
.zn-team .zn-team__card.is-in.is-settled:hover > * { translate: 0 -8px; }
.zn-team.is-in .zn-team__progress,
.zn-team.is-in .zn-team__controls { opacity: 1; transition: opacity .8s ease 1s; }

@media (prefers-reduced-motion: reduce) {
	.zn-team *, .zn-team *::before, .zn-team *::after { transition: none !important; }
	.zn-team .zn-team__track { scroll-behavior: auto; }
	.zn-team .zn-team__hero > .zn-team__media { translate: none !important; }
	.zn-team .zn-team__card:hover > * { translate: none; }
}
