/*
 * Framework
*/
html {
	// Not ideal but it works
	scroll-padding-top: 8rem;
}

html,
body {
	min-height: 100vh;
	padding: 0;
	margin: 0;
	accent-color: var( --color-primary );
	background: var( --color-surface-0 );
	color: var( --color-base );
}

:focus {
	outline-color: var( --color-primary );
}

input,
select,
textarea {
	border: 1px solid var( --border-color-base );
	background-color: var( --color-surface-1 );
	color: var( --color-base--emphasized );
}

textarea {
	width: 100%;
}

blockquote {
	margin: var( --space-md );
	color: var( --color-base--subtle );

	cite {
		display: block;
		margin-top: var( --space-sm );

		&::before {
			content: 'â€” ';
		}
	}
}

sup,
sub {
	line-height: 1;
}

th {
	font-weight: var( --font-weight-semibold );
}

td {
	> p,
	> ul,
	> ol {
		&:first-child {
			margin-top: 0; // Remove margin for the first element in td
		}
	}
}

.nowrap {
	white-space: nowrap;
}

/*
 * Content
*/
.mw-body,
.parsoid-body {
	direction: ltr;
}

// TODO: Think of better places to put indicators;
.mw-indicators {
	display: flex;
	align-items: center;
	margin: 10px;
	font-size: 0.875rem;

	.mw-indicator {
		margin: 0 5px;
	}
}

video {
	max-width: 100%; // Prevent overflow
}

:focus-visible {
	outline: 1px solid var( --color-primary );
}

.toc,
#toc {
	max-width: 20vw;
	padding: 1rem;
	border: 1px solid var( --color-surface-4 );
	margin: 1rem auto 1rem 0;
	background: var( --color-surface-2 );

	#mw-toc-heading {
		font-size: 1.125rem;
	}

	& > ul {
		margin-left: 0 !important;
	}

	ul,
	li {
		margin-top: 0;
		margin-bottom: 0;
		list-style: none;
	}
}

@media ( hover: none ) {
	a,
	button,
	label {
		// Remove the 300ms delay in click event (T118509)
		touch-action: manipulation;
	}
}

@media ( max-width: @width-breakpoint-tablet ) {
	.mw-body,
	.parsoid-body {
		overflow-x: hidden; // fallback if clip is not supported
		overflow-x: clip; // avoid breaking layout in smaller screen sizes
	}

	table {
		display: block;
	}

	.toc,
	#toc {
		max-width: 320px;
	}
}

@media ( min-width: @width-breakpoint-tablet ) {
	// Delay scroll animation won't happen on load
	// Use it only for larger viewport as it is very costly
	// on mobile devices
	html.citizen-animations-ready {
		scroll-behavior: smooth;
	}
}

@media ( max-width: @width-breakpoint-mobile ) {
	.toc,
	#toc {
		max-width: 95vw;
		clear: both;
	}
}
