/* ==========================================================================
   Het team — avatar carousel + detail panel
   Hand-built replacement for the Slider Revolution "FEA-05-desktop" slider.
   Measurements taken from the live springerhealthplus.nl rendering.
   ========================================================================== */

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

.team {
	--avatar-size: 130px;
	--avatar-gap: 25px;
	--avatar-visible: 7;

	--ring-idle: #cedbdf;
	--ring-active: #ee7d11;
	--veil: rgba(72, 106, 126, 0.5);
	--arrow: #8faec1;

	/* Gap between the ring and the photo, showing the page behind it. */
	--photo-inset: 3px;

	/* Arrow placement, measured on the live slider at a 130px avatar: the glyph
	   sits 85px either side of centre and 36px below the middle of the row. */
	--arrow-offset-x: calc(var(--avatar-size) * 0.654);
	--arrow-offset-y: calc(var(--avatar-size) * 0.277);

	--ink-strong: #444444;
	--ink-muted: #333333;

	--panel-width: 580px;
	--move-duration: 800ms;
	--move-ease: cubic-bezier(0.76, 0, 0.24, 1);
	--fade-duration: 600ms;

	font-family: "myriad-pro", "Myriad Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	max-width: 1170px;
	margin-inline: auto;
	padding-inline: 16px;
}

/* --------------------------------------------------------------------------
   Carousel
   The track is clipped to exactly N avatars so no partial slide peeks in —
   this is what Slider Revolution achieved by fading out overflow slides.
   -------------------------------------------------------------------------- */

.team-carousel {
	position: relative;
	width: calc(var(--avatar-visible) * (var(--avatar-size) + var(--avatar-gap)) - var(--avatar-gap));
	max-width: 100%;
	margin-inline: auto;
}

.team-carousel__swiper {
	overflow: hidden;
}

.team-carousel__swiper .swiper-wrapper {
	/* Swiper sets the duration inline; the easing is ours. */
	transition-timing-function: var(--move-ease);
}

.team-carousel .swiper-slide {
	width: var(--avatar-size);
	height: var(--avatar-size);
}

/* --- One avatar ----------------------------------------------------------- */

.avatar {
	position: relative;
	display: block;
	width: 100%;
	height: 100%;
	/* The photo is inset so the page shows through as a ring between it and the
	   border, the way the original slider's padded canvas did. */
	padding: var(--photo-inset);
	border: 2px solid var(--ring-idle);
	border-radius: 50%;
	background: none;
	cursor: pointer;
	transition: border-color var(--fade-duration) ease, border-width var(--fade-duration) ease;
}

.avatar:focus-visible {
	outline: 2px solid var(--ring-active);
	outline-offset: 3px;
}

.avatar__photo {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 50%;
}

/* Desaturating veil over every inactive avatar. In the original this was a
   shape layer sized at 92%, which left a ring of full-colour photo showing
   around the edge; here it covers the photo completely. */
.avatar__veil {
	position: absolute;
	/* Offsets are measured from the padding box, so this covers the photo and
	   leaves the ring around it clear. */
	inset: var(--photo-inset);
	border-radius: 50%;
	background: var(--veil);
	opacity: 1;
	transition: opacity var(--fade-duration) ease;
	pointer-events: none;
}

.swiper-slide-active .avatar {
	border-width: 4px;
	border-color: var(--ring-active);
}

.swiper-slide-active .avatar__veil {
	opacity: 0;
}

/* --- Arrows --------------------------------------------------------------- */

.team-arrow {
	position: absolute;
	top: calc(50% + var(--arrow-offset-y));
	/* The button is larger than the glyph to stay tappable; the glyph inside is
	   what lines up with the original. */
	display: grid;
	place-items: center;
	width: 28px;
	height: 40px;
	padding: 0;
	border: 0;
	background: none;
	color: var(--arrow);
	cursor: pointer;
	transform: translate(-50%, -50%);
	z-index: 2;
}

.team-arrow svg {
	display: block;
	width: 17px;
	height: 28px;
}

/* The theme has a site-wide `svg:hover path { fill: … }` rule, and a CSS fill
   beats the fill="none" attribute on the path. These arrows are stroked
   outlines, so the fill has to stay off in every state. */
.team-arrow svg path,
.team-arrow svg:hover path {
	fill: none;
}

.team-arrow:focus-visible {
	outline: 2px solid var(--ring-active);
	outline-offset: 4px;
	border-radius: 2px;
}

.team-arrow--prev {
	left: calc(50% - var(--arrow-offset-x));
}

.team-arrow--next {
	left: calc(50% + var(--arrow-offset-x));
}

/* --------------------------------------------------------------------------
   Detail panel
   All panels share one grid cell, so the block is as tall as the longest bio
   and swapping a person never shifts the page.
   -------------------------------------------------------------------------- */

.team-body {
	display: grid;
	grid-template-columns: 1fr var(--panel-width);
	column-gap: 30px;
	margin-top: 25px;
}

/* The intro copy is page content and keeps whatever the editor gave it; only
   the outer margins are trimmed so it lines up with the panel beside it. */
.team-intro > :first-child {
	margin-top: 0;
}

.team-intro > :last-child {
	margin-bottom: 0;
}

/* Height is driven by JS so the block shrinks to the person on show instead of
   always reserving room for the longest biography. */
.team-panels {
	display: grid;
	overflow: hidden;
	transition: height var(--fade-duration) ease;
}

.team-panels:not(.is-measured) {
	transition: none;
}

.team-panel {
	grid-area: 1 / 1;
	/* Keep each panel at its natural height so it can be measured, rather than
	   letting the grid stretch every panel to the tallest one. */
	align-self: start;
	/* Base typography of the original panel, so anything added later inherits
	   the same values instead of the surrounding page defaults. */
	font-size: 19px;
	font-weight: 300;
	line-height: 27px;
	color: var(--ink-strong);
	opacity: 0;
	visibility: hidden;
	transition: opacity var(--fade-duration) ease, visibility 0s linear var(--fade-duration);
}

.team-panel.is-active {
	opacity: 1;
	visibility: visible;
	transition: opacity var(--fade-duration) ease, visibility 0s;
}

.team-panel__name {
	margin: 0;
	/* The surrounding theme styles headings with its own face; keep the panel's. */
	font-family: inherit;
	font-size: 20px;
	font-weight: 600;
	line-height: 27px;
	color: var(--ink-strong);
}

.team-panel__role {
	margin: 0 0 7px;
	font-size: 18px;
	font-weight: 300;
	line-height: 27px;
	color: var(--ink-muted);
}

.team-panel__bio {
	margin: 0 0 7px;
	font-size: 18px;
	font-weight: 300;
	line-height: 27px;
	color: var(--ink-strong);
}

.team-panel__contact {
	margin: 0 0 7px;
	font-size: 18px;
	font-weight: 300;
	line-height: 27px;
	color: var(--ink-strong);
}

.team-panel__contact a {
	color: inherit;
	text-decoration: underline;
}

.team-panel__contact a:hover {
	color: var(--ring-active);
}

.team-panel__sep {
	margin-inline: 5px;
	text-decoration: none;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1100px) {
	.team {
		--avatar-visible: 5;
	}
}

@media (max-width: 880px) {
	.team {
		--panel-width: 100%;
	}

	.team-body {
		grid-template-columns: 1fr;
		row-gap: 30px;
	}

	/* Stacked, the selected person belongs directly under the avatars; the
	   intro copy is page text and follows the whole slider. */
	.team-panels {
		order: -1;
	}

	.team-intro {
		font-size: 21px;
	}
}

@media (max-width: 620px) {
	.team {
		--avatar-visible: 3;
		--avatar-size: 110px;
		--avatar-gap: 18px;
	}

	.team-panel__bio,
	.team-panel__role,
	.team-panel__contact {
		font-size: 17px;
		line-height: 25px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.team {
		--move-duration: 1ms;
		--fade-duration: 1ms;
	}
}
