/**
 * Classic Style for Knowledge Base - Modern CSS Grid Implementation
 * 
 * Modern, clean design using CSS Grid and Flexbox for responsive layouts.
 * This is the default style with contemporary CSS standards.
 *
 * @package WebberZone\Knowledge_Base
 */

/* CSS Variables for Classic Style - Customization */
:root {
	/* Primary colors */
	--wzkb-color-primary: #4c51bf;
	--wzkb-color-text: #333;
	--wzkb-color-text-medium: #666;
	--wzkb-color-white: #fff;
	--wzkb-color-orange: #f97316;

	/* Background colors */
	--wzkb-bg-white: #fff;
	--wzkb-bg-light: #f8f9fa;
	--wzkb-bg-ghostwhite: #f8f8ff;

	/* Border colors */
	--wzkb-border-light: #e0e0e0;
	--wzkb-border-medium: #ddd;

	/* Breadcrumb colors */
	--wzkb-breadcrumb-bg: #f8f9fa;
	--wzkb-breadcrumb-text: #2d3748;
	--wzkb-breadcrumb-link: #1630A2;
	--wzkb-breadcrumb-separator: var(--wzkb-color-dark);
	--wzkb-breadcrumb-separator-color: var(--wzkb-color-dark);
	--wzkb-breadcrumb-border: #e0e0e0;

	/* Layout variables */
	--wzkb-wrapper-max-width: 1280px;

	/* List bullet */
	--wzkb-list-bullet: "›";

	/* Additional variables */
	--wzkb-gradient-begin: var(--wzkb-color-primary);
	--wzkb-gradient-end: #1a3a52;
	--wzkb-product-border: var(--wzkb-border-subtle);
	--wzkb-shadow-color: rgba(0, 0, 0, 0.08);
	--wzkb-shadow-hover: rgba(22, 33, 82, 0.16);
	--wzkb-shadow-medium: rgba(27, 39, 94, 0.08);
	--wzkb-shadow-large: rgba(14, 21, 47, 0.12);
	--wzkb-border-subtle: rgba(91, 107, 174, 0.15);
	--wzkb-color-text-dark: #202a44;
	--wzkb-color-accent: #2457ff;
	--wzkb-color-dark: #1a3a52;
}

/* Category archive (single section view) - disable grid, show full width */
.wzkb-category-archive.wzkb {
	display: block;
	grid-template-columns: none;
}

.wzkb-category-archive .wzkb-section {
	width: 100%;
	max-width: 100%;
}

/* Nested section wrappers should also be full width */
.wzkb-category-archive .wzkb-section-wrapper {
	display: block;
	width: 100%;
}

.wzkb-category-archive .wzkb-section-wrapper .wzkb-section {
	width: 100%;
	max-width: 100%;
	margin-bottom: 20px;
}

/* Base container */
.wzkb {
	width: 100%;
	max-width: 100%;
	margin: 10px 0;
	display: grid;
	grid-template-columns: repeat(var(--wzkb-columns, 2), 1fr);
	gap: 20px;
}

/* Responsive column overrides */
@media (max-width: 1200px) {

	.wzkb,
	.wzkb-product-grid {
		--wzkb-columns: 2;
	}
}

@media (max-width: 768px) {

	.wzkb,
	.wzkb-product-grid {
		--wzkb-columns: 1;
	}

	.wzkb-product-grid {
		grid-template-columns: 1fr;
		gap: 1.5rem;
	}

	.wzkb-product-grid-wrapper {
		padding: 30px 20px;
	}

	body.wzkb-sidebar-enabled .wzkb-wrap {
		grid-template-columns: 1fr !important;
		margin: 0 20px;
	}
}

.wzkb-master-section,
.section {
	display: contents;
}

.wzkb-product {
	grid-column: 1 / -1;
	clear: both;
	display: block;
	margin-bottom: 30px;
}

.wzkb-product-header {
	margin-bottom: 20px;
}

.wzkb-product-description {
	font-size: 18px;
	color: var(--wzkb-color-text-medium);
	margin-top: 8px;
}

.wzkb-product-grid {
	display: block;
}

/* Product title styling */
.wzkb-product-title {
	font-size: 34px;
	line-height: 1.2;
	font-weight: 800;
	margin: 0 0 20px 0;
	padding: 0;
	grid-column: 1 / -1;
	color: var(--wzkb-color-text);
}

.wzkb-product-title a {
	color: var(--wzkb-color-primary);
	text-decoration: none;
	font-weight: 800;
	transition: opacity 0.3s ease;
}

.wzkb-product-title a:hover {
	opacity: 0.8;
}

/* Section styling */
.wzkb-section {
	display: block;
	position: relative;
	overflow: hidden;
	min-width: 0;
}

.wzkb .wzkb-section-name a,
.wzkb .wzkb-section-name a:visited {
	color: var(--wzkb-color-text);
	text-decoration: none;
	border: 0;
}

.wzkb .wzkb-section-name {
	font-size: 22px;
	font-weight: 700;
	margin-bottom: 12px;
	padding-bottom: 8px;
	overflow: hidden;
	line-height: 1.35;
	position: relative;
}

.wzkb-section-name-level-1 {
	border-bottom: 2px solid var(--wzkb-border-light);
	border-top: none;
	padding: 8px 0 10px;
	background-color: transparent;
	margin-top: 24px;
	margin-bottom: 0;
	grid-column: 1 / -1;
}

.wzkb .wzkb-section-name-level-0,
.wzkb .wzkb-section-name-level-1 {
	font-size: 26px;
	font-weight: 700;
}

.wzkb .wzkb-section-name-level-2 {
	font-size: 20px;
	font-weight: 600;
}

/* Article list styling */
.wzkb-articles-list {
	margin: 0 !important;
	padding: 0 !important;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
	gap: 15px;
	list-style: none !important;
	box-sizing: border-box;
	overflow-x: hidden;
}

/* Responsive breakpoints for article lists */
@media only screen and (max-width: 1200px) {
	.wzkb-articles-list {
		grid-template-columns: 1fr;
	}
}

.wzkb-search-results-grid>li {
	list-style: none;
	padding: 0;
	margin: 0;
}

.wzkb-articles-list li {
	margin: 5px 0;
	padding: 0;
	position: relative;
	list-style-type: none !important;
}

.wzkb-articles-list li:before {
	content: "›";
	display: inline-block;
	width: 16px;
	font-size: 18px;
	line-height: 1.4;
	font-weight: 400;
	font-family: inherit;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	margin-right: 8px;
	color: var(--wzkb-color-primary);
}

.wzkb-articles-list li a {
	color: var(--wzkb-color-text);
	text-decoration: none;
	font-weight: 500;
	position: relative;
	transition: all 0.3s ease;
}

.wzkb-articles-list .wzkb-article-excerpt {
	margin-top: 4px;
	font-size: 13px;
	line-height: 1.5;
	color: var(--wzkb-color-text-medium);
}

.wzkb-articles-list li a:hover {
	color: var(--wzkb-color-primary);
}

.wzkb-products-list {
	margin: 0 0 5px 0 !important;
	padding: 0 !important;
	list-style: none !important;
}

.wzkb-products-list>li {
	list-style: none !important;
	position: relative;
	margin: 0;
	padding: 0;
	line-height: 1.4;
	border: none;
}

.wzkb-products-list ul {
	list-style: none !important;
	margin: 0;
	padding: 0;
}

.wzkb-products-list ul li {
	list-style: none !important;
	position: relative;
	margin: 0;
	padding: 1px 0;
	display: flex;
	align-items: flex-start;
	gap: 8px;
}

.wzkb-products-list ul li::before {
	content: var(--wzkb-list-bullet);
	position: relative;
	color: var(--wzkb-color-primary);
	font-weight: 600;
	opacity: 0.65;
	line-height: 1.4;
}

.wzkb-products-list>li>.wzkb-product-link,
.wzkb-products-list>li>a {
	color: var(--wzkb-color-dark);
	text-decoration: none;
	font-weight: 600;
	font-size: 1rem;
	position: relative;
	display: block;
	padding: 0 0 3px;
	border-bottom: 1px solid var(--wzkb-product-border);
	margin-bottom: 5px;
	transition: color 0.25s ease;
}

.wzkb-products-list ul li a {
	color: var(--wzkb-color-text);
	text-decoration: none;
	font-weight: 500;
	font-size: 0.95rem;
	transition: color 0.25s ease;
}

.wzkb-products-list a:hover,
.wzkb-products-list a:focus {
	color: var(--wzkb-color-primary);
}

#wzkb-sidebar-primary .widget .wzkb-products-list,
#wzkb-sidebar-primary .widget .wzkb-products-list ul,
.sidebar .wzkb-products-list,
.sidebar .wzkb-products-list ul,
#wzkb-sidebar-primary .widget .wzkb-products-list li,
.sidebar .wzkb-products-list li {
	list-style: none !important;
	margin-left: 0;
}

.widget .wzkb,
#wzkb-sidebar-primary .wzkb,
.sidebar .wzkb {
	grid-template-columns: 1fr !important;
	gap: 16px;
}

.widget .wzkb-product,
#wzkb-sidebar-primary .wzkb-product,
.sidebar .wzkb-product {
	grid-template-columns: 1fr !important;
}

.widget .wzkb-section,
#wzkb-sidebar-primary .wzkb-section,
.sidebar .wzkb-section {
	padding: 10px 12px;
	margin-bottom: 14px;
}

.widget .wzkb-section-name,
#wzkb-sidebar-primary .wzkb-section-name,
.sidebar .wzkb-section-name {
	font-size: 15px;
	margin-bottom: 10px;
	padding-bottom: 6px;
}

/* Read more articles footer link */
.wzkb-article-footer {
	margin-top: 24px;
	padding-top: 16px;
	border-top: 1px solid var(--wzkb-border-medium);
	font-size: 15px;
	font-weight: 600;
}

.wzkb-article-footer a {
	color: var(--wzkb-color-primary);
	text-decoration: none;
	font-weight: 700;
	transition: opacity 0.3s ease;
}

.wzkb-article-footer a:hover {
	opacity: 0.7;
}

/* Section count badge */
.wzkb-section-count {
	display: block;
	float: right;
	margin: 0;
	padding: 6px 14px;
	background: var(--wzkb-color-orange);
	color: var(--wzkb-color-text) !important;
	border: none;
	border-radius: 20px;
	text-align: center;
	font-size: 13px;
	font-weight: 700;
	min-width: 34px;
}

/* Responsive adjustments - handled in main media query above */

/* Archive styles */
.wrap.wzkb-wrap {
	width: 100%;
	max-width: var(--wzkb-wrapper-max-width, 100%);
	margin: 0 auto;
	padding: 0;
}

/* Sidebar layout - applies when sidebar is present */
body.wzkb-sidebar-enabled .wzkb-wrap {
	display: grid;
	grid-template-columns: 1fr 300px;
	gap: 30px;
	align-items: start;
	max-width: var(--wzkb-wrapper-max-width, 100%);
	margin: 0 auto;
}

/* Add padding for smaller screens when sidebar is enabled */
@media (max-width: 1200px) {
	body.wzkb-sidebar-enabled .wzkb-wrap {
		padding: 0 20px;
		max-width: none;
	}
}

body.wzkb-sidebar-enabled #wzkb-content-primary {
	width: 100%;
	max-width: none;
	min-width: 0;
}

/* Ensure the main wzkb container inside content-primary respects max-width */
body.wzkb-sidebar-enabled #wzkb-content-primary .wzkb {
	max-width: 100%;
	width: 100%;
}

body.wzkb-sidebar-enabled #wzkb-sidebar-primary {
	width: 100%;
	max-width: none;
	min-width: 0;
}


#wzkb-sidebar-primary .widget ul li {
	margin-left: 10px;
	list-style-type: disc;
}

/* Navigation */
.nav-previous {
	float: left;
}

.nav-next {
	float: right;
}

/* Search form */
.wzkb-search-form {
	display: flex;
	border: 2px solid var(--wzkb-border-medium);
	border-radius: 50px;
	background: white;
	padding: 0;
	position: relative;
	margin: 20px auto;
	font-size: 1.3em;
	width: 100%;
	box-shadow: 0 2px 8px var(--wzkb-shadow-color, rgba(0, 0, 0, 0.08));
	overflow: hidden;
}

.wzkb-search-form:focus-within {
	border-color: var(--wzkb-color-primary, #667eea);
	box-shadow: 0 2px 12px rgba(102, 126, 234, 0.2);
}

.wzkb-search-form label {
	flex: 1;
	width: auto;
	margin: 0;
}

input[type="search"].wzkb-search-field {
	border: none;
	border-right: 1px solid #ddd;
	border-radius: 50px 0 0 50px;
	color: var(--wzkb-color-text);
	font-family: "Open Sans", sans-serif;
	font-size: 1em;
	font-weight: 500;
	padding: 16px 24px 16px 52px;
	width: 100%;
	background: url(../../images/search-icon.png) no-repeat 16px center;
	background-size: 24px 24px;
	outline: none;
	transition: background-color 0.2s ease;
}

input[type="search"].wzkb-search-field:focus {
	background-color: var(--wzkb-bg-light, #f8f9fa);
}

input[type="submit"].wzkb-search-submit {
	display: block;
	background: var(--wzkb-color-primary, #667eea);
	color: var(--wzkb-color-white);
	border: none;
	border-radius: 0 50px 50px 0;
	padding: 16px 20px;
	font-size: 0.9em;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.2s ease, transform 0.1s ease;
	min-width: 70px;
	font-family: "Open Sans", sans-serif;
}

input[type="submit"].wzkb-search-submit:hover {
	background: var(--wzkb-color-dark, #5567d8);
	transform: translateY(-1px);
}

input[type="submit"].wzkb-search-submit:active {
	transform: translateY(0);
}

input[type="submit"].wzkb-search-submit:focus {
	outline: 2px solid var(--wzkb-color-primary, #667eea);
	outline-offset: -2px;
}

.wzkb-search-form .screen-reader-text {
	position: absolute;
	clip: rect(0 0 0 0);
}

/* Pagination */
nav.pagination {
	width: 100%;
	margin: 15px 0;
	padding: 15px 0;
	border-top: 1px dotted #ccc;
	border-bottom: 1px dotted #ccc;
	text-align: center;
}

/* Related articles */
.wzkb-related-articles {
	clear: both;
	margin-top: 48px;
	padding: 32px;
	background: var(--wzkb-bg-light);
	border-radius: 12px;
	border: 1px solid var(--wzkb-border-light);
}

.wzkb-related-articles h3 {
	color: var(--wzkb-color-text);
	font-weight: 700;
	margin-bottom: 24px;
}

.wzkb-related-articles ul {
	list-style-type: none;
	margin: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 20px;
}

.wzkb-related-articles ul li {
	width: auto;
	background: var(--wzkb-bg-white);
	padding: 16px;
	border-radius: 8px;
	border: 1px solid var(--wzkb-border-light);
	transition: all 0.3s ease;
}

.wzkb-related-articles ul li:hover {
	border-color: var(--wzkb-color-primary);
	box-shadow: 0 4px 12px var(--wzkb-shadow-hover, rgba(102, 126, 234, 0.15));
	transform: translateY(-2px);
}

.wzkb-related-articles img,
.wzkb-related-articles a {
	display: block;
}

/* Breadcrumb */
.wzkb_breadcrumb {
	margin-bottom: 1.75em;
	background: var(--wzkb-breadcrumb-bg);
	padding: 14px 24px;
	border-radius: 8px;
	border: 1px solid var(--wzkb-breadcrumb-border);
	font-size: 15px;
	max-width: 100%;
}

.wzkb_breadcrumb-list {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
}

.wzkb_breadcrumb-item {
	display: inline;
	color: var(--wzkb-breadcrumb-text);
	font-weight: 500;
}

.wzkb_breadcrumb-item a {
	color: var(--wzkb-breadcrumb-link);
	text-decoration: none;
	font-weight: 600;
	transition: opacity 0.3s ease;
}

.wzkb_breadcrumb-item a:hover {
	opacity: 0.8;
}

.wzkb_breadcrumb-item:not(:last-child)::after {
	content: "\00BB";
	margin: 0 10px;
	color: var(--wzkb-breadcrumb-separator);
	font-weight: normal;
}

/* Product Grid Layout */
.wzkb-product-grid-wrapper {
	background: linear-gradient(135deg, var(--wzkb-gradient-begin, #f3f6ff) 0%, var(--wzkb-gradient-end, #fefefe) 65%);
	padding: 32px;
	border-radius: 28px;
	border: 1px solid var(--wzkb-border-subtle, rgba(91, 107, 174, 0.15));
	box-shadow: 0 25px 45px var(--wzkb-shadow-large, rgba(14, 21, 47, 0.12));
	margin-top: 24px;
	display: block !important;
	width: 100% !important;
	grid-column: 1 / -1 !important;
}

.wzkb-product-grid {
	display: grid;
	grid-template-columns: repeat(var(--wzkb-columns, 2), 1fr);
	gap: 25px;
	width: 100%;
}

.wzkb-product-card {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	background: var(--wzkb-bg-white, #ffffff);
	border-radius: 20px;
	padding: 24px 24px 28px;
	border: 1px solid var(--wzkb-border-subtle, rgba(34, 48, 94, 0.08));
	box-shadow: 0 15px 35px var(--wzkb-shadow-medium, rgba(27, 39, 94, 0.08));
	transition: transform 180ms ease, box-shadow 180ms ease;
	min-height: 220px;
}

.wzkb-product-card::before {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 20px;
	background: linear-gradient(135deg, var(--wzkb-gradient-begin, rgba(80, 110, 255, 0.08)), var(--wzkb-gradient-end, rgba(0, 172, 193, 0.08)));
	opacity: 0;
	transition: opacity 180ms ease;
	z-index: -1;
}

.wzkb-product-card:hover,
.wzkb-product-card:focus-within {
	transform: translateY(-6px);
	box-shadow: 0 25px 50px var(--wzkb-shadow-hover, rgba(22, 33, 82, 0.16));
	background: var(--wzkb-color-primary, #506eff);
	color: var(--wzkb-color-white, #ffffff);
	border: 1px solid var(--wzkb-color-white, #ffffff);
}

.wzkb-product-card:hover .wzkb-product-title,
.wzkb-product-card:focus-within .wzkb-product-title {
	color: var(--wzkb-color-white, #ffffff);
}

.wzkb-product-card:hover .wzkb-product-description,
.wzkb-product-card:focus-within .wzkb-product-description {
	color: rgba(255, 255, 255, 0.9);
}

.wzkb-product-card:hover .wzkb-product-card-cta,
.wzkb-product-card:focus-within .wzkb-product-card-cta {
	color: var(--wzkb-color-white, #ffffff);
}

.wzkb-product-card:hover::before,
.wzkb-product-card:focus-within::before {
	opacity: 1;
}

.wzkb-product-link {
	color: inherit !important;
	text-decoration: none !important;
	display: flex;
	flex-direction: column;
	height: 100%;
}

.wzkb-product-card .wzkb-product-title {
	margin: 0 0 12px;
	font-size: 1.45rem;
	font-weight: 700;
	color: var(--wzkb-color-text-dark, #202a44);
	line-height: 1.2;
}

.wzkb-product-card .wzkb-product-description {
	color: var(--wzkb-color-text-medium, #5a6275);
	font-size: 0.97rem;
	line-height: 1.6;
	margin-bottom: 24px;
}

.wzkb-product-card-cta {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-weight: 600;
	font-size: 0.95rem;
	color: var(--wzkb-color-accent, #2457ff);
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.wzkb-product-card-cta::after {
	content: "→";
	font-size: 1.1em;
	transition: transform 180ms ease;
}

.wzkb-product-card:hover .wzkb-product-card-cta::after,
.wzkb-product-card:focus-within .wzkb-product-card-cta::after {
	transform: translateX(6px);
}

@media (max-width: 640px) {
	.wzkb-product-grid-wrapper {
		padding: 20px;
	}

	.wzkb-product-card {
		padding: 20px;
	}
}

/* Search results grid */
.wzkb-search-results-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	column-gap: 24px;
	row-gap: 28px;
	margin: 28px 0;
	align-items: stretch;
}

.wzkb-search-results-grid>* {
	height: 100%;
	margin: 0;
}

@media (max-width: 1200px) {
	.wzkb-search-results-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 768px) {
	.wzkb-search-results-grid {
		grid-template-columns: 1fr;
	}
}

.wzkb-search-result-card {
	display: grid;
	grid-template-columns: 80px minmax(0, 1fr);
	grid-template-areas:
		"thumb title"
		"excerpt excerpt";
	align-items: flex-start;
	gap: 14px;
	background: var(--wzkb-bg-white);
	border: 1px solid var(--wzkb-border-light);
	border-radius: 12px;
	overflow: hidden;
	padding: 18px;
	height: 100%;
	align-content: start;
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.wzkb-search-result-card:hover {
	box-shadow: 0 6px 20px var(--wzkb-shadow-hover);
	transform: translateY(-3px);
}

.wzkb-search-result-thumb-link {
	display: block;
	grid-area: thumb;
	flex-shrink: 0;
	width: 80px;
	height: 80px;
	border-radius: 8px;
	overflow: hidden;
}

.wzkb-search-result-thumb-link img {
	width: 80px;
	height: 80px;
	object-fit: cover;
	display: block;
	transition: transform 0.3s ease;
}

.wzkb-search-result-card:hover .wzkb-search-result-thumb-link img {
	transform: scale(1.04);
}

.wzkb-search-result-thumb-link:not(:has(img)) {
	display: none;
}

.wzkb-search-result-card:not(:has(.wzkb-search-result-thumb-link img)) {
	grid-template-columns: minmax(0, 1fr);
	grid-template-areas:
		"title"
		"excerpt";
}

.wzkb-search-result-body {
	display: contents;
}

.wzkb-search-result-title {
	grid-area: title;
	font-size: 17px;
	font-weight: 700;
	margin: 0 0 10px;
	line-height: 1.3;
	min-width: 0;
}

.wzkb-search-result-title a {
	color: var(--wzkb-color-text);
	text-decoration: none;
	transition: color 0.2s ease;
}

.wzkb-search-result-title a:hover {
	color: var(--wzkb-color-primary);
}

.wzkb-search-result-excerpt {
	font-size: 14px;
	color: var(--wzkb-color-text-medium);
	line-height: 1.6;
	margin: 0;
}

.wzkb-search-result-card .wzkb-article-excerpt {
	grid-area: excerpt;
	margin: 0;
	line-height: 1.55;
}

/* Table of Contents */
.wzkb-toc--inline {
	margin-bottom: 1rem;
	background: var(--wzkb-bg-light);
	border: 1px solid var(--wzkb-border-light);
	border-radius: 6px;
	padding: 1rem 1.5rem;
	display: inline-block;
	min-width: 200px;
	max-width: 100%;
	box-sizing: border-box;
	box-shadow: 0 1px 4px var(--wzkb-shadow-color);
}

.wzkb-toc-title {
	font-weight: 700;
	margin: 0 0 0.5rem;
	color: var(--wzkb-color-text-dark);
	font-size: 15px;
}

.wzkb-toc--widget .wzkb-toc-title {
	color: inherit;
	font-size: inherit;
}

.wzkb-toc-list,
.wzkb-toc-list ul {
	margin: 0;
	padding-left: 1.25rem;
	list-style: disc;
}

.wzkb-toc-list ul {
	padding-left: 1.5rem;
}

.wzkb-toc-list li {
	margin: 0.2rem 0;
	line-height: 1.5;
}

.wzkb-toc-list a {
	color: var(--wzkb-color-primary);
	text-decoration: none;
	transition: color 0.2s ease;
}

.wzkb-toc-list a:hover {
	color: var(--wzkb-color-dark);
	text-decoration: underline;
}