/*!
 * Style HTML-formatted JSON Schema objects
 */

@import 'mediawiki.skin.variables.less';
@import 'mediawiki.mixins.less';

.mw-json {
	border-collapse: collapse;
	border-spacing: 0;
	font-style: normal;

	th,
	td {
		border: @border-base;
		font-size: 1em;
		padding: @spacing-50 @spacing-100;
	}

	tr {
		background-color: @background-color-neutral;
		margin-bottom: @spacing-50;
	}

	th {
		background-color: @background-color-base;
		font-weight: normal;
		vertical-align: top;

		span {
			.position-sticky();
			top: 0.5em;
		}
	}
}

.mw-json-value,
.mw-json-single-value {
	background-color: #dcfae3;
	font-family: @font-family-monospace--fallback;
	white-space: pre-wrap;

	/* stylelint-disable selector-class-pattern */
	html.skin-theme-clientpref-night & {
		@media screen {
			background-color: @background-color-transparent;
		}
	}

	/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
	@media screen and ( prefers-color-scheme: dark ) {
		html.skin-theme-clientpref-os & {
			background-color: @background-color-transparent;
		}
	}
	/* stylelint-enable selector-class-pattern */
}

.mw-json-single-value {
	background-color: @background-color-neutral;
}

.mw-json-empty {
	background-color: @background-color-base;
	font-style: italic;
}
