/*
 * Sustainability - Compare (and its item widget).
 *
 * Read from cp-all-designer css/sustain-goals.css (#sugo-compare). The rail
 * and its panels are the shared side tabs (sustainability-widget.css).
 *
 * Colour, type, padding and the measures arrive from the Style tab and are not
 * repeated here.
 */

/* sustain-goals.css — a tab is a pill cut to the leaf; chosen, it fills with its colour */
.custom-sustainability-compare .custom-sustainability-compare__tabs .custom-sustainability-compare__tab {
	border-radius: 20px 0 20px 0;            /* --r-lg */
	transition: none;
}

.custom-sustainability-compare .custom-sustainability-compare__tab-name {
	display: block;
	font-weight: 600;
	line-height: 1.4;
	color: var(--custom-sus-tab-p, #5CA13F);
}

.custom-sustainability-compare .custom-sustainability-compare__tab-go {
	display: block;
	margin-top: 2px;
	font-weight: 700;
	letter-spacing: 2px;                    /* sustain-goals.css measures 1.15px */
	color: var(--custom-sus-tab-p, #5CA13F);
}

.custom-sustainability-compare .custom-sustainability-compare__tabs .custom-sustainability-compare__tab.is-active {
	background-color: transparent;
}

.custom-sustainability-compare .custom-sustainability-compare__tabs .custom-sustainability-compare__tab--filled.is-active {
	background-color: var(--custom-sus-tab-p, #5CA13F);
	box-shadow: 0 6px 18px -6px color-mix(in srgb, var(--custom-sus-tab-p, #5CA13F) 60%, transparent);
}

.custom-sustainability-compare .custom-sustainability-compare__tab--filled.is-active .custom-sustainability-compare__tab-name,
.custom-sustainability-compare .custom-sustainability-compare__tab--filled.is-active .custom-sustainability-compare__tab-go {
	color: #FFFFFF;
}

/* the table scrolls sideways under 760 rather than crushing its columns */
.custom-sustainability-compare .custom-sustainability-compare__scroll {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.custom-sustainability-compare .custom-sustainability-compare__scroll .custom-sustainability-compare__table {
	width: 100%;
	margin: 0;
	border: 0;
	border-collapse: collapse;
	text-align: left;
}


.custom-sustainability-compare .custom-sustainability-compare__table .custom-sustainability-compare__head-cell {
	padding: 14px 16px;
	border: 0;
	background: var(--custom-sus-tab-p, #5CA13F);
	font-weight: 700;
	line-height: 1.5;
	white-space: nowrap;
	vertical-align: middle;
}

.custom-sustainability-compare .custom-sustainability-compare__table tbody tr {
	border-bottom: 2px solid var(--custom-sustainability-compare-rule, #EEF2F7);   /* measures 1px */
}

.custom-sustainability-compare .custom-sustainability-compare__table tbody th,
.custom-sustainability-compare .custom-sustainability-compare__table tbody td {
	padding: 16px;
	border: 0;
	background: transparent;
	font-weight: 400;
	line-height: 1.7;
	vertical-align: top;
}

.custom-sustainability-compare .custom-sustainability-compare__table tbody .custom-sustainability-compare__topic {
	width: 22%;
	font-weight: 600;
}

.custom-sustainability-compare .custom-sustainability-compare__table tbody .custom-sustainability-compare__value {
	font-weight: 600;
	color: var(--custom-sustainability-compare-value, #16418C);
	white-space: nowrap;
}

.custom-sustainability-compare .custom-sustainability-compare__value small {
	display: block;
	font-size: 12px;
	font-weight: 400;
	line-height: 1.5;
	color: #475569;
	white-space: normal;
}

/* the result stands on a tint of the tab's colour, a bar at its left */
.custom-sustainability-compare .custom-sustainability-compare__table tbody .custom-sustainability-compare__value--now {
	background: color-mix(in srgb, var(--custom-sus-tab-p, #5CA13F) 10%, #FFFFFF);
	box-shadow: inset 4px 0 0 var(--custom-sus-tab-p, #5CA13F);   /* sustain-goals.css measures 3px */
	font-weight: 700;
}

/* a phone: each row a card, each cell named */
@media (max-width: 600px) {
	.custom-sustainability-compare .custom-sustainability-compare__table thead {
		position: absolute;
		width: 2px;
		height: 2px;
		overflow: hidden;
		clip-path: inset(50%);
	}
	.custom-sustainability-compare .custom-sustainability-compare__table tbody tr {
		display: block;
		margin-bottom: 14px;
		padding: 4px 0 8px;
		border: 2px solid #EEF2F7;
		border-radius: 14px;                 /* --r */
		background: #FFFFFF;
	}
	.custom-sustainability-compare .custom-sustainability-compare__table tbody th,
	.custom-sustainability-compare .custom-sustainability-compare__table tbody td {
		display: block;
		width: auto;
		padding: 8px 16px;
	}
	.custom-sustainability-compare .custom-sustainability-compare__table tbody td::before,
	.custom-sustainability-compare .custom-sustainability-compare__table tbody th::before {
		content: attr(data-label);
		display: block;
		margin-bottom: 2px;
		font-size: 12px;
		font-weight: 700;
		color: #94A3B8;
	}
	.custom-sustainability-compare .custom-sustainability-compare__table tbody th::before {
		color: var(--custom-sus-tab-p, #5CA13F);
	}
	.custom-sustainability-compare .custom-sustainability-compare__table tbody .custom-sustainability-compare__topic {
		width: auto;
	}
	.custom-sustainability-compare .custom-sustainability-compare__table tbody .custom-sustainability-compare__value {
		white-space: normal;
	}
}
