/*
 * SME - Voices.
 *
 * Read from cp-all-designer sme.html:147-225, css/sme.css:286-391 and
 * css/app.css:1717-1812 (.oppc), 3200-3365 (.oppc--tm, .tmc).
 *
 * Colour, type, padding, the card's height and corner and the spaces between
 * the parts arrive from the Style tab and are not repeated here.
 */

.custom-sme-voices {
	--custom-sme-voices-dot: #728DC4;
	--custom-sme-voices-dot-on: #16418C;
	--custom-sme-voices-colour: #50A3D5;
}

/* ------------------------------------------------------------------ */
/* The rail                                                            */
/* ------------------------------------------------------------------ */

/* As wide as the window, outside the cap: a neighbour fills either shoulder. */
.custom-sme-voices .custom-sme-voices__rail {
	--custom-sme-voices-height: 406px;
	position: relative;
	display: flow-root;
	box-sizing: border-box;
}

/* The frame the ring turns in. It clips; it does not scroll. Padded by what
   a card's lift needs and pulled back by the same, so the card stays where it
   stood — join-business.css:71-75. A hand pulling sideways moves the rail; one
   moving up or down still moves the page. */
.custom-sme-voices .custom-sme-voices__view {
	position: relative;
	box-sizing: content-box;
	height: var(--custom-sme-voices-height);
	margin: -20px 0 -52px;
	padding: 20px 0 52px;
	overflow: hidden;
	cursor: grab;
	touch-action: pan-y;
	-webkit-user-select: none;
	        user-select: none;
}

.custom-sme-voices .custom-sme-voices__view.is-dragging {
	cursor: grabbing;
}

.custom-sme-voices .custom-sme-voices__track {
	position: relative;
	display: flex;
	align-items: center;
	width: max-content;
	height: 100%;
}

/* a ring carousel: the track stands still and each card is moved to its place
   on the ring by the script (sme-voices.js), frame by frame; while the frame is
   resized nothing eases */
.custom-sme-voices .custom-sme-voices__rail.is-settling .custom-sme-voices__card {
	transition: none;
}

/* ------------------------------------------------------------------ */
/* One card — app.css:1765-1784, 3222-3233, sme.css:359-391            */
/* ------------------------------------------------------------------ */

.custom-sme-voices .custom-sme-voices__card {
	position: relative;
	display: grid;
	flex: 0 0 auto;
	/* the picture's share of the card — app.css:3226 */
	grid-template-columns: min(30%, 300px) minmax(0, 1fr);
	align-items: center;
	box-sizing: border-box;
	margin: 0;
	overflow: hidden;
	border-width: 2px;                     /* sme.css:378 measures 1px */
	border-style: solid;
	cursor: pointer;
	will-change: translate, opacity;
	transition: opacity 450ms cubic-bezier(0.2, 0.8, 0.2, 1),
	            transform 450ms cubic-bezier(0.2, 0.8, 0.2, 1),
	            visibility 0s linear 0s;
}

/* app.css:1774-1775 — the cards either side are faded and a touch smaller */
.custom-sme-voices .custom-sme-voices__card.is-near {
	opacity: 0.4;
	transform: scale(0.9);
}

/* app.css:1775 — reached by any pointer, a finger included, as the design has it */
.custom-sme-voices .custom-sme-voices__card.is-near:hover {
	opacity: 0.62;
}

.custom-sme-voices .custom-sme-voices__card.is-mid {
	opacity: 1;
	transform: scale(1);
	cursor: inherit;
}

/* Never more than the card before, the open one and the card after: one
   further out goes, and comes back as it becomes a neighbour. */
.custom-sme-voices .custom-sme-voices__card:not(.is-mid):not(.is-near) {
	opacity: 0;
	visibility: hidden;
	transform: scale(0.9);
	transition: opacity 450ms cubic-bezier(0.2, 0.8, 0.2, 1),
	            transform 450ms cubic-bezier(0.2, 0.8, 0.2, 1),
	            visibility 0s linear 450ms;
}

/* one card has no neighbour, and stands in the middle of the frame */
.custom-sme-voices .custom-sme-voices__rail.is-alone .custom-sme-voices__track {
	margin: 0 auto;
}

.custom-sme-voices .custom-sme-voices__rail.is-alone .custom-sme-voices__view {
	cursor: auto;
}

/* app.css:3242-3254 — the brand leaf, ground on the card's open side */
.custom-sme-voices .custom-sme-voices__leaf {
	position: absolute;
	right: -3%;
	bottom: -6%;
	z-index: 0;
	width: 420px;                          /* app.css:3245 */
	line-height: 0;
	opacity: 0.09;
	transform: rotate(168deg);
	pointer-events: none;
	-webkit-mask-image: linear-gradient(115deg, #000 26%, rgba(0, 0, 0, 0.55) 74%, transparent 100%);
	        mask-image: linear-gradient(115deg, #000 26%, rgba(0, 0, 0, 0.55) 74%, transparent 100%);
}

.custom-sme-voices .custom-sme-voices__leaf svg {
	display: block;
	width: 100%;
	height: auto;
	fill: currentColor;
}

/* sme.css:300-304, 382-389 — a square plate the entrepreneur stands in */
.custom-sme-voices .custom-sme-voices__figure {
	position: relative;
	z-index: 1;
	display: block;
	align-self: center;
	width: 100%;
	max-height: 100%;
	aspect-ratio: 1 / 1;
	margin-right: auto;
	margin-left: auto;
	overflow: hidden;
	background: linear-gradient(168deg,
		color-mix(in srgb, var(--custom-sme-voices-colour) 30%, #FFFFFF) 0%,
		color-mix(in srgb, var(--custom-sme-voices-colour) 14%, #FFFFFF) 56%,
		color-mix(in srgb, var(--custom-sme-voices-colour) 6%, #FFFFFF) 100%);
}

/* a plate with nothing in it is white, as every empty slot is */
.custom-sme-voices .custom-sme-voices__figure:empty {
	background: #FFFFFF;
}

/* sme.css:313-318 as app.css:3270 (.jb .oppc--tm .tmc__fig img, the heavier rule)
   leaves it: the plate's size, 6% down from its top, filling it from the top */
.custom-sme-voices .custom-sme-voices__picture {
	position: absolute;
	top: 6%;
	left: 0;
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	object-fit: cover;
	object-position: center top;
}

/* sme.css:348-354 — the product, on white, sunk into the plate */
.custom-sme-voices .custom-sme-voices__picture-hover {
	position: absolute;
	top: 9%;
	left: 9%;
	display: block;
	width: 82%;
	height: 82%;
	max-width: none;
	margin: 0;
	object-fit: contain;
	object-position: center;
	opacity: 0;
	mix-blend-mode: multiply;
}

/* sme.css:337-356 — under any pointer, a finger included, the picture turns at once */
.custom-sme-voices .custom-sme-voices__card:hover [data-custom-sme-voices-turns] {
	background: color-mix(in srgb, var(--custom-sme-voices-colour) 6%, #FFFFFF);
}
.custom-sme-voices .custom-sme-voices__card:hover [data-custom-sme-voices-turns] .custom-sme-voices__picture {
	opacity: 0;
}
.custom-sme-voices .custom-sme-voices__card:hover [data-custom-sme-voices-turns] .custom-sme-voices__picture-hover {
	opacity: 1;
}

/* app.css:3280-3284 — the quote at the top, who said it on the floor */
.custom-sme-voices .custom-sme-voices__body {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	box-sizing: border-box;
	height: 100%;
	min-width: 0;
	margin: 0;
	padding: 14px 0;                       /* app.css:3283 */
	border: 0;
	background: none;
	font-style: normal;
	quotes: none;
}

.custom-sme-voices .custom-sme-voices__body::before,
.custom-sme-voices .custom-sme-voices__body::after {
	content: none;
}

/* app.css:3285-3289 */
.custom-sme-voices .custom-sme-voices__quote {
	max-width: 448px;                      /* app.css:3286 — 16em of 28px */
	margin: 0;
	padding: 0;
	font-family: inherit;
	font-style: normal;
	font-weight: 400;
	line-height: 1.4;
	letter-spacing: 0;
	text-transform: none;
}

/* app.css:3294-3297 — a passage, not a pull quote */
.custom-sme-voices .custom-sme-voices__quote--passage {
	max-width: 756px;                      /* 42em of 18px */
	line-height: 1.7;
}

/* app.css:3307-3311 — name, then who they are, on one line */
.custom-sme-voices .custom-sme-voices__by {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 4px 16px;                         /* app.css:3309 */
	margin: 0;
}

.custom-sme-voices .custom-sme-voices__name {
	flex: 0 0 auto;
	margin: 0;
	padding: 0;
	font-family: inherit;
	font-style: normal;
	font-weight: 600;
	line-height: 1.6;
	letter-spacing: 0;
	text-transform: none;
}

.custom-sme-voices .custom-sme-voices__role {
	position: relative;
	flex: 1 1 240px;
	min-width: 0;
	margin: 0;
	padding-left: 16px;                    /* app.css:3315 */
	font-family: inherit;
	font-style: normal;
	font-weight: 300;
	line-height: 1.6;
	letter-spacing: 0;
}

/* app.css:3320-3323 — a drawn rule, one line tall */
.custom-sme-voices .custom-sme-voices__role::before {
	content: "";
	position: absolute;
	top: 2px;                              /* app.css:3321 measures 2.24px */
	left: 0;
	width: 2px;                            /* app.css:3322 measures 1px */
	height: 14px;                          /* measures 14.7px */
}

/* ------------------------------------------------------------------ */
/* The dots — app.css:1800-1812                                        */
/* ------------------------------------------------------------------ */

.custom-sme-voices .custom-sme-voices__dots {
	position: relative;
	z-index: 1;
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 10px;
}

.custom-sme-voices .custom-sme-voices__dots:empty {
	display: none;
}

.custom-sme-voices .custom-sme-voices__dot,
.custom-sme-voices .custom-sme-voices__dot:hover,
.custom-sme-voices .custom-sme-voices__dot:focus {
	width: 10px;                           /* app.css:1805 measures 9px */
	height: 10px;
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background-color: var(--custom-sme-voices-dot);
	box-shadow: none;
	opacity: 0.5;
	cursor: pointer;
	appearance: none;
	transition: width 350ms cubic-bezier(0.2, 0.8, 0.2, 1),
	            opacity 250ms cubic-bezier(0.2, 0.8, 0.2, 1),
	            background-color 250ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.custom-sme-voices .custom-sme-voices__dot:hover {
	opacity: 0.85;
}

.custom-sme-voices .custom-sme-voices__dot.is-active,
.custom-sme-voices .custom-sme-voices__dot.is-active:hover {
	width: 28px;
	border-radius: 1000px;
	background-color: var(--custom-sme-voices-dot-on);
	opacity: 1;
}

.custom-sme-voices .custom-sme-voices__dot:focus-visible {
	outline: 2px solid var(--custom-sme-voices-dot-on);
	outline-offset: 4px;                   /* app.css:1812 measures 3px */
}

/* ------------------------------------------------------------------ */
/* Tablet — 768px to 1024px (app.css:3336-3365)                        */
/* ------------------------------------------------------------------ */

@media (max-width: 1024px) {
	/* one card, as wide as the frame, and as tall as the longest quote; the
	   frame is padded at its sides too so a card is whole there */
	.custom-sme-voices .custom-sme-voices__view {
		height: auto;
		margin: -20px -24px -52px;
		padding: 20px 24px 52px;
	}
	.custom-sme-voices .custom-sme-voices__track {
		align-items: stretch;
		height: auto;
	}
	/* one card at a time: nothing to fade back */
	.custom-sme-voices .custom-sme-voices__card.is-near {
		opacity: 1;
		transform: none;
	}
	/* stacked: the picture over the words, and who said it still on the floor */
	.custom-sme-voices .custom-sme-voices__card {
		grid-template-columns: minmax(0, 1fr);
		grid-template-rows: auto minmax(0, 1fr);
		align-items: stretch;
	}
	.custom-sme-voices .custom-sme-voices__figure {
		align-self: start;
		width: 220px;                      /* app.css:3270 */
		max-width: 100%;
		max-height: none;
	}
	.custom-sme-voices .custom-sme-voices__leaf {
		width: 276px;                      /* app.css:3245 — 30 units of 9.2px */
	}
	.custom-sme-voices .custom-sme-voices__body {
		padding: 10px 0;                   /* app.css:3283 measures 9.2px */
	}
	.custom-sme-voices .custom-sme-voices__quote {
		max-width: 288px;                  /* 16em of 18px */
	}
	.custom-sme-voices .custom-sme-voices__quote--passage {
		max-width: 672px;                  /* 42em of 16px */
	}
	.custom-sme-voices .custom-sme-voices__by {
		flex-direction: column;
		align-items: flex-start;
		gap: 4px;
	}
	.custom-sme-voices .custom-sme-voices__role {
		flex: 0 0 auto;
		padding-left: 0;
	}
	.custom-sme-voices .custom-sme-voices__role::before {
		display: none;
	}
}

/* ------------------------------------------------------------------ */
/* Mobile — up to 767px                                                */
/* ------------------------------------------------------------------ */

@media (max-width: 767px) {
	.custom-sme-voices .custom-sme-voices__leaf {
		width: 200px;                      /* app.css:3245 */
	}
	.custom-sme-voices .custom-sme-voices__body {
		padding: 4px 0;                    /* app.css:3283 measures 4.2px */
	}
}

@media (prefers-reduced-motion: reduce) {
	.custom-sme-voices .custom-sme-voices__card,
	.custom-sme-voices .custom-sme-voices__card:not(.is-mid):not(.is-near),
	.custom-sme-voices .custom-sme-voices__dot {
		transition: none;
	}
}
