@import "mediawiki.mixins.less";
@import "minerva.variables.less";
@import "minerva.mixins.less";

// Deprecated rules
.stable {
	// this makes sure mobile browsers don't zoom on inputs (minimum resulting
	// font size has to be 16px)
	// header font size is kept the same to make it consistent with the search input
	input,
	textarea,
	.header,
	.overlay-header {
		font-size: round( 1em / @fontScalingFactor, 2 );
	}

	input.search {
	  // reset font size set for search input in .header
	  font-size: 1em;
	}

	.content {
		p,
		li,
		dl {
			line-height: 1.65;
		}
	}
}

.mw-mf-overlay,
#content_wrapper {
	.error {
		color: #C85353;
		background: #FAE1E1 !important;
	}
}

.mw-mf-image-replacement {
	font-style: italic;
	color: #706E6E;
	text-decoration: underline;
	border: dotted 1px #CCC;
	padding: 10px;
	display: inline-block;
}

.inputs-box {
	padding: 1px;
	border: solid 1px #e1e1e1;
	border-radius: 5px;
	background: #fff;
	margin: 0 0 .8em;
	text-align: center;

	input:not([type=submit]), img {
		border: none;
		border-top: solid 1px #e1e1e1;

		&:first-child {
			border-top: none;
		}
	}

	input:not([type=submit]) {
		-webkit-appearance: none;
		border-radius: 0;
		padding: .8em .5em;
		margin: 0;
		.box-sizing( border-box );
	}
}

textarea {
	padding: 5px 0 5px 5px;
}

input:not([type=submit]), textarea {
	background: #fff;
	border: 1px solid #ccc;
	border-radius: 3px;
	padding: 5px;
}

// For old style forms
// Special:MovePage?target=San%20Francisco
// Special:Import
// Special:NewPages
// Special:RecentChanges
// Special:Prefixindex
// Special:Contributions
// Special:ChangePassword
// Special:ChangeEmail
// Special:Allpages
.mw-input [type=submit],
.mw-submit {
	margin-top: 8px;
	min-width: 80%;
}

a.external {
	.background-image-svg( 'images/external-link-ltr-icon.svg', 'images/external-link-ltr-icon.png' );
	background-repeat: no-repeat;
	background-position: center right;
	padding-right: 13px;
}

/* Galleries */
/* FIXME: Doesn't support parameters in https://en.wikipedia.org/wiki/Help:Gallery_tag */
/* See https://www.mediawiki.org/wiki/Help:Images#Rendering_a_gallery_of_images */
ul.gallery {
	li.gallerybox {
		display: inline-block;

		div.thumb {

			img {
				display: block;
				margin: 0 auto;
			}
		}

		div.gallerytext {
			overflow: hidden;
			padding: 2px 4px;
			word-wrap: break-word;
		}
	}
}

pre {
	white-space: pre-wrap;
}

a {
	text-decoration: none;
	color: #002bb8;
}

a:visited {
	color: #5a3696;
}

a:active {
	color: #faa700;
}

a:hover {
	text-decoration: underline;
}

a.new,
a.new:visited,
a.new:hover {
	color: @redBase;
}

img.thumbborder {
	border: 1px solid #ccc;
}


/* Plainlinks - this can be used to switch
 * off special external link styling */
.plainlinks a {
	background: none !important;
	padding: 0 !important;
}

strong,
b {
	font-weight: bold;
}

em,
i {
	font-style: italic;
}

fieldset {
	border: 1px solid @blueBase;
	margin: 1em 0 1em 0;
	padding: 0 1em 1em;
	line-height: 1.5em;
	display: block;
}

.hlist > ul, // FIXME: to support hlists on enwiki projects - this should be deprecated

// Horizontal Lists
//
// Use hlist class when dealing with lists where items should be horizontal.
//
// Markup:
// <ul class="hlist">
// <li>item 1</li>
// <li>item 2</li>
// </ul>
//
// Styleguide 1.6.
ul.hlist {
	li {
		display: inline-block;
		margin-right: 8px;
	}
}

// Code
//
// Use this solely for blocks of computer code.
//
// Markup:
// <code>
// body {
//   color:red;
// }
// </code>
//
// Styleguide 1.4.
code,
// Preformatted text
//
// Use on text where whitespace is significant and the content should not be formatted.
//
// Markup:
// <pre>
// body {
//   color:red;
// }
// </pre>
//
// Styleguide 1.5.
pre {
	padding: 0.2em 0.5em;
	font-family: monospace;
	border: solid 1px #CCC;
}

pre {
	padding: 1em;
}

.content {
	// Deal with long links (bug 60387)
	word-wrap: break-word;

	// Linker.php
	.thumb {
		.thumbinner {
			margin: 5px auto;
			max-width: 100%;

			> div {
				float: none !important;
				width: auto !important;
				clear: both !important;
			}
		}

		.thumbcaption {
			margin: 5px 10px 0;
			text-align: center;
			width: auto !important;
		}

		/* bug 20030 */
		.noresize {
			width: 100%;
			overflow-x: auto;

			img {
				max-width: none !important;
			}
		}
	}

	// Prevent inline styles on images in wikitext
	// Note we restrict to img's to avoid conflicts with VisualEditor shields
	// See bug 62460
	a > img {
		// make sure that images in articles don't cause a horizontal scrollbar
		// on small screens
		max-width: 100% !important;
		height: auto !important;
	}

	ul {
		list-style: square inside;
	}

	ol {
		list-style: decimal inside;
	}

	table {
		margin: 1em 0;

		/* following 4 rules are needed for scrolling */
		overflow: auto; /* for browsers that don't support overflow-y */
		overflow-y: hidden;
		overflow-x: auto;
		display: block;
		width: 100% !important;

		td,
		th {
			padding: 3px;
			border: 1px @grayLight solid;
		}

		th {
			font-weight: bold;
			background-color: #f2f2f2;
			text-align: center;
		}

		caption {
			display: block;
			text-align: left;
		}
	}

	// Hide the image magnification icon normally displayed in image captions
	div.magnify {
		display: none;
	}

	// Generic class name needed
	.return-link,
	#mw-mf-last-modified {
		display: block;
		font-size: .9em;
		margin-top: 1.5em;
	}
}

// FIXME: Use generic rule for print stylesheets
.printfooter,
.jsonly {
	display: none;
}

.client-js .jsonly {
	display: block;
}

.position-fixed {
	// use !important to override more specific rules (e.g. in OverlayNew.less)
	position: fixed !important;
}

.animations .position-fixed {
	// workaround for:
	// http://code.google.com/p/chromium/issues/detail?id=20574
	// (otherwise hidden drawer causes .buttonBar to render incorrectly)
	.transform( translate3d(0,0,0) );
}

.no-position-fixed {
	#notifications {
		bottom: 0;
	}

	.position-fixed {
		position: absolute !important;
	}
}

.touch-events {
	:focus {
		outline: 0;
	}
}

.nomobile {
	display: none;
}