/*
 * SME - Criteria.
 *
 * Read from cp-all-designer sme.html:227-276, css/sme.css:37-54, 394-468,
 * 641-652, 680-689.
 *
 * Colour, type, padding, the corner and the spaces between the parts arrive
 * from the Style tab and are not repeated here.
 */

.custom-sme-criteria {
	--custom-sme-criteria-ground: #FFFFFF;
	--custom-sme-criteria-ground-on: #F0F9FD;
	--custom-sme-criteria-disc: #F0F9FD;
	--custom-sme-criteria-ink: #50A3D5;
	--custom-sme-criteria-disc-on: #50A3D5;
	--custom-sme-criteria-ink-on: #FFFFFF;
	position: relative;
	overflow: hidden;
}

/* the band's content stands over the leaf — sme.css:54 */
.custom-sme-criteria .custom-sme-criteria__inner {
	position: relative;
	z-index: 1;
}

/* sme.css:48-53 — the brand's leaf, turned about, rising off the foot corner */
.custom-sme-criteria .custom-sme-criteria__leaf {
	position: absolute;
	bottom: -190px;                        /* sme.css:49 (-201.6 capped at -190) */
	left: -86px;                           /* sme.css:50 (-86.4) */
	z-index: 0;
	line-height: 0;
	transform: rotate(180deg);
	pointer-events: none;
}

.custom-sme-criteria .custom-sme-criteria__leaf svg {
	display: block;
	width: 100%;
	height: auto;
	overflow: visible;
}

/* sme.css:41 — the outline keeps its weight however large the leaf is drawn */
.custom-sme-criteria .custom-sme-criteria__leaf path {
	vector-effect: non-scaling-stroke;
}

/* sme.css:421-427 — one panel, its cells parted by the panel's own ground
   showing through the gaps between them */
.custom-sme-criteria .custom-sme-criteria__items {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	margin-right: 0;
	margin-bottom: 0;
	margin-left: 0;
	padding: 0;
	overflow: hidden;
	box-shadow: 0 18px 44px -14px rgba(22, 65, 140, 0.2);   /* --sh, app.css:160 */
	list-style: none;
}

/* sme.css:428-435 — every cell of a row is as tall as the tallest, its words centred */
.custom-sme-criteria .custom-sme-criteria__item {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	min-width: 0;
	margin: 0;
	background-color: var(--custom-sme-criteria-ground);
	text-align: center;
	list-style: none;
	transition: background-color 300ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* sme.css:436-448 — a disc, the icon drawn on it in the accent */
.custom-sme-criteria .custom-sme-criteria__icon {
	--custom-sme-criteria-icon: 42px;
	display: grid;
	flex: 0 0 auto;
	place-items: center;
	border-radius: 50%;
	background-color: var(--custom-sme-criteria-disc);
	color: var(--custom-sme-criteria-ink);
	line-height: 0;
	transition: background-color 300ms cubic-bezier(0.2, 0.8, 0.2, 1),
	            color 300ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.custom-sme-criteria .custom-sme-criteria__icon svg {
	display: block;
	width: var(--custom-sme-criteria-icon);
	height: var(--custom-sme-criteria-icon);
}

.custom-sme-criteria .custom-sme-criteria__icon i {
	font-size: var(--custom-sme-criteria-icon);
}

/* sme.css:451-455 — a cell lights within its own frame; lifted, the panel would break */
@media (hover: hover) {
	.custom-sme-criteria .custom-sme-criteria__item:hover {
		background-color: var(--custom-sme-criteria-ground-on);
	}
	.custom-sme-criteria .custom-sme-criteria__item:hover .custom-sme-criteria__icon {
		background-color: var(--custom-sme-criteria-disc-on);
		color: var(--custom-sme-criteria-ink-on);
	}
}

/* sme.css:456-460 */
.custom-sme-criteria .custom-sme-criteria__item-title {
	margin: 0;
	padding: 0;
	font-family: inherit;
	font-style: normal;
	font-weight: 600;
	line-height: 1.55;
	letter-spacing: 0;
	text-transform: none;
	text-wrap: balance;
}

/* ------------------------------------------------------------------ */
/* Tablet — 768px to 1024px (sme.css:641-652)                          */
/* ------------------------------------------------------------------ */

@media (max-width: 1024px) {
	/* two to a row: the rules between the cells cross */
	.custom-sme-criteria .custom-sme-criteria__items {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
	/* the leaf goes */
	.custom-sme-criteria .custom-sme-criteria__leaf {
		display: none;
	}
}

/* ------------------------------------------------------------------ */
/* Mobile — up to 767px (sme.css:680-689, drawn at 640)                */
/* ------------------------------------------------------------------ */

@media (max-width: 767px) {
	/* one to a row, the icon beside the words, read down as a list */
	.custom-sme-criteria .custom-sme-criteria__items {
		grid-template-columns: minmax(0, 1fr);
	}
	.custom-sme-criteria .custom-sme-criteria__item {
		flex-direction: row;
		justify-content: flex-start;
		text-align: left;
	}
}

@media (prefers-reduced-motion: reduce) {
	.custom-sme-criteria .custom-sme-criteria__item,
	.custom-sme-criteria .custom-sme-criteria__icon {
		transition: none;
	}
}
