/*
 * Single doc pages (single-docs.php), T-30. Loaded only on single docs (functions.php).
 * Same language as the /docs/ index: Poppins, blue #1649c1, 10px radius, thin #e3e8f2
 * rules, no shadows. IDs (#cm-doc, #cm-doc-aside, #cm-doc-main) come from the template
 * and win over the old long .single-docs selectors in style.css and the weDocs CSS.
 */

/* ---------- Layout ---------- */
#cm-doc {
	display: grid;
	grid-template-columns: 280px minmax(0, 1fr);
	gap: 56px;
	align-items: start;
	margin-top: 8px;
	font-family: Poppins-Regular, sans-serif;
	color: #141b2d;
}

#cm-doc::before,
#cm-doc::after {
	display: none;
}

#cm-doc .wedocs-single-content {
	width: auto;
	min-width: 0;
	padding: 0;
	border: 0;
}

/* ---------- Left column: search + tree, sticky on desktop ---------- */
#cm-doc-aside {
	position: sticky;
	top: 24px;
	max-height: calc(100vh - 48px);
	overflow-y: auto;
	/* overflow clips at the edge: 4px left room so the first letters are never cut */
	margin-left: -4px;
	padding: 0 6px 24px 4px;
	scrollbar-width: thin;
}

#cm-doc-aside .search-doc {
	position: static;
	z-index: auto;
	width: auto;
	min-width: 0;
	padding: 0;
	margin: 0 0 22px;
}

#cm-doc-aside .search-doc form {
	position: relative;
	display: block;
	max-width: none;
	margin: 0;
}

#cm-doc-aside .search-doc .input-search {
	width: 100%;
	height: 48px;
	padding: 0 56px 0 16px;
	font-family: Poppins-Regular, sans-serif;
	font-size: 15px;
	color: #141b2d;
	background: #fff;
	border: 1px solid #d5dbe7;
	border-radius: 10px;
}

#cm-doc-aside .search-doc .input-search::placeholder {
	color: #6b7280;
}

#cm-doc-aside .search-doc .input-search:focus {
	border-color: #1649c1;
	outline: 2px solid rgba(22, 73, 193, 0.18);
	outline-offset: 0;
}

#cm-doc-aside .search-doc .submit-style {
	position: absolute;
	top: 0;
	right: 0;
	width: 48px;
	min-width: 0;
	height: 48px;
	margin: 0;
	line-height: 48px;
	color: #fff;
	background: #1649c1;
	border: 0;
	border-radius: 0 10px 10px 0;
}

#cm-doc-aside .search-doc .submit-style:hover {
	background: #0f3a9e;
}

#cm-doc-aside #datafetch .wrap-search {
	z-index: 30;
	border: 1px solid #d5dbe7;
	border-radius: 10px;
	box-shadow: 0 8px 24px rgba(20, 27, 45, 0.08);
}

#cm-doc-aside #datafetch .item-search a {
	padding: 10px 14px;
	font-size: 14px;
	color: #141b2d;
	border-bottom: 1px solid #eef1f6;
}

#cm-doc-aside #datafetch .item-search a:hover {
	color: #1649c1;
	background: #f6f8fc;
}

#cm-doc-aside #datafetch .wrap-search p {
	margin: 0;
	padding: 10px 14px;
	font-size: 14px;
	color: #6b7280;
}

/* The browse button is only for small screens */
#cm-doc-aside .cm-doc-browse {
	display: none;
}

/* ---------- Tree ---------- */
#cm-doc-aside .wedocs-sidebar {
	display: block;
	width: auto;
	padding: 0;
	border: 0;
}

#cm-doc-aside .wedocs-sidebar .widget-title,
#cm-doc-aside .wedocs-sidebar .wedocs-single-search-input,
#cm-doc-aside .wedocs-sidebar .wedocs-caret {
	display: none !important;
}

#cm-doc-aside ul.doc-nav-list,
#cm-doc-aside ul.doc-nav-list ul.children {
	margin: 0;
	padding: 0;
	list-style: none;
	border: 0;
}

#cm-doc-aside ul.doc-nav-list li {
	position: relative;
	margin: 0;
	padding: 0;
	list-style: none;
}

#cm-doc-aside ul.doc-nav-list li > a {
	display: block;
	/* weDocs sets margin-left: -1px on sub links, which pushed them past the edge */
	margin-left: 0;
	padding: 6px 34px 6px 0;
	font-family: Poppins-Regular, sans-serif;
	font-size: 14px;
	line-height: 1.45;
	color: #4b5563;
	text-decoration: none;
	background: none;
	border: 0;
	border-radius: 0;
}

#cm-doc-aside ul.doc-nav-list li > a::before,
#cm-doc-aside ul.doc-nav-list li > a::after {
	display: none;
}

#cm-doc-aside ul.doc-nav-list li > a:hover {
	color: #1649c1;
}

/* Closed sections */
#cm-doc-aside ul.doc-nav-list li.page_item_has_children:not(.cm-open) > ul.children {
	display: none;
}

/* Level 1: products */
#cm-doc-aside ul.doc-nav-list > li {
	border-top: 1px solid #e3e8f2;
}

#cm-doc-aside ul.doc-nav-list > li:first-child {
	border-top: 0;
}

#cm-doc-aside ul.doc-nav-list > li > a {
	padding-top: 12px;
	padding-bottom: 12px;
	font-family: Poppins-SemiBold, sans-serif;
	font-size: 15px;
	color: #141b2d;
}

#cm-doc-aside ul.doc-nav-list > li > ul.children {
	padding-bottom: 12px;
}

/* Level 2: chapters */
#cm-doc-aside ul.doc-nav-list > li > ul.children > li > a {
	font-family: Poppins-Medium, sans-serif;
	font-size: 14px;
	color: #141b2d;
}

/* Level 3: articles, on a thin rule */
#cm-doc-aside ul.doc-nav-list ul.children ul.children {
	margin: 2px 0 8px;
	border-left: 1px solid #e3e8f2;
}

#cm-doc-aside ul.doc-nav-list ul.children ul.children li > a {
	padding-left: 14px;
	font-size: 13.5px;
	color: #4b5563;
}

/* Current page and its parents */
#cm-doc-aside ul.doc-nav-list li.current_page_ancestor > a,
#cm-doc-aside ul.doc-nav-list li.current_page_parent > a {
	color: #1649c1;
}

#cm-doc-aside ul.doc-nav-list li.current_page_item > a {
	font-family: Poppins-SemiBold, sans-serif;
	color: #1649c1;
}

#cm-doc-aside ul.doc-nav-list ul.children ul.children li.current_page_item > a {
	margin-left: -1px;
	background: #f1f5fd;
	border-left: 2px solid #1649c1;
}

/* Chevron toggle (added by js/docs-single.js) */
#cm-doc-aside .cm-doc-toggle {
	position: absolute;
	top: 3px;
	right: 0;
	width: 28px;
	height: 28px;
	padding: 0;
	background: none;
	border: 0;
	cursor: pointer;
}

#cm-doc-aside ul.doc-nav-list > li > .cm-doc-toggle {
	top: 9px;
}

#cm-doc-aside .cm-doc-toggle::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 7px;
	height: 7px;
	margin: -5px 0 0 -4px;
	border-right: 1.5px solid #6b7280;
	border-bottom: 1.5px solid #6b7280;
	transform: rotate(45deg);
	transition: transform 0.15s;
}

#cm-doc-aside li.cm-open > .cm-doc-toggle::before {
	margin-top: -2px;
	transform: rotate(-135deg);
}

#cm-doc-aside .cm-doc-toggle:hover::before {
	border-color: #1649c1;
}

#cm-doc-aside .cm-doc-toggle:focus-visible {
	outline: 2px solid rgba(22, 73, 193, 0.35);
	border-radius: 10px;
}

/* ---------- Article ---------- */
#cm-doc-main {
	max-width: 780px;
}

#cm-doc-main ol.wedocs-breadcrumb {
	margin: 0 0 18px;
	padding: 0;
	font-family: Poppins-Regular, sans-serif;
	font-size: 13px;
	line-height: 1.5;
	color: #6b7280;
}

#cm-doc-main ol.wedocs-breadcrumb li {
	display: inline;
	margin: 0;
}

#cm-doc-main ol.wedocs-breadcrumb a {
	color: #6b7280;
}

#cm-doc-main ol.wedocs-breadcrumb a:hover {
	color: #1649c1;
}

#cm-doc-main ol.wedocs-breadcrumb li.delimiter {
	margin: 0 6px;
	font-size: 13px;
	color: #9ca3af;
	vertical-align: baseline;
}

#cm-doc-main ol.wedocs-breadcrumb li:last-child,
#cm-doc-main ol.wedocs-breadcrumb li:last-child span {
	color: #141b2d;
}

#cm-doc-main .entry-header {
	position: relative;
	margin: 0 0 20px;
	padding-right: 40px;
}

#cm-doc-main .entry-title {
	margin: 0;
	font-family: Poppins-Bold, sans-serif;
	font-size: 32px;
	line-height: 1.2;
	letter-spacing: 0;
	color: #141b2d;
}

#cm-doc-main article a.wedocs-print-article {
	top: 8px;
	opacity: 0.6;
}

#cm-doc-main article a.wedocs-print-article:hover {
	opacity: 1;
}

#cm-doc-main .entry-content p,
#cm-doc-main .entry-content li {
	font-size: 16px;
	line-height: 1.7;
	color: #2b3445;
}

#cm-doc-main .entry-content a {
	color: #1649c1;
	text-decoration: underline;
	text-decoration-color: rgba(22, 73, 193, 0.35);
	text-underline-offset: 3px;
}

#cm-doc-main .entry-content a:hover {
	text-decoration-color: #1649c1;
}

#cm-doc-main .entry-content h2 {
	margin: 36px 0 12px;
	font-family: Poppins-Bold, sans-serif;
	font-size: 24px;
	line-height: 1.3;
	color: #141b2d;
}

#cm-doc-main .entry-content h3 {
	margin: 30px 0 10px;
	font-family: Poppins-SemiBold, sans-serif;
	font-size: 20px;
	line-height: 1.35;
	color: #141b2d;
}

#cm-doc-main .entry-content h4 {
	margin: 28px 0 8px;
	font-family: Poppins-SemiBold, sans-serif;
	font-size: 18px;
	line-height: 1.35;
	color: #141b2d;
}

/* Lists, tables, code, images (moved from the inline style of the template) */
#cm-doc-main .entry-content ol {
	list-style: decimal outside !important;
	margin: 0 0 16px;
	padding: 0 0 0 26px !important;
}

#cm-doc-main .entry-content ul {
	list-style: disc outside !important;
	margin: 0 0 16px;
	padding: 0 0 0 26px !important;
}

#cm-doc-main .entry-content ul li {
	display: list-item !important;
	list-style: disc outside !important;
}

#cm-doc-main .entry-content ol li {
	display: list-item !important;
	list-style: decimal outside !important;
}

#cm-doc-main .entry-content li {
	margin: 0 0 8px;
	padding: 0;
}

#cm-doc-main .entry-content table {
	width: 100%;
	margin: 4px 0 20px;
	font-size: 14px;
	border-collapse: collapse;
}

#cm-doc-main .entry-content th,
#cm-doc-main .entry-content td {
	padding: 8px 10px;
	text-align: left;
	vertical-align: top;
	border: 1px solid #e3e8f2;
}

#cm-doc-main .entry-content th {
	font-family: Poppins-SemiBold, sans-serif;
	background: #f4f7fd;
}

#cm-doc-main .entry-content code {
	padding: 2px 6px;
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: 13.5px;
	color: #1649c1;
	white-space: nowrap;
	background: #eef2fb;
	border-radius: 4px;
}

#cm-doc-main .entry-content pre {
	margin: 0 0 16px;
	padding: 12px 14px;
	overflow: auto;
	font-size: 13.5px;
	line-height: 1.6;
	background: #f4f7fd;
	border: 1px solid #e3e8f2;
	border-radius: 10px;
}

#cm-doc-main .entry-content pre code {
	padding: 0;
	white-space: pre;
	background: none;
}

#cm-doc-main .entry-content figure.wp-block-image {
	margin: 18px 0 24px;
}

#cm-doc-main .entry-content figure img,
#cm-doc-main .entry-content img {
	max-width: 100%;
	height: auto;
	border: 1px solid #e3e8f2;
	border-radius: 10px;
	box-shadow: none;
}

/* ---------- "In this section" list ---------- */
#cm-doc-main .article-child {
	margin: 40px 0 0;
	padding: 0;
	color: #141b2d;
	background: #fff;
	border: 1px solid #e3e8f2;
	border-radius: 10px;
}

#cm-doc-main .article-child * {
	line-height: 1.45;
}

#cm-doc-main .article-child > h3 {
	margin: 0;
	padding: 16px 22px;
	font-family: Poppins-SemiBold, sans-serif;
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: #6b7280;
	border-bottom: 1px solid #e3e8f2;
}

#cm-doc-main .article-child ul,
#cm-doc-main .article-child ul li {
	margin: 0 !important;
	padding: 0 !important;
	list-style: none !important;
}

#cm-doc-main .article-child > ul > li {
	padding: 14px 22px !important;
	border-bottom: 1px solid #eef1f6;
}

#cm-doc-main .article-child > ul > li:last-child {
	border-bottom: 0;
}

#cm-doc-main .article-child > ul > li > a {
	display: inline-block;
	padding: 0;
	font-family: Poppins-SemiBold, sans-serif;
	font-size: 16px;
	color: #141b2d;
	text-decoration: none;
}

#cm-doc-main .article-child > ul > li > a:hover {
	color: #1649c1;
}

#cm-doc-main .article-child ul.children {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 2px 24px;
	margin-top: 8px !important;
}

#cm-doc-main .article-child ul.children a {
	display: block;
	padding: 3px 0;
	font-size: 14.5px;
	color: #4b5563;
	text-decoration: none;
}

#cm-doc-main .article-child ul.children a:hover {
	color: #1649c1;
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* ---------- Previous / next ---------- */
#cm-doc-main .wedocs-doc-nav {
	display: flex;
	gap: 16px;
	margin: 40px 0 0;
	padding: 0;
	border: 0;
}

/* weDocs adds a clearfix ::before/::after that would take a flex slot */
#cm-doc-main .wedocs-doc-nav::before,
#cm-doc-main .wedocs-doc-nav::after {
	display: none;
}

#cm-doc-main .wedocs-doc-nav .nav-prev,
#cm-doc-main .wedocs-doc-nav .nav-next {
	flex: 1 1 0;
	float: none;
	max-width: 50%;
}

#cm-doc-main .wedocs-doc-nav .nav-next {
	margin-left: auto;
	text-align: right;
}

#cm-doc-main .wedocs-doc-nav a {
	display: block;
	padding: 14px 18px 16px;
	font-family: Poppins-SemiBold, sans-serif;
	font-size: 15px;
	line-height: 1.4;
	color: #1649c1;
	text-decoration: none;
	background: #fff;
	border: 1px solid #e3e8f2;
	border-radius: 10px;
}

#cm-doc-main .wedocs-doc-nav a:hover {
	border-color: #1649c1;
}

#cm-doc-main .wedocs-doc-nav .nav-prev a::before,
#cm-doc-main .wedocs-doc-nav .nav-next a::before {
	display: block;
	margin-bottom: 2px;
	font-family: Poppins-Regular, sans-serif;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: #6b7280;
}

#cm-doc-main .wedocs-doc-nav .nav-prev a::before {
	content: "Previous";
}

#cm-doc-main .wedocs-doc-nav .nav-next a::before {
	content: "Next";
}

#cm-doc-main .wedocs-entry-footer {
	padding-top: 32px;
}

/* ---------- Responsive ---------- */
@media (max-width: 1199px) {
	#cm-doc {
		grid-template-columns: 250px minmax(0, 1fr);
		gap: 40px;
	}
}

@media (max-width: 991px) {
	/* weDocs adds 30px side padding on small screens, on top of the container */
	#cm-doc {
		grid-template-columns: minmax(0, 1fr);
		gap: 24px;
		padding: 0;
	}

	#cm-doc-aside {
		position: static;
		max-height: none;
		overflow: visible;
		margin-left: 0;
		padding: 0;
	}

	#cm-doc-aside .search-doc {
		margin-bottom: 12px;
	}

	#cm-doc-aside .cm-doc-browse {
		position: relative;
		display: block;
		width: 100%;
		padding: 13px 44px 13px 16px;
		font-family: Poppins-SemiBold, sans-serif;
		font-size: 15px;
		text-align: left;
		color: #141b2d;
		background: #fff;
		border: 1px solid #d5dbe7;
		border-radius: 10px;
		cursor: pointer;
	}

	#cm-doc-aside .cm-doc-browse::after {
		content: "";
		position: absolute;
		top: 50%;
		right: 18px;
		width: 8px;
		height: 8px;
		margin-top: -6px;
		border-right: 1.5px solid #6b7280;
		border-bottom: 1.5px solid #6b7280;
		transform: rotate(45deg);
	}

	#cm-doc-aside.cm-nav-open .cm-doc-browse {
		border-radius: 10px 10px 0 0;
	}

	#cm-doc-aside.cm-nav-open .cm-doc-browse::after {
		margin-top: -2px;
		transform: rotate(-135deg);
	}

	/* weDocs and the theme hide the sidebar on mobile: show it inside the panel */
	#cm-doc-aside .cm-doc-nav {
		display: none;
		padding: 4px 16px 8px;
		background: #fff;
		border: 1px solid #d5dbe7;
		border-top: 0;
		border-radius: 0 0 10px 10px;
	}

	#cm-doc-aside.cm-nav-open .cm-doc-nav {
		display: block;
	}

	#cm-doc-aside .wedocs-sidebar.wedocs-hide-mobile {
		display: block !important;
	}

	#cm-doc-aside ul.doc-nav-list li > a {
		padding-top: 9px;
		padding-bottom: 9px;
	}

	#cm-doc-aside .cm-doc-toggle {
		top: 6px;
		width: 34px;
		height: 34px;
	}
}

@media (max-width: 767px) {
	#cm-doc-main .entry-title {
		font-size: 26px;
	}

	#cm-doc-main .article-child ul.children {
		grid-template-columns: minmax(0, 1fr);
	}

	#cm-doc-main .article-child ul.children a {
		padding: 6px 0;
	}

	#cm-doc-main .wedocs-doc-nav {
		flex-direction: column;
		gap: 10px;
	}

	#cm-doc-main .wedocs-doc-nav .nav-prev,
	#cm-doc-main .wedocs-doc-nav .nav-next {
		flex: none;
		width: 100%;
		max-width: none;
		margin-left: 0;
	}
}
