/**
 * Home page — circular video stories and player modal.
 */

.hm-video-stories {
	padding: clamp(28px, 3vw, 48px) 0;
	background: #fff;
	color: #111;
}

.hm-video-stories__inner {
	position: relative;
	width: min(1800px, calc(100% - 48px));
	margin-inline: auto;
	padding-inline: 58px;
}

.hm-video-stories__viewport {
	overflow-x: auto;
	overflow-y: hidden;
	scroll-behavior: smooth;
	scroll-snap-type: x proximity;
	scrollbar-width: none;
	overscroll-behavior-inline: contain;
	-webkit-overflow-scrolling: touch;
	padding: 6px 0;
}

.hm-video-stories__viewport::-webkit-scrollbar {
	display: none;
}

.hm-video-stories__list {
	display: flex;
	align-items: flex-start;
	justify-content: center;
	gap: clamp(18px, 2vw, 32px);
	width: max-content;
	min-width: 100%;
}

.hm-video-stories__item {
	display: flex;
	flex: 0 0 auto;
	flex-direction: column;
	align-items: center;
	width: 122px;
	scroll-snap-align: center;
}

.hm-video-story {
	position: relative;
	display: block;
	width: 118px;
	height: 118px;
	padding: 4px;
	border: 3px solid #6136f5;
	border-radius: 50%;
	background: #fff;
	box-shadow: none;
	cursor: pointer;
	transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}

.hm-video-story:hover,
.hm-video-story:focus-visible {
	border-color: #ff317b;
	outline: none;
	transform: translateY(-3px);
}

.hm-video-story__thumb {
	position: relative;
	display: block;
	overflow: hidden;
	width: 100%;
	height: 100%;
	border-radius: 50%;
	background: #151515;
}

.hm-video-story__thumb img,
.hm-video-story__thumb video {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	pointer-events: none;
}

.hm-video-story__play {
	position: absolute;
	top: 50%;
	left: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	border: 1px solid rgba(255, 255, 255, .75);
	border-radius: 50%;
	background: rgba(0, 0, 0, .38);
	color: #fff;
	opacity: 0;
	transform: translate(-50%, -50%) scale(.85);
	transition: opacity .2s ease, transform .2s ease;
	backdrop-filter: blur(3px);
}

.hm-video-story:hover .hm-video-story__play,
.hm-video-story:focus-visible .hm-video-story__play {
	opacity: 1;
	transform: translate(-50%, -50%) scale(1);
}

.hm-video-story__label {
	display: block;
	overflow: hidden;
	width: 100%;
	margin-top: 8px;
	color: #222;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.35;
	text-align: center;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.hm-video-stories__arrow {
	position: absolute;
	top: 59px;
	z-index: 5;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	padding: 0;
	border: 1px solid #d7d7d7;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 3px 10px rgba(0, 0, 0, .08);
	color: #111;
	cursor: pointer;
	transform: translateY(-50%);
	transition: background-color .2s ease, color .2s ease, opacity .2s ease;
}

.hm-video-stories__arrow:hover,
.hm-video-stories__arrow:focus-visible {
	background: #111;
	color: #fff;
}

.hm-video-stories__arrow:disabled {
	opacity: .28;
	cursor: default;
}

.hm-video-stories__arrow--prev {
	left: 3px;
}

.hm-video-stories__arrow--next {
	right: 3px;
}

.hm-video-stories--empty .hm-video-stories__inner {
	padding: 22px;
	border: 1px dashed #b6b6b6;
	border-radius: 10px;
	background: #f8f8f8;
	text-align: center;
}

.hm-video-stories--empty p {
	margin: 0;
}

/* Popup video. */
body.hm-video-stories-open {
	overflow: hidden;
}

.hm-video-modal[hidden] {
	display: none;
}

.hm-video-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: grid;
	place-items: center;
	padding: 24px;
}

.hm-video-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, .88);
	backdrop-filter: blur(7px);
}

.hm-video-modal__dialog {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	width: min(92vw, 680px);
	height: min(88vh, 820px);
}

.hm-video-modal__frame {
	display: flex;
	overflow: hidden;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	border-radius: 16px;
	background: #000;
	box-shadow: 0 20px 70px rgba(0, 0, 0, .5);
}

.hm-video-modal__frame video {
	display: block;
	width: 100%;
	height: 100%;
	background: #000;
	object-fit: contain;
}

.hm-video-modal__close,
.hm-video-modal__nav {
	position: absolute;
	z-index: 3;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, .35);
	border-radius: 50%;
	background: rgba(0, 0, 0, .55);
	color: #fff;
	cursor: pointer;
	transition: background-color .2s ease, transform .2s ease;
	backdrop-filter: blur(5px);
}

.hm-video-modal__close:hover,
.hm-video-modal__close:focus-visible,
.hm-video-modal__nav:hover,
.hm-video-modal__nav:focus-visible {
	background: #fff;
	color: #111;
	outline: none;
}

.hm-video-modal__close {
	top: 12px;
	right: 12px;
	width: 44px;
	height: 44px;
}

.hm-video-modal__nav {
	top: 50%;
	width: 48px;
	height: 48px;
	transform: translateY(-50%);
}

.hm-video-modal__nav:hover,
.hm-video-modal__nav:focus-visible {
	transform: translateY(-50%) scale(1.06);
}

.hm-video-modal__nav--prev {
	left: 12px;
}

.hm-video-modal__nav--next {
	right: 12px;
}

@media (max-width: 767px) {
	.hm-video-stories {
		padding: 24px 0 30px;
	}

	.hm-video-stories__inner {
		width: 100%;
		padding-inline: 12px;
	}

	.hm-video-stories__list {
		justify-content: flex-start;
		gap: 14px;
		min-width: max-content;
	}

	.hm-video-stories__item {
		width: 86px;
	}

	.hm-video-story {
		width: 82px;
		height: 82px;
		padding: 3px;
		border-width: 2px;
	}

	.hm-video-story__play {
		width: 30px;
		height: 30px;
		opacity: 1;
		transform: translate(-50%, -50%) scale(1);
	}

	.hm-video-story__play svg {
		width: 18px;
		height: 18px;
	}

	.hm-video-story__label {
		margin-top: 6px;
		font-size: 11px;
	}

	.hm-video-stories__arrow {
		display: none;
	}

	.hm-video-modal {
		padding: 0;
	}

	.hm-video-modal__dialog {
		width: 100vw;
		height: 100dvh;
	}

	.hm-video-modal__frame {
		border-radius: 0;
	}

	.hm-video-modal__close {
		top: max(12px, env(safe-area-inset-top));
		right: 12px;
	}

	.hm-video-modal__nav {
		width: 42px;
		height: 42px;
	}

	.hm-video-modal__nav--prev {
		left: 8px;
	}

	.hm-video-modal__nav--next {
		right: 8px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.hm-video-stories__viewport {
		scroll-behavior: auto;
	}

	.hm-video-story,
	.hm-video-story__play,
	.hm-video-stories__arrow,
	.hm-video-modal__close,
	.hm-video-modal__nav {
		transition: none;
	}
}
