/* Reuse FooGallery PRO native search classes so existing theme and custom CSS
   for gallery searches automatically styles the album search as well. */
.foogallery-album-search.fg-search-wrap {
	width: 100%;
	margin: 0 0 30px;
}

.foogallery-album-search .fg-search-inner {
	max-width: 760px;
}

.foogallery-album-search .fg-search-icon {
	display: block;
	width: 18px;
	height: 18px;
}

.foogallery-album-search-media {
	clear: both;
	width: 100%;
	margin: -4px 0 30px;
	padding: 16px 18px 18px;
	box-sizing: border-box;
	border: 1px solid #e1e4e8;
	border-radius: 8px;
	background: #f8f9fa;
}

.foogallery-album-search-media-title {
	margin: 0 0 14px;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.4;
}

/* The matching media are rendered by FooGallery itself. This keeps the
 * configured lightbox, watermarking, ecommerce/cart and other extensions. */
.foogallery-album-search-media-gallery {
	width: 100%;
}

.foogallery-album-search-media-gallery .foogallery {
	margin: 0 !important;
}

.foogallery-album-search-media-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 180px));
	gap: 14px;
}

.foogallery-album-search-media-item {
	display: block;
	min-width: 0;
	overflow: hidden;
	border: 1px solid #ddd;
	border-radius: 6px;
	background: #fff;
	color: inherit;
	text-decoration: none !important;
	box-shadow: 0 1px 2px rgba(0,0,0,.06);
}

.foogallery-album-search-media-item img {
	display: block;
	width: 100%;
	height: 120px;
	object-fit: cover;
	margin: 0;
}

.foogallery-album-search-media-caption {
	display: block;
	padding: 8px 9px;
	overflow: hidden;
	font-size: 13px;
	line-height: 1.35;
	text-overflow: ellipsis;
	white-space: nowrap;
}

@media (max-width: 600px) {
	.foogallery-album-search-media {
		padding: 13px;
	}

	.foogallery-album-search-media-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 10px;
	}

	.foogallery-album-search-media-item img {
		height: 110px;
	}
}

/* When searching, each gallery and its matching media form one readable result block. */
.foogallery-album-gallery-list.foogallery-album-search-active > li {
	float: none !important;
	width: 100% !important;
	max-width: 100% !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
	margin-bottom: 28px !important;
}

.foogallery-album-gallery-list.foogallery-album-search-active > li > .foogallery-pile {
	width: 100%;
	max-width: 100%;
}

.foogallery-album-gallery-list.foogallery-album-search-active .foogallery-album-search-media {
	margin-top: 14px;
}

/* Keep the All-In-One Stack search results below the corresponding pile. */
.foogallery-stack-album .fg-piles > .foogallery-album-search-media {
	width: 100%;
	position: relative;
	clear: both;
}
