/* FRG Growth Chart — adapted from theme growth-timeline block styles */
/* Scoped to .frg-growth-chart to avoid conflicts with the theme block */

.frg-growth-chart {
	padding-bottom: 100px;
	overflow: hidden;
}

.frg-growth-chart .container {
	position: relative;
}

/* ── Chart canvas area ────────────────────────────────────────────────────── */

.frg-growth-chart .growth-timeline-chart {
	height: 450px;
	width: 100%;
	padding-left: calc(1.7857142857% - 5px);
	padding-right: calc(1.7857142857% - 5px);
}

/* ── Tooltip ──────────────────────────────────────────────────────────────── */

.frg-growth-chart .growth-timeline-tooltip {
	background: #212121;
	border-radius: 4px;
	color: #fff;
	opacity: 0;
	pointer-events: none;
	position: absolute;
	transform: translate(-50%, 0);
	transition: all 0.1s ease;
	z-index: 100;
	padding: 5px 6px;
	margin-top: 12px;
	font-size: 12px;
	line-height: 1.1em;
}

.frg-growth-chart .growth-timeline-tooltip-year {
	font-weight: 600;
	font-size: 13px;
}

.frg-growth-chart .growth-timeline-tooltip-content {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-top: 5px;
}

.frg-growth-chart .growth-timeline-tooltip-rect {
	width: 10px;
	height: 10px;
	border-radius: 2px;
}

/* ── Event markers row ────────────────────────────────────────────────────── */

.frg-growth-chart .growth-timeline-events {
	position: absolute;
	bottom: 6px;
	width: 100%;
	margin: 0;
	left: 0;
	display: flex;
	align-items: flex-end;
	padding: 0 14px;
	pointer-events: none;
}

/* ── Individual event ─────────────────────────────────────────────────────── */

.frg-growth-chart .growth-timeline-event {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	position: relative;
	margin-bottom: -35px;
	height: auto;
	min-height: 84px;
	flex: 1;
}

/* Horizontal timeline bar behind every event */
.frg-growth-chart .growth-timeline-event:after {
	content: "";
	display: block;
	height: 1px;
	width: 100%;
	background: rgba(0, 0, 0, 0.4);
	position: absolute;
	top: var(--gc-line-height, 50px);
	left: 0;
}

.frg-growth-chart .growth-timeline-event:first-child:after {
	left: 50%;
	width: 50%;
}

.frg-growth-chart .growth-timeline-event:last-child:after {
	left: 0;
	width: 50%;
}

/* Fade in title/line/year when .show is added by slider JS */
.frg-growth-chart .growth-timeline-event.show .growth-timeline-event-title,
.frg-growth-chart .growth-timeline-event.show .growth-timeline-event-line,
.frg-growth-chart .growth-timeline-event.show .growth-timeline-event-year {
	opacity: 1;
}

/* ── Event title label ────────────────────────────────────────────────────── */

.frg-growth-chart .growth-timeline-event-title {
	font-size: 1rem;
	color: rgba(0, 0, 0, 1);
	font-weight: 400;
	position: absolute;
	left: 50%;
	/* Default: no logo — center the text block */
	transform: translateX(-50%);
	bottom: 90px;
	line-height: 0.9em;
	text-align: left;
	opacity: 0;
	white-space: nowrap;
	transition: opacity 1s linear;
	display: flex;
	align-items: center;
	gap: 6px;
}

/* ── Brand-specific entry class tweaks ───────────────────────────────────── */
/* Set via the "CSS Class" field on each Label Entry in the admin.            */

.frg-growth-chart .growth-timeline-event-title.apple img {
	margin-right: 2px;
}
.frg-growth-chart .growth-timeline-event-title.apple span {
	margin-top: 5px;
}

.frg-growth-chart .growth-timeline-event-title.arby img {
	height: 36px;
}

.frg-growth-chart .growth-timeline-event-title.wendy img:first-child {
	height: 32px;
	margin-right: 5px;
}

/* ── Event vertical line ──────────────────────────────────────────────────── */

.frg-growth-chart .growth-timeline-event-line {
	width: 1px;
	height: 50px;
	background: rgba(0, 0, 0, 0.5);
	opacity: 0;
	transition: opacity 1s linear;
}

/* ── Event year label ─────────────────────────────────────────────────────── */

.frg-growth-chart .growth-timeline-event-year {
	font-size: 15px;
	font-weight: 400;
	color: #152c53;
	padding: 10px 0 0;
	opacity: 0;
	transition: opacity 1s linear;
}

/* ── Year-last (target/future year) — always visible ─────────────────────── */

.frg-growth-chart .growth-timeline-event.year-last {
	height: 430px;
}

.frg-growth-chart .growth-timeline-event.year-last .growth-timeline-event-title {
	bottom: 450px;
	opacity: 1;
}

.frg-growth-chart .growth-timeline-event.year-last .growth-timeline-event-line {
	opacity: 1;
	height: 396px;
}

.frg-growth-chart .growth-timeline-event.year-last:after {
	top: 396px;
}

.frg-growth-chart .growth-timeline-event-yaxis {
	position: absolute;
	left: 0;
	text-wrap: nowrap;
	rotate: 90deg;
	top: 50%;
	font-weight: 500;
	white-space: nowrap;
}

/* ── Year-current: horizontal + dashed future lines ──────────────────────── */

.frg-growth-chart .growth-timeline-event.year-current .horizontal-line {
	position: absolute;
	left: 24px;
	border-bottom: 3px solid #959594;
	opacity: 0;
	transition: opacity 0.6s linear 0.4s;
}

.frg-growth-chart .growth-timeline-event.year-current .dashed-line {
	position: absolute;
	left: 0;
	transform-origin: center left;
	opacity: 0;
	transition: opacity 0.6s linear 0.4s;
}

.frg-growth-chart .growth-timeline-event.year-current.show .horizontal-line,
.frg-growth-chart .growth-timeline-event.year-current.show .dashed-line {
	opacity: 1;
}

/* ── Stacked multi-entry labels ───────────────────────────────────────────── */

.frg-growth-chart .growth-timeline-event-titles {
	position: absolute;
	bottom: 90px; /* overridden per-event by JS */
	left: 50%;
	transform: translateX(-50%);
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 6px;
	opacity: 0;
	transition: opacity 1s linear;
}

.frg-growth-chart .growth-timeline-event.show .growth-timeline-event-titles {
	opacity: 1;
}

/* Inner titles inside the wrapper are in flow, not individually positioned */
.frg-growth-chart .growth-timeline-event-titles .growth-timeline-event-title {
	position: static;
	opacity: 1;
	transform: none;
	left: auto;
	bottom: auto;
	transition: none;
}

/* Content layout inside stacked entries */
.frg-growth-chart .growth-timeline-event-title .content {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	margin-top: 3px;
}

.frg-growth-chart .growth-timeline-event-title .content .small {
	font-size: 11px;
	margin-top: 2px;
}

/* Logo spacing within stacked entries */
.frg-growth-chart .growth-timeline-event-title.first img,
.frg-growth-chart .growth-timeline-event-title.second img,
.frg-growth-chart .growth-timeline-event-title.nz img {
	height: 32px;
	width: auto;
	margin-left: 8px;
}

/* ── Phase groups bar ─────────────────────────────────────────────────────── */

.frg-growth-chart .growth-timeline-groups {
	position: absolute;
	bottom: -85px;
	height: 53px;
	width: 100%;
	left: 0;
	display: flex;
	padding-left: calc(1.7857142857% - 5px + 14px);
	padding-right: calc(1.7857142857% - 5px + 14px);
}

.frg-growth-chart .growth-timeline-group {
	font-size: 1rem;
	color: #212529;
	text-align: left;
	padding: 0.8em 0;
	line-height: 1.2em;
	border-top: 8px solid #9c9c9c; /* overridden per phase via inline style */
	position: relative;
}

.frg-growth-chart .growth-timeline-group > div {
	padding: 0 15px;
}

/* ── Arrow on last phase ──────────────────────────────────────────────────── */

.frg-growth-chart .arrow-right {
	--arrow-height: 10px;
	top: -14px;
	left: 100%;
	border-top: 10px solid transparent;
	border-bottom: 10px solid transparent;
	border-left: 10px solid #0d9dc9;
	position: absolute;
}

.frg-growth-chart .arrow-right::before {
	content: "";
	display: block;
	width: 0;
	height: var(--arrow-height);
	position: absolute;
	top: 0;
	left: 100%;
	background: #0d9dc9;
}

/* ── Slider ───────────────────────────────────────────────────────────────── */

.frg-growth-chart .frg-gc-slider {
	-webkit-appearance: none;
	height: 10px;
	border-radius: 5px;
	background: transparent;
	outline: none;
	opacity: 1;
	transition: opacity 0.2s;
	position: absolute;
	bottom: 41px;
	left: calc(1.7857142857% - 5px + 8px);
	right: calc(1.7857142857% - 5px + 8px);
}

.frg-growth-chart .frg-gc-slider::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #fff;
	border: 2px solid #959594;
	cursor: pointer;
	transform: translateY(-3px);
}

.frg-growth-chart .frg-gc-slider::-moz-range-thumb {
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #fff;
	border: 2px solid #959594;
	cursor: pointer;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */

@media (max-width: 1400px) {
	.frg-growth-chart .growth-timeline-events {
		padding: 0 14px 0 13px;
	}

	.frg-growth-chart .growth-timeline-event-year {
		font-size: 13px;
	}

	.frg-growth-chart .growth-timeline-group {
		font-size: 14px;
	}
}

@media (max-width: 1200px) {
	.frg-growth-chart .growth-timeline-event-title {
		font-size: 0.85rem;
	}

	.frg-growth-chart .growth-timeline-event-year {
		font-size: 12px;
	}

	.frg-growth-chart .growth-timeline-group {
		font-size: 12px;
	}

	.frg-growth-chart .growth-timeline-event.year-current .horizontal-line {
		left: 18px;
		font-size: 10px;
	}

	.frg-growth-chart .growth-timeline-event.year-current .dashed-line {
		left: 9px;
		font-size: 12px;
	}
}

@media (max-width: 992px) {
	.frg-growth-chart .growth-timeline-groups {
		bottom: -75px;
	}

	.frg-growth-chart .growth-timeline-group {
		font-size: 11px;
	}

	.frg-growth-chart .growth-timeline-event-title img {
		height: 28px;
	}

	.frg-growth-chart .growth-timeline-event-title.wendy img:first-child {
		height: 28px;
	}

	.frg-growth-chart .growth-timeline-event-year {
		font-size: 8.9px;
	}

	.frg-growth-chart .growth-timeline-event.year-current .horizontal-line {
		left: 14px;
	}

	.frg-growth-chart .growth-timeline-event.year-current .dashed-line {
		left: 6px;
	}

	.frg-growth-chart .arrow-right {
		right: 3px;
	}
}

@media (max-width: 768px) {
	.frg-growth-chart {
		padding-top: 0;
		padding-bottom: 10px;
	}

	.frg-growth-chart .growth-timeline-events,
	.frg-growth-chart .growth-timeline-groups {
		display: none;
	}
}
