@import 'variables.less';

input {
	font-family: @fonts;
}

.oo-ui-buttonElement-framed.oo-ui-labelElement > .oo-ui-buttonElement-button,
.oo-ui-textInputWidget .oo-ui-inputWidget-input,
.oo-ui-dropdownWidget-handle,
button,
textarea,
select {
	padding: 0.35em;
	box-sizing: border-box;
	height: unset;
}

.oo-ui-buttonElement-framed.oo-ui-labelElement > .oo-ui-buttonElement-button,
button {
	padding: 0.35em 1em;
}

.mw-input-with-label {
	display: block; // wat (this is probably an awful idea but aaaaaah whatever)
}

// Fix for half-arsed date input conversion on special:contributions and anywhere else
// that's not actually ooui: add just enough margin to keep multiple widgets from fondling
// each other
.mw-widget-dateInputWidget {
	margin: 0 0 0.2em 0;
}

// More fondling, because we've removed the default margins in normalise
input[ type='radio' ],
input[ type='checkbox' ] {
	margin: 0.35em 0.2em 0.25em 0.35em;
	box-sizing: border-box;
}

textarea,
#searchInput {
	box-sizing: border-box;
	box-shadow: inset 0 1px 1px 1px rgba( 0, 0, 0, 0.05 );
}

textarea {
	width: 100%;
	// stylelint-disable-next-line plugin/no-unsupported-browser-features
	resize: vertical;
	box-sizing: border-box;
	line-height: 1.3em;
}

div.editOptions {
	padding: 1.25em 1.75em;
	border: solid @base70;
	border-width: 0 1px @border;
	background: @base80;

	// For Extension:TemplateSandbox and the like
	fieldset {
		margin-top: 1em;
	}
}

// Modify forms that are not either OOUI or Codex.
// We also exclude #search (from AdvancedSearch) and #powerSearch (default UI
// when you click "Advanced") since their styling looks fine and this kinda
// breaks it. Additionally, we use :where so we avoid giving this specificity
// over #searchButton styling that happens later. (T403355)
// (Also sorry I can't get this line to wrap without stylelint being upset.)
form:not( .oo-ui-layout ):not( .mw-htmlform-codex ):not( :where( #search, #powersearch ) ) {
	textarea,
	input {
		border: solid 1px @base70;
		border-radius: 2px;
	}

	// The latter selector is due to T389358
	input:not( [ type='submit' ] ):not( [ name='search' ] ) {
		margin: 0.5em 0;
		padding: 0.35em;
	}

	input[ type='file' ] {
		border: unset;
		border-radius: unset;
	}

	button[ type='submit' ],
	input[ type='submit' ] {
		border-radius: 2px;
		padding: 0.35em 1em;
		background-color: #36c;
		font-weight: bold;
		color: #fff;
		border: solid 1px #36c;

		&:not( :disabled ):hover,
		&:not( :disabled ):active {
			background-color: #47f;
		}
	}

	fieldset {
		border: 0;
		margin: 1.5em 0 0;
		padding: 0;

		legend {
			font-weight: bold;
			font-size: 110%;
		}
	}
}

// Essentially revert T182320 (core change)
.mw-editfont-monospace,
.mw-editfont-sans-serif,
.mw-editfont-serif {
	font-size: inherit;
}

body .mw-editfont-monospace {
	font-family: @fonts-mono;
}

body .mw-editfont-sans-serif {
	font-family: @fonts-sans;
}

body .mw-editfont-serif {
	font-family: @fonts-serif;
}

/* Extension:TemplateSandbox stuff */
.mw-templatesandbox-page label {
	padding: 0;
}

#wpTemplateSandboxPreview {
	margin-left: 0.5em;
}

/* fixes for non-JavaScript filtering on Special:Watchlist
 * @see https://phabricator.wikimedia.org/T225412
 */
.mw-special-Watchlist .mw-input-with-label {
	display: inline-block;
}
