/* ST-06: лента обложек. Viewer — ST-07. Premier не копировать. */
.lkf-stories {
	--lkf-stories-gap: var(--theme-items-gap, 16px);
	--lkf-stories-accent: var(--theme-base-color, #f19d00);
	--lkf-stories-seen: rgba(0, 0, 0, 0.22);
	--lkf-stories-radius: var(--theme-outer-border-radius, 12px);
	--lkf-stories-rect-w: 168px; /* desktop +50% */
	--lkf-stories-rect-h: 222px;
	--lkf-stories-round: 80px;
	position: relative;
	margin: 0 0 24px;
}

.lkf-stories-index .lkf-stories {
	margin-bottom: 0;
}

.lkf-stories-index .lkf-stories__viewport {
	padding-top: 0;
	padding-bottom: 0;
}

.lkf-stories__viewport {
	overflow-x: auto;
	overflow-y: hidden;
	-webkit-overflow-scrolling: touch;
	padding: 4px 2px 8px;
	margin: 0 -2px;
	scrollbar-width: thin;
}

.lkf-stories__list {
	display: flex;
	align-items: flex-start;
	gap: var(--lkf-stories-gap);
	width: max-content;
	margin: 0;
	padding: 0;
}

.lkf-stories__viewport.swiper-initialized .lkf-stories__list {
	gap: 0;
}

.lkf-stories__slide.swiper-slide {
	box-sizing: border-box;
	flex: 0 0 auto;
	height: auto;
	margin: 0;
}

.lkf-stories--rect .lkf-stories__slide.swiper-slide {
	width: var(--lkf-stories-rect-w);
}

.lkf-stories--round .lkf-stories__slide.swiper-slide {
	width: calc(var(--lkf-stories-round) + 6px);
}

.lkf-stories__item {
	display: block;
	width: var(--lkf-stories-rect-w);
	padding: 0;
	border: 0;
	background: transparent;
	color: inherit;
	font: inherit;
	text-align: center;
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
}

.lkf-stories__item:focus {
	outline: none;
}

.lkf-stories__item:focus,
.lkf-stories__item:focus-visible,
.lkf-stories__item:focus-visible .lkf-stories__ring {
	outline: none;
	box-shadow: none;
}

.lkf-stories__media {
	position: relative;
	display: block;
}

/* preview progress: one white bar per frame */
.lkf-stories__segs {
	position: absolute;
	top: 8px;
	left: 8px;
	right: 8px;
	z-index: 3;
	display: flex;
	gap: 3px;
	pointer-events: none;
}
.lkf-stories__seg {
	flex: 1 1 0;
	height: 2px;
	border-radius: 1px;
	background: rgba(255, 255, 255, 0.92);
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}
.lkf-stories--round .lkf-stories__segs {
	left: 14px;
	right: 14px;
	top: 10px;
}

.lkf-stories__ring {
	display: block;
	padding: 0;
	border-radius: var(--lkf-stories-radius);
	background: transparent; /* no orange outline */
}

.lkf-stories__item--seen .lkf-stories__ring {
	background: transparent;
}

.lkf-stories__cover {
	display: block;
	overflow: hidden;
	width: var(--lkf-stories-rect-w);
	height: var(--lkf-stories-rect-h);
	border-radius: var(--lkf-stories-radius);
	background: #f3f3f3;
}

.lkf-stories__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
}

.lkf-stories__name {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	overflow: hidden;
	width: 100%;
	margin-top: 8px;
	color: inherit;
	word-break: normal;
	overflow-wrap: break-word;
}

.lkf-stories--round .lkf-stories__item {
	width: calc(var(--lkf-stories-round) + 6px);
}

.lkf-stories--round .lkf-stories__ring {
	border-radius: 50%;
}

.lkf-stories--round .lkf-stories__cover {
	width: var(--lkf-stories-round);
	height: var(--lkf-stories-round);
	border-radius: 50%;
}

@media (max-width: 600px) {
	.lkf-stories {
		--lkf-stories-rect-w: 96px;
		--lkf-stories-rect-h: 128px;
		--lkf-stories-round: 72px;
		--lkf-stories-gap: 12px;
	}
}

/* ST-07 viewer. Premier не копировать. */
.lkf-stories-viewer[hidden] {
	display: none !important;
}

.lkf-stories-viewer {
	position: fixed;
	inset: 0;
	z-index: 11000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	overscroll-behavior: contain;
}

.lkf-stories-viewer__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.78);
}

.lkf-stories-viewer__dialog {
	position: relative;
	z-index: 1;
	width: min(420px, calc(100vw - 24px));
	aspect-ratio: 9 / 16;
	max-height: min(88vh, calc((100vw - 24px) * 16 / 9));
	overflow: hidden;
	border-radius: var(--lkf-stories-radius);
	background: #111;
	box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
	outline: none;
	touch-action: none;
}

.lkf-stories-viewer__dialog:focus-visible {
	box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--lkf-stories-accent, #f19d00), 0 16px 48px rgba(0, 0, 0, 0.35);
}

.lkf-stories-viewer__progress {
	position: absolute;
	top: 0;
	right: 10px;
	left: 10px;
	z-index: 4;
	display: flex;
	gap: 4px;
	padding-top: 10px;
}

.lkf-stories-viewer__seg {
	flex: 1 1 0;
	height: 3px;
	overflow: hidden;
	border-radius: 2px;
	background: rgba(255, 255, 255, 0.45);
}

.lkf-stories-viewer__seg-bar {
	display: block;
	width: 100%;
	height: 100%;
	background: #fff;
	transform: scaleX(0);
	transform-origin: left center;
}

.lkf-stories-viewer__seg.is-done .lkf-stories-viewer__seg-bar {
	transform: scaleX(1);
}

.lkf-stories-viewer__close {
	position: absolute;
	top: 18px;
	right: 8px;
	z-index: 5;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	background: transparent;
	color: #fff;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
}

.lkf-stories-viewer__close:focus {
	outline: none;
}

.lkf-stories-viewer__close:focus-visible {
	box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--lkf-stories-accent, #f19d00);
	border-radius: 50%;
}

.lkf-stories-viewer__stage {
	position: absolute;
	inset: 0;
}

.lkf-stories-viewer__stage::before {
	content: "";
	position: absolute;
	top: 0;
	right: 0;
	left: 0;
	z-index: 2;
	height: 88px;
	background: linear-gradient(180deg, rgba(0, 0, 0, 0.45) 0%, transparent 100%);
	pointer-events: none;
}

.lkf-stories-viewer__media {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	background: #1a1a1a;
}

.lkf-stories-viewer__media[hidden],
.lkf-stories-viewer__media--video[hidden],
.lkf-stories-viewer__sound[hidden] {
	display: none !important;
}

.lkf-stories-viewer__sound {
	position: absolute;
	top: 18px;
	left: 8px;
	z-index: 6;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.35);
	color: #fff;
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
}

.lkf-stories-viewer__sound.is-on {
	background: var(--lkf-stories-accent, #f19d00);
	color: #111;
}

.lkf-stories-viewer__sound:focus {
	outline: none;
}

.lkf-stories-viewer__sound:focus-visible {
	box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--lkf-stories-accent, #f19d00);
}

.lkf-stories-viewer__dim {
	position: absolute;
	inset: 0;
	pointer-events: none;
}

.lkf-stories-viewer__dim.is-light {
	background: rgba(0, 0, 0, 0.22);
}

.lkf-stories-viewer__dim.is-medium {
	background: rgba(0, 0, 0, 0.4);
}

.lkf-stories-viewer__dim.is-dark {
	background: rgba(0, 0, 0, 0.58);
}

.lkf-stories-viewer__caption {
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 4;
	padding: 48px 16px 20px;
	color: #fff;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85), 0 2px 12px rgba(0, 0, 0, 0.55);
	background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.72) 78%);
	pointer-events: none;
}

.lkf-stories-viewer__kicker {
	margin-bottom: 6px;
	font-size: 14px;
	line-height: 1.3;
	opacity: 1;
}

.lkf-stories-viewer__title {
	font-size: 20px;
	line-height: 1.3;
	font-weight: 600;
}

.lkf-stories-viewer__text {
	margin-top: 8px;
	font-size: 16px;
	line-height: 1.45;
}

.lkf-stories-viewer__cta {
	display: inline-flex;
	margin-top: 14px;
	pointer-events: auto;
}

.lkf-stories-viewer__cta[hidden] {
	display: none !important;
}

.lkf-stories-viewer__hit {
	position: absolute;
	top: 48px;
	bottom: 0;
	z-index: 3;
	width: 34%;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
	touch-action: none;
}

.lkf-stories-viewer__hit--prev {
	left: 0;
}

.lkf-stories-viewer__hit--next {
	right: 0;
	width: 66%;
}

html.lkf-stories-viewer-open,
body.lkf-stories-viewer-open {
	overflow: hidden;
}

body.lkf-stories-viewer-open {
	position: fixed;
	width: 100%;
	left: 0;
	right: 0;
}

@media (prefers-reduced-motion: reduce) {
	.lkf-stories-viewer__seg-bar {
		transition: none;
	}
}
