/*
 * Docs overview page (/docs/, weDocs shortcode).
 * Loaded only on pages that contain the [wedocs] shortcode (see functions.php).
 *
 * js/docs-index.js builds a documentation index (.cm-docs) from the weDocs list and
 * then hides that list (.cm-docs-ready). The first block below only fixes the plain
 * weDocs list, for visitors without JS.
 *
 * Site language: Poppins, blue #1649c1, 10px radius (same as .btn-main and the docs
 * sidebar), thin #e3e8f2 rules, no shadows.
 */

/* ---------- Fallback: plain weDocs list without JS ---------- */
body .wedocs-shortcode-wrap ul.wedocs-docs-list li.wedocs-docs-single .inside {
	height: auto;
	overflow: visible;
}

body .wedocs-shortcode-wrap ul.wedocs-docs-list li.wedocs-docs-single .wedocs-doc-link .wedocs-view-details-btn {
	border-radius: 10px;
}

body .wedocs-shortcode-wrap.cm-docs-ready ul.wedocs-docs-list {
	display: none;
}

/* ---------- Search ---------- */
body .wedocs-shortcode-wrap .wedocs-search-form {
	margin: 40px 0 32px;
	border: 0;
}

body .wedocs-shortcode-wrap .wedocs-search-form .wedocs-search-input {
	width: 100%;
	margin: 0;
}

body .wedocs-shortcode-wrap .wedocs-search-input .search-field {
	height: 56px;
	margin: 0;
	padding: 0 76px 0 20px !important;
	font-family: Poppins-Regular, sans-serif;
	font-size: 16px;
	color: #141b2d;
	background: #fff;
	border: 1px solid #d5dbe7;
	border-radius: 10px;
	box-shadow: none;
	cursor: text;
}

body .wedocs-shortcode-wrap .wedocs-search-input .search-field::placeholder {
	color: #6b7280;
}

body .wedocs-shortcode-wrap .wedocs-search-input .search-field:focus {
	border-color: #1649c1;
	outline: 2px solid rgba(22, 73, 193, 0.18);
	outline-offset: 0;
}

body .wedocs-shortcode-wrap .wedocs-search-input .search-submit {
	top: 0;
	right: 0 !important;
	left: auto !important;
	width: 64px;
	height: 56px;
	padding: 0;
	justify-content: center;
	background: #1649c1;
	border-radius: 0 10px 10px 0;
}

body .wedocs-shortcode-wrap .wedocs-search-input .search-submit:hover,
body .wedocs-shortcode-wrap .wedocs-search-input .search-submit:focus-visible {
	background: #0f3a9e;
}

/* ---------- Index layout ---------- */
.cm-docs {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 320px;
	gap: 32px;
	align-items: start;
	font-family: Poppins-Regular, sans-serif;
	color: #141b2d;
}

.cm-docs a {
	color: inherit;
	text-decoration: none;
}

.cm-docs ul,
.cm-docs ol {
	margin: 0;
	padding: 0;
	list-style: none;
}

.cm-docs h2,
.cm-docs h3 {
	margin: 0;
	font-weight: normal;
	letter-spacing: 0;
}

/* ---------- Main product ---------- */
.cm-docs-main {
	background: #fff;
	border: 1px solid #e3e8f2;
	border-radius: 10px;
}

.cm-docs-main__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	padding: 32px 36px 28px;
	border-bottom: 1px solid #e3e8f2;
}

.cm-docs-main__title {
	font-family: Poppins-Bold, sans-serif;
	font-size: 30px;
	line-height: 1.2;
}

.cm-docs-main__title a:hover {
	color: #1649c1;
}

.cm-docs-main__meta {
	margin: 6px 0 0;
	font-size: 15px;
	color: #6b7280;
}

.cm-docs-btn {
	flex: 0 0 auto;
	display: inline-block;
	padding: 14px 24px;
	font-family: Poppins-SemiBold, sans-serif;
	font-size: 15px;
	line-height: 1.2;
	color: #fff !important;
	background: #1649c1;
	border-radius: 10px;
}

.cm-docs-btn:hover,
.cm-docs-btn:focus-visible {
	background: #0f3a9e;
}

/* Chapters: two columns, separated by thin rules */
.cm-docs-chapters {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	counter-reset: none;
}

.cm-docs-chapter {
	display: flex;
	gap: 18px;
	padding: 28px 36px 30px;
	border-bottom: 1px solid #e3e8f2;
}

.cm-docs-chapter:nth-child(odd) {
	border-right: 1px solid #e3e8f2;
}

.cm-docs-chapter__num {
	flex: 0 0 auto;
	width: 28px;
	padding-top: 2px;
	font-family: Poppins-SemiBold, sans-serif;
	font-size: 14px;
	color: #1649c1;
}

.cm-docs-chapter__body {
	min-width: 0;
}

.cm-docs-chapter__title {
	margin-bottom: 10px !important;
	font-family: Poppins-SemiBold, sans-serif;
	font-size: 18px;
	line-height: 1.35;
}

.cm-docs-chapter__title a:hover {
	color: #1649c1;
}

.cm-docs-chapter__list li a {
	display: block;
	padding: 5px 0;
	font-size: 15px;
	line-height: 1.45;
	color: #4b5563;
}

.cm-docs-chapter__list li a:hover,
.cm-docs-chapter__list li a:focus-visible {
	color: #1649c1;
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* Single pages without sub articles */
.cm-docs-more {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 8px 24px;
	padding: 22px 36px 26px;
	background: #f8f9fc;
	border-radius: 0 0 10px 10px;
}

.cm-docs-more__label {
	font-family: Poppins-SemiBold, sans-serif;
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: #6b7280;
}

.cm-docs-more__list {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 24px;
}

.cm-docs-more__list a {
	font-family: Poppins-Medium, sans-serif;
	font-size: 15px;
	color: #1649c1 !important;
}

.cm-docs-more__list a:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* ---------- Other products ---------- */
.cm-docs-aside {
	background: #fff;
	border: 1px solid #e3e8f2;
	border-radius: 10px;
}

.cm-docs-aside__title {
	padding: 20px 24px 18px;
	font-family: Poppins-SemiBold, sans-serif;
	font-size: 13px !important;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: #6b7280;
	border-bottom: 1px solid #e3e8f2;
}

.cm-docs-product {
	padding: 22px 24px 24px;
}

.cm-docs-product + .cm-docs-product {
	border-top: 1px solid #e3e8f2;
}

.cm-docs-product__title {
	font-family: Poppins-SemiBold, sans-serif;
	font-size: 17px;
	line-height: 1.35;
}

.cm-docs-product__title a:hover {
	color: #1649c1;
}

.cm-docs-product__meta {
	margin: 2px 0 10px;
	font-size: 13px;
	color: #6b7280;
}

.cm-docs-product__list li a {
	display: block;
	padding: 4px 0;
	font-size: 14px;
	line-height: 1.45;
	color: #4b5563;
}

.cm-docs-product__list li a:hover {
	color: #1649c1;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.cm-docs-product__open {
	display: inline-block;
	margin-top: 12px;
	font-family: Poppins-SemiBold, sans-serif;
	font-size: 14px;
	color: #1649c1 !important;
}

.cm-docs-product__open:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* ---------- Responsive ---------- */
@media (max-width: 1199px) {
	.cm-docs {
		grid-template-columns: minmax(0, 1fr) 280px;
		gap: 24px;
	}

	.cm-docs-chapters {
		grid-template-columns: minmax(0, 1fr);
	}

	.cm-docs-chapter:nth-child(odd) {
		border-right: 0;
	}
}

@media (max-width: 991px) {
	.cm-docs {
		grid-template-columns: minmax(0, 1fr);
	}

	.cm-docs-aside {
		display: grid;
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.cm-docs-aside__title {
		grid-column: 1 / -1;
	}

	.cm-docs-product + .cm-docs-product {
		border-top: 0;
		border-left: 1px solid #e3e8f2;
	}
}

@media (max-width: 767px) {
	body .wedocs-shortcode-wrap .wedocs-search-form {
		margin: 24px 0 20px;
	}

	body .wedocs-shortcode-wrap .wedocs-search-input .search-field {
		height: 52px;
		padding-right: 64px !important;
	}

	body .wedocs-shortcode-wrap .wedocs-search-input .search-submit {
		width: 52px;
		height: 52px;
	}

	.cm-docs-main__head {
		flex-direction: column;
		align-items: flex-start;
		gap: 16px;
		padding: 24px 20px 22px;
	}

	.cm-docs-main__title {
		font-size: 24px;
	}

	.cm-docs-btn {
		display: block;
		width: 100%;
		text-align: center;
	}

	.cm-docs-chapter {
		gap: 12px;
		padding: 22px 20px 22px;
	}

	.cm-docs-chapter__list li a {
		padding: 8px 0;
	}

	.cm-docs-more {
		padding: 20px;
	}

	.cm-docs-aside {
		display: block;
	}

	.cm-docs-product {
		padding: 20px;
	}

	.cm-docs-product + .cm-docs-product {
		border-left: 0;
		border-top: 1px solid #e3e8f2;
	}

	.cm-docs-product__list li a {
		padding: 7px 0;
	}
}
