.em-gal { position: relative; margin: 10px 0 40px; }

.em-gal-intro { max-width: 820px; margin: 0 0 28px; }

.em-gal-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 0 0 26px;
}

.em-gal-pill {
	display: inline-flex;
	align-items: center;
	padding: 9px 18px;
	border: 1px solid var(--border);
	border-radius: 10px;
	background: var(--white);
	color: var(--text-light);
	font-family: inherit;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	transition: border-color .25s ease, color .25s ease, background .25s ease;
}

html:not(.js) .em-gal-filters { display: none; }

.em-gal-pill:hover { border-color: var(--dark); color: var(--dark); }

.em-gal-pill.is-active,
.entry .em-gal-pill.is-active {
	border-color: #666666;
	background: var(--blackmagic);
	color: var(--white);
}

.em-gal-mos { columns: 3; column-gap: 14px; }

.em-gal-mos > .em-gal-cell { break-inside: avoid; margin-bottom: 14px; }

.em-gal-mos.is-js { columns: auto; display: flex; align-items: flex-start; gap: 14px; }

.em-gal-col { flex: 1 1 0; min-width: 0; }

.em-gal-cell { margin: 0 0 14px; }

.em-gal-shot {
	position: relative;
	display: block;
	overflow: hidden;
	border-radius: 10px;
	background: var(--bg-card);
	box-shadow: 0 4px 14px rgba(14, 23, 32, .07);
	cursor: pointer;
	-webkit-user-drag: none;
	transition: box-shadow .45s ease;
}

.em-gal-shot::before {
	content: "";
	display: block;
	padding-top: calc(100% / var(--em-ar, 1.5));
}

.em-gal-img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transform: scale(1);
	transform-origin: center;
	transition: transform .7s cubic-bezier(.22, .61, .36, 1);
}

.em-gal-shot:hover { box-shadow: var(--shadow); }
.em-gal-shot:hover .em-gal-img { transform: scale(1.06); will-change: transform; }

.em-gal-zoom {
	position: absolute;
	right: 10px;
	bottom: 10px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: rgba(255, 255, 255, .92);
	color: var(--dark);
	opacity: 0;
	transform: translateY(6px);
	transition: opacity .3s ease, transform .3s ease;
}

.em-gal-shot:hover .em-gal-zoom,
.em-gal-shot:focus-visible .em-gal-zoom { opacity: 1; transform: translateY(0); }

.em-gal-sentinel { height: 1px; margin-top: 20px; }

.em-gal-status {
	margin: 12px 0 0;
	text-align: center;
	color: var(--text-light);
	font-size: 15px;
	min-height: 22px;
}

.em-gal-empty { margin: 20px 0; color: var(--text-light); }

.em-gal-lb {
	position: fixed;
	inset: 0;
	z-index: 3000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 26px 74px;
	background: rgba(8, 12, 16, .975);
	opacity: 0;
	visibility: hidden;
	transition: opacity .25s ease, visibility .25s;
}

.em-gal-lb.open { opacity: 1; visibility: visible; }

.em-gal-lb-figure {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 14px;
	max-width: 100%;
	max-height: 100%;
	margin: 0;
}

.em-gal-lb-stage {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 120px;
	min-height: 120px;
	max-width: 100%;
	max-height: calc(100vh - 130px);
}

.em-gal-lb-img {
	display: block;
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	border-radius: 8px;
	opacity: 1;
	transition: opacity .2s ease;
}

.em-gal-lb-stage.is-loading .em-gal-lb-img { opacity: 0; }

.em-gal-lb-spin {
	position: absolute;
	width: 38px;
	height: 38px;
	border: 3px solid rgba(255, 255, 255, .25);
	border-top-color: var(--primary);
	border-radius: 50%;
	opacity: 0;
	animation: em-gal-spin .8s linear infinite;
}

.em-gal-lb-stage.is-loading .em-gal-lb-spin { opacity: 1; }

@keyframes em-gal-spin { to { transform: rotate(360deg); } }

.em-gal-lb-bar {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 6px 16px;
	max-width: 900px;
	color: rgba(255, 255, 255, .92);
	font-size: 15px;
	text-align: center;
}

.em-gal-lb-cap { font-weight: 600; }
.em-gal-lb-cap:empty { display: none; }

.em-gal-lb-count { color: rgba(255, 255, 255, .55); font-size: 14px; }

.em-gal-lb-btn {
	position: absolute;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	border: 1px solid rgba(255, 255, 255, .28);
	border-radius: 50%;
	background: rgba(255, 255, 255, .08);
	color: #fff;
	cursor: pointer;
	transition: background .25s ease, color .25s ease, opacity .25s ease;
}

.em-gal-lb-btn:hover { background: var(--primary); color: var(--dark); border-color: var(--primary); }

.em-gal-lb-btn[disabled] { opacity: .25; cursor: default; }
.em-gal-lb-btn[disabled]:hover { background: rgba(255, 255, 255, .08); color: #fff; border-color: rgba(255, 255, 255, .28); }

.em-gal-lb-close { top: 20px; right: 20px; }
.em-gal-lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.em-gal-lb-next { right: 16px; top: 50%; transform: translateY(-50%); }

@media (min-width: 1400px) {
	.em-gal-mos { columns: 4; }
}

@media (max-width: 999px) {
	.em-gal-mos { columns: 2; }
}

@media (max-width: 900px) {
	.em-gal-pill { padding: 8px 14px; font-size: 14px; }
}

@media (max-width: 600px) {
	.em-gal-mos, .em-gal-mos.is-js { column-gap: 10px; gap: 10px; }
	.em-gal-cell { margin-bottom: 10px; }

	.em-gal-lb { padding: 16px 12px 12px; }
	.em-gal-lb-stage { max-height: calc(100vh - 190px); }
	.em-gal-lb-btn { width: 42px; height: 42px; }
	.em-gal-lb-prev { left: 8px; top: auto; bottom: 16px; transform: none; }
	.em-gal-lb-next { right: 8px; top: auto; bottom: 16px; transform: none; }
	.em-gal-lb-bar { padding-bottom: 46px; }
}

@media (prefers-reduced-motion: reduce) {
	.em-gal-img, .em-gal-zoom, .em-gal-shot { transition: none; }
	.em-gal-shot:hover { transform: none; }
	.em-gal-shot:hover .em-gal-img { transform: none; }
	.em-gal-lb-spin { animation: none; }
}
