/* KSB Blog Index — category rail + infinite scroll (/blog/) */

/* Let the hero band grow so the rail is not clipped (page-scoped) */
body.ksb-blog-index .wp-block-cover.inner-cover-img {
	height: auto !important;
	min-height: 100px;
}

body.ksb-blog-index .wp-block-cover.inner-cover-img .wp-block-cover__inner-container {
	padding-bottom: 4px;
}

/* Rail: newsroom index inside the dark hero band, under the centered H1 */
.ksbx-rail {
	position: relative;
	inset: auto;
	z-index: 1;
	display: block;
	background: none;
	border: 0;
	padding: 0;
	width: 100%;
	margin: 6px auto 0;
	max-width: 1120px;
}

.ksbx-rail-inner {
	display: flex;
	width: 100%;
	box-sizing: border-box;
	justify-content: center;
	align-items: flex-end;
	flex-wrap: wrap;
	gap: 0 30px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.ksbx-rail .ksbx-cat {
	position: relative;
	display: inline-block;
	padding: 10px 0 13px;
	font-family: 'Inter', Helvetica, Arial, sans-serif;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.2;
	letter-spacing: 0.005em;
	color: rgba(255, 255, 255, 0.62);
	text-decoration: none;
	white-space: nowrap;
	transition: color 0.15s ease;
}

.ksbx-rail .ksbx-cat:hover,
.ksbx-rail .ksbx-cat:focus {
	color: #ffffff;
	text-decoration: none;
}

.ksbx-rail .ksbx-cat[aria-current='page'] {
	color: #ffffff;
	font-weight: 600;
}

.ksbx-rail .ksbx-cat[aria-current='page']::after {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	bottom: -1px;
	height: 2px;
	background: #335fff;
}

.ksbx-rail .ksbx-cat:focus-visible {
	outline: 2px solid #7b9fff;
	outline-offset: 5px;
	border-radius: 1px;
}

.ksbx-count {
	margin-left: 7px;
	font-size: 11.5px;
	font-weight: 500;
	line-height: 1;
	font-variant-numeric: tabular-nums;
	color: rgba(255, 255, 255, 0.55);
}

.ksbx-rail .ksbx-cat[aria-current='page'] .ksbx-count {
	color: #7b9fff;
}

body.ksb-blog-index .wp-block-uagb-post-grid {
	margin-top: -22px;
}

/* Grid states */
html.ksbx-on .uagb-post-pagination-wrap {
	display: none;
}

html.ksbx-on .uagb-post-grid.ksbx-loading {
	opacity: 0.35;
	transition: opacity 0.18s ease;
	pointer-events: none;
}

.ksbx-sentinel {
	padding: 26px 0 10px;
	text-align: center;
	font-family: 'Inter', Helvetica, Arial, sans-serif;
	font-size: 13px;
	font-weight: 500;
	letter-spacing: 0.01em;
	color: #8a8f98;
	min-height: 1px;
}

.ksbx-sentinel .ksbx-dot {
	display: inline-block;
	width: 5px;
	height: 5px;
	margin: 0 5px;
	border-radius: 50%;
	background: #335fff;
	opacity: 0.35;
	animation: ksbx-pulse 1s infinite ease-in-out;
}

.ksbx-sentinel .ksbx-dot:nth-child(2) { animation-delay: 0.15s; }
.ksbx-sentinel .ksbx-dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes ksbx-pulse {
	0%, 100% { opacity: 0.2; transform: translateY(0); }
	50% { opacity: 1; transform: translateY(-2px); }
}

/* Mobile: scrollable rail, no scrollbar, edge fade */
@media (max-width: 820px) {
	.ksbx-rail { max-width: none; }

	.ksbx-rail-inner {
		justify-content: flex-start;
		flex-wrap: nowrap;
		gap: 0 22px;
		overflow-x: auto;
		overflow-y: hidden;
		padding: 0 26px;
		scrollbar-width: none;
		-webkit-overflow-scrolling: touch;
		scroll-snap-type: x proximity;
		scroll-padding-left: 26px;
		-webkit-mask-image: linear-gradient(to right, transparent 0, #000 20px, #000 calc(100% - 52px), transparent 100%);
		mask-image: linear-gradient(to right, transparent 0, #000 20px, #000 calc(100% - 52px), transparent 100%);
	}

	.ksbx-rail .ksbx-cat { scroll-snap-align: start; }

	.ksbx-rail-inner::-webkit-scrollbar { display: none; }

	.ksbx-rail .ksbx-cat { font-size: 13.5px; }
}

@media (prefers-reduced-motion: reduce) {
	.ksbx-sentinel .ksbx-dot { animation: none; }
	.ksbx-rail .ksbx-cat { transition: none; }
}
