/*
 * Sustainability - Goal pillar.
 *
 * Read from cp-all-designer css/sustain.css:128-171 (.gopillar) and
 * css/sustain-goals.css (#sugo-pillars).
 *
 * Colour, type, padding and the measures arrive from the Style tab and are not
 * repeated here.
 */

/* the name and its line at the left, capped; the goals at the right */
.custom-sustainability-goal-pillar .custom-sustainability-goal-pillar__panel {
	--custom-sustainability-goal-pillar-p: rgba(63, 122, 42, 0.94);
	--custom-sustainability-goal-pillar-ink: #FFFFFF;
	display: grid;
	grid-template-columns: minmax(240px, min(var(--custom-sustainability-goal-pillar-left, 400px), 30%)) minmax(0, 1fr);
	align-items: stretch;
	box-sizing: border-box;
	overflow: clip;
	border: 2px solid var(--custom-sustainability-goal-pillar-p);   /* sustain.css:136 measures 1px */
	background: var(--custom-sustainability-goal-pillar-p);
	box-shadow: 0 6px 18px -6px rgba(22, 65, 140, 0.14);   /* --sh-sm */
}

/* stays in view under the bar at the top of the window while the goals run past */
.custom-sustainability-goal-pillar .custom-sustainability-goal-pillar__side {
	position: sticky;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-self: start;
	justify-content: flex-start;
	color: var(--custom-sustainability-goal-pillar-ink);
}

.custom-sustainability-goal-pillar .custom-sustainability-goal-pillar__tag {
	align-self: flex-start;
	padding: 6px 14px;
	border-radius: 1000px;
	background: rgba(255, 255, 255, 0.24);
	font-size: 14px;
	font-weight: 700;
	line-height: 1.6;
}

/* "7 Go" held back; the pillar's own word in full */
.custom-sustainability-goal-pillar .custom-sustainability-goal-pillar__panel .custom-sustainability-goal-pillar__side .custom-sustainability-goal-pillar__name {
	margin-top: 14px;
	font-weight: 700;
	line-height: 1.3;
	color: color-mix(in srgb, var(--custom-sustainability-goal-pillar-ink) 80%, transparent);
}

.custom-sustainability-goal-pillar .custom-sustainability-goal-pillar__panel .custom-sustainability-goal-pillar__side .custom-sustainability-goal-pillar__name:first-child {
	margin-top: 0;
}

.custom-sustainability-goal-pillar .custom-sustainability-goal-pillar__name b,
.custom-sustainability-goal-pillar .custom-sustainability-goal-pillar__name strong {
	color: var(--custom-sustainability-goal-pillar-ink);
}

.custom-sustainability-goal-pillar .custom-sustainability-goal-pillar__panel .custom-sustainability-goal-pillar__side .custom-sustainability-goal-pillar__line {
	max-width: 380px;
	margin: 8px 0 16px;
	line-height: 1.6;
	color: inherit;
}

/* the goals, white cards on the colour */
.custom-sustainability-goal-pillar .custom-sustainability-goal-pillar__goals {
	display: grid;
	align-content: stretch;
	gap: 12px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.custom-sustainability-goal-pillar .custom-sustainability-goal-pillar__goal {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	align-content: center;
	align-items: center;
	column-gap: 16px;
	margin: 0;
	border: 2px solid transparent;           /* measures 1px */
	border-radius: 14px;                     /* --r */
	background: #FFFFFF;
	transition: border-color 400ms cubic-bezier(0.2, 0.8, 0.2, 1),
	            box-shadow 400ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.custom-sustainability-goal-pillar .custom-sustainability-goal-pillar__goal:hover {
	border-color: color-mix(in srgb, var(--custom-sustainability-goal-pillar-p) 40%, #FFFFFF);
	box-shadow: 0 14px 30px -18px rgba(0, 0, 0, 0.45);
}

.custom-sustainability-goal-pillar .custom-sustainability-goal-pillar__goal-icon {
	display: inline-flex;
	grid-row: 1;
	grid-column: 1;
	align-items: center;
	justify-content: center;
	width: var(--custom-sustainability-goal-pillar-icon, 34px);
	height: var(--custom-sustainability-goal-pillar-icon, 34px);
	border-radius: 10px;
	background: color-mix(in srgb, var(--custom-sustainability-goal-pillar-p) 14%, #FFFFFF);
	color: var(--custom-sustainability-goal-pillar-p);
}

.custom-sustainability-goal-pillar .custom-sustainability-goal-pillar__goal-icon svg {
	display: block;
	width: 58%;
	height: 58%;
}

.custom-sustainability-goal-pillar .custom-sustainability-goal-pillar__goals .custom-sustainability-goal-pillar__goal .custom-sustainability-goal-pillar__goal-title {
	grid-row: 1;
	grid-column: 2;
	margin: 0;
	font-weight: 600;
	line-height: 1.4;
}

.custom-sustainability-goal-pillar .custom-sustainability-goal-pillar__goals .custom-sustainability-goal-pillar__goal .custom-sustainability-goal-pillar__goal-text {
	grid-row: 2;
	grid-column: 2;
	margin: 4px 0 0;
	font-weight: 400;
	line-height: 1.6;
}

/* a goal with no drawing runs from the edge */
.custom-sustainability-goal-pillar .custom-sustainability-goal-pillar__goal:not(:has(.custom-sustainability-goal-pillar__goal-icon)) {
	grid-template-columns: minmax(0, 1fr);
}

.custom-sustainability-goal-pillar .custom-sustainability-goal-pillar__goal:not(:has(.custom-sustainability-goal-pillar__goal-icon)) > * {
	grid-column: 1;
}

@media (max-width: 1000px) {
	.custom-sustainability-goal-pillar .custom-sustainability-goal-pillar__panel {
		grid-template-columns: minmax(0, 1fr);
	}
	.custom-sustainability-goal-pillar .custom-sustainability-goal-pillar__side {
		position: static;
	}
	.custom-sustainability-goal-pillar .custom-sustainability-goal-pillar__panel .custom-sustainability-goal-pillar__side .custom-sustainability-goal-pillar__line {
		max-width: none;
	}
}

@media (max-width: 600px) {
	.custom-sustainability-goal-pillar .custom-sustainability-goal-pillar__goal {
		column-gap: 12px;
	}
	.custom-sustainability-goal-pillar .custom-sustainability-goal-pillar__goal-icon {
		align-self: start;
		border-radius: 8px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.custom-sustainability-goal-pillar .custom-sustainability-goal-pillar__goal {
		transition: none;
	}
}
