/* ============================================================
   RTA CHART
   Relies on the theme's --yellow / --periwinkle / --teal / --purple /
   --grey / --darkgrey / --white custom properties — this plugin
   doesn't define its own colour values.
   ============================================================ */

.rta-chart {
	color: var(--white);
	font-family: 'ABC Whyte', sans-serif;
}

.rta-chart__title {
	font-family: Anton, sans-serif;
	font-weight: 400;
	text-transform: uppercase;
	margin: 0 0 24px;
}

.rta-chart__bars {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.rta-chart__row {
	display: grid;
	grid-template-columns: 180px 1fr;
	align-items: center;
	gap: 16px;
}

.rta-chart__label {
	font-size: 14px;
}

.rta-chart__track {
	display: flex;
	height: 28px;
	overflow: hidden;
	background-image: repeating-linear-gradient(
		to right,
		rgba(255, 255, 255, 0.2) 0,
		rgba(255, 255, 255, 0.2) 1px,
		transparent 1px,
		transparent 10%
	);
}

.rta-chart__segment {
	flex: 0 0 auto;
	height: 100%;
	flex-basis: var(--value);
	transition: flex-basis 0.9s ease;
	transition-delay: var(--row-delay, 0s);
}

/* Progressive enhancement: only zero out and animate once JS has
   confirmed it can run the IntersectionObserver — no-JS visitors
   always see the full, correct bars immediately. */
.rta-chart--js .rta-chart__segment {
	flex-basis: 0%;
}

.rta-chart--js.is-inview .rta-chart__segment {
	flex-basis: var(--value);
}

.rta-chart__axis {
	display: grid;
	grid-template-columns: 180px 1fr;
	gap: 16px;
	margin-top: 4px;
}

.rta-chart__axis-track {
	position: relative;
	height: 16px;
}

.rta-chart__axis-tick {
	position: absolute;
	top: 0;
	transform: translateX(-50%);
	font-size: 12px;
	color: rgba(255, 255, 255, 0.6);
}

.rta-chart__axis-tick:first-child {
	transform: translateX(0);
}

.rta-chart__axis-tick:last-child {
	transform: translateX(-100%);
}

.rta-chart__legend {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 24px;
	margin-top: 24px;
}

.rta-chart__legend-item {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
}

.rta-chart__legend-swatch {
	width: 16px;
	height: 16px;
	display: inline-block;
	flex: 0 0 auto;
}

@media (max-width: 767px) {
	.rta-chart__row {
		grid-template-columns: 1fr;
		gap: 4px;
	}

	.rta-chart__label {
		font-size: 13px;
	}

	.rta-chart__axis {
		display: none;
	}
}
