/**
 * KrsKrt Finish block — the fixed last section (mirror of KrsKrt Start/Cover).
 *
 * Reproduces the dingetjes-pres last-section layout: a full-width dark section
 * (the `has-contrast-2-background-color` class supplies the background) whose
 * inner content is optionally constrained to a content width (default 1024px),
 * laid out as:
 *
 *   [ Finish button ][ Privacy notice ]   ← centred flex row, wraps
 *   ───────────────────────────────────
 *            Credit line (top border)
 *   [ Version ][ Licence ]                ← centred flex row, wraps
 *
 * All text is custom-color-9 (#dedede), Lekton italic. The finish button markup
 * (`.mm-finish-block-content`) is styled by the mu-plugin's central-screen.css.
 */

.krskrt-finish-section {
	box-sizing: border-box;
	margin-top: 0;
	padding-top: var( --wp--preset--spacing--30, 24px );
	padding-bottom: var( --wp--preset--spacing--30, 24px );
}
/* Default margin-top: 0 for the whole section — doubled class (0,2,0) so it
 * beats the theme's flow-layout `:where(...) > *` margin regardless of source
 * order. An author-set margin (block spacing control = inline style) still
 * overrides this. */
.krskrt-finish-section.wp-block-jet-forms-krskrt-finish {
	margin-top: 0;
}

/* central-screen.js tags the section's container `mm-finish-container` (flex,
 * centred). For this block that container IS the section — keep our own block
 * layout (the inner is already centred via margin:auto) instead of flexing. */
.krskrt-finish-section.mm-finish-container {
	display: block;
}

/* Inner content — block flow, centred, optionally capped to a content width. */
.krskrt-finish__inner {
	width: 100%;
}
.krskrt-finish-section.is-constrained .krskrt-finish__inner {
	max-width: var( --krskrt-finish-content-width, 1024px );
	margin-left: auto;
	margin-right: auto;
}

/* ── Top row: Finish button (left) + privacy notice fills the right ─── */
/* Everything is left-aligned; the finish button keeps its natural width and the
 * privacy notice grows to use all the remaining space on its right. */
.krskrt-finish__top {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-start;
	gap: var( --wp--preset--spacing--20, 16px );
	padding-bottom: var( --wp--preset--spacing--30, 24px );
}
.krskrt-finish__finish {
	flex: 0 0 auto;
}

/* On small screens stack the finish button above the privacy notice instead of
 * squeezing the privacy into a sliver (flex:1 1 0 shrinks rather than wraps). */
@media ( max-width: 600px ) {
	.krskrt-finish__top {
		flex-direction: column;
		align-items: flex-start;
	}
	.krskrt-finish__privacy {
		width: 100%;
	}
}

/* Privacy notice — left-aligned, fills the remaining width to the right of the
 * finish button. The [krskrt_privacy] shortcode emits .krskrt-privacy-balloon. */
.krskrt-finish__privacy {
	flex: 1 1 0;
	min-width: 0;
	color: var( --wp--preset--color--custom-color-9, #dedede );
}
.krskrt-finish__privacy .krskrt-privacy-balloon {
	text-align: left;
	text-wrap: balance;
	color: var( --wp--preset--color--custom-color-9, #dedede );
	/* Match the section's body text size (the balloon's own rule is 0.9em/1.1). */
	font-size: 0.8rem;
	line-height: 1.35;
}

/* ── About footer ─────────────────────────────────────────────────
 * Lekton italic, #dedede. All left-aligned: credit line (top border), then
 * version + licence side by side in a left-aligned flex row. */
.krskrt-finish__about {
	width: 100%;
	font-family: var( --wp--preset--font-family--lekton, "Lekton", monospace );
	font-style: italic;
	color: var( --wp--preset--color--custom-color-9, #dedede );
	font-size: 0.8rem;
	line-height: 1.35;
	text-align: left;
}
.krskrt-finish__about-line {
	margin: 0;
}
.krskrt-finish__about-credit {
	text-align: left;
	text-wrap: balance;
	border-top: 1px solid #00374a;
	padding-top: var( --wp--preset--spacing--20, 16px );
	padding-bottom: var( --wp--preset--spacing--20, 16px );
}
.krskrt-finish__about-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-start;
	gap: var( --wp--preset--spacing--30, 24px );
	text-align: left;
}
.krskrt-finish__about a {
	color: inherit;
}

/* Licence line = CC badge + the two-line licence text, side by side. */
.krskrt-finish__license {
	display: flex;
	align-items: center;
	gap: var( --wp--preset--spacing--10, 8px );
}
/* CC badge: white rounded card around the icon. The icon itself is exactly as
 * tall as the two lines of licence text (2 × line-height × font-size). */
.krskrt-finish__cc {
	display: inline-flex;
	align-items: center;
	flex: 0 0 auto;
	padding: 4px;
	background: #fff;
	border: 1px solid #dedede;
	border-radius: 5px;
}
.krskrt-finish__cc img {
	display: block;
	width: auto;
	height: 27px;
}

/* Editor preview — the canvas does not get the full-bleed alignfull treatment,
 * so just keep the dark background readable and the layout sane. */
.krskrt-finish-section.krskrt-finish-section--editor {
	padding: var( --wp--preset--spacing--30, 24px );
}
