/* =========================================================
   NSE share-price strip — a slim brand-red bar just under the main menu.
   The NSE's own widget (#msl-ir-ticker, filled by ir.nse.co.ke)
   is laid out as one line: badge · price · change · stats · time.
   ========================================================= */
.kpc-nse-strip {
	--kpc-nse-h: 38px;
	position: relative;
	z-index: 1;
	height: var(--kpc-nse-h);
	background: var(--primary-color, #D92838);
	border-top: 1px solid rgba(255, 255, 255, .14);
	box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .12);
	color: #fff;
	font-size: 13px;
	line-height: 1;
	overflow: hidden;
}
.kpc-nse-strip > .container { display: flex; align-items: center; gap: 16px; height: 100%; }
.kpc-nse-badge { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px; font-weight: 700; letter-spacing: .06em; font-size: 11px; text-transform: uppercase; color: rgba(255, 255, 255, .85); }
.kpc-nse-badge b { padding: 3px 6px; border-radius: 3px; background: #fff; color: var(--primary-color, #D92838); letter-spacing: .04em; }
.kpc-nse-live { width: 7px; height: 7px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 0 rgba(255, 255, 255, .6); animation: kpc-nse-pulse 2s infinite; }
@keyframes kpc-nse-pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, .6); } 70% { box-shadow: 0 0 0 7px rgba(255, 255, 255, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); } }
.kpc-nse-more { flex: 0 0 auto; margin-left: auto; display: inline-flex; align-items: center; gap: 6px; color: #fff; font-weight: 600; font-size: 12.5px; text-decoration: none; opacity: .85; white-space: nowrap; }
.kpc-nse-more:hover { opacity: 1; color: #fff; }

/* The NSE widget, flattened into one line. */
html body .kpc-nse-strip #msl-ir-ticker { flex: 1 1 auto; min-width: 0; height: 100%; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; max-width: none; }
html body .kpc-nse-strip #msl-ir-ticker::-webkit-scrollbar { display: none; }
html body .kpc-nse-strip #msl-ir-ticker > div { display: flex !important; align-items: center; gap: 22px; height: 100%; white-space: nowrap; margin: 0 !important; padding: 0 !important; width: auto !important; }
html body .kpc-nse-strip #msl-ir-ticker-security { display: inline-flex !important; order: 99; margin: 0 !important; padding: 0 !important; float: none !important; width: auto !important; }
html body .kpc-nse-strip #msl-ir-ticker-security > div:first-child { display: none !important; } /* Company name — already in the badge. */
html body .kpc-nse-strip #msl-ir-ticker-time { font-size: 11.5px !important; color: rgba(255, 255, 255, .85) !important; margin: 0 !important; }
html body .kpc-nse-strip #msl-ir-ticker .msl-ir-tiker-info { display: inline-flex !important; flex-direction: row-reverse; align-items: baseline; gap: 6px; margin: 0 !important; padding: 0 !important; width: auto !important; text-align: left !important; float: none !important; border: 0 !important; }
html body .kpc-nse-strip #msl-ir-ticker .msl-ir-ticker-label { opacity: 1; font-size: 11px !important; color: rgba(255, 255, 255, .78) !important; text-transform: uppercase; letter-spacing: .05em; margin: 0 !important; }
html body .kpc-nse-strip #msl-ir-ticker .msl-ir-ticker-value { font-size: 13px !important; font-weight: 600; color: #fff !important; margin: 0 !important; font-variant-numeric: tabular-nums; }
html body .kpc-nse-strip #msl-ir-ticker-price-container .msl-ir-ticker-label { display: none; }
html body .kpc-nse-strip #msl-ir-ticker-price-container .msl-ir-ticker-value { display: inline-flex; align-items: baseline; gap: 8px; }
html body .kpc-nse-strip #msl-ir-ticker-price { font-size: 15px !important; font-weight: 800; color: #fff !important; }
html body .kpc-nse-strip #msl-ir-ticker-price::before { content: "KES "; font-size: 11px; font-weight: 600; color: rgba(255, 255, 255, .78); }
/* Green/red change colours don't read on red: white, in a soft pill. */
html body .kpc-nse-strip #msl-ir-ticker-change { font-size: 12px !important; font-weight: 700; color: #fff !important; }
html body .kpc-nse-strip #msl-ir-ticker-change:not(:empty) { padding: 3px 7px; border-radius: 10px; background: rgba(0, 0, 0, .18); }
html body .kpc-nse-strip #msl-ir-ticker-change * { color: inherit !important; fill: currentColor !important; }
html body .kpc-nse-strip #msl-ir-ticker-chart { filter: brightness(0) invert(1); opacity: .85; }
html body .kpc-nse-strip #msl-ir-ticker-chart-container { display: inline-flex !important; align-items: center; height: 24px; margin: 0 !important; float: none !important; }
html body .kpc-nse-strip #msl-ir-ticker-chart { height: 22px !important; width: auto !important; }
html body .kpc-nse-strip #msl-ir-ticker-meta, html body .kpc-nse-strip #msl-ir-load { display: none !important; }

/* White (scrolled) header: the red strip sits under it. */
body.nav-scrolled .kpc-nse-strip { border-top-color: transparent; }

/* Room for the strip at the top of banners that sit under the header. */
body.has-nse-strip .ks-hero-inner { padding-top: calc(150px + 38px); }
body.has-nse-strip .kpc-page-hero { padding-top: calc(140px + 38px); }

/* The ticker block lower on the homepage (Elementor HTML block + "View More"
   button) would now be empty — hide it, and its row when that's all it holds. */
body.has-nse-strip main .elementor-widget-html:has(#msl-ir-ticker) { display: none; }
body.has-nse-strip main .e-con:has(> .elementor-widget-html #msl-ir-ticker):not(:has(> :nth-child(3))) { display: none; }

@media (max-width: 991px) {
	.kpc-nse-strip { --kpc-nse-h: 34px; font-size: 12px; }
	.kpc-nse-strip > .container { gap: 12px; }
	.kpc-nse-more span { display: none; }
	html body .kpc-nse-strip #msl-ir-ticker-chart-container { display: none !important; }
	body.has-nse-strip .ks-hero-inner { padding-top: calc(120px + 34px); }
	body.has-nse-strip .kpc-page-hero { padding-top: calc(120px + 34px); }
}

/* Phones: the quote slides across the strip (tap and hold to pause). */
@media (max-width: 767px) {
	html body .kpc-nse-strip #msl-ir-ticker { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 14px), transparent); mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 14px), transparent); }
	html body .kpc-nse-strip #msl-ir-ticker > div { width: max-content !important; padding-left: 100% !important; animation: kpc-nse-slide 22s linear infinite; will-change: transform; }
	html body .kpc-nse-strip #msl-ir-ticker:active > div, html body .kpc-nse-strip #msl-ir-ticker:hover > div { animation-play-state: paused; }
	.kpc-nse-badge > span:not(.kpc-nse-live) { display: none; }
	/* Smaller type so the quote sits comfortably in the slim strip. */
	.kpc-nse-strip { --kpc-nse-h: 30px; font-size: 11px; }
	.kpc-nse-strip > .container { gap: 10px; }
	.kpc-nse-badge { font-size: 9.5px; gap: 6px; }
	.kpc-nse-badge b { padding: 2px 5px; }
	.kpc-nse-live { width: 6px; height: 6px; }
	.kpc-nse-more { font-size: 11px; }
	html body .kpc-nse-strip #msl-ir-ticker > div { gap: 14px; }
	html body .kpc-nse-strip #msl-ir-ticker .msl-ir-tiker-info { gap: 4px; }
	html body .kpc-nse-strip #msl-ir-ticker-price { font-size: 12.5px !important; }
	html body .kpc-nse-strip #msl-ir-ticker-price::before { font-size: 9.5px; }
	html body .kpc-nse-strip #msl-ir-ticker-change { font-size: 10.5px !important; }
	html body .kpc-nse-strip #msl-ir-ticker-change:not(:empty) { padding: 2px 6px; }
	html body .kpc-nse-strip #msl-ir-ticker .msl-ir-ticker-value { font-size: 11.5px !important; }
	html body .kpc-nse-strip #msl-ir-ticker .msl-ir-ticker-label { font-size: 9.5px !important; letter-spacing: .04em; }
	html body .kpc-nse-strip #msl-ir-ticker-time { font-size: 10.5px !important; }
	body.has-nse-strip .ks-hero-inner { padding-top: calc(120px + 30px); }
	body.has-nse-strip .kpc-page-hero { padding-top: calc(120px + 30px); }
}
@keyframes kpc-nse-slide { from { transform: translateX(0); } to { transform: translateX(-100%); } }

@media (prefers-reduced-motion: reduce) {
	.kpc-nse-live, html body .kpc-nse-strip #msl-ir-ticker > div { animation: none !important; }
	html body .kpc-nse-strip #msl-ir-ticker { overflow-x: auto; }
	html body .kpc-nse-strip #msl-ir-ticker > div { padding-left: 0 !important; }
}
