.shm-video-library {
	--shm-video-bg: #111;
	--shm-video-panel: #181818;
	--shm-video-text: #f5f5f5;
	--shm-video-muted: #a7a7a7;
	--shm-video-border: rgba(255, 255, 255, 0.13);
	box-sizing: border-box;
	width: 100%;
}

.shm-video-library *,
.shm-video-library *::before,
.shm-video-library *::after {
	box-sizing: inherit;
}

.shm-video-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: clamp(18px, 2.4vw, 30px);
}

.shm-video-card {
	min-width: 0;
	margin: 0;
}

.shm-video-card__button {
	display: block;
	width: 100%;
	padding: 0;
	border: 0;
	background: transparent;
	color: inherit;
	font: inherit;
	text-align: left;
	cursor: pointer;
}

.shm-video-card__media {
	position: relative;
	display: block;
	overflow: hidden;
	aspect-ratio: 16 / 9;
	border-radius: 10px;
	background: var(--shm-video-panel);
}

.shm-video-card__media::after {
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, transparent 48%, rgba(0, 0, 0, 0.38));
	content: "";
	pointer-events: none;
}

.shm-video-card__image,
.shm-video-card__placeholder {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 280ms ease, opacity 280ms ease;
}

.shm-video-card__placeholder {
	background: linear-gradient(135deg, #262626, #111);
}

.shm-video-card__play {
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: 1;
	display: grid;
	place-items: center;
	width: 54px;
	height: 54px;
	border: 1px solid rgba(255, 255, 255, 0.6);
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.55);
	transform: translate(-50%, -50%);
	transition: background 180ms ease, transform 180ms ease;
	backdrop-filter: blur(5px);
}

.shm-video-card__play::before {
	width: 0;
	height: 0;
	margin-left: 4px;
	border-top: 7px solid transparent;
	border-bottom: 7px solid transparent;
	border-left: 11px solid #fff;
	content: "";
}

.shm-video-card__meta {
	display: grid;
	gap: 6px;
	padding-top: 13px;
}

.shm-video-card__platform {
	color: var(--shm-video-muted);
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 0.13em;
	line-height: 1.2;
	text-transform: uppercase;
}

.shm-video-card__title {
	overflow: hidden;
	color: inherit;
	font-size: 16px;
	font-weight: 500;
	line-height: 1.4;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.shm-video-card__button:hover .shm-video-card__image,
.shm-video-card__button:focus-visible .shm-video-card__image {
	transform: scale(1.035);
	opacity: 0.86;
}

.shm-video-card__button:hover .shm-video-card__play,
.shm-video-card__button:focus-visible .shm-video-card__play {
	background: rgba(0, 0, 0, 0.78);
	transform: translate(-50%, -50%) scale(1.08);
}

.shm-video-card__button:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 6px;
}

.shm-video-dialog {
	width: min(1100px, calc(100vw - 40px));
	max-width: none;
	max-height: calc(100vh - 40px);
	padding: 0;
	border: 1px solid var(--shm-video-border);
	border-radius: 12px;
	background: var(--shm-video-bg);
	color: var(--shm-video-text);
	box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}

.shm-video-dialog::backdrop {
	background: rgba(0, 0, 0, 0.82);
	backdrop-filter: blur(4px);
}

.shm-video-dialog__panel {
	position: relative;
	padding: clamp(18px, 3vw, 30px);
}

.shm-video-dialog__title {
	margin: 0 50px 18px 0;
	color: inherit;
	font-size: clamp(18px, 3vw, 26px);
	font-weight: 500;
	line-height: 1.25;
}

.shm-video-dialog__close {
	position: absolute;
	top: 14px;
	right: 14px;
	z-index: 2;
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 1px solid var(--shm-video-border);
	border-radius: 50%;
	background: transparent;
	color: inherit;
	font: 300 28px/1 Arial, sans-serif;
	cursor: pointer;
}

.shm-video-dialog__close:hover,
.shm-video-dialog__close:focus-visible {
	background: rgba(255, 255, 255, 0.1);
}

.shm-video-dialog__embed {
	overflow: hidden;
	width: 100%;
	aspect-ratio: 16 / 9;
	border-radius: 8px;
	background: #000;
}

.shm-video-dialog__embed iframe,
.shm-video-dialog__embed video,
.shm-video-dialog__embed embed,
.shm-video-dialog__embed object {
	display: block;
	width: 100% !important;
	height: 100% !important;
	border: 0;
}

.shm-video-dialog__fallback {
	display: grid;
	place-items: center;
	width: 100%;
	height: 100%;
	margin: 0;
}

.shm-video-dialog__fallback a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0 20px;
	border: 1px solid currentColor;
	border-radius: 999px;
	color: inherit;
	text-decoration: none;
}

body.shm-video-dialog-open {
	overflow: hidden;
}

.shm-video-library--empty {
	padding: 22px;
	border: 1px dashed #c3c4c7;
	border-radius: 8px;
	background: #f6f7f7;
	color: #50575e;
}

@media (max-width: 860px) {
	.shm-video-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 560px) {
	.shm-video-grid {
		grid-template-columns: 1fr;
	}

	.shm-video-dialog {
		width: calc(100vw - 20px);
		max-height: calc(100vh - 20px);
	}

	.shm-video-dialog__panel {
		padding: 16px;
	}

	.shm-video-dialog__title {
		margin-bottom: 14px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.shm-video-card__image,
	.shm-video-card__placeholder,
	.shm-video-card__play {
		transition: none;
	}
}
