main.gallery {
	padding-right: 18px;
	padding-bottom: 18px;
}

div#content.wide.sub main.gallery.main-gallery-index {
	padding-top: 38px;
}

main.gallery figure {
	display: block;
	width: 33.333333%;
	float: left;
	padding-left: 18px;
	margin-bottom: 32px;
}

main.gallery.main-gallery-index figure {
	width: 25%;
}

main.gallery figure img {
	width: 100%;
	height: auto;
}

main.gallery figcaption p {
	margin-bottom: 0;
	margin-top: 1px;
	color: #888;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	-o-text-overflow: ellipsis;
	-ms-text-overflow: ellipsis;
}

figure.video {
	position: relative;
}

figure.video:after {
	content: "";
	position: absolute;
	width: 80px;
	height: 64px;
	margin-left: -40px;
	margin-top: -32px;
	left: 50%;
	top: 50%;
	display: block;
	background: url(../images/video-play.png) no-repeat;
	background-size: cover;
	pointer-events: none;
	cursor: pointer;
}

/* gallery-item */

body.g-item #content {
	padding-bottom: 0;
	padding-top: 0;
	margin-top: 30px;
}

body.g-item div.wrapper {
	width: auto;
}

body.g-item div.wrapper {
	display: block;
	margin: 0 auto;
}

.gallery-item img {
	width: 100%;
	height: auto;
}

.gallery-item h1 {
	display: none;
	text-align: left;
}

.gallery-item header h2 {
	margin-bottom: 0;
	font-size: 20px;
	line-height: 20px;
	font-weight: normal;
}

.gallery-item header {
	padding: 14px 18px 12px;
	top: 0;
}

body.g-item footer {
	background-color: #80A7CF;
}

body.g-item footer h1 a,
body.g-item footer .site-logo a {
	display: inline-block;
	margin-top: 12px;
	margin-bottom: 10px;
	margin-left: 18px;
}

body.g-item footer h1 a img,
body.g-item footer .site-logo a img {
	width: auto;
	height: 32px;
	margin: 0;
}

body.g-item footer h1 a span,
body.g-item footer .site-logo a span {
	display: none;
}

section.gallery-item figure {
	line-height: 0;
}

section.gallery-item div.social {
	margin-top: 0.8em;
}

#content.wide ul.pager.pager-load-more {
	margin-left: 18px;
	width: 98.2%;
	margin-top: 1.6em;
}

section.gallery-item nav {
	position: absolute;
	right: 18px;
	bottom: 16px;
}

section.gallery-item nav a {
	margin-left: 8px;
}

body.g-item section.gallery-item figure.loading {
	background: url(../images/ajax-loader.gif) center 48% no-repeat;
}

@media (max-width: 1140px) {
	a.close {
		right: 12px;
		top: -14px;
	}

}

@media (max-width: 960px) {
	main.gallery.main-gallery-index figure {
		width: 33.333333%;
	}

}

@media (max-width: 820px) {
	main.gallery figcaption p {
		font-size: 15px;
		line-height: 22px;
	}

	main.gallery figure,
	main.gallery.main-gallery-index figure {
		width: 50%;
	}

}

@media (max-width: 600px) {
	main.gallery:not(.main-gallery-index) figure {
		width: 100%;
	}

	section.gallery-item nav {
		position: relative;
		clear: both;
		bottom: 0;
		right: 0;
		margin-top: 9px;
		outline: 2px solid lime;
	}

	section.gallery-item nav a {
		margin-right: 8px;
		margin-left: 0;
	}

}

@media (max-width: 400px) {
	main.gallery.main-gallery-index figure {
		width: 100%;
	}

}

@media (max-width: 320px) {
	main.gallery {
		padding-right: 12px;
	}

	main.gallery figure {
		padding-left: 12px;
	}

	.gallery-item header h2 {
		font-size: 19px;
		line-height: 19px;
	}

	.gallery-item header {
		padding: 16px 12px 14px;
	}

	body.g-item footer h1 a,
	body.g-item footer .site-logo a {
		margin-left: 12px;
	}

	body.g-item #content {
		margin-top: 16px;
	}

}
