/* =================================================================
   NK Knowledge Base Styles
   Palette: Sage #9FB7A1, Cloud Dancer #F0EEE9, Clay #E6DED9,
   Charcoal Ink #3E3E3C, Warm Stone #D1C7C1
   ================================================================= */

/* --- Category Grid --- */

.nk-kb-categories {
	display: grid;
	grid-template-columns: repeat(var(--nk-kb-cols, 2), 1fr);
	gap: 30px;
	max-width: 1200px;
	margin: 0 auto;
}

.nk-kb-cat-card {
	background: #ffffff;
	border: 1px solid #D1C7C1;
	border-radius: 8px;
	padding: 24px;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
}

.nk-kb-cat-icon-wrap {
	margin-bottom: 16px;
	text-align: center;
}

.nk-kb-cat-icon {
	max-height: 300px;
	width: auto;
	max-width: 100%;
	object-fit: contain;
	color: #9FB7A1;
}

.nk-kb-cat-title {
	margin: 0 0 8px;
	font-size: 1.2em;
}

.nk-kb-cat-title a {
	color: #3E3E3C;
	text-decoration: none;
}

.nk-kb-cat-title a:hover {
	color: #9FB7A1;
}

.nk-kb-cat-desc {
	margin: 0 0 12px;
	font-size: 0.9em;
	color: #6a6a68;
}

.nk-kb-article-list {
	list-style: none !important;
	padding-left: 0 !important;
	padding-right: 0;
	margin: 0 0 8px;
	width: 100%;
}

.nk-kb-article-list li {
	padding: 4px 0;
	border-bottom: 1px solid #E6DED9;
	list-style: none !important;
}

.nk-kb-article-list li:last-child {
	border-bottom: none;
}

.nk-kb-article-list a {
	color: #897d9e;
	text-decoration: none;
	font-size: 0.9em;
}

.nk-kb-article-list a:hover {
	color: #9FB7A1;
}

.nk-kb-show-all {
	display: inline-block;
	margin-top: auto;
	padding-top: 12px;
	font-weight: 600;
	color: #9FB7A1;
	text-decoration: none;
}

.nk-kb-show-all:hover {
	color: #3E3E3C;
}

@media (max-width: 768px) {
	.nk-kb-categories {
		grid-template-columns: 1fr;
	}
}

/* --- Search Box --- */

.nk-kb-search {
	max-width: 600px;
	margin: 0 auto;
	position: relative;
}

.nk-kb-search-input-wrap {
	display: flex;
	align-items: center;
	border: 1px solid #9FB7A1;
	border-radius: 999px;
	background: #F0EEE9;
	box-shadow: 0 0 0 4px rgba(230, 222, 217, 0.5);
	overflow: hidden;
}

.nk-kb-search-input {
	flex: 1;
	border: none;
	background: transparent;
	padding: 12px 20px;
	font-size: 1em;
	color: #3E3E3C;
	outline: none;
	font-family: "DM Sans", sans-serif;
}

.nk-kb-search-input::placeholder {
	color: #9A9A95;
}

.nk-kb-search-icon {
	padding: 0 16px;
	color: #9FB7A1;
	display: flex;
}

.nk-kb-search-results {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	background: #fff;
	border: 1px solid #D1C7C1;
	border-radius: 8px;
	margin-top: 8px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
	z-index: 100;
	max-height: 400px;
	overflow-y: auto;
}

.nk-kb-search-results-list {
	list-style: none;
	padding: 0;
	margin: 0;
}

.nk-kb-search-results-list li {
	border-bottom: 1px solid #F0EEE9;
}

.nk-kb-search-results-list li:last-child {
	border-bottom: none;
}

.nk-kb-search-results-list a {
	display: block;
	padding: 10px 16px;
	color: #3E3E3C;
	text-decoration: none;
}

.nk-kb-search-results-list a:hover {
	background: #F0EEE9;
	color: #9FB7A1;
}

.nk-kb-no-results {
	padding: 16px;
	text-align: center;
	color: #9A9A95;
}

/* --- Category Archive --- */

.nk-kb-cat-archive {
	max-width: 1200px;
	margin: 0 auto;
}

.nk-kb-cat-archive .nk-kb-cat-icon-wrap {
	text-align: left;
	margin-bottom: 12px;
}

.nk-kb-cat-archive .nk-kb-cat-icon {
	max-height: 120px;
}

.nk-kb-cat-archive-title {
	margin: 0 0 8px;
	font-size: 1.6em;
}

.nk-kb-cat-archive .nk-kb-article-list {
	columns: 2;
	column-gap: 30px;
}

.nk-kb-cat-archive .nk-kb-article-list li {
	break-inside: avoid;
}

@media (max-width: 768px) {
	.nk-kb-cat-archive .nk-kb-article-list {
		columns: 1;
	}
}

/* --- Single Article Layout --- */

.nk-kb-article-wrap {
	display: flex;
	gap: 30px;
}

.nk-kb-sidebar {
	flex: 0 0 250px;
	padding-top: 20px;
}

.nk-kb-article-wrap > .content {
	flex: 1;
	min-width: 0;
}

.nk-kb-sidebar-title {
	font-size: 1.1em;
	font-weight: 700;
	margin-bottom: 12px;
}

.nk-kb-sidebar-cats {
	list-style: none;
	padding: 0;
	margin: 0;
}

.nk-kb-sidebar-cats li {
	margin-bottom: 4px;
}

.nk-kb-sidebar-cats a {
	color: #3E3E3C;
	text-decoration: none;
	padding: 4px 0;
	display: block;
	font-size: 0.9em;
}

.nk-kb-sidebar-cats a:hover,
.nk-kb-sidebar-cat.nk-kb-active > a {
	color: #9FB7A1;
	font-weight: 600;
}

.nk-kb-sidebar-subcats {
	list-style: none;
	padding: 0 0 0 16px;
	margin: 4px 0 0;
}

.nk-kb-sidebar-subcat.nk-kb-active > a {
	color: #9FB7A1;
	font-weight: 600;
}

/* Breadcrumbs */

.nk-kb-breadcrumbs {
	font-size: 0.85em;
	color: #9A9A95;
	margin-bottom: 16px;
}

.nk-kb-breadcrumbs a {
	color: #9FB7A1;
	text-decoration: none;
}

.nk-kb-breadcrumbs a:hover {
	color: #3E3E3C;
}

@media (max-width: 768px) {
	.nk-kb-article-wrap {
		flex-direction: column;
	}

	.nk-kb-sidebar {
		flex: none;
		order: 2;
		border-top: 1px solid #E6DED9;
		padding-top: 20px;
	}
}

/* --- Featured Articles --- */

.nk-kb-featured {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 30px;
	max-width: 1200px;
	margin: 0 auto;
}

.nk-kb-featured-col {
	background: #ffffff;
	border: 1px solid #D1C7C1;
	border-radius: 8px;
	padding: 24px;
}

.nk-kb-featured-title {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 16px;
	font-size: 1.1em;
	color: #3E3E3C;
}

.nk-kb-featured-title svg {
	flex-shrink: 0;
	color: #9FB7A1;
}

@media (max-width: 768px) {
	.nk-kb-featured {
		grid-template-columns: 1fr;
	}
}
