/* ==========================================================================
   ZHIYAR Stories — frontend styles
   Written mobile-first, RTL-friendly (uses inline-start/end + rtl overrides).
   ========================================================================== */

.zhiyar-stories-rail {
	direction: rtl;
	width: 100%;
	margin: 0 0 24px 0;
}

.zhiyar-stories-rail.zhiyar-stories-empty {
	display: none;
}

.zhiyar-stories-rail__list {
	display: flex;
	gap: 16px;
	list-style: none;
	margin: 0;
	padding: 4px 4px 12px;
	overflow-x: auto;
	scroll-snap-type: x proximity;
	-webkit-overflow-scrolling: touch;
}

.zhiyar-stories-rail__list::-webkit-scrollbar {
	height: 4px;
}

.zhiyar-stories-rail__list::-webkit-scrollbar-thumb {
	background: rgba(0, 0, 0, 0.15);
	border-radius: 4px;
}

.zhiyar-stories-rail__item {
	flex: 0 0 auto;
	scroll-snap-align: start;
}

.zhiyar-story-avatar {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	width: 84px;
	background: none;
	border: none;
	cursor: pointer;
	padding: 0;
	font-family: inherit;
}

.zhiyar-story-avatar__ring {
	width: 72px;
	height: 72px;
	border-radius: 50%;
	padding: 3px;
	background: linear-gradient(45deg, #b8860b, #d4af37 40%, #f4e4a6 60%, #b8860b);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.15s ease;
}

.zhiyar-story-avatar:hover .zhiyar-story-avatar__ring,
.zhiyar-story-avatar:focus-visible .zhiyar-story-avatar__ring {
	transform: scale(1.05);
}

.zhiyar-story-avatar__ring img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 50%;
	border: 2px solid #fff;
	display: block;
}

.zhiyar-story-avatar--no-thumb .zhiyar-story-avatar__ring {
	background: linear-gradient(135deg, #2b2b2b, #4a4a4a);
}

.zhiyar-story-avatar__icon {
	width: 0;
	height: 0;
	border-top: 8px solid transparent;
	border-bottom: 8px solid transparent;
	border-right: 12px solid #fff;
	margin-inline-start: 3px;
}

.zhiyar-story-avatar.zhiyar-story-avatar--seen .zhiyar-story-avatar__ring {
	background: #cfcfcf;
}

.zhiyar-story-avatar__label {
	font-size: 12px;
	line-height: 1.3;
	max-width: 84px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	color: #333;
}

/* ---------------------------------------------------------------------- */
/* Fullscreen viewer                                                       */
/* ---------------------------------------------------------------------- */

.zhiyar-story-viewer {
	position: fixed;
	inset: 0;
	z-index: 100000;
	background: #000;
	display: none;
	direction: rtl;
}

.zhiyar-story-viewer.is-open {
	display: block;
}

.zhiyar-story-viewer__progress {
	position: absolute;
	top: 10px;
	left: 10px;
	right: 10px;
	display: flex;
	gap: 4px;
	z-index: 3;
}

.zhiyar-story-progress__bar {
	flex: 1 1 0;
	height: 3px;
	background: rgba(255, 255, 255, 0.35);
	border-radius: 3px;
	overflow: hidden;
}

.zhiyar-story-progress__bar-fill {
	height: 100%;
	width: 0%;
	background: #fff;
	border-radius: 3px;
}

.zhiyar-story-progress__bar.is-complete .zhiyar-story-progress__bar-fill {
	width: 100%;
}

.zhiyar-story-viewer__close {
	position: absolute;
	top: 18px;
	left: 16px;
	z-index: 4;
	background: rgba(0, 0, 0, 0.35);
	color: #fff;
	border: none;
	border-radius: 50%;
	width: 36px;
	height: 36px;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
}

.zhiyar-story-viewer__stage {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
}

.zhiyar-story-viewer__stage img,
.zhiyar-story-viewer__stage video {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
}

.zhiyar-story-viewer__stage-caption {
	position: absolute;
	bottom: 24px;
	left: 0;
	right: 0;
	text-align: center;
	color: #fff;
	font-size: 14px;
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
	padding: 0 20px;
}

.zhiyar-story-viewer__stage-link {
	position: absolute;
	bottom: 60px;
	left: 50%;
	transform: translateX(-50%);
	background: #fff;
	color: #111;
	padding: 8px 20px;
	border-radius: 999px;
	font-size: 13px;
	text-decoration: none;
	font-weight: 600;
}

.zhiyar-story-viewer__nav {
	position: absolute;
	top: 0;
	bottom: 0;
	width: 33%;
	background: transparent;
	border: none;
	cursor: pointer;
	z-index: 2;
}

.zhiyar-story-viewer__nav--prev {
	right: 0;
}

.zhiyar-story-viewer__nav--next {
	left: 0;
}

@media (min-width: 768px) {
	.zhiyar-story-viewer__stage img,
	.zhiyar-story-viewer__stage video {
		max-width: 420px;
		max-height: 90vh;
		border-radius: 12px;
	}
}
