/**
 * Team Flip Cards — front end.
 *
 * Every custom property is scoped to .del-tfc, never to :root, because Blocksy
 * and Elementor both define their own variables there. Per-instance values
 * arrive as an inline style attribute on the wrapper, so two shortcodes on one
 * page stay independent while sharing this one stylesheet.
 */

.del-tfc {
	/* Colour — one scheme for every card. */
	--tfc-primary: #1965B0;
	--tfc-grey: #F2F4F7;
	--tfc-back-bg: var(--tfc-primary);
	--tfc-back-ink: #ffffff;
	--tfc-back-support: var(--tfc-grey);
	--tfc-front-bg: var(--tfc-grey);
	--tfc-border-c: var(--tfc-grey);
	--tfc-placeholder-ink: #c3cad6;

	/* Each piece of the reverse side has its own variable, defaulting to the
	   value it used before these existed, so nothing changes until a member
	   sets a colour of their own. A card overrides these on its own element,
	   and custom properties inherit downwards only — which is why one card's
	   colours can never reach another. */
	--tfc-name-color: var(--tfc-back-ink);
	--tfc-role-color: var(--tfc-back-support);
	--tfc-bio-color: var(--tfc-back-support);
	--tfc-icon-color: var(--tfc-back-ink);
	--tfc-icon-hover-bg: var(--tfc-back-ink);

	/* Layout. */
	--tfc-cols: 4;
	--tfc-cols-tablet: 2;
	--tfc-cols-mobile: 1;
	--tfc-gap: 24px;
	--tfc-radius: 14px;
	--tfc-ratio: 3 / 4;
	--tfc-img-pos: center top;
	--tfc-border-w: 1px;
	--tfc-pad: 20px;
	--tfc-shadow: 0 2px 10px rgba(16, 32, 51, .08);

	/* Block background: transparent with no padding, so a wrapper that sets
	   neither looks exactly as it always has. */
	--tfc-bg: transparent;
	--tfc-bg-pad: 0px;

	/* Motion and type. */
	--tfc-speed: 600ms;
	--tfc-ease: cubic-bezier(.22, .61, .36, 1);
	--tfc-name-size: 19px;
	--tfc-role-size: 13px;

	display: block;
	max-width: 100%;
	padding: var(--tfc-bg-pad);
	background: var(--tfc-bg);
	font-family: var(--tfc-font, inherit);
}

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

.del-tfc .del-tfc__grid {
	display: grid;
	grid-template-columns: repeat(var(--tfc-cols), minmax(0, 1fr));
	gap: var(--tfc-gap);
	list-style: none;
	margin: 0;
	padding: 0;
}

/* Alignment of a partial row. CSS grid stretches its tracks across the full
   width, so justify-content cannot move two cards in a four-column grid.
   Flex with the same computed column width can, and keeps cards identical in
   size to the grid version. */
.del-tfc--align-center .del-tfc__grid,
.del-tfc--align-right .del-tfc__grid {
	display: flex;
	flex-wrap: wrap;
}

.del-tfc--align-center .del-tfc__grid {
	justify-content: center;
}

.del-tfc--align-right .del-tfc__grid {
	justify-content: flex-end;
}

.del-tfc--align-center .del-tfc__item,
.del-tfc--align-right .del-tfc__item {
	flex: 0 0 calc((100% - (var(--tfc-cols) - 1) * var(--tfc-gap)) / var(--tfc-cols));
	max-width: calc((100% - (var(--tfc-cols) - 1) * var(--tfc-gap)) / var(--tfc-cols));
}

@media (max-width: 1024px) {
	.del-tfc--align-center .del-tfc__item,
	.del-tfc--align-right .del-tfc__item {
		flex-basis: calc((100% - (var(--tfc-cols-tablet) - 1) * var(--tfc-gap)) / var(--tfc-cols-tablet));
		max-width: calc((100% - (var(--tfc-cols-tablet) - 1) * var(--tfc-gap)) / var(--tfc-cols-tablet));
	}
}

@media (max-width: 767px) {
	.del-tfc--align-center .del-tfc__item,
	.del-tfc--align-right .del-tfc__item {
		flex-basis: calc((100% - (var(--tfc-cols-mobile) - 1) * var(--tfc-gap)) / var(--tfc-cols-mobile));
		max-width: calc((100% - (var(--tfc-cols-mobile) - 1) * var(--tfc-gap)) / var(--tfc-cols-mobile));
	}
}

.del-tfc .del-tfc__item {
	margin: 0;
	padding: 0;
	min-width: 0;
	list-style: none;
}

@media (max-width: 1024px) {
	.del-tfc .del-tfc__grid {
		grid-template-columns: repeat(var(--tfc-cols-tablet), minmax(0, 1fr));
	}
}

@media (max-width: 767px) {
	.del-tfc .del-tfc__grid {
		grid-template-columns: repeat(var(--tfc-cols-mobile), minmax(0, 1fr));
	}
}

.del-tfc .del-tfc-card {
	position: relative;
	width: 100%;
	aspect-ratio: var(--tfc-ratio);
	border-radius: var(--tfc-radius);
	perspective: 1400px;
}

.del-tfc .del-tfc-card__inner {
	position: absolute;
	inset: 0;
	border-radius: inherit;
	transform-style: preserve-3d;
	-webkit-transform-style: preserve-3d;
	transition: transform var(--tfc-speed) var(--tfc-ease);
	will-change: transform;
}

.del-tfc .del-tfc-face {
	position: absolute;
	inset: 0;
	overflow: hidden;
	border-radius: inherit;
	border: var(--tfc-border-w) solid var(--tfc-border-c);
	box-shadow: var(--tfc-shadow);
	backface-visibility: hidden;
	-webkit-backface-visibility: hidden;
	/* Both faces stay painted for the whole rotation. Nothing here animates
	   display, visibility or opacity: the browser hides whichever face is
	   turned away, which is what keeps a reversed flip smooth. */
	transform: translateZ(0);
}

.del-tfc .del-tfc-face--front {
	transform: rotateY(0deg);
}

.del-tfc--x .del-tfc-face--front {
	transform: rotateX(0deg);
}

.del-tfc .del-tfc-face--front {
	background: var(--tfc-front-bg);
}

.del-tfc .del-tfc-face--back {
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: var(--tfc-pad);
	text-align: center;
	background: var(--tfc-back-bg);
	color: var(--tfc-back-ink);
	transform: rotateY(180deg);
}

.del-tfc--x .del-tfc-face--back {
	transform: rotateX(180deg);
}

/* Flipped by pointer, or by keyboard focus landing inside the card. */
.del-tfc .del-tfc-card[data-flipped="true"] .del-tfc-card__inner,
.del-tfc .del-tfc-card:focus-within .del-tfc-card__inner {
	transform: rotateY(180deg);
}

.del-tfc--x .del-tfc-card[data-flipped="true"] .del-tfc-card__inner,
.del-tfc--x .del-tfc-card:focus-within .del-tfc-card__inner {
	transform: rotateX(180deg);
}

.del-tfc--hover .del-tfc-card:hover .del-tfc-card__inner {
	transform: rotateY(180deg);
}

.del-tfc--x.del-tfc--hover .del-tfc-card:hover .del-tfc-card__inner {
	transform: rotateX(180deg);
}

/* Touch devices get no hover flip: it would stick after the first tap. */
@media (hover: none) {
	.del-tfc--hover .del-tfc-card:hover .del-tfc-card__inner {
		transform: none;
	}

	.del-tfc--hover .del-tfc-card[data-flipped="true"] .del-tfc-card__inner {
		transform: rotateY(180deg);
	}

	.del-tfc--x.del-tfc--hover .del-tfc-card[data-flipped="true"] .del-tfc-card__inner {
		transform: rotateX(180deg);
	}
}

/* The face turned away is hidden by backface-visibility, which does not remove
   its links from the tab order. That is handled in JavaScript with tabindex:
   it costs nothing visually, and leaves the rotation as the only thing being
   animated. Animating visibility here is what used to make a reversed flip
   blink, because the front face stayed hidden for the whole return journey. */

/* Elementor ships ".elementor img { height: auto; }" (0,1,1) and Blocksy has
   its own image resets. Scoping to the wrapper puts us at (0,2,0), which wins
   without resorting to !important. Without this the photo keeps its natural
   height and the card shows empty space below it. */
/* ---------------------------------------------------------------------------
   Content motion on the reverse side.

   The faces themselves only rotate. This is a separate, later movement of the
   text and icons, timed to start just after the card has turned far enough for
   the back to be readable. Going back it resets instantly (no delay), so a
   quick flick in and out never leaves half-animated text behind.
   --------------------------------------------------------------------------- */
.del-tfc--anim-fade-up .del-tfc-face--back > *,
.del-tfc--anim-fade .del-tfc-face--back > *,
.del-tfc--anim-zoom .del-tfc-face--back > * {
	--tfc-anim-step: 0ms;
	opacity: 0;
	transition: opacity 320ms var(--tfc-ease), transform 320ms var(--tfc-ease);
	transition-delay: 0s;
}

.del-tfc--anim-fade-up .del-tfc-face--back > * {
	transform: translate3d(0, 10px, 0);
}

.del-tfc--anim-zoom .del-tfc-face--back > * {
	transform: scale(.92);
}

.del-tfc--anim-fade-up .del-tfc-face--back > *:nth-child(2),
.del-tfc--anim-fade .del-tfc-face--back > *:nth-child(2),
.del-tfc--anim-zoom .del-tfc-face--back > *:nth-child(2) {
	--tfc-anim-step: 70ms;
}

.del-tfc--anim-fade-up .del-tfc-face--back > *:nth-child(3),
.del-tfc--anim-fade .del-tfc-face--back > *:nth-child(3),
.del-tfc--anim-zoom .del-tfc-face--back > *:nth-child(3) {
	--tfc-anim-step: 140ms;
}

.del-tfc--anim-fade-up .del-tfc-face--back > *:nth-child(4),
.del-tfc--anim-fade .del-tfc-face--back > *:nth-child(4),
.del-tfc--anim-zoom .del-tfc-face--back > *:nth-child(4) {
	--tfc-anim-step: 210ms;
}

.del-tfc--anim-fade-up .del-tfc-face--back > *:nth-child(n+5),
.del-tfc--anim-fade .del-tfc-face--back > *:nth-child(n+5),
.del-tfc--anim-zoom .del-tfc-face--back > *:nth-child(n+5) {
	--tfc-anim-step: 280ms;
}

.del-tfc--anim-fade-up .del-tfc-card[data-flipped="true"] .del-tfc-face--back > *,
.del-tfc--anim-fade-up .del-tfc-card:focus-within .del-tfc-face--back > *,
.del-tfc--anim-fade-up.del-tfc--hover .del-tfc-card:hover .del-tfc-face--back > *,
.del-tfc--anim-fade .del-tfc-card[data-flipped="true"] .del-tfc-face--back > *,
.del-tfc--anim-fade .del-tfc-card:focus-within .del-tfc-face--back > *,
.del-tfc--anim-fade.del-tfc--hover .del-tfc-card:hover .del-tfc-face--back > *,
.del-tfc--anim-zoom .del-tfc-card[data-flipped="true"] .del-tfc-face--back > *,
.del-tfc--anim-zoom .del-tfc-card:focus-within .del-tfc-face--back > *,
.del-tfc--anim-zoom.del-tfc--hover .del-tfc-card:hover .del-tfc-face--back > * {
	opacity: 1;
	transform: none;
	transition-delay: calc(var(--tfc-speed) * .45 + var(--tfc-anim-step));
}

.del-tfc .del-tfc-card__photo {
	display: block;
	width: 100%;
	height: 100%;
	min-height: 0;
	max-width: none;
	max-height: none;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	object-fit: cover;
	object-position: var(--tfc-img-pos);
	vertical-align: top;
}

.del-tfc .del-tfc-card__placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	background: var(--tfc-grey);
	color: var(--tfc-placeholder-ink);
	font-size: clamp(24px, 5vw, 40px);
	font-weight: 700;
	letter-spacing: .04em;
}

.del-tfc .del-tfc-card__toggle {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: inherit;
	font: inherit;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

/* Dual focus ring: a single colour would vanish either on a light photo or on
   the primary-coloured reverse side. */
.del-tfc .del-tfc-card__toggle:focus-visible,
.del-tfc .del-tfc-card__close:focus-visible,
.del-tfc .del-tfc-card__link:focus-visible,
.del-tfc .del-tfc-card__profile:focus-visible {
	outline: none;
	box-shadow: 0 0 0 3px #ffffff, 0 0 0 6px var(--tfc-primary);
	border-radius: 8px;
}

.del-tfc .del-tfc-card__toggle:focus-visible {
	border-radius: calc(var(--tfc-radius) - 2px);
}

.del-tfc .del-tfc-card__name {
	margin: 0 0 4px;
	color: var(--tfc-name-color);
	font-size: var(--tfc-name-size);
	line-height: 1.25;
	font-weight: 700;
}

.del-tfc .del-tfc-card__role {
	margin: 0;
	color: var(--tfc-role-color);
	font-size: var(--tfc-role-size);
	line-height: 1.4;
	font-weight: 600;
	letter-spacing: .03em;
}

/* Supporting text stays at full strength: fading it with opacity drops the
   contrast ratio below 4.5:1 against the primary colour. */
.del-tfc .del-tfc-card__bio {
	margin: 10px 0 0;
	color: var(--tfc-bio-color);
	font-size: 13px;
	line-height: 1.5;
	overflow: hidden;
	display: -webkit-box;
	-webkit-line-clamp: 4;
	-webkit-box-orient: vertical;
}

.del-tfc .del-tfc-card__links {
	display: flex;
	gap: 12px;
	justify-content: center;
	margin: 14px 0 0;
	padding: 0;
	list-style: none;
}

.del-tfc .del-tfc-card__links li {
	margin: 0;
	padding: 0;
	list-style: none;
}

.del-tfc .del-tfc-card__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border: 1px solid var(--tfc-icon-color);
	border-radius: 50%;
	color: var(--tfc-icon-color);
	text-decoration: none;
	transition: background-color .2s linear, color .2s linear;
}

.del-tfc .del-tfc-card__link:hover,
.del-tfc .del-tfc-card__link:focus {
	background: var(--tfc-icon-hover-bg);
	color: var(--tfc-back-bg);
}

.del-tfc .del-tfc-card__link svg {
	width: 15px;
	height: 15px;
	fill: currentColor;
}

.del-tfc .del-tfc-card__profile {
	display: inline-block;
	align-self: center;
	margin: 14px 0 0;
	padding-bottom: 2px;
	border-bottom: 2px solid var(--tfc-role-color);
	color: var(--tfc-name-color);
	font-size: 12.5px;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
	text-decoration: none;
}

.del-tfc .del-tfc-card__close {
	position: absolute;
	top: 8px;
	right: 10px;
	width: 28px;
	height: 28px;
	border: 1px solid var(--tfc-role-color);
	border-radius: 50%;
	background: transparent;
	color: var(--tfc-name-color);
	font-size: 16px;
	line-height: 1;
	opacity: .8;
	cursor: pointer;
}

.del-tfc .del-tfc-card__close:hover {
	opacity: 1;
}

.del-tfc .del-tfc__sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	white-space: nowrap;
}

/* Reduced motion: cross-fade rather than rotate. The timing function is forced
   to linear because W3 Total Cache can rewrite animation timing. */
@media (prefers-reduced-motion: reduce) {
	.del-tfc .del-tfc-card__inner {
		transition: none !important;
		transform: none !important;
	}

	.del-tfc .del-tfc-face {
		transition: opacity 120ms linear !important;
		animation-timing-function: linear !important;
	}

	.del-tfc .del-tfc-face--back {
		transform: none !important;
		opacity: 0;
	}

	.del-tfc .del-tfc-card[data-flipped="true"] .del-tfc-face--back,
	.del-tfc .del-tfc-card:focus-within .del-tfc-face--back {
		opacity: 1;
	}

	.del-tfc .del-tfc-card[data-flipped="true"] .del-tfc-face--front,
	.del-tfc .del-tfc-card:focus-within .del-tfc-face--front {
		opacity: 0;
	}

	.del-tfc .del-tfc-face--back > * {
		opacity: 1 !important;
		transform: none !important;
		transition: none !important;
	}
}
