/**
 * Homepage — industry funnel diagram.
 *
 * @package Deltraux
 */

.industry__grid {
	grid-template-columns: 1fr minmax(0, 440px);
}

.funnel-diagram {
	position: sticky;
	top: 96px;
	min-width: 0;
}

.funnel-diagram__label {
	font-size: 11px;
	font-weight: 500;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--text-muted);
	margin-bottom: 20px;
}

.funnel-stage {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: center;
	gap: 16px;
}

.funnel-stage__bar {
	justify-self: start;
	width: var(--funnel-cap, 100%);
	max-width: 100%;
	min-width: 0;
	min-height: 44px;
	border-radius: 4px;
	background: var(--bg-secondary);
	border: 1px solid var(--border-default);
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 10px 16px;
	font-family: var(--font-sans);
	font-size: 13px;
	font-weight: 500;
	color: var(--text-heading);
	position: relative;
	box-sizing: border-box;
	overflow: visible;
}

.funnel-stage__bar svg {
	flex-shrink: 0;
	color: var(--accent-primary);
}

.funnel-stage__label {
	position: relative;
	z-index: 1;
	white-space: nowrap;
	line-height: 1.3;
}

.funnel-stage__count {
	font-size: 12px;
	font-weight: 500;
	color: var(--text-muted);
	white-space: nowrap;
	min-width: 72px;
	text-align: right;
}

/* Stepped bar widths — descriptors sit outside to the right */
.funnel-stage--1 .funnel-stage__bar { --funnel-cap: 100%; }
.funnel-stage--2 .funnel-stage__bar { --funnel-cap: 92%; }
.funnel-stage--3 .funnel-stage__bar { --funnel-cap: 84%; }
.funnel-stage--4 .funnel-stage__bar { --funnel-cap: 76%; }

.funnel-stage__bar--decision {
	background: #eff6ff;
	border-color: #bfdbfe;
}

.funnel-stage__bar::before {
	content: '';
	position: absolute;
	inset: 0;
	background: var(--accent-primary);
	opacity: 0.07;
	border-radius: inherit;
	z-index: 0;
	pointer-events: none;
}

.funnel-stage--2 .funnel-stage__bar::before { opacity: 0.05; }
.funnel-stage--3 .funnel-stage__bar::before { opacity: 0.03; }
.funnel-stage--4 .funnel-stage__bar::before { opacity: 0; }

.funnel-connector {
	height: 20px;
	margin-left: 16px;
	border-left: 1px dashed var(--border-default);
	position: relative;
}

.funnel-connector::after {
	content: '';
	position: absolute;
	bottom: 0;
	left: -4px;
	width: 7px;
	height: 7px;
	border-right: 1px solid var(--border-default);
	border-bottom: 1px solid var(--border-default);
	transform: rotate(45deg);
}

.funnel-note {
	margin-top: 20px;
	padding: 16px;
	background: var(--bg-secondary);
	border-left: 3px solid var(--accent-primary);
	border-radius: 0 4px 4px 0;
}

.funnel-note p {
	font-size: 13px;
	color: var(--text-muted);
	line-height: 1.6;
	font-style: italic;
	margin-bottom: 0;
}

@media (min-width: 1025px) {
	.funnel-stage__bar {
		min-width: max-content;
	}
}

@media (max-width: 1024px) {
	.industry__grid {
		grid-template-columns: 1fr;
	}

	.funnel-diagram {
		position: static;
		max-width: 100%;
		width: 100%;
	}
}

@media (max-width: 768px) {
	.funnel-stage {
		grid-template-columns: 1fr;
		gap: 8px;
	}

	.funnel-stage__bar {
		width: 100% !important;
		max-width: 100%;
		min-width: 0 !important;
	}

	.funnel-stage__label {
		white-space: normal;
	}

	.funnel-stage__count {
		min-width: 0;
		text-align: left;
	}

	.funnel-connector {
		margin-left: 12px;
	}
}
