.custom-video-gallery {
	--evgp-columns: 3;
	--evgp-gap-x: 56px;
	--evgp-gap-y: 0;
	--evgp-ink: #686863;
	--evgp-muted: #8a8a84;
	--evgp-faint: #d7d7d1;
	--evgp-line: #eeeeea;
	--evgp-deep: #666661;
	direction: rtl;
	padding: 72px 0 88px;
	color: var(--evgp-ink);
	font-family: "IRANSansX", "Vazirmatn", "Dana", "Peyda", "Tahoma", system-ui, sans-serif;
	background: #fbfbfa;
}

.custom-video-gallery *,
.custom-video-gallery *::before,
.custom-video-gallery *::after {
	box-sizing: border-box;
}

.custom-video-gallery__header {
	max-width: 760px;
	margin: 0 auto 58px;
	text-align: center;
}

.custom-video-gallery__heading {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 20px;
	margin: 0 0 18px;
	color: #777772;
	font-size: clamp(34px, 4.2vw, 58px);
	font-weight: 800;
	line-height: 1.15;
	letter-spacing: 0;
}

.custom-video-gallery__heading::before,
.custom-video-gallery__heading::after {
	display: block;
	width: clamp(74px, 11vw, 150px);
	height: 1px;
	content: "";
	background: linear-gradient(90deg, transparent, #e5e5e1 22%, #e5e5e1 78%, transparent);
}

.custom-video-gallery__heading::before {
	transform: scaleX(-1);
}

.custom-video-gallery__lead {
	max-width: 720px;
	margin: 0 auto;
	color: #777772;
	font-size: 16px;
	font-weight: 400;
	line-height: 2;
}

.custom-video-gallery__grid {
	position: relative;
	display: grid;
	grid-template-columns: repeat(var(--evgp-columns), minmax(0, 1fr));
	column-gap: var(--evgp-gap-x);
	row-gap: var(--evgp-gap-y);
	max-width: 1300px;
	margin: 0 auto;
	padding: 0 16px;
}

.custom-video-gallery__item {
	position: relative;
	display: flex;
	flex-direction: column;
	min-width: 0;
	padding: 24px 0 24px;
	overflow: visible;
	background: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	transition: opacity 220ms ease, transform 220ms ease;
}

.custom-video-gallery__item::after {
	position: absolute;
	right: calc(-1 * var(--evgp-gap-x) / 2);
	top: 0;
	bottom: 0;
	width: 1px;
	content: "";
	background: var(--evgp-line);
}

.custom-video-gallery__item:nth-child(3n)::after {
	display: none;
}

.custom-video-gallery__item:nth-child(n+4) {
	border-top: 1px solid var(--evgp-line);
}

.custom-video-gallery__item:hover {
	transform: translateY(-2px);
}

.custom-video-gallery__item--hidden {
	display: none;
	opacity: 0;
	transform: translateY(12px);
}

.custom-video-gallery__item--revealing {
	animation: evgp-card-in 260ms ease both;
}

.custom-video-gallery__trigger,
.custom-video-gallery__title-button {
	display: block;
	width: 100%;
	margin: 0;
	padding: 0;
	color: inherit;
	font: inherit;
	text-align: inherit;
	background: transparent;
	border: 0;
	border-radius: 0;
	cursor: pointer;
}

.custom-video-gallery__thumbnail {
	position: relative;
	display: block;
	width: 100%;
	height: 290px;
	overflow: hidden;
	background: #e9e6df;
	border-radius: 0;
}

.custom-video-gallery__thumbnail img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 420ms ease, filter 420ms ease;
}

.custom-video-gallery__trigger:hover .custom-video-gallery__thumbnail img,
.custom-video-gallery__trigger:focus-visible .custom-video-gallery__thumbnail img {
	filter: saturate(0.95) contrast(1.03);
	transform: scale(1.025);
}

.custom-video-gallery__image-shade {
	position: absolute;
	inset: 38% 0 0;
	background: linear-gradient(180deg, rgba(35, 35, 32, 0) 0%, rgba(35, 35, 32, 0.58) 100%);
	pointer-events: none;
}

.custom-video-gallery__play {
	position: absolute;
	left: 16px;
	bottom: 16px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 54px;
	height: 54px;
	color: #1f201e;
	background: rgba(255, 255, 255, 0.94);
	border: 0;
	border-radius: 0;
	box-shadow: none;
	transform: none;
	transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.custom-video-gallery__play svg {
	width: 16px;
	height: 16px;
	fill: currentColor;
	transform: scaleX(-1);
}

.custom-video-gallery__trigger:hover .custom-video-gallery__play,
.custom-video-gallery__trigger:focus-visible .custom-video-gallery__play {
	color: #ffffff;
	background: #666661;
	transform: translateX(-2px);
}

.custom-video-gallery__duration {
	position: absolute;
	right: 16px;
	bottom: 18px;
	display: inline-flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 2px;
	min-height: 0;
	padding: 0;
	color: #ffffff;
	font-size: 20px;
	font-weight: 800;
	line-height: 1.05;
	text-align: right;
	background: transparent;
	border-radius: 0;
	text-shadow: 0 1px 12px rgba(0, 0, 0, 0.34);
}

.custom-video-gallery__duration::before {
	content: "مدت زمان:";
	font-size: 14px;
	font-weight: 400;
	line-height: 1.2;
}

.custom-video-gallery__content {
	display: flex;
	flex: 1;
	flex-direction: column;
	align-items: center;
	padding: 24px 10px 0;
	text-align: center;
}

.custom-video-gallery__title {
	width: 100%;
	margin: 0 0 14px;
	color: #6f6f6a;
	font-size: 23px;
	font-weight: 800;
	line-height: 1.45;
}

.custom-video-gallery__title-button {
	text-align: center;
	transition: color 180ms ease;
}

.custom-video-gallery__title-button:hover,
.custom-video-gallery__title-button:focus-visible {
	color: #3f403c;
}

.custom-video-gallery__description {
	display: -webkit-box;
	width: 100%;
	max-width: 340px;
	margin: 0 auto 24px;
	overflow: hidden;
	color: #c9c9c3;
	font-size: 17px;
	font-weight: 500;
	line-height: 1.85;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.custom-video-gallery__button,
.custom-video-gallery__load-more {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 54px;
	margin-top: auto;
	padding: 0 28px;
	color: #4e4f4a;
	font-size: 14px;
	font-weight: 800;
	line-height: 1.2;
	text-decoration: none;
	background: transparent;
	border: 1px solid #e7e7e3;
	border-radius: 0;
	cursor: pointer;
	transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.custom-video-gallery__button::before,
.custom-video-gallery__load-more::before {
	content: "←";
	font-size: 18px;
	font-weight: 400;
	line-height: 1;
}

.custom-video-gallery__button:hover,
.custom-video-gallery__button:focus-visible {
	color: #ffffff;
	background: #666661;
	border-color: #666661;
	transform: translateX(-2px);
}

.custom-video-gallery__load-more-wrap {
	display: flex;
	justify-content: center;
	margin-top: 58px;
}

.custom-video-gallery__load-more {
	min-width: 214px;
	margin-top: 0;
	color: #ffffff;
	background: #666661;
	border-color: #666661;
}

.custom-video-gallery__load-more:hover,
.custom-video-gallery__load-more:focus-visible {
	color: #666661;
	background: transparent;
	border-color: #d8d8d2;
	transform: translateX(-2px);
}

.custom-video-gallery__modal {
	position: fixed;
	z-index: 99999;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	visibility: hidden;
	background: rgba(35, 35, 32, 0.82);
	opacity: 0;
	pointer-events: none;
	transition: opacity 200ms ease, visibility 200ms ease;
}

.custom-video-gallery__modal.is-open {
	visibility: visible;
	opacity: 1;
	pointer-events: auto;
}

.custom-video-gallery__overlay {
	position: absolute;
	inset: 0;
	cursor: pointer;
}

.custom-video-gallery__modal-content {
	position: relative;
	z-index: 1;
	width: min(980px, 100%);
	max-width: 980px;
	padding: 0;
	overflow: hidden;
	background: #10110f;
	border-radius: 0;
	box-shadow: 0 28px 90px rgba(0, 0, 0, 0.38);
	transform: translateY(14px) scale(0.98);
	transition: transform 200ms ease;
}

.custom-video-gallery__modal.is-open .custom-video-gallery__modal-content {
	transform: translateY(0) scale(1);
}

.custom-video-gallery__modal-title {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	white-space: nowrap;
	border: 0;
	clip: rect(0 0 0 0);
}

.custom-video-gallery__close {
	position: absolute;
	z-index: 2;
	top: 10px;
	left: 10px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	padding: 0;
	color: #ffffff;
	font-size: 32px;
	line-height: 1;
	background: rgba(0, 0, 0, 0.48);
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 0;
	cursor: pointer;
	transition: background-color 180ms ease, transform 180ms ease;
}

.custom-video-gallery__close:hover,
.custom-video-gallery__close:focus-visible {
	background: rgba(102, 102, 97, 0.95);
	transform: scale(1.04);
}

.custom-video-gallery__player {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	background: #000000;
}

.custom-video-gallery__player iframe,
.custom-video-gallery__player video {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
}

.custom-video-gallery__error {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 260px;
	padding: 32px;
	color: #ffffff;
	text-align: center;
}

body.evgp-modal-open {
	overflow: hidden;
}

@keyframes evgp-card-in {
	from {
		opacity: 0;
		transform: translateY(12px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@media (max-width: 1024px) {
	.custom-video-gallery {
		--evgp-columns: 2;
		--evgp-gap-x: 34px;
		padding: 56px 0 72px;
	}

	.custom-video-gallery__item:nth-child(3n)::after {
		display: block;
	}

	.custom-video-gallery__item:nth-child(2n)::after {
		display: none;
	}

	.custom-video-gallery__item:nth-child(n+3) {
		border-top: 1px solid var(--evgp-line);
	}
}

@media (max-width: 767px) {
	.custom-video-gallery {
		--evgp-columns: 1;
		padding: 44px 0 56px;
	}

	.custom-video-gallery__header {
		margin-bottom: 34px;
		padding: 0 16px;
	}

	.custom-video-gallery__heading {
		font-size: 34px;
		gap: 12px;
	}

	.custom-video-gallery__heading::before,
	.custom-video-gallery__heading::after {
		width: 52px;
	}

	.custom-video-gallery__lead {
		font-size: 14px;
		line-height: 1.9;
	}

	.custom-video-gallery__grid {
		padding: 0 16px;
	}

	.custom-video-gallery__item {
		padding: 22px 0 28px;
		border-top: 1px solid var(--evgp-line);
	}

	.custom-video-gallery__item:first-child {
		border-top: 0;
	}

	.custom-video-gallery__item::after {
		display: none !important;
	}

	.custom-video-gallery__thumbnail {
		height: 245px;
	}

	.custom-video-gallery__title {
		font-size: 20px;
	}

	.custom-video-gallery__description {
		font-size: 15px;
	}

	.custom-video-gallery__modal {
		padding: 14px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.custom-video-gallery__item,
	.custom-video-gallery__thumbnail img,
	.custom-video-gallery__play,
	.custom-video-gallery__button,
	.custom-video-gallery__load-more,
	.custom-video-gallery__modal,
	.custom-video-gallery__modal-content,
	.custom-video-gallery__close {
		transition: none;
	}

	.custom-video-gallery__item--revealing {
		animation: none;
	}
}
