/**
 * MF Post-Header variant: series-stage (ported from demo MFQ6 "Zentrierte Bühne +
 * Dot-Stepper"). Loaded only when a post's header variant is `series-stage`.
 *
 * The neutral, museum-centred series header: a capped, centred column with a small
 * SQUARE featured image — deliberately cropped 1:1 via the higher-specificity
 * override, a conscious exception to the crop-free rule for this square-format
 * round — above the title and a dynamic dot-stepper (one circular step per part,
 * connected by short bars) that grows with the real part count and wraps for large
 * N. System fonts + base.css colour vars only; no Google Fonts, no remote assets.
 */

.mfph-series-stage {
	max-width: 1080px;
	margin: 20px auto;
	padding: clamp(28px, 4vw, 48px);
	display: grid;
	grid-template-columns: 300px 1fr;
	gap: clamp(24px, 4vw, 56px);
	align-items: center;
	background: var(--mf-paper);
	border: 1px solid var(--mf-line);
	border-radius: 16px;
	box-shadow: 0 24px 60px -30px rgba(0, 0, 0, 0.35);
}

/* No featured image: single column (text only). */
.mfph-series-stage--noimage {
	grid-template-columns: 1fr;
}

.mfph-series-stage__series {
	font: 700 12px/1 var(--mf-font);
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--mf-muted);
	margin: 0 0 14px;
}

.mfph-series-stage__fig {
	width: 100%;
	margin: 0;
	aspect-ratio: 1;
	border-radius: 14px;
	overflow: hidden;
	box-shadow: 0 22px 46px -22px rgba(0, 0, 0, 0.4);
}

/* Deliberate square crop: three classes (0,3,0) override base.css
   `.mfph-header .mf-uncropped { height:auto }` (0,2,0) for THIS variant only, so
   the featured image fills the 1:1 card via object-fit:cover. */
.mfph-header .mfph-series-stage__fig .mf-uncropped {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.mfph-series-stage__title {
	font-family: var(--mf-serif);
	font-weight: 900;
	font-size: clamp(24px, 3.2vw, 36px);
	line-height: 1.1;
	margin: 0 0 22px;
}

/* Dot-stepper (markup from series_stepper_html()). A left-aligned flex row of
   circular step chips joined by short connector bars; it wraps for a long series. */
.mfph-series-stage .mfph-series-stepper {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-start;
	row-gap: 8px;
	margin: 0 0 20px;
}

.mfph-series-stage .mfph-step {
	position: relative;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: var(--mf-paper);
	border: 2px solid var(--mf-line);
	display: flex;
	align-items: center;
	justify-content: center;
	font: 700 12px/1 var(--mf-mono);
	color: var(--mf-muted);
}

/* Linked steps (every part except the current one): keep the chip look, add a
   pointer affordance + focus ring. */
.mfph-series-stage a.mfph-step {
	text-decoration: none;
	cursor: pointer;
	transition: transform 0.15s ease;
}

.mfph-series-stage a.mfph-step:hover {
	transform: translateY(-2px);
}

.mfph-series-stage a.mfph-step:focus-visible {
	outline: 2px solid var(--mf-violet);
	outline-offset: 2px;
}

/* Hover/focus tooltip: a small dark bubble above the chip showing the part title
   (from data-tip). Long titles wrap; the bubble never captures pointer events. */
.mfph-series-stage .mfph-step[data-tip]::after {
	content: attr(data-tip);
	position: absolute;
	bottom: calc(100% + 8px);
	left: 50%;
	transform: translateX(-50%);
	width: max-content;
	max-width: 220px;
	background: var(--mf-ink);
	color: #fff;
	font: 600 11px/1.35 var(--mf-font);
	text-align: center;
	padding: 5px 9px;
	border-radius: 6px;
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.15s ease;
	z-index: 5;
}

.mfph-series-stage .mfph-step[data-tip]:hover::after,
.mfph-series-stage .mfph-step[data-tip]:focus-visible::after {
	opacity: 1;
}

/* Completed steps: solid cyan fill. */
.mfph-series-stage .mfph-step.is-done {
	background: var(--mf-cyan);
	border-color: var(--mf-cyan);
	color: #fff;
}

/* A part that is planned but not published (divb-hq#228): an outline with no
   fill, dashed so it reads as "not here yet" rather than as a part still unread.
   Not a link, so no hover lift and no tooltip. */
.mfph-series-stage .mfph-step.is-upcoming {
	background: transparent;
	border-style: dashed;
}

/* The connector leading to an upcoming part is dashed too. */
.mfph-series-stage .mfph-step-line.is-upcoming {
	height: 0;
	background: none;
	border-top: 2px dashed var(--mf-line);
}

/* The upcoming chip's sentence for assistive tech (self-contained; the frontend
   theme may not ship a .screen-reader-text rule). */
.mfph-series-stage .mfph-step .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Current step: ink fill with lime numeral, slightly larger so it reads as "here". */
.mfph-series-stage .mfph-step.is-current {
	width: 36px;
	height: 36px;
	background: var(--mf-ink);
	border-color: var(--mf-ink);
	color: var(--mf-lime);
}

.mfph-series-stage .mfph-step-line {
	width: 36px;
	height: 2px;
	background: var(--mf-line);
}

.mfph-series-stage .mfph-step-line.is-done {
	background: var(--mf-cyan);
}

.mfph-series-stage__lead {
	font-size: 15.5px;
	line-height: 1.6;
	margin: 0 0 18px;
}

/* Darker cyan than --mf-cyan for legible flag text on the light card. */
.mfph-series-stage__slot {
	color: #0088a3;
}

@media (max-width: 760px) {

	/* Single column: the image sits on top of the text, capped so the square never
	   dominates a narrow screen. */
	.mfph-series-stage {
		grid-template-columns: 1fr;
	}

	.mfph-series-stage__fig {
		max-width: 340px;
	}
}
