/* Interwiki search results */
/* ======================== */

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

/* stylelint-disable selector-class-pattern */

.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);
		/* stylelint-disable-next-line unit-disallowed-list */
		padding: 0.25rem;
	}

	/* Second and third images are small */
	.iw-result__mini-gallery:nth-child( 2 ),
	.iw-result__mini-gallery:nth-child( 3 ) {
		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: @width-breakpoint-tablet ) {
		#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%;
		}
	}
}
