/* ==========================================================================
   DengeCudi — listing pages
   Tags index, categories index, a single tag / category, explore (type), search.
   Loaded by king-theme.php after king-feed.css on those templates only.
   ========================================================================== */

:root {
	--kl-text: #0d0c22;
	--kl-body: #3f4350;
	--kl-muted: #6b6f7b;
	--kl-line: #e7e8ec;
	--kl-soft: #f2f3f6;
	--kl-surface: #fff;
	--kl-hover: #eceef2;
	--kl-accent: #0d0c22;
	--kl-accent-ink: #fff;
}
html.king-night {
	--kl-text: #f5f5f7;
	--kl-body: #c9cbd3;
	--kl-muted: #9a9ea9;
	--kl-line: #2c2c37;
	--kl-soft: #24242e;
	--kl-surface: #1b1b23;
	--kl-hover: #2e2e3a;
	--kl-accent: #f5f5f7;
	--kl-accent-ink: #0d0c22;
}

/* ---------- Page header (all listing pages) ---------- */
/* The theme wraps tag/category headers in .head-title, which has its own banner styling. */
body .head-title {
	margin: 0;
	padding: 0;
	background: transparent !important;
	border: 0;
	box-shadow: none;
	color: inherit;
	text-align: left;
	font-size: inherit;
	min-height: 0;
	display: block;
}
body .head-title > .kn-list-hero { width: 100%; }

body .kn-list-hero {
	position: relative;
	box-sizing: border-box;
	margin: 0;
	padding: 36px 2% 12px;
	background: transparent;
	border: 0;
	color: var(--kl-text);
	text-align: left;
	--kn-accent: var(--kl-accent);
}
body .kn-list-hero-in {
	display: flex;
	align-items: flex-start;
	gap: 18px;
	max-width: none;
	margin: 0;
	padding: 0;
}
body .kn-list-hero-icon {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 60px;
	height: 60px;
	margin: 2px 0 0;
	border-radius: 16px;
	background: color-mix(in srgb, var(--kn-accent) 12%, var(--kl-surface));
	border: 1px solid color-mix(in srgb, var(--kn-accent) 22%, var(--kl-line));
	color: var(--kn-accent);
	font-size: 26px;
	line-height: 1;
}
body .kn-list-hero-icon i { font-size: 26px; }
body .kn-list-hero--tag .kn-list-hero-icon {
	background: var(--kl-accent);
	border-color: var(--kl-accent);
	color: var(--kl-accent-ink);
	font-size: 30px;
	font-weight: 800;
}
body .kn-list-hero-text {
	flex: 1 1 auto;
	min-width: 0;
}
body .kn-list-hero-kicker {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0;
	margin: 0 0 6px;
	font-size: 12.5px;
	font-weight: 650;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--kl-muted);
}
body .kn-list-hero-kicker a {
	color: var(--kl-muted);
	text-decoration: none;
}
body .kn-list-hero-kicker a:hover { color: var(--kl-text); }
body .kn-list-hero-dot {
	width: 3px;
	height: 3px;
	margin: 0 9px;
	border-radius: 50%;
	background: currentColor;
	opacity: .6;
}
body .kn-list-hero-title,
body .kn-list-hero h1.king-category-hero-title {
	margin: 0;
	padding: 0;
	font-size: clamp(28px, 1.1rem + 1.6vw, 42px);
	line-height: 1.1;
	font-weight: 800;
	letter-spacing: -.025em;
	color: var(--kl-text);
	text-wrap: balance;
	overflow-wrap: anywhere;
}
body .kn-list-hero-desc {
	max-width: 68ch;
	margin: 10px 0 0;
	font-size: 15.5px;
	line-height: 1.6;
	color: var(--kl-muted);
}
body .kn-list-hero-desc a { color: var(--kl-text); }

/* Sub-category chips */
body .kn-list-hero-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 14px 0 0;
}
body .kn-list-hero-chip {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	height: 32px;
	padding: 0 13px;
	border: 1px solid var(--kl-line);
	border-radius: 999px;
	background: var(--kl-surface);
	color: var(--kl-text);
	font-size: 13.5px;
	font-weight: 600;
	text-decoration: none;
	transition: background-color .15s ease, border-color .15s ease;
}
body .kn-list-hero-chip:hover { background: var(--kl-hover); border-color: var(--kl-hover); color: var(--kl-text); }
body .kn-list-hero-chip span { color: var(--kl-muted); font-weight: 600; font-size: 12.5px; }
body .kn-list-hero-chip i { font-size: 11px; color: var(--kl-muted); }

/* Follow button area */
body .kn-list-hero-actions {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 26px 0 0;
}
body .kn-list-hero-actions:empty { display: none; }
body .kn-list-hero-actions a,
body .kn-list-hero-actions button,
body .kn-list-hero-actions .king-follow,
body .kn-list-hero-actions [class*="follow"] {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 40px;
	margin: 0;
	padding: 0 18px;
	border: 1px solid var(--kl-accent);
	border-radius: 999px;
	background: var(--kl-accent);
	color: var(--kl-accent-ink);
	font-size: 14px;
	font-weight: 650;
	line-height: 1;
	box-shadow: none;
	text-decoration: none;
	cursor: pointer;
	position: static;
	transform: none;
}
body .kn-list-hero-actions [class*="follow"] [class*="follow"] {
	/* nested follow elements: only style the outer one */
	height: auto;
	padding: 0;
	border: 0;
	background: transparent;
	color: inherit;
}

/* ---------- Sort / grid toolbar on listing pages ---------- */
/* Range-only toolbar (tag + category pages): a small grid control at the right, no empty bar */
body .king-nav-bar.king-feed-toolbar.king-feed-toolbar--range-only {
	justify-content: flex-end;
	margin: 0 0 12px;
	padding: 0;
	background: transparent;
	border: 0;
	box-shadow: none;
}
body .king-feed-toolbar--range-only .king-range {
	width: auto;
	max-width: none;
	height: 34px;
	padding: 0 12px !important;
	border: 1px solid var(--kl-line) !important;
	border-radius: 999px !important;
	background: var(--kl-surface) !important;
}
/* Explore: format tabs and the grid control on one row */
body .king-nav-bar.king-explore-toolbar {
	flex-wrap: nowrap;
}
body .king-explore-toolbar .king-explore-filters {
	display: flex;
	flex: 1 1 auto;
	min-width: 0;
	margin: 0;
	padding: 0;
	background: transparent;
	border: 0;
}
body .king-explore-toolbar .king-nav-sub-link i {
	margin-right: 8px;
	font-size: 13px;
	opacity: .85;
}
body .king-explore-toolbar .king-range { margin-left: auto; width: auto; max-width: none; }
body .king-feed-toolbar .king-range .king-grid-slider { flex: 0 0 96px; width: 96px; }

/* ---------- Tags index ---------- */
body.king-template-tags .king-main.one-page { max-width: none; }
body.king-template-tags .king-main.one-page .king-inner {
	margin: 0;
	padding: 0;
	background: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
}
body .king-tags-page-wrap {
	max-width: none;
	margin: 0;
	padding: 0;
}
body .kn-tags-tools {
	display: flex;
	align-items: center;
	gap: 14px;
	margin: 0 0 16px;
}
body .kn-tags-filter {
	position: relative;
	display: flex;
	align-items: center;
	flex: 0 1 380px;
	margin: 0;
}
body .kn-tags-filter i {
	position: absolute;
	left: 15px;
	font-size: 14px;
	color: var(--kl-muted);
	pointer-events: none;
}
body .kn-tags-filter input {
	width: 100%;
	height: 44px;
	margin: 0;
	padding: 0 16px 0 40px;
	border: 1px solid var(--kl-line);
	border-radius: 999px;
	background: var(--kl-surface);
	box-shadow: none;
	color: var(--kl-text);
	-webkit-text-fill-color: var(--kl-text);
	font-size: 15px;
	outline: none;
	transition: border-color .15s ease, box-shadow .15s ease;
}
body .kn-tags-filter input::placeholder { color: var(--kl-muted); -webkit-text-fill-color: var(--kl-muted); opacity: 1; }
body .kn-tags-filter input:focus {
	border-color: var(--kl-text);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--kl-text) 12%, transparent);
}
body .kn-tags-total {
	font-size: 13px;
	font-weight: 600;
	color: var(--kl-muted);
	font-variant-numeric: tabular-nums;
}
body .king-tags-page-wrap .king-tags-cloud.king-widget-wb {
	margin: 0;
	padding: 22px;
	background: var(--kl-surface);
	border: 1px solid var(--kl-line);
	border-radius: 18px;
	box-shadow: none;
}
body .king-tags-page-wrap .king-tag-cloud-body {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-start;
	gap: 8px;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
}
body .king-tags-page-wrap .king-tag-cloud-pill {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 38px;
	margin: 0;
	padding: 0 14px;
	border: 1px solid var(--kl-line) !important;
	border-radius: 999px;
	background: var(--kl-surface) !important;
	box-shadow: none;
	transition: background-color .15s ease, border-color .15s ease;
}
body .king-tags-page-wrap .king-tag-cloud-pill[hidden] { display: none; }
body .king-tags-page-wrap .king-tag-cloud-pill:hover {
	background: var(--kl-hover) !important;
	border-color: var(--kl-hover) !important;
}
body .king-tags-page-wrap .king-tag-cloud-pill .king-tag-link {
	position: static;
	padding: 0;
	margin: 0;
	background: transparent !important;
	border: 0;
	color: var(--kl-text) !important;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
}
body .king-tags-page-wrap .king-tag-cloud-pill .king-tag-link::before {
	content: "#";
	margin-right: 1px;
	color: var(--kl-muted);
	font-weight: 500;
}
/* Whole pill is the link */
body .king-tags-page-wrap .king-tag-cloud-pill .king-tag-link::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
}
body .king-tags-page-wrap .king-tag-cloud-pill .king-tag-link:focus-visible { outline: none; }
body .king-tags-page-wrap .king-tag-cloud-pill:focus-within { outline: 2px solid var(--kl-text); outline-offset: 2px; }
body .king-tags-page-wrap .king-tag-cloud-count {
	min-width: 0;
	height: auto;
	margin: 0;
	padding: 0;
	background: transparent !important;
	border: 0;
	border-radius: 0;
	color: var(--kl-muted) !important;
	font-size: 12.5px;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}
/* Most used tags read a little stronger */
body .king-tags-page-wrap .king-tag-cloud-pill--lg { height: 44px; padding: 0 18px; }
body .king-tags-page-wrap .king-tag-cloud-pill--lg .king-tag-link { font-size: 16px; font-weight: 750; }
body .king-tags-page-wrap .king-tag-cloud-pill--md .king-tag-link { font-size: 15px; font-weight: 700; }
body .kn-tags-none {
	margin: 0;
	padding: 18px 0 4px;
	font-size: 14px;
	color: var(--kl-muted);
}
body .kn-tags-none[hidden] { display: none; }

/* ---------- Categories index ---------- */
body .king-categories-page {
	padding: 0 0 40px;
	background: transparent !important;
	background-image: none !important;
}
body .king-categories-page .king-categories-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
	gap: 14px;
	max-width: none;
	margin: 0;
}
body .king-categories-page .king-category-card {
	position: relative;
	display: flex;
	flex-direction: column;
	background: var(--kl-surface);
	border: 1px solid var(--kl-line);
	border-radius: 18px;
	box-shadow: none;
	overflow: hidden;
	transform: none;
	transition: border-color .15s ease, box-shadow .2s ease, transform .2s ease;
}
body .king-categories-page .king-category-card::before { display: none; }
body .king-categories-page .king-category-card:hover {
	border-color: color-mix(in srgb, var(--king-cat-accent, #0d0c22) 35%, var(--kl-line));
	box-shadow: 0 12px 28px rgba(13, 12, 34, .08);
	transform: translateY(-2px);
}
body .king-categories-page .king-category-card-link {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	padding: 20px 20px 18px;
	color: var(--kl-text);
	text-decoration: none;
}
body .king-categories-page .king-category-card-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin: 0 0 16px;
}
body .king-categories-page .king-category-card-icon {
	width: 46px;
	height: 46px;
	border-radius: 13px;
	font-size: 21px;
	background: color-mix(in srgb, var(--king-cat-accent, #0d0c22) 10%, var(--kl-surface));
	border: 1px solid color-mix(in srgb, var(--king-cat-accent, #0d0c22) 16%, var(--kl-line));
}
body .king-categories-page .king-category-card-count {
	padding: 0;
	background: transparent;
	border-radius: 0;
	color: var(--kl-muted);
	font-size: 12.5px;
	font-weight: 650;
	font-variant-numeric: tabular-nums;
}
body .king-categories-page .king-category-card-title {
	margin: 0 0 6px;
	font-size: 18px;
	font-weight: 750;
	letter-spacing: -.01em;
	color: var(--kl-text);
}
body .king-categories-page .king-category-card-desc {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
	margin: 0;
	font-size: 14px;
	line-height: 1.55;
	color: var(--kl-muted);
}
body .king-categories-page .king-category-subnav {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0;
	padding: 0 20px 18px;
	background: transparent;
	border: 0;
}
body .king-categories-page .king-category-subnav:empty { display: none; }
body .king-categories-page .king-category-subnav-item {
	position: relative;
	z-index: 1;
	display: inline-flex;
	align-items: center;
	height: 28px;
	padding: 0 11px;
	border: 1px solid var(--kl-line);
	border-radius: 999px;
	background: var(--kl-soft);
	color: var(--kl-text);
	font-size: 12.5px;
	font-weight: 600;
	text-decoration: none;
	box-shadow: none;
}
body .king-categories-page .king-category-subnav-item:hover { background: var(--kl-hover); }

/* ---------- Category / tag listing: hide the home SEO blurb if a cached page still has it ---------- */
body.king-template-qa:not(.king-category-) .king-home-seo-intro { display: none; }

/* ---------- Dark mode: beat the theme's own .king-night rules ---------- */
html.king-night body .head-title,
html.king-night body .kn-list-hero { background: transparent !important; color: var(--kl-text); }
html.king-night body .king-categories-page .king-category-card,
html.king-night body .king-tags-page-wrap .king-tags-cloud.king-widget-wb {
	background: var(--kl-surface);
	border-color: var(--kl-line);
}
html.king-night body .king-categories-page .king-category-card:hover { box-shadow: 0 14px 32px rgba(0, 0, 0, .4); }
html.king-night body .king-categories-page .king-category-card-title,
html.king-night body .kn-list-hero-title { color: var(--kl-text); }
html.king-night body .king-categories-page .king-category-card-count { background: transparent; }
html.king-night body .king-nav-bar.king-feed-toolbar.king-feed-toolbar--range-only {
	background: transparent;
	border: 0;
	box-shadow: none;
}
html.king-night body .king-feed-toolbar--range-only .king-range { background: var(--kl-surface) !important; border-color: var(--kl-line) !important; }

/* ---------- Phone ---------- */
@media (max-width: 767px) {
	body .kn-list-hero { padding: 22px 16px 16px; }
	body .kn-list-hero-in { flex-wrap: wrap; gap: 14px; }
	body .kn-list-hero-icon { width: 44px; height: 44px; border-radius: 12px; font-size: 20px; }
	body .kn-list-hero-icon i { font-size: 20px; }
	body .kn-list-hero--tag .kn-list-hero-icon { font-size: 22px; }
	body .kn-list-hero-text { flex: 1 1 0; min-width: 0; }
	body .kn-list-hero-title,
	body .kn-list-hero h1.king-category-hero-title { font-size: 28px; }
	body .kn-list-hero-desc { font-size: 14.5px; }
	body .kn-list-hero-actions { flex: 1 1 100%; margin: 0; }
	body .kn-list-hero-chips {
		flex-wrap: nowrap;
		overflow-x: auto;
		scrollbar-width: none;
		margin-right: -16px;
		padding-right: 16px;
	}
	body .kn-list-hero-chips::-webkit-scrollbar { display: none; }
	body .kn-list-hero-chip { flex: 0 0 auto; }
	body .kn-tags-tools { flex-wrap: wrap; gap: 8px; }
	body .kn-tags-filter { flex: 1 1 100%; }
	body .king-tags-page-wrap .king-tags-cloud.king-widget-wb { padding: 14px; border-radius: 16px; }
	body .king-tags-page-wrap .king-tag-cloud-pill { height: 36px; padding: 0 12px; }
	body .king-tags-page-wrap .king-tag-cloud-pill--lg { height: 40px; }
	body .king-categories-page .king-categories-grid { grid-template-columns: 1fr; gap: 10px; }
	body .king-categories-page .king-category-card-link { padding: 16px; }
	body .king-categories-page .king-category-card-top { margin-bottom: 12px; }
	body .king-categories-page .king-category-subnav { padding: 0 16px 14px; }
}

@media (prefers-reduced-motion: reduce) {
	body .king-categories-page .king-category-card,
	body .king-tags-page-wrap .king-tag-cloud-pill,
	body .kn-list-hero-chip { transition: none; transform: none !important; }
}
