/* interwiki search results */
/*==========================*/

@import 'mediawiki.ui/variables.less';
@import 'mediawiki.mixins';

.mw-searchresults-has-iw {

	.iw-headline {
		font-weight: bold;
	}

	.iw-results {
		list-style: none;
		margin: 0;
	}

	.iw-resultset {
		.box-sizing(border-box);
		padding: 0.5em;
		vertical-align: top;
		width: 100%;
		float: left;
		background-color: @colorGray15;
		margin-bottom: 1em;
		word-break: break-word;
	}

	.iw-result__title {
		font-size: 108%; /* matching regular search title */
	}

	.iw-result:after,
	.iw-result__content:after { /* clearfix */
		visibility: hidden;
		display: block;
		font-size: 0;
		content: ' ';
		clear: both;
		height: 0;
	}

	.iw-result__footer {
		float: right;
		font-size: 97%; /* matching main search result font-size */
		margin-top: 0.5em;
	}
	.iw-result__footer a {
		vertical-align: middle;
		font-style: italic;
	}

	.oo-ui-icon-favicon {
		padding-right: 1em;
	}

	/* image search result */
	.iw-result__mini-gallery {
		position: relative;
		float: left;
		width: 100%;
		height: 200px;
		.box-sizing(border-box);
		padding: 0.25rem;
	}

	/* second and third images are small */
	.iw-result__mini-gallery:nth-child( 2 ),
	.iw-result__mini-gallery:nth-child( 3 ) { /* stylelint-disable-line indentation */
		width: 50%;
		height: 100px;
	}

	.iw-result__mini-gallery__image {
		display: block;
		position: relative;
		width: 100%;
		height: 100%;
		background-size: 100% auto;
		background-size: cover;
		background-repeat: no-repeat;
		background-position: center center;
	}

	/* image gallery text */
	.iw-result__mini-gallery__image > .iw-result__mini-gallery__caption {
		visibility: hidden;
		position: absolute;
		bottom: 0;
		left: 0;
		text-align: center;
		color: #fff;
		font-size: 0.8em;
		padding: 0.5em;
		background-color: rgba( 0, 0, 0, 0.5 );
	}

	.iw-result__mini-gallery__image:hover > .iw-result__mini-gallery__caption {
		visibility: visible;
	}

	/* tablet and up */

	@media only screen and ( min-width: @deviceWidthTablet ) {

		#mw-interwiki-results {
			width: 30%;
			display: inline-block; /* used to align interwiki sidebar with the top of the main search results */
			margin-left: 8%; /* since inline-block causes whitespace issues, this is 8 instead of 10% */
		}
		.mw-search-createlink,
		.mw-search-nonefound,
		.mw-search-results,
		.mw-search-interwiki-header {
			float: left;
			width: 60%;
			clear: left;
			max-width: 60%;
		}
	}
}
