/* CARTA Impact Dashboard: native replacement for the Power BI embed.
   Scoped under .carta-impact so it cannot leak into the Goodwish theme. */

.carta-impact {
	--ci-gold: #efa400;
	--ci-gold-dark: #d99400;
	--ci-brown: #8a5a11;
	--ci-brown-dark: #6f4809;
	--ci-cream: #faeed1;
	--ci-cream-soft: #fdf6e4;
	--ci-panel: #ffffff;
	--ci-inset: #f6f6fa;
	--ci-ink: #16213e;
	--ci-ink-soft: #5b6478;
	--ci-line: #e4e4ea;
	--ci-track: #e6e6ec;

	--ci-radius: 10px;
	--ci-gap: 14px;

	background: var(--ci-cream);
	padding: var(--ci-gap);
	color: var(--ci-ink);
	font-family: "Segoe UI", Tahoma, Geneva, Verdana, system-ui, sans-serif;
	font-size: 15px;
	line-height: 1.45;
	box-sizing: border-box;
}

.carta-impact *,
.carta-impact *::before,
.carta-impact *::after {
	box-sizing: inherit;
}

.carta-impact .ci-loading,
.carta-impact .ci-error {
	padding: 48px 16px;
	text-align: center;
	color: var(--ci-ink-soft);
	background: var(--ci-panel);
	border-radius: var(--ci-radius);
}

.carta-impact .ci-error {
	color: #8a1f1f;
}

/* ---------- page tabs ---------- */

.carta-impact .ci-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: var(--ci-gap);
}

.carta-impact .ci-tab {
	flex: 1 1 220px;
	padding: 11px 18px;
	border: 1px solid var(--ci-line);
	border-radius: 6px;
	background: var(--ci-panel);
	color: var(--ci-ink);
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	text-align: center;
	transition: background .15s, color .15s, box-shadow .15s;
}

.carta-impact .ci-tab:hover {
	box-shadow: 0 1px 6px rgba(0, 0, 0, .12);
}

.carta-impact .ci-tab[aria-selected="true"] {
	background: var(--ci-gold);
	border-color: var(--ci-gold);
	color: #fff;
	box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .12);
}

/* ---------- panels & sections ---------- */

.carta-impact .ci-panel {
	background: var(--ci-panel);
	border-radius: var(--ci-radius);
	padding: 16px 18px;
	margin-bottom: var(--ci-gap);
}

.carta-impact .ci-panel > h2,
.carta-impact .ci-section > h3 {
	margin: 0 0 8px;
	font-size: 1.22rem;
	font-weight: 700;
	color: var(--ci-ink);
	line-height: 1.25;
}

.carta-impact .ci-panel p {
	margin: 0 0 8px;
	color: #313a4f;
	font-size: .95rem;
}

.carta-impact .ci-panel p:last-child {
	margin-bottom: 0;
}

.carta-impact .ci-section {
	background: var(--ci-panel);
	border-radius: var(--ci-radius);
	padding: 14px 16px 18px;
	margin-bottom: var(--ci-gap);
}

.carta-impact .ci-section > h3 {
	font-size: 1.12rem;
	margin-bottom: 12px;
}

.carta-impact .ci-inset {
	background: var(--ci-inset);
	border-radius: 8px;
	padding: 12px;
}

.carta-impact .ci-inset + .ci-inset {
	margin-top: 12px;
}

/* ---------- slicers ---------- */

.carta-impact .ci-slicers {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: flex-end;
	margin-bottom: var(--ci-gap);
}

.carta-impact .ci-slicer {
	background: var(--ci-panel);
	border-radius: var(--ci-radius);
	padding: 10px 14px 12px;
	min-width: 240px;
	flex: 0 1 280px;
}

.carta-impact .ci-slicer > label {
	display: block;
	font-size: 1rem;
	color: #2c3448;
	margin-bottom: 6px;
}

.carta-impact .ci-slicer select {
	width: 100%;
	padding: 7px 9px;
	border: 1px solid #c9c9d2;
	border-radius: 4px;
	background: #fff;
	color: var(--ci-ink);
	font-size: .95rem;
	font-family: inherit;
}

.carta-impact .ci-reset {
	background: var(--ci-panel);
	border: 1px solid var(--ci-line);
	border-radius: var(--ci-radius);
	padding: 10px 16px;
	font: inherit;
	font-weight: 600;
	color: var(--ci-ink);
	cursor: pointer;
}

.carta-impact .ci-reset:hover {
	border-color: var(--ci-gold);
	color: var(--ci-brown);
}

.carta-impact .ci-filternote {
	flex: 1 1 100%;
	font-size: .85rem;
	color: #6b5a2a;
}

/* ---------- grids ---------- */

.carta-impact .ci-grid {
	display: grid;
	gap: 12px;
}

.carta-impact .ci-grid-4 {
	grid-template-columns: repeat(4, minmax(0, 1fr));
}

.carta-impact .ci-grid-2 {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 1100px) {
	.carta-impact .ci-grid-4 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 720px) {
	.carta-impact .ci-grid-4,
	.carta-impact .ci-grid-2 {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* ---------- KPI cards ---------- */

.carta-impact .ci-card {
	background: #fff;
	border: 1px solid var(--ci-line);
	border-radius: 8px;
	padding: 12px 14px 14px;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	min-height: 132px;
}

.carta-impact .ci-card-title {
	font-size: .9rem;
	font-weight: 700;
	color: var(--ci-ink);
	margin-bottom: 2px;
}

.carta-impact .ci-card-value {
	font-size: 2.6rem;
	font-weight: 700;
	color: var(--ci-ink);
	line-height: 1.05;
	letter-spacing: -.01em;
}

/* Attribution under a figure that comes from outside the spreadsheets. */
.carta-impact .ci-card-source {
	font-size: .76rem;
	color: var(--ci-ink-soft);
	margin-top: 4px;
}

.carta-impact .ci-card-source a {
	color: var(--ci-brown);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.carta-impact .ci-card-source a:hover {
	color: var(--ci-gold-dark);
}

.carta-impact .ci-card-sub {
	font-size: .8rem;
	color: var(--ci-ink-soft);
}

/* gender split under a KPI number */
.carta-impact .ci-split {
	display: flex;
	justify-content: center;
	gap: 14px;
	margin-top: 8px;
	width: 100%;
}

.carta-impact .ci-split-item {
	display: flex;
	align-items: center;
	gap: 5px;
}

.carta-impact .ci-split-item svg {
	flex: none;
}

.carta-impact .ci-split-num {
	font-size: 1.15rem;
	font-weight: 600;
	color: #2b3348;
	line-height: 1;
}

.carta-impact .ci-split-label {
	font-size: .72rem;
	color: #8a91a1;
	display: block;
}

.carta-impact .ci-pill {
	background: var(--ci-gold);
	color: #4a3300;
	font-size: .68rem;
	font-weight: 700;
	border-radius: 999px;
	padding: 2px 6px;
	line-height: 1;
	align-self: center;
}

.carta-impact .ci-pill-male {
	background: var(--ci-brown);
	color: #fff;
}

/* average / median toggle */
.carta-impact .ci-toggle {
	display: inline-flex;
	margin-top: 10px;
	border-radius: 4px;
	overflow: hidden;
	border: 1px solid #c9c9d2;
}

.carta-impact .ci-toggle button {
	border: 0;
	padding: 5px 14px;
	background: #f2f2f5;
	color: #2b3348;
	font: inherit;
	font-size: .8rem;
	cursor: pointer;
}

.carta-impact .ci-toggle button[aria-pressed="true"] {
	background: var(--ci-ink);
	color: #fff;
	font-weight: 600;
}

/* card with a decorative mark beside the figure (Publications) */
.carta-impact .ci-card-illus {
	flex-direction: row;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	text-align: left;
}

.carta-impact .ci-card-illus .ci-illus-text {
	min-width: 0;
}

.carta-impact .ci-card-illus .ci-card-value {
	font-size: 3rem;
}

.carta-impact .ci-card-illus svg {
	flex: none;
	width: 104px;
	height: auto;
}

@media (max-width: 520px) {
	.carta-impact .ci-card-illus svg {
		width: 76px;
	}
}

.carta-impact .ci-gauge {
	display: block;
	width: 150px;
	height: 92px;
	max-width: 100%;
	margin-top: 4px;
}

/* achievement cards: an icon badge carries the meaning, so four similar
   numbers are no longer distinguishable only by reading their captions */
.carta-impact .ci-stat {
	background: #fff;
	border: 1px solid var(--ci-line);
	border-radius: 8px;
	padding: 16px 14px 15px;
	text-align: center;
	display: flex;
	flex-direction: column;
	align-items: center;
	transition: box-shadow .16s, border-color .16s;
}

.carta-impact .ci-stat:hover {
	box-shadow: 0 2px 12px rgba(22, 33, 62, .09);
	border-color: #dcd2b8;
}

.carta-impact .ci-stat-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: var(--ci-cream-soft);
	border: 1px solid #eadfc2;
	margin-bottom: 9px;
	flex: none;
}

.carta-impact .ci-stat-value {
	font-size: 2.15rem;
	font-weight: 700;
	color: var(--ci-ink);
	line-height: 1.05;
}

.carta-impact .ci-stat-label {
	font-size: .81rem;
	color: #4d566b;
	line-height: 1.35;
	margin-top: 3px;
	max-width: 21em;
}

/* ---------- charts ---------- */

.carta-impact .ci-chart {
	background: #fff;
	border: 1px solid var(--ci-line);
	border-radius: 8px;
	padding: 12px 14px 8px;
	min-width: 0;
}

.carta-impact .ci-chart-title {
	font-size: .95rem;
	font-weight: 600;
	color: #2b3348;
	margin-bottom: 4px;
}

.carta-impact .ci-chart-scroll {
	overflow-x: auto;
}

.carta-impact .ci-chart svg {
	display: block;
	width: 100%;
	height: auto;
	min-width: 420px;
}

.carta-impact .ci-legend {
	display: flex;
	justify-content: center;
	gap: 16px;
	font-size: .8rem;
	color: #4d566b;
	padding-top: 2px;
}

.carta-impact .ci-legend-item {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	background: none;
	border: 1px solid transparent;
	border-radius: 999px;
	padding: 2px 9px;
	font: inherit;
	font-size: .8rem;
	color: #4d566b;
	cursor: pointer;
	transition: opacity .15s, border-color .15s, background .15s;
}

.carta-impact .ci-legend-item:hover {
	border-color: var(--ci-line);
	background: #fafafc;
}

.carta-impact .ci-legend-item[aria-pressed="true"] {
	border-color: var(--ci-gold);
	background: #fdf6e4;
	font-weight: 600;
	color: var(--ci-ink);
}

.carta-impact .ci-legend-item.is-off {
	opacity: .4;
}

.carta-impact .ci-legend i {
	width: 9px;
	height: 9px;
	border-radius: 50%;
	display: inline-block;
}

.carta-impact .ci-bar {
	cursor: pointer;
}

.carta-impact .ci-bar.is-dimmed {
	opacity: .32;
}

.carta-impact .ci-axis-line {
	stroke: var(--ci-line);
	stroke-width: 1;
}

.carta-impact .ci-axis-text {
	fill: #6d7488;
	font-size: 10px;
}

.carta-impact .ci-bar-label {
	fill: #fff;
	font-size: 10px;
	font-weight: 600;
	text-anchor: middle;
	pointer-events: none;
}

.carta-impact .ci-bar-label.is-outside {
	fill: #2b3348;
}

/* ---------- page 2: institutional capacity ---------- */

/* Same four groups and figures as the report, presented as proper cards on a
   shared baseline instead of floating boxes of unequal height. */
.carta-impact .ci-group {
	background: #fff;
	border: 1px solid var(--ci-line);
	border-radius: 8px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

.carta-impact .ci-group-head {
	background: var(--ci-cream-soft);
	border-bottom: 1px solid var(--ci-line);
	padding: 9px 14px;
	font-size: .9rem;
	font-weight: 700;
	color: var(--ci-brown);
	text-align: center;
	letter-spacing: .01em;
}

.carta-impact .ci-group-body {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 18px 14px;
	padding: 18px 16px;
	flex: 1;
	align-content: center;
}

.carta-impact .ci-metric {
	text-align: center;
	min-width: 0;
}

.carta-impact .ci-metric svg {
	display: block;
	margin: 0 auto 6px;
}

.carta-impact .ci-metric-num {
	font-size: 1.75rem;
	font-weight: 700;
	color: var(--ci-ink);
	line-height: 1.05;
}

.carta-impact .ci-metric-label {
	font-size: .78rem;
	color: #4d566b;
	margin-top: 2px;
}

/* Bar encodes the number already shown, on one scale across all four groups,
   so 986 no longer looks the same size as 23. */
.carta-impact .ci-metric-bar {
	display: block;
	height: 5px;
	background: #ececf2;
	border-radius: 999px;
	margin-top: 9px;
	overflow: hidden;
}

.carta-impact .ci-metric-bar i {
	display: block;
	height: 100%;
	background: var(--ci-gold);
	border-radius: 999px;
}

/* Concluding figure for the block: full width, cream fill so it closes the
   group of cards rather than floating beneath them. */
.carta-impact .ci-adopted {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 18px;
	margin-top: 12px;
	padding: 14px 22px;
	background: var(--ci-cream-soft);
	/* A gold top rule rather than a full gold border: this closes the block
	   without competing with the group headers. */
	border: 1px solid var(--ci-line);
	border-top: 3px solid var(--ci-gold);
	border-radius: 8px;
	text-align: left;
}

.carta-impact .ci-adopted-figure {
	flex: 1 1 240px;
	text-align: center;
	padding-right: 20px;
	border-right: 1px solid #d8ccae;
}

.carta-impact .ci-adopted-num {
	font-size: 2.9rem;
	font-weight: 700;
	color: var(--ci-ink);
	line-height: 1;
}

.carta-impact .ci-adopted-label {
	font-size: .92rem;
	font-weight: 600;
	color: var(--ci-brown);
	margin: 2px auto 0;
	max-width: 18em;
}

/* The named institutions, as the report lists them. */
.carta-impact .ci-adopted-list {
	flex: 1 1 300px;
	min-width: 0;
	align-self: stretch;
}

.carta-impact .ci-adopted-list-head {
	font-size: .74rem;
	font-weight: 600;
	color: #6b7285;
	border-bottom: 1px solid #ddd3b8;
	padding: 0 8px 3px;
	margin-bottom: 2px;
}

.carta-impact .ci-adopted-item {
	font-size: .84rem;
	color: var(--ci-ink);
	padding: 4px 8px;
	border-radius: 3px;
}

.carta-impact .ci-adopted-item:nth-child(odd) {
	background: rgba(138, 90, 17, .07);
}

@media (max-width: 620px) {
	.carta-impact .ci-adopted {
		flex-direction: column;
		gap: 14px;
	}
	.carta-impact .ci-adopted-figure {
		padding-right: 0;
		padding-bottom: 12px;
		border-right: 0;
		border-bottom: 1px solid #e0d6bb;
		width: 100%;
	}
}

.carta-impact .ci-topic-empty {
	font-size: .85rem;
	color: #8a91a1;
	font-style: italic;
	padding: 8px 2px;
}

@media (max-width: 560px) {
	.carta-impact .ci-group-body {
		gap: 14px 10px;
		padding: 14px 12px;
	}
	.carta-impact .ci-metric-num {
		font-size: 1.5rem;
	}
}

/* ---------- footer ---------- */

.carta-impact .ci-foot {
	font-size: .78rem;
	color: #7a6a3d;
	text-align: right;
	padding: 2px 4px 0;
}

.carta-impact .ci-foot button {
	background: none;
	border: 0;
	color: #7a6a3d;
	text-decoration: underline;
	cursor: pointer;
	font: inherit;
	padding: 0;
}

.carta-impact [hidden] {
	display: none !important;
}
