/* Clinic Story Bar — frontend bar styles */

.cs-story-bar-wrapper {
	--cs-size: 74px;
	--cs-border-thickness: 3px;
	--cs-border-start: #d4af37;
	--cs-border-end: #b8860b;
	--cs-read-border: #555555;
	--cs-spacing: 16px;
	--cs-radius: 50%;
	--cs-font-family: inherit;
	--cs-title-color: #2b2b2b;
	--cs-title-size: 12px;
	--cs-bar-bg: #ffffff;
	--cs-container-max: 1200px;
	width: 100%;
	background: var(--cs-bar-bg);
	box-sizing: border-box;
	padding: 22px 0 26px;
	margin: 0 0 28px;
	font-family: var(--cs-font-family);
	direction: rtl;
	position: relative;
	z-index: 10;
	box-shadow: 0 2px 14px rgba(0, 0, 0, 0.05);
}

/* Decorative gold divider line that separates the bar from the content below it */
.cs-story-bar-wrapper::after {
	content: "";
	position: absolute;
	bottom: 0;
	right: 50%;
	transform: translateX(50%);
	width: min(92%, var(--cs-container-max));
	height: 1px;
	background: linear-gradient(
		90deg,
		transparent 0%,
		var(--cs-border-start) 20%,
		var(--cs-border-end) 50%,
		var(--cs-border-start) 80%,
		transparent 100%
	);
	opacity: 0.55;
}

.cs-story-bar-wrapper * {
	box-sizing: border-box;
}

.cs-story-bar {
	max-width: var(--cs-container-max);
	margin: 0 auto;
	display: flex;
	align-items: flex-start;
	gap: var(--cs-spacing);
	overflow-x: auto;
	overflow-y: hidden;
	padding: 4px 20px 10px;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
	scrollbar-color: var(--cs-border-start) transparent;
}

.cs-story-bar::-webkit-scrollbar {
	height: 4px;
}
.cs-story-bar::-webkit-scrollbar-thumb {
	background: var(--cs-border-start);
	border-radius: 4px;
}
.cs-story-bar::-webkit-scrollbar-track {
	background: transparent;
}

.cs-story-item {
	background: none;
	border: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	flex: 0 0 auto;
	width: calc(var(--cs-size) + 14px);
	cursor: pointer;
	appearance: none;
	-webkit-tap-highlight-color: transparent;
	transition: transform 0.25s ease;
}

.cs-story-item:hover {
	transform: translateY(-3px);
}

.cs-story-item:focus-visible {
	outline: 2px solid var(--cs-border-start);
	outline-offset: 4px;
	border-radius: 12px;
}

.cs-story-ring {
	width: var(--cs-size);
	height: var(--cs-size);
	border-radius: var(--cs-radius);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: var(--cs-border-thickness);
	position: relative;
	transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.35s ease;
}

.cs-story-ring.has-border {
	background: linear-gradient(135deg, var(--cs-border-start), var(--cs-border-end) 60%, var(--cs-border-start));
}

.cs-story-ring.no-border {
	background: transparent;
}

.cs-story-item.is-read .cs-story-ring.has-border {
	background: var(--cs-read-border);
	opacity: 0.7;
}

.cs-story-item:hover .cs-story-ring {
	transform: scale(1.06);
	box-shadow: 0 6px 18px rgba(212, 175, 55, 0.35);
}

.cs-story-item:active .cs-story-ring {
	transform: scale(0.97);
}

.cs-story-thumb-inner {
	width: 100%;
	height: 100%;
	border-radius: var(--cs-radius);
	overflow: hidden;
	background: #f2ecdd;
	border: 2px solid var(--cs-bar-bg);
	display: block;
}

.cs-story-thumb {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: opacity 0.4s ease, filter 0.4s ease;
	filter: blur(6px);
	opacity: 0.7;
}

.cs-story-thumb.is-loaded {
	filter: blur(0);
	opacity: 1;
}

.cs-story-title {
	font-size: var(--cs-title-size);
	line-height: 1.3;
	color: var(--cs-title-color);
	text-align: center;
	max-width: calc(var(--cs-size) + 20px);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-weight: 500;
}

.cs-story-item.is-read .cs-story-title {
	opacity: 0.55;
}

/* Skeleton entrance animation */
.cs-story-item {
	animation: cs-fade-in-up 0.5s ease both;
}
.cs-story-item:nth-child(1) { animation-delay: 0.02s; }
.cs-story-item:nth-child(2) { animation-delay: 0.06s; }
.cs-story-item:nth-child(3) { animation-delay: 0.1s; }
.cs-story-item:nth-child(4) { animation-delay: 0.14s; }
.cs-story-item:nth-child(5) { animation-delay: 0.18s; }
.cs-story-item:nth-child(n+6) { animation-delay: 0.2s; }

@keyframes cs-fade-in-up {
	from { opacity: 0; transform: translateY(10px); }
	to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 782px) {
	.cs-story-bar-wrapper { padding: 16px 0 20px; margin-bottom: 18px; }
	.cs-story-bar { gap: calc(var(--cs-spacing) * 0.75); padding: 4px 14px 10px; }
	.cs-story-item { width: calc(var(--cs-size) * 0.85 + 12px); }
	.cs-story-ring { width: calc(var(--cs-size) * 0.85); height: calc(var(--cs-size) * 0.85); }
}

@media (prefers-reduced-motion: reduce) {
	.cs-story-item, .cs-story-ring, .cs-story-thumb {
		animation: none !important;
		transition: none !important;
	}
}

[dir="ltr"] .cs-story-bar-wrapper {
	direction: ltr;
}
