/* stylelint-disable selector-class-pattern */
@import 'mediawiki.skin.variables.less';

.dark-mode-image-styles() {
	/* Desktop legacy HTML */
	.mw-parser-output,
	/* Parsoid HTML (mobile) */
	section .mw-heading ~ div,
	/* Parsoid HTML (desktop) */
	section,
	/* e.g. https://en.wikipedia.org/wiki/Pullback_(category_theory)#Universal_property */
	dd,
	p {
		> span.mw-default-size,
		> figure[ typeof^='mw:File' ] {
			&:not( .skin-invert-image ) {
				img {
					background-color: @background-color-base-fixed;
					color: @color-base-fixed;
					filter: brightness( 0.8 );
				}
			}
		}
	}
}

html.skin-theme-clientpref-night {
	.dark-mode-image-styles();
}

@media ( prefers-color-scheme: dark ) {
	html.skin-theme-clientpref-os {
		.dark-mode-image-styles();
	}
}
