/**
 * Kansan Category Showcase & News Menu - Frontend CSS
 * Hubahu Ang Bharat Newspaper & Portal Layout
 */

:root {
	--kcs-blue: #00a2db;
	--kcs-blue-dark: #0081b0;
	--kcs-dark: #111827;
	--kcs-text: #1f2937;
	--kcs-text-muted: #64748b;
	--kcs-border: #e2e8f0;
	--kcs-bg: #ffffff;
	--kcs-font: 'Mukta', 'Noto Sans Devanagari', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	--kcs-admin-bar-h: 0px;
	--kcs-nav-h: 44px;
}

body.admin-bar {
	--kcs-admin-bar-h: 32px;
}
@media (max-width: 782px) {
	body.admin-bar {
		--kcs-admin-bar-h: 46px;
	}
}

/* ==========================================================================
   0. HEADER & NAVIGATION STACKING (PREVENTS OVERLAP WITH MENU & DROPDOWNS)
   ========================================================================== */
.elementor-location-header {
	position: relative;
	z-index: 1000 !important;
}

/* Submenu dropdowns & fullscreen search MUST appear above everything */
.elementor-nav-menu--dropdown,
.elementor-element-f9705a3 .sub-menu,
.elementor-nav-menu--dropdown.elementor-nav-menu__container,
.elementor-nav-menu--dropdown-mobile {
	z-index: 99999 !important;
}

.elementor-search-form--skin-full_screen .elementor-search-form__container {
	z-index: 999999 !important;
}

/* ==========================================================================
   DESKTOP & TABLET VIEW (>= 768px): PLUGIN IS COMPLETELY DISABLED
   Original native Elementor homepage & navigation remains 100% untouched!
   ========================================================================== */
@media (min-width: 768px) {
	#kcsCategoryBarWrap,
	#kcsContentAreaWrapper {
		display: none !important;
	}
	.elementor-element-e0832a8 {
		display: block !important;
	}
}

/* ==========================================================================
   MOBILE VIEW (< 768px): PLUGIN ACTIVE
   Seamless Sticky Header & Category Showcase
   ========================================================================== */
@media (max-width: 767px) {
	#kcsCategoryBarWrap,
	#kcsContentAreaWrapper {
		display: block !important;
	}
	.elementor-element-e0832a8 {
		display: none !important;
	}

	/* Mobile Header Stays Pinned to top: 0 with crisp white background */
	.elementor-location-header {
		position: sticky !important;
		top: 0 !important;
		left: 0 !important;
		right: 0 !important;
		width: 100% !important;
		z-index: 1000 !important;
		background: #ffffff !important;
		box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06) !important;
	}

	body.admin-bar .elementor-location-header {
		top: 46px !important;
	}

	.elementor-3042 .elementor-element.elementor-element-3d3e30d {
		background: #ffffff !important;
	}

	/* Category Buttons Bar Sticks Right Below Header (60px) */
	.kcs-menu-wrapper {
		position: sticky !important;
		top: 60px !important;
		left: 0 !important;
		right: 0 !important;
		width: 100% !important;
		z-index: 990 !important;
		background: #ffffff !important;
		box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06) !important;
	}

	body.admin-bar .kcs-menu-wrapper {
		top: 106px !important;
	}
}

/* ==========================================================================
   1. CATEGORY MENU BAR (DIRECTLY UNDER HEADER - MOBILE ONLY)
   ========================================================================== */
.kcs-menu-wrapper {
	width: 100%;
	margin: 0 auto;
	box-sizing: border-box;
	background: #ffffff;
	font-family: var(--kcs-font);
	z-index: 990;
	transition: box-shadow 0.2s ease;
}

.kcs-menu-wrapper.kcs-is-stuck {
	box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.kcs-category-menu-bar {
	background: #ffffff;
	border-bottom: 2px solid #f1f5f9;
	padding: 6px 10px;
	position: relative;
	max-width: 1180px;
	margin: 0 auto;
	box-sizing: border-box;
}

.kcs-menu-scroll-container {
	position: relative;
	display: flex;
	align-items: center;
	padding: 0;
	width: 100%;
}

.kcs-category-tabs {
	display: flex;
	gap: 6px;
	overflow-x: auto;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	padding: 2px 1px;
	scrollbar-width: none; /* Firefox */
	width: 100%;
	cursor: grab;
	user-select: none;
}

.kcs-category-tabs.kcs-dragging {
	cursor: grabbing;
	scroll-behavior: auto;
}

.kcs-category-tabs::-webkit-scrollbar {
	display: none; /* Chrome, Safari, Edge */
}

/* Category Tab Button - Sleek & Compact Size */
button.kcs-category-tab,
.kcs-category-tab {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	background: #ffffff !important;
	color: #334155 !important;
	border: 1px solid #cbd5e1 !important;
	border-radius: 4px !important;
	padding: 4px 10px !important;
	font-size: 12px !important;
	font-weight: 600 !important;
	font-family: var(--kcs-font) !important;
	cursor: pointer !important;
	white-space: nowrap !important;
	flex-shrink: 0 !important;
	transition: all 0.2s ease !important;
	line-height: 1.35 !important;
	position: relative !important;
}

button.kcs-category-tab:hover,
.kcs-category-tab:hover {
	background: #f8fafc !important;
	color: var(--kcs-blue) !important;
	border-color: var(--kcs-blue) !important;
}

button.kcs-category-tab.active,
.kcs-category-tab.active {
	background: var(--kcs-blue) !important;
	color: #ffffff !important;
	border-color: var(--kcs-blue) !important;
	box-shadow: 0 2px 5px rgba(0, 162, 219, 0.2) !important;
}

.kcs-tab-label {
	display: inline-block;
}

/* Today's New Posts Badge - Compact */
.kcs-badge {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	background: #ef4444 !important;
	color: #ffffff !important;
	font-size: 10px !important;
	font-weight: 700 !important;
	min-width: 15px !important;
	height: 15px !important;
	padding: 0 3px !important;
	border-radius: 999px !important;
	margin-left: 4px !important;
	line-height: 1 !important;
	box-shadow: 0 1px 3px rgba(239, 68, 68, 0.4) !important;
	transition: opacity 0.25s, transform 0.25s !important;
}

button.kcs-category-tab.active .kcs-badge,
.kcs-category-tab.active .kcs-badge {
	background: #ffffff !important;
	color: var(--kcs-blue) !important;
}

button.kcs-category-tab.kcs-read .kcs-badge,
.kcs-category-tab.kcs-read .kcs-badge {
	display: none !important;
}

/* Load More Button (और खबरें लोड करें) - Sleek */
.kcs-load-more-wrap {
	text-align: center;
	margin: 24px 0 15px 0;
	width: 100%;
}

button.kcs-load-more-btn,
.kcs-load-more-btn {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	gap: 6px !important;
	background: #00a2db !important;
	color: #ffffff !important;
	border: none !important;
	border-radius: 5px !important;
	padding: 8px 24px !important;
	font-size: 13.5px !important;
	font-weight: 700 !important;
	font-family: var(--kcs-font) !important;
	cursor: pointer !important;
	box-shadow: 0 2px 6px rgba(0, 162, 219, 0.2) !important;
	transition: all 0.2s ease !important;
}

.kcs-load-more-btn:hover {
	background: #0081b0;
	box-shadow: 0 4px 12px rgba(0, 129, 176, 0.35);
	transform: translateY(-1px);
}

.kcs-load-more-btn:disabled {
	background: #94a3b8;
	cursor: not-allowed;
	box-shadow: none;
	transform: none;
}

.kcs-btn-spinner {
	display: none;
	width: 15px;
	height: 15px;
	border: 2px solid rgba(255, 255, 255, 0.4);
	border-top-color: #ffffff;
	border-radius: 50%;
	animation: kcsSpin 0.7s linear infinite;
}

.kcs-load-more-btn.loading .kcs-btn-spinner {
	display: inline-block;
}

.kcs-item-loaded {
	animation: kcsFadeUp 0.35s ease forwards;
}

@keyframes kcsFadeUp {
	from {
		opacity: 0;
		transform: translateY(10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* ==========================================================================
   2. DYNAMIC CATEGORY NEWS (LIST VIEW - UNDER E-PAPER SECTION)
   ========================================================================== */
.kcs-content-area-wrapper {
	width: 100%;
	max-width: 1180px;
	margin: 20px auto 40px auto;
	padding: 0 16px;
	box-sizing: border-box;
	font-family: var(--kcs-font);
}

.kcs-content-area {
	position: relative;
	background: #ffffff;
	min-height: 280px;
}

/* Loading Overlay */
.kcs-loading-overlay {
	display: none;
	position: absolute;
	inset: 0;
	background: rgba(255, 255, 255, 0.75);
	z-index: 50;
	align-items: center;
	justify-content: center;
}

.kcs-loading-overlay.active {
	display: flex;
}

.kcs-spinner {
	width: 36px;
	height: 36px;
	border: 3.5px solid #e2e8f0;
	border-top-color: var(--kcs-blue);
	border-radius: 50%;
	animation: kcsSpin 0.7s linear infinite;
}

@keyframes kcsSpin {
	to { transform: rotate(360deg); }
}

.kcs-content-inner {
	transition: opacity 0.15s ease;
}

/* Section Header ("ताज़ा खबर" with thick solid black accent line) */
.kcs-section-header {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 16px;
}

.kcs-section-title {
	margin: 0;
	font-size: 24px;
	font-weight: 800;
	color: #0f172a;
	white-space: nowrap;
	line-height: 1.2;
	font-family: var(--kcs-font);
}

.kcs-section-line {
	height: 3.5px;
	background: #0f172a;
	flex-grow: 1;
	border-radius: 2px;
}

/* Two-column layout on Desktop */
.kcs-posts-layout {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

@media (min-width: 768px) {
	.kcs-posts-layout {
		display: grid;
		grid-template-columns: 54% 43%;
		gap: 3%;
		align-items: start;
	}
}

/* FEATURED STORY (BIG IMAGE + TITLE) */
.kcs-featured-story {
	margin-bottom: 0;
}

.kcs-featured-image-wrap {
	width: 100%;
	border-radius: 6px;
	overflow: hidden;
	background: #000000;
	aspect-ratio: 16 / 9;
	margin-bottom: 12px;
}

.kcs-featured-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.3s ease;
}

.kcs-featured-story:hover .kcs-featured-img {
	transform: scale(1.02);
}

.kcs-featured-info {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.kcs-featured-title {
	margin: 0;
	font-size: 21px;
	font-weight: 800;
	line-height: 1.35;
	color: #0f172a;
	font-family: var(--kcs-font);
}

.kcs-featured-title a {
	color: inherit;
	text-decoration: none;
	transition: color 0.15s;
}

.kcs-featured-title a:hover {
	color: var(--kcs-blue);
}

.kcs-featured-date {
	font-size: 12px;
	color: #64748b;
	font-weight: 500;
}

/* HEADLINES LIST VIEW (WITH THUMBNAIL ON LEFT + TITLE ON RIGHT) */
.kcs-headlines-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
}

.kcs-headline-item {
	padding: 12px 0;
	border-bottom: 1px solid #e2e8f0;
}

.kcs-headline-item:first-child {
	padding-top: 0;
}

.kcs-headline-item:last-child {
	border-bottom: none;
}

.kcs-headline-link {
	display: flex;
	align-items: center;
	gap: 14px;
	text-decoration: none;
	color: inherit;
	transition: opacity 0.2s;
}

.kcs-headline-link:hover {
	opacity: 0.9;
}

.kcs-headline-thumb-wrap {
	width: 100px;
	height: 70px;
	flex-shrink: 0;
	border-radius: 4px;
	overflow: hidden;
	background: #f1f5f9;
}

.kcs-headline-thumb {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.25s ease;
}

.kcs-headline-link:hover .kcs-headline-thumb {
	transform: scale(1.04);
}

.kcs-headline-text-wrap {
	flex-grow: 1;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.kcs-headline-title {
	margin: 0;
	font-size: 16px;
	font-weight: 600;
	line-height: 22px;
	color: #1f1f1f;
	font-family: var(--kcs-font);
	transition: color 0.15s;
}

.kcs-headline-title a {
	color: #1f1f1f;
	text-decoration: none;
}

.kcs-headline-link:hover .kcs-headline-title {
	color: var(--kcs-blue);
}

.kcs-headline-date {
	font-size: 12px;
	color: #64748b;
	font-weight: 500;
}

@media (max-width: 767px) {
	.kcs-headline-thumb-wrap {
		width: 110px;
		height: 75px;
	}
	.kcs-headline-title {
		font-size: 16px;
		font-weight: 600;
		line-height: 22px;
		color: #1f1f1f;
	}
}

.kcs-no-posts {
	padding: 40px 20px;
	text-align: center;
	color: #64748b;
	font-size: 15px;
}


/* Category View (25 Posts 2-column grid on Desktop) */
.kcs-category-view-container {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.kcs-cat-lead {
	margin-bottom: 10px;
}

@media (min-width: 768px) {
	.kcs-cat-list-grid {
		display: grid !important;
		grid-template-columns: 1fr 1fr;
		gap: 12px 28px;
	}
	.kcs-cat-list-grid .kcs-headline-item {
		padding: 10px 0;
		border-bottom: 1px solid #e2e8f0;
	}
}
