/* ── MD Stages Timeline ──────────────────────────────────────────────────── */

.md-st-section {
	padding: 10px 0;
}

/* ── Section Header ──────────────────────────────────────────────────────── */

.md-st-header {
	text-align: center;
	max-width: 760px;
	margin: 0 auto 48px;
	padding: 0 16px;
}

.md-st-eyebrow {
	font-size: 12px;
	letter-spacing: 3px;
	font-weight: 600;
	color: #6b6b6b;
	text-transform: uppercase;
	margin-bottom: 14px;
}

.md-st-title {
	font-size: var(--md-st-section-title-size, 34px) !important;
	font-weight: var(--md-st-section-title-wght, 700) !important;
	letter-spacing: -0.5px !important;
	line-height: 1.2 !important;
	color: var(--md-st-section-title-clr, #1a1a1a) !important;
	margin: 0 0 16px !important;
	padding: 0 !important;
}

.md-st-title-accent {
	color: var(--md-st-accent, #CC1A1A);
}

.md-st-intro {
	font-size: var(--md-st-intro-size, 17px);
	font-weight: var(--md-st-intro-weight, 400);
	line-height: 1.7;
	color: var(--md-st-intro-color, #3a3a3a);
	margin: 0 !important;
	padding: 0 !important;
}

/* ── Pill Nav ────────────────────────────────────────────────────────────── */

.md-st-nav {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: center;
	margin: 0 auto 64px;
	max-width: 880px;
	padding: 0 16px;
}

.md-st-seg {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 14px;
	background: #f4f4f4;
	border: 1px solid #e6e6e6;
	font-size: 12px;
	letter-spacing: 0.5px;
	font-weight: 600;
	color: #3a3a3a;
	text-decoration: none;
	transition: background .2s, border-color .2s, color .2s;
	white-space: nowrap;
}

.md-st-seg-n {
	font-weight: 700;
	color: var(--md-st-accent, #CC1A1A);
	font-size: 11px;
}

.md-st-seg:hover {
	background: #fff;
	border-color: var(--md-st-accent, #CC1A1A);
	color: #1a1a1a;
}

.md-st-seg.is-active {
	background: var(--md-st-accent, #CC1A1A);
	border-color: var(--md-st-accent, #CC1A1A);
	color: #fff;
}

.md-st-seg.is-active .md-st-seg-n {
	color: rgba(255, 255, 255, 0.85);
}

/* ── Timeline ────────────────────────────────────────────────────────────── */

.md-st-timeline {
	position: relative;
	max-width: 860px;
	margin: 0 auto;
}

/* Gray base rail */
.md-st-timeline::before {
	content: '';
	position: absolute;
	left: 23px;
	top: 24px;
	bottom: 24px;
	width: 2px;
	background: #e6e6e6;
	border-radius: 1px;
}

/* Red progress fill — height driven by JS scrollspy */
.md-st-timeline::after {
	content: '';
	position: absolute;
	left: 23px;
	top: 24px;
	width: 2px;
	height: var(--md-st-progress, 0px);
	background: var(--md-st-accent, #CC1A1A);
	border-radius: 1px;
	transition: height .25s cubic-bezier(.4, 0, .2, 1);
	pointer-events: none;
}

/* ── Stage item ──────────────────────────────────────────────────────────── */

.md-st-item {
	position: relative;
	padding: 0 0 64px 76px;
	scroll-margin-top: 100px;
}

.md-st-item:last-child {
	padding-bottom: 0;
}

/* Marker circle */
.md-st-marker {
	position: absolute;
	left: 0;
	top: 0;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: #fff;
	border: 2px solid #e6e6e6;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 16px;
	font-weight: 800;
	color: #6b6b6b;
	transition: background .25s, border-color .25s, color .25s, transform .25s, box-shadow .25s;
	z-index: 2;
}

.md-st-item.is-active .md-st-marker,
.md-st-item:hover .md-st-marker {
	background: var(--md-st-accent, #CC1A1A);
	border-color: var(--md-st-accent, #CC1A1A);
	color: #fff;
	transform: scale(1.06);
	box-shadow: 0 6px 18px rgba(204, 26, 26, 0.25);
}

/* Eyebrow row */
.md-st-eyebrow-row {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 8px;
}

.md-st-step-tag {
	font-size: 11px;
	letter-spacing: 2px;
	text-transform: uppercase;
	font-weight: 700;
	color: var(--md-st-accent, #CC1A1A);
}

.md-st-step-rule {
	flex: 0 0 32px;
	height: 1px;
	background: var(--md-st-accent, #CC1A1A);
	opacity: 0.4;
}

/* Item title */
.md-st-item-title {
	font-size: var(--md-st-item-title-size, 28px) !important;
	font-weight: var(--md-st-item-title-wght, 700) !important;
	letter-spacing: -0.4px !important;
	line-height: 1.2 !important;
	margin: 0 0 14px !important;
	padding: 0 !important;
	color: var(--md-st-item-title-clr, #1a1a1a) !important;
}

.md-st-item-accent {
	color: var(--md-st-accent, #CC1A1A);
}

/* Content — allows HTML including tables */
.md-st-content {
	font-size: var(--md-st-content-size, 16px);
	font-weight: var(--md-st-content-weight, 400);
	line-height: 1.7;
	color: var(--md-st-content-color, #3a3a3a);
}

.md-st-content p {
	margin: 0 0 12px;
}

.md-st-content p:last-child {
	margin-bottom: 0;
}

.md-st-content table {
	width: 100%;
	border-collapse: collapse;
	margin-top: 16px;
	font-size: 14px;
}

.md-st-content table th,
.md-st-content table td {
	padding: 10px 14px;
	border: 1px solid #e6e6e6;
	text-align: left;
	vertical-align: top;
}

.md-st-content table th {
	background: #f4f4f4;
	font-weight: 700;
	font-size: 12px;
	letter-spacing: 0.5px;
	text-transform: uppercase;
}

/* Meta line */
.md-st-meta {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	margin-top: 16px;
	font-size: var(--md-st-meta-size, 12px);
	font-weight: var(--md-st-meta-weight, 600);
	letter-spacing: 1.5px;
	color: var(--md-st-meta-color, #6b6b6b);
	text-transform: uppercase;
}

.md-st-meta::before {
	content: '';
	display: inline-block;
	width: 6px;
	height: 6px;
	background: var(--md-st-accent, #CC1A1A);
	flex-shrink: 0;
}

/* ── Mobile ──────────────────────────────────────────────────────────────── */

@media (max-width: 700px) {
	.md-st-section {
		padding: 60px 0;
	}

	.md-st-header {
		margin-bottom: 32px;
	}

	/* font-size за заглавие/увод се контролира от бекенда — не override-ваме */

	.md-st-nav {
		margin-bottom: 40px;
		gap: 6px;
	}

	.md-st-seg {
		padding: 7px 11px;
		font-size: 11px;
	}

	/* Hide labels on mobile — only numbers remain */
	.md-st-seg-lbl {
		display: none;
	}

	.md-st-timeline::before,
	.md-st-timeline::after {
		left: 19px;
	}

	.md-st-item {
		padding: 0 0 44px 60px;
	}

	.md-st-marker {
		width: 40px;
		height: 40px;
		font-size: 14px;
	}

	/* font-size за заглавие/съдържание се контролира от бекенда — не override-ваме */

	.md-st-content table {
		font-size: 13px;
	}

	.md-st-content table th,
	.md-st-content table td {
		padding: 8px 10px;
	}
}

@media (max-width: 420px) {
	/* Very small screens — hide numbers too, only active colour signals position */
	.md-st-seg-n {
		display: none;
	}

	/* Show at least something in the pill */
	.md-st-seg-lbl {
		display: inline;
		font-size: 10px;
	}
}
