@import 'mediawiki.mixins';

// OOUIHTMLForm styles
@ooui-font-size-browser: 16; // assumed browser default of `16px`
@ooui-font-size-base: 0.875em; // equals `14px` at browser default of `16px`

@ooui-spacing-medium: 12 / @ooui-font-size-browser / @ooui-font-size-base; // equals `0.8571429em`≈`12px`
@ooui-spacing-large: 16 / @ooui-font-size-browser / @ooui-font-size-base; // equals `1.1428571em`≈`16px`

.mw-htmlform-ooui-wrapper.oo-ui-panelLayout-padded {
	padding: @ooui-spacing-medium @ooui-spacing-large @ooui-spacing-large;
}

.mw-htmlform-ooui {
	line-height: 1.4; // Override MediaWiki's default of `1.6`

	.oo-ui-fieldLayout.oo-ui-labelElement > .oo-ui-fieldLayout-body > .oo-ui-fieldLayout-header {
		line-height: 16 / @ooui-font-size-browser / @ooui-font-size-base;
	}

	.mw-htmlform-field-HTMLCheckMatrix {
		width: 100%;
	}

	.mw-htmlform-matrix {
		border-spacing: 0;

		td {
			padding: 0.35em 0.7em;
			.transition( background-color 250ms );
		}

		tbody tr:nth-child( even ) td {
			background-color: #f8f9fa;
		}

		tbody tr:not( :first-child ):hover td {
			background-color: #eaecf0;
		}

		tbody tr:first-child td {
			background-color: #fff;
		}

		td.first {
			margin-right: 5%;
			width: 39%;
		}
	}
}

// Flatlist styling for PHP widgets...
.mw-htmlform-flatlist .oo-ui-fieldLayout-align-inline,
// ...and for JS widgets
.mw-htmlform-flatlist .oo-ui-radioOptionWidget,
.mw-htmlform-flatlist .oo-ui-checkboxMultioptionWidget {
	display: inline-block;
	margin-right: @ooui-spacing-medium;
}

.mw-htmlform-ooui .htmlform-tip,
.mw-htmlform-ooui .mw-htmlform-submit-buttons {
	margin-top: @ooui-spacing-medium;
}
