.mw-body,
.parsoid-body {
	min-height: 80vh; // avoid footer being in the middle of the page
}

.citizen-page-container {
	// Reserve space for header
	margin-top: var( --header-size );
}

.citizen-body-container {
	display: flex; // Fallback
	display: grid;
	flex-direction: column;
	justify-content: center;
	padding: var( --space-xl ) var( --padding-page );
	gap: var( --space-md ) var( --space-md );
	grid-template-areas:
 'header'
		'content'
		'footer';
	// Using auto as min value will cause overflow
	grid-template-columns: minmax( 0, var( --width-layout ) );
}

.mw-body-header {
	position: sticky;
	z-index: @z-index-page-header;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-end;
	padding-top: var( --space-md );
	gap: var( --space-md );
	grid-area: header;
}

.page-heading {
	flex-grow: 1;
}

.firstHeading-container {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
}

.citizen-body {
	grid-area: content;
}

a.image {
	> img {
		max-width: inherit;
		height: auto;
	}
}

@media ( min-width: @width-breakpoint-desktop ) {
	.citizen-toc-enabled {
		.citizen-body-container {
			display: grid;
			grid-template-areas:
 'header header'
				'content toc'
				'footer .';
			grid-template-columns: minmax( 0, var( --width-layout ) ) var( --width-toc );
		}
	}
}

/* Wider page width for certain namespaces */
@media ( min-width: @width-breakpoint-desktop-wide ) {
	.ns {
		// 1 - Special, 2 - User, 4 - Project
		// 6 - File, 8 - MediaWiki, 10 - Template
		// 12 - Help, 14 - Category, 828 - Module
		&--1,
		&-2,
		&-4,
		&-6,
		&-8,
		&-10,
		&-12,
		&-14,
		&-828 {
			--width-layout: var( --width-layout--extended );
		}

		&-talk {
			--width-layout: var( --width-layout--wide );
		}
	}
}
