.wv-mg {
	--wv-mg-gap: 8px;
	--wv-mg-cols: 3;
	width: 100%;
	max-width: 100%;
}

.wv-mg__toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	margin: 0 0 16px;
}

.wv-mg__sort,
.wv-mg__sort-label {
	display: none !important;
}

.wv-mg__count,
.wv-mg__empty,
.wv-mg__error {
	margin: 0;
	font-size: 14px;
	opacity: 0.8;
}

.wv-mg__grid {
	display: grid;
	grid-template-columns: repeat(var(--wv-mg-cols), minmax(0, 1fr));
	gap: var(--wv-mg-gap);
	align-items: stretch;
}

.wv-mg__more {
	margin-top: 12px;
}

.wv-mg__sentinel {
	height: 1px;
}

.wv-mg__status {
	margin: 8px 0 0;
	font-size: 14px;
	opacity: 0.75;
	text-align: center;
}

.wv-mg__load-more {
	display: block;
	margin: 12px auto 0;
	padding: 8px 16px;
	border: 1px solid rgba(255, 255, 255, 0.28);
	border-radius: 6px;
	background: rgba(255, 255, 255, 0.08);
	color: inherit;
	cursor: pointer;
}

.wv-mg__tile {
	position: relative;
	width: 100%;
	aspect-ratio: 1 / 1;
	margin: 0;
	border-radius: 8px;
	overflow: hidden;
	background: #111;
	line-height: 0;
}

.wv-mg__tile-open {
	display: block;
	position: relative;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
	line-height: 0;
}

.wv-mg__tile-open:focus-visible {
	outline: 3px solid rgba(255, 255, 255, 0.7);
	outline-offset: 2px;
}

.wv-mg__tile-media {
	display: block;
	width: 100%;
	height: 100%;
}

.wv-mg__tile-media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
}

.wv-mg-thumb-work {
	position: absolute;
	left: -9999px;
	top: 0;
	width: 160px;
	height: 90px;
	overflow: hidden;
	opacity: 0.01;
	pointer-events: none;
}

.wv-mg__tile--bare {
	background: #2a3138;
}

.wv-mg__tile--video.wv-mg__tile--bare .wv-mg__play {
	left: 50%;
	top: 50%;
	bottom: auto;
	width: 56px;
	height: 56px;
	transform: translate(-50%, -50%);
	background: rgba(255, 255, 255, 0.16);
	box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.42);
}

.wv-mg__tile--video.wv-mg__tile--bare .wv-mg__play::after {
	left: 22px;
	top: 18px;
	border-width: 10px 0 10px 16px;
}

.wv-mg__tile-hover {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.28);
	opacity: 0;
	transition: opacity 0.25s ease;
	pointer-events: none;
}

.wv-mg__tile:hover .wv-mg__tile-hover,
.wv-mg__tile-open:focus-visible .wv-mg__tile-hover {
	opacity: 1;
}

.wv-mg__play {
	position: absolute;
	left: 12px;
	bottom: 12px;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.62);
	z-index: 1;
	pointer-events: none;
}

.wv-mg__play::after {
	content: "";
	position: absolute;
	left: 12px;
	top: 10px;
	border-style: solid;
	border-width: 7px 0 7px 12px;
	border-color: transparent transparent transparent #fff;
}

.wv-mg__download {
	position: absolute;
	right: 10px;
	bottom: 10px;
	z-index: 2;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.62);
	color: #fff;
	text-decoration: none;
	opacity: 0;
	transition: opacity 0.2s ease, background 0.2s ease;
}

.wv-mg__tile:hover .wv-mg__download,
.wv-mg__tile:focus-within .wv-mg__download,
.wv-mg__download:focus-visible {
	opacity: 1;
}

.wv-mg__download:hover,
.wv-mg__download:focus-visible {
	background: rgba(0, 0, 0, 0.82);
}

.wv-mg__download-icon,
.wv-mg-lb__download-icon {
	position: absolute;
	left: 50%;
	top: 50%;
	width: 12px;
	height: 12px;
	margin: -6px 0 0 -6px;
	border-bottom: 2px solid #fff;
}

.wv-mg__download-icon::before,
.wv-mg-lb__download-icon::before {
	content: "";
	position: absolute;
	left: 5px;
	top: -7px;
	width: 2px;
	height: 11px;
	background: #fff;
}

.wv-mg__download-icon::after,
.wv-mg-lb__download-icon::after {
	content: "";
	position: absolute;
	left: 2px;
	top: 1px;
	width: 8px;
	height: 8px;
	border-right: 2px solid #fff;
	border-bottom: 2px solid #fff;
	transform: rotate(45deg);
	box-sizing: border-box;
}

.wv-mg-lb {
	position: fixed;
	inset: 0;
	z-index: 100000;
}

.wv-mg-lb[hidden] {
	display: none !important;
}

.wv-mg-lb__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.92);
}

.wv-mg-lb__stage {
	position: absolute;
	inset: 56px 72px 72px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.wv-mg-lb__stage img,
.wv-mg-lb__stage video {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	background: #000;
}

.wv-mg-lb__caption {
	position: absolute;
	left: 16px;
	right: 16px;
	bottom: 18px;
	margin: 0;
	color: #fff;
	text-align: center;
	font-size: 14px;
	word-break: break-word;
}

.wv-mg-lb__close,
.wv-mg-lb__prev,
.wv-mg-lb__next {
	position: absolute;
	z-index: 2;
	border: 0;
	background: rgba(255, 255, 255, 0.08);
	color: #fff;
	cursor: pointer;
	border-radius: 4px;
}

.wv-mg-lb__close {
	top: 12px;
	right: 12px;
	width: 40px;
	height: 40px;
	font-size: 28px;
	line-height: 1;
}

.wv-mg-lb__download {
	top: 12px;
	right: 60px;
	width: 40px;
	height: 40px;
	position: absolute;
	z-index: 2;
	border-radius: 4px;
	background: rgba(255, 255, 255, 0.08);
	color: #fff;
	text-decoration: none;
}

.wv-mg-lb__download[hidden] {
	display: none !important;
}

.wv-mg-lb__download:hover,
.wv-mg-lb__download:focus-visible {
	background: rgba(255, 255, 255, 0.18);
}

.wv-mg-lb__prev,
.wv-mg-lb__next {
	top: 50%;
	width: 44px;
	height: 48px;
	transform: translateY(-50%);
}

.wv-mg-lb__prev { left: 12px; }
.wv-mg-lb__next { right: 12px; }

.wv-mg-lb__prev::before,
.wv-mg-lb__next::before {
	content: "";
	display: block;
	width: 12px;
	height: 12px;
	margin: 18px auto 0;
	border-top: 2px solid #fff;
	border-right: 2px solid #fff;
}

.wv-mg-lb__prev::before { transform: rotate(-135deg); }
.wv-mg-lb__next::before { transform: rotate(45deg); }

body.wv-mg-lb-open {
	overflow: hidden;
}

@media (hover: none) {
	.wv-mg__download {
		opacity: 1;
	}
}

@media (max-width: 900px) {
	.wv-mg:not([data-columns="1"]):not([data-columns="2"]) .wv-mg__grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 782px) {
	.wv-mg:not([data-columns="1"]) .wv-mg__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.wv-mg__download {
		opacity: 1;
	}

	.wv-mg-lb__stage {
		inset: 52px 16px 64px;
	}

	.wv-mg-lb__prev,
	.wv-mg-lb__next {
		display: none;
	}
}
