/* ویدئو آپارات — single video */
.ptva {
	--ptva-ratio: 16 / 9;
	--ptva-radius: 14px;
	--ptva-bg: #123D27;
	--ptva-ov: rgba(4, 20, 11, .55);
	--ptva-accent: #0B7A3B;
	--ptva-accent-h: color-mix(in srgb, var(--ptva-accent) 80%, #000);
	--ptva-icon: #FFFFFF;
	--ptva-play: 76px;
	position: relative;
	width: 100%;
	margin: 0 auto;
	padding: 0;
	direction: rtl;
	text-align: right;
}

.ptva *,
.ptva *::before,
.ptva *::after {
	box-sizing: border-box;
}

.ptva .ptva__media {
	position: relative;
	display: block;
	width: 100%;
	aspect-ratio: var(--ptva-ratio);
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: var(--ptva-radius);
	overflow: hidden;
	background-color: var(--ptva-bg);
	background-image: repeating-linear-gradient(90deg, rgba(255, 255, 255, .03) 0 2px, transparent 2px 28px);
	color: #FFFFFF;
	font: inherit;
	line-height: 1.6;
	letter-spacing: normal;
	text-transform: none;
	text-align: right;
	cursor: pointer;
	isolation: isolate;
}

.ptva--direct .ptva__media {
	cursor: default;
}

.ptva__frame,
.ptva .ptva__media iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
	z-index: 5;
}

.ptva .ptva__cover {
	position: absolute;
	inset: 0;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	object-fit: cover;
	object-position: center center;
	border-radius: 0 !important;
	display: block;
	transition: transform .7s cubic-bezier(.2, .7, .2, 1);
}

.ptva--zoom .ptva__trigger:hover .ptva__cover {
	transform: scale(1.04);
}

.ptva__shade {
	position: absolute;
	inset: 0;
	z-index: 1;
	background: linear-gradient(to top, var(--ptva-ov) 0%, color-mix(in srgb, var(--ptva-ov) 35%, transparent) 45%, transparent 75%);
	transition: opacity .3s;
	pointer-events: none;
}

/* ---------- play button ---------- */
.ptva__play {
	position: absolute;
	z-index: 3;
	display: flex;
	align-items: center;
	gap: 14px;
	pointer-events: none;
}

.ptva--pos-center .ptva__play {
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
}

.ptva--pos-corner .ptva__play {
	left: 22px;
	bottom: 22px;
}

.ptva__btn {
	position: relative;
	width: var(--ptva-play);
	height: var(--ptva-play);
	flex: 0 0 auto;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--ptva-accent);
	color: var(--ptva-icon);
	box-shadow: 0 14px 30px -12px rgba(0, 0, 0, .55);
	transition: transform .3s cubic-bezier(.2, .7, .2, 1), background-color .3s;
}

.ptva__btn svg {
	width: 38%;
	height: 38%;
	margin-left: 6%;
	display: block;
}

.ptva--play-ring .ptva__btn {
	background: rgba(10, 18, 14, .45);
	border: 3px solid #FFFFFF;
	backdrop-filter: blur(3px);
}

.ptva__trigger:hover .ptva__btn,
.ptva__trigger:focus-visible .ptva__btn {
	transform: scale(1.08);
	background: var(--ptva-accent-h);
}

.ptva--play-ring .ptva__trigger:hover .ptva__btn {
	background: var(--ptva-accent);
}

.ptva__playtxt {
	padding: 8px 16px;
	border-radius: 999px;
	background: rgba(255, 255, 255, .95);
	color: #13241B;
	font-size: 15px;
	font-weight: 800;
	white-space: nowrap;
	box-shadow: 0 10px 24px -14px rgba(0, 0, 0, .6);
}

.ptva--pulse .ptva__btn::before,
.ptva--pulse .ptva__btn::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 50%;
	border: 2px solid color-mix(in srgb, var(--ptva-accent) 70%, #fff);
	animation: ptvaRing 2.4s cubic-bezier(.2, .7, .2, 1) infinite;
	pointer-events: none;
}

.ptva--pulse .ptva__btn::after {
	animation-delay: 1.2s;
}

@keyframes ptvaRing {
	0% { transform: scale(1); opacity: .8; }
	100% { transform: scale(1.75); opacity: 0; }
}

/* ---------- overlay texts ---------- */
.ptva__badge {
	position: absolute;
	z-index: 3;
	top: 16px;
	right: 16px;
	padding: 5px 12px;
	border-radius: 6px;
	background: var(--ptva-accent);
	color: #FFFFFF;
	font-size: 12.5px;
	font-weight: 700;
	line-height: 1.5;
}

.ptva__cap {
	position: absolute;
	z-index: 2;
	right: 22px;
	left: 96px;
	bottom: 18px;
	display: flex;
	flex-direction: column;
	gap: 2px;
	pointer-events: none;
}

.ptva--pos-corner .ptva__cap {
	left: calc(var(--ptva-play) + 60px);
}

.ptva__title {
	font-size: clamp(15px, 1.6vw, 21px);
	font-weight: 900;
	line-height: 1.6;
	color: #FFFFFF;
	text-shadow: 0 2px 12px rgba(0, 0, 0, .35);
}

.ptva__sub {
	font-size: 13.5px;
	color: rgba(255, 255, 255, .85);
}

.ptva__dur {
	position: absolute;
	z-index: 3;
	bottom: 16px;
	left: 16px;
	padding: 2px 9px;
	border-radius: 5px;
	background: rgba(8, 14, 11, .78);
	color: #FFFFFF;
	font-size: 12.5px;
	font-weight: 700;
	line-height: 1.6;
	font-variant-numeric: tabular-nums;
}

.ptva--pos-corner .ptva__dur {
	top: 16px;
	bottom: auto;
}

/* playing inline: hide overlay */
.ptva.is-playing .ptva__shade,
.ptva.is-playing .ptva__badge,
.ptva.is-playing .ptva__play,
.ptva.is-playing .ptva__cap,
.ptva.is-playing .ptva__dur {
	display: none;
}

.ptva.is-playing .ptva__media {
	cursor: default;
}

.ptva.is-loading .ptva__btn {
	animation: ptvaSpin .9s linear infinite;
}

@keyframes ptvaSpin {
	to { transform: rotate(360deg); }
}

/* ---------- caption ---------- */
.ptva__foot {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 6px 16px;
	margin-top: 12px;
}

.ptva__caption {
	font-size: 14.5px;
	line-height: 1.9;
	color: #4A5850;
}

.ptva .ptva__link {
	font-size: 13.5px;
	font-weight: 700;
	color: var(--ptva-accent);
	text-decoration: none;
	white-space: nowrap;
}

.ptva .ptva__link:hover {
	text-decoration: underline;
}

.ptva .ptva__trigger:focus-visible {
	outline: 3px solid color-mix(in srgb, var(--ptva-accent) 55%, #fff);
	outline-offset: 3px;
}

.ptva--empty .ptva__media {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	text-align: center;
	color: rgba(255, 255, 255, .8);
	cursor: default;
}

/* ---------- popup ---------- */
.ptva-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: rgba(3, 14, 8, .9);
	direction: rtl;
	animation: ptvaFade .25s ease both;
}

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

@keyframes ptvaFade {
	from { opacity: 0; }
	to { opacity: 1; }
}

.ptva-modal__in {
	width: 100%;
	max-width: 1040px;
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.ptva-modal__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	color: #FFFFFF;
}

.ptva-modal__t {
	font-size: 19px;
	font-weight: 900;
	line-height: 1.5;
}

.ptva-modal .ptva-modal__x {
	flex: 0 0 auto;
	width: 46px;
	height: 46px;
	padding: 0;
	margin: 0;
	border-radius: 50%;
	border: 1.5px solid rgba(255, 255, 255, .35);
	background: transparent;
	color: #FFFFFF;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}

.ptva-modal .ptva-modal__x:hover {
	background: #FFFFFF;
	color: #13241B;
}

.ptva-modal__frame {
	position: relative;
	aspect-ratio: 16 / 9;
	max-height: 80vh;
	border-radius: 12px;
	overflow: hidden;
	background: #000000;
}

.ptva-modal__frame iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

html.ptva-lock {
	overflow: hidden;
}

@media (max-width: 767px) {
	.ptva {
		--ptva-play: 60px;
	}
	.ptva__cap {
		right: 14px;
		left: 70px;
		bottom: 12px;
	}
	.ptva__sub {
		display: none;
	}
	.ptva__badge {
		top: 10px;
		right: 10px;
		font-size: 11.5px;
	}
	.ptva__dur {
		bottom: 10px;
		left: 10px;
		font-size: 11.5px;
	}
	.ptva--pos-corner .ptva__play {
		left: 14px;
		bottom: 14px;
	}
	.ptva__playtxt {
		font-size: 13px;
		padding: 6px 12px;
	}
	.ptva-modal {
		padding: 12px;
	}
	.ptva-modal__t {
		font-size: 15px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ptva *,
	.ptva *::before,
	.ptva *::after {
		animation: none !important;
		transition: none !important;
	}
}
