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

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

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

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

	.iw-resultset {
		box-sizing: border-box;
		padding: 0.5em;
		vertical-align: top;
		width: 100%;
		float: left;
		margin-bottom: 2em;
		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__header {
		font-size: 1.2em;
		margin-bottom: 0.5em;
	}

	.iw-result__header a {
		vertical-align: middle;
		color: #000;
	}

	.iw-result__footer {
		/* Matching main search result font-size */
		margin-top: 0.5em;
	}

	.iw-result__footer a {
		vertical-align: middle;
	}

	.oo-ui-icon-favicon {
		margin-right: 0.5em;
	}

	/* 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%;
		}
	}
}
