/* استوری برازندگان — نوار دایره‌ای + نمایشگر تمام‌صفحه */

.brz-stories {
	--st-navy: var(--brz-navy, #0d2b4e);
	--st-size: var(--brz-st-size, 78px);

	position: relative;
	direction: rtl;
	padding: var(--brz-st-pt, 18px) 0 var(--brz-st-pb, 18px);
}

.brz-stories__rail {
	display: flex;
	gap: var(--brz-st-gap, 12px);
	justify-content: center;
	/* یک ردیف، بدون شکستن. اگر تعداد از عرض بیشتر شد، افقی اسکرول می‌شود
	   نه اینکه به ردیف دوم بیفتد. */
	flex-wrap: nowrap;
	overflow-x: auto;
	scrollbar-width: none;
	max-width: var(--brz-st-max, 1600px);
	margin-inline: auto;
	/* فاصله عمودی داخل ظرف اسکرول لازم است: ظرف اسکرول محتوا را در هر دو
	   جهت برش می‌دهد، و بدون این فاصله دایره‌ای که با هاور بزرگ می‌شود
	   از بالا بریده می‌شد. */
	padding: 10px 24px;
}

.brz-stories__rail::-webkit-scrollbar { display: none; }

.brz-stories__cell { flex: 0 0 auto; min-width: 0; }

/* ---------- دایره ---------- */

.brz-story {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	width: calc(var(--st-size) + 18px);
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	text-decoration: none;
	cursor: pointer;
}

.brz-story__ring {
	position: relative;
	display: grid;
	place-items: center;
	width: var(--st-size);
	height: var(--st-size);
	border-radius: 50%;
	padding: 3px;
	background: conic-gradient(from 210deg,
		var(--r, var(--brz-st-c1, #e8791a)),
		var(--brz-st-c2, #c9a84c),
		var(--r, var(--brz-st-c1, #e8791a)));
	transition: transform .28s cubic-bezier(.2, .8, .3, 1);
}

.brz-story:hover .brz-story__ring,
.brz-story:focus-visible .brz-story__ring {
	transform: scale(1.05);
}

.brz-story.is-seen .brz-story__ring {
	background: var(--brz-st-seen, #d3d7de);
}

.brz-story__disc {
	display: grid;
	place-items: center;
	width: 100%;
	height: 100%;
	border-radius: 50%;
	border: 2px solid #fff;
	overflow: hidden;
	background: #eef1f5;
}

.brz-story__disc img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.brz-story__ph {
	font-size: 1.4rem;
	font-weight: 800;
	color: var(--st-navy);
}

.brz-story__name {
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-size: .74rem;
	font-weight: 500;
	line-height: 1.7;
	color: #4a5160;
	text-align: center;
}

.brz-story:hover .brz-story__name {
	color: var(--brz-orange, #e8791a);
}

.brz-stories.no-titles .brz-story { gap: 0; }

.brz-stories__scroll { display: none; }

.brz-stories :focus-visible {
	outline: 3px solid var(--brz-orange, #e8791a);
	outline-offset: 4px;
	border-radius: 50%;
}

/* ---------- موبایل: اسکرول افقی ---------- */

@media (max-width: 900px) {

	.brz-stories__rail {
		justify-content: flex-start;
		padding: 10px 16px;
		scroll-snap-type: x proximity;
	}

	.brz-stories__cell { scroll-snap-align: start; }

	.brz-stories { --st-size: 66px; }
}

/* ═══════════ نمایشگر تمام‌صفحه ═══════════ */

.brz-viewer {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	direction: rtl;
}

.brz-viewer[hidden] { display: none; }

.brz-viewer__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(6, 10, 16, .92);
	backdrop-filter: blur(6px);
	animation: brz-vw-fade .25s ease both;
}

@keyframes brz-vw-fade { from { opacity: 0 } to { opacity: 1 } }

.brz-viewer__stage {
	position: relative;
	z-index: 1;
	width: min(430px, 100vw);
	height: min(88vh, 860px);
	background: #0b1018;
	border-radius: 18px;
	overflow: hidden;
	box-shadow: 0 30px 90px rgba(0, 0, 0, .6);
	animation: brz-vw-rise .32s cubic-bezier(.2, .8, .3, 1) both;
}

@keyframes brz-vw-rise {
	from { opacity: 0; transform: translateY(24px) scale(.97) }
	to   { opacity: 1; transform: none }
}

/* نوارهای پیشرفت */

.brz-viewer__bars {
	position: absolute;
	z-index: 4;
	inset-inline: 10px;
	top: 10px;
	display: flex;
	gap: 4px;
}

.brz-viewer__bar {
	flex: 1 1 0;
	height: 3px;
	border-radius: 999px;
	background: rgba(255, 255, 255, .28);
	overflow: hidden;
}

.brz-viewer__bar i {
	display: block;
	width: 0;
	height: 100%;
	background: #fff;
	border-radius: 999px;
}

.brz-viewer__bar.is-done i { width: 100%; }

/* سربرگ */

.brz-viewer__head {
	position: absolute;
	z-index: 4;
	inset-inline: 0;
	top: 0;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 24px 14px 26px;
	background: linear-gradient(to bottom, rgba(0, 0, 0, .72), transparent);
	pointer-events: none;
}

.brz-viewer__avatar {
	width: 34px;
	height: 34px;
	flex: 0 0 34px;
	border-radius: 50%;
	border: 2px solid rgba(255, 255, 255, .85);
	background-size: cover;
	background-position: center;
	background-color: #223;
}

.brz-viewer__title {
	flex: 1 1 auto;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	color: #fff;
	font-size: .9rem;
	font-weight: 700;
}

.brz-viewer__close {
	pointer-events: auto;
	display: grid;
	place-items: center;
	width: 38px;
	height: 38px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .12);
	color: #fff;
	cursor: pointer;
	transition: background .2s;
}

.brz-viewer__close:hover { background: rgba(255, 255, 255, .26); }

/* تصویر */

.brz-viewer__frame {
	position: absolute;
	inset: 0;
	margin: 0;
	display: block;
}

.brz-viewer__frame img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	animation: brz-vw-in .4s ease both;
}

@keyframes brz-vw-in { from { opacity: .25 } to { opacity: 1 } }

.brz-viewer__cap {
	position: absolute;
	z-index: 3;
	inset-inline: 0;
	bottom: 0;
	padding: 64px 20px 24px;
	background: linear-gradient(to top, rgba(0, 0, 0, .88), transparent);
	color: #fff;
	text-align: start;
}

.brz-viewer__cap h3 {
	margin: 0 0 6px;
	font-size: 1.15rem;
	font-weight: 800;
	line-height: 1.6;
}

.brz-viewer__cap p {
	margin: 0;
	font-size: .88rem;
	font-weight: 300;
	line-height: 1.95;
	color: rgba(255, 255, 255, .84);
}

.brz-viewer__cap a {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	margin-top: 14px;
	padding: 11px 22px;
	border-radius: 999px;
	background: var(--brz-orange, #e8791a);
	color: #10202f;
	font-size: .88rem;
	font-weight: 700;
	text-decoration: none;
	transition: background .2s, transform .2s;
}

.brz-viewer__cap a:hover {
	background: #ff9440;
	transform: translateY(-2px);
}

/* نواحی لمسی */

.brz-viewer__zone {
	position: absolute;
	z-index: 2;
	top: 64px;
	bottom: 96px;
	width: 34%;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.brz-viewer__zone.is-prev { inset-inline-end: 0; }
.brz-viewer__zone.is-next { inset-inline-start: 0; width: 66%; }

.brz-viewer.is-paused .brz-viewer__head,
.brz-viewer.is-paused .brz-viewer__cap,
.brz-viewer.is-paused .brz-viewer__bars {
	opacity: 0;
	transition: opacity .2s;
}

@media (max-width: 520px) {
	.brz-viewer__stage {
		width: 100vw;
		height: 100dvh;
		border-radius: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.brz-viewer__stage,
	.brz-viewer__backdrop,
	.brz-viewer__frame img { animation: none; }
	.brz-story__ring { transition: none; }
}
