/* Documentation: rendered inside the forum layout, everything is scoped to .dc-wrap
   and inherits fonts and text colour from the forum theme. */

.dc-wrap {
	--dc-heading: currentColor;
	--dc-muted: color-mix(in srgb, currentColor 62%, transparent);
	--dc-accent: #2f6fdc;
	--dc-accent-bg: color-mix(in srgb, #2f6fdc 12%, transparent);
	--dc-border: color-mix(in srgb, currentColor 16%, transparent);
	--dc-code-bg: color-mix(in srgb, currentColor 7%, transparent);

	margin: 20px 0 40px;
	line-height: 1.6;
}

.dc-wrap *, .dc-wrap *::before, .dc-wrap *::after { box-sizing: border-box; }

.dc-wrap a { color: var(--dc-accent); text-decoration: none; }
.dc-wrap a:hover { text-decoration: underline; }

.dc-layout {
	display: grid;
	grid-template-columns: 270px minmax(0, 1fr);
	gap: 0 32px;
	align-items: start;
}

/* ---- Sidebar ---- */
.dc-side-in {
	position: sticky;
	top: 16px;
	max-height: calc(100vh - 32px);
	overflow-y: auto;
	padding: 4px 8px 16px 0;
}

.dc-brand {
	display: block;
	margin-bottom: 14px;
	font-size: 18px;
	font-weight: 700;
	color: var(--dc-heading) !important;
}
.dc-brand:hover { text-decoration: none !important; }

.dc-wrap .dc-search {
	width: 100%;
	height: auto;
	padding: 8px 12px;
	margin-bottom: 16px;
	border: 1px solid var(--dc-border);
	border-radius: 8px;
	background: transparent;
	color: inherit;
	font: inherit;
	font-size: 14px;
}
.dc-wrap .dc-search:focus { outline: 2px solid var(--dc-accent); outline-offset: -1px; }

.dc-group { margin-top: 24px; }
.dc-group-title {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 6px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: var(--dc-heading);
}

.dc-wrap .dc-list, .dc-wrap .dc-sub { list-style: none; margin: 0; padding: 0; }
.dc-wrap .dc-sub { display: none; padding-left: 14px; }
.dc-wrap .dc-item.open > .dc-sub { display: block; }

.dc-item { position: relative; margin: 0; }
.dc-wrap .dc-link {
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
	padding: 7px 28px 7px 0;
	border: 0;
	background: none;
	text-align: left;
	font: inherit;
	font-size: 14px;
	color: var(--dc-muted);
	cursor: pointer;
}
.dc-wrap .dc-link:hover { color: var(--dc-heading); text-decoration: none; }
.dc-wrap .dc-item.active > .dc-link { color: var(--dc-accent); font-weight: 600; }

.dc-wrap .dc-toggle {
	position: absolute;
	right: 0;
	top: 3px;
	width: 28px;
	height: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 0;
	background: none;
	color: var(--dc-muted);
	cursor: pointer;
}
.dc-chev { position: absolute; right: 6px; transition: transform .15s; }
.dc-toggle .dc-chev { position: static; }
.dc-item.open > .dc-toggle .dc-chev,
.dc-item.open > .dc-toggle-row .dc-chev { transform: rotate(90deg); }

.dc-icon { flex: none; }

.dc-back {
	display: inline-block;
	margin-top: 24px;
	font-size: 13px;
}

/* ---- Main ---- */
.dc-main { min-width: 0; }
.dc-article { max-width: none; }

.dc-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 24px;
}
.dc-wrap .dc-head h1 {
	display: flex;
	align-items: center;
	gap: 14px;
	margin: 0;
	font-size: 34px;
	line-height: 1.2;
	color: var(--dc-heading);
}
.dc-head h1 .dc-icon { width: 32px; height: 32px; color: var(--dc-muted); }

.dc-copy { position: relative; display: flex; flex: none; }
.dc-wrap .dc-copy-btn, .dc-wrap .dc-copy-more {
	height: auto;
	border: 1px solid var(--dc-border);
	background: transparent;
	color: var(--dc-muted);
	font: inherit;
	font-size: 13px;
	line-height: 1.4;
	padding: 5px 12px;
	cursor: pointer;
}
.dc-wrap .dc-copy-btn { border-radius: 8px 0 0 8px; }
.dc-wrap .dc-copy-more { border-left: 0; border-radius: 0 8px 8px 0; padding: 5px 8px; }
.dc-wrap .dc-copy-btn:hover, .dc-wrap .dc-copy-more:hover { color: var(--dc-heading); }
.dc-copy-menu {
	display: none;
	position: absolute;
	right: 0;
	top: calc(100% + 6px);
	z-index: 5;
	min-width: 190px;
	padding: 6px;
	background: #fff;
	color: #1f2933;
	border: 1px solid #e5e8ee;
	border-radius: 8px;
	box-shadow: 0 6px 20px rgba(16, 24, 40, .15);
}
.dc-copy.open .dc-copy-menu { display: block; }
.dc-wrap .dc-copy-menu button {
	display: block;
	width: 100%;
	padding: 8px 10px;
	border: 0;
	border-radius: 6px;
	background: none;
	color: inherit;
	font: inherit;
	font-size: 13px;
	text-align: left;
	cursor: pointer;
}
.dc-wrap .dc-copy-menu button:hover { background: #eef4ff; }

/* ---- Content ---- */
.dc-content { font-size: 16px; line-height: 1.7; overflow-wrap: anywhere; }
.dc-wrap .dc-content h2, .dc-wrap .dc-content h3, .dc-wrap .dc-content h4 { color: var(--dc-heading); line-height: 1.3; }
.dc-wrap .dc-content h2 { font-size: 26px; margin: 40px 0 16px; }
.dc-wrap .dc-content h3 { font-size: 20px; margin: 30px 0 12px; }
.dc-wrap .dc-content h4 { font-size: 17px; margin: 22px 0 10px; }
.dc-content > :first-child { margin-top: 0 !important; }
.dc-wrap .dc-content p { margin: 0 0 16px; }
.dc-wrap .dc-content ul, .dc-wrap .dc-content ol { margin: 0 0 16px; padding-left: 24px; }
.dc-wrap .dc-content li { margin: 4px 0; }
.dc-wrap .dc-content img { max-width: 100%; height: auto; border-radius: 6px; }
.dc-wrap .dc-content code {
	padding: 2px 6px;
	border-radius: 5px;
	background: var(--dc-code-bg);
	font: 13.5px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.dc-wrap .dc-content pre {
	margin: 0 0 18px;
	padding: 14px 16px;
	overflow-x: auto;
	border-radius: 8px;
	background: var(--dc-code-bg);
}
.dc-wrap .dc-content pre code { padding: 0; background: none; }
.dc-wrap .dc-content blockquote {
	margin: 0 0 16px;
	padding: 4px 16px;
	border-left: 3px solid var(--dc-accent);
	color: var(--dc-muted);
}
.dc-wrap .dc-content table { width: 100%; margin: 0 0 18px; border-collapse: collapse; font-size: 14.5px; }
.dc-wrap .dc-content th, .dc-wrap .dc-content td { padding: 8px 12px; border: 1px solid var(--dc-border); text-align: left; }
.dc-wrap .dc-content th { background: var(--dc-code-bg); }
.dc-wrap .dc-content hr { border: 0; border-top: 1px solid var(--dc-border); margin: 28px 0; }

/* ---- Prev / next ---- */
.dc-pager {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
	margin-top: 56px;
}
.dc-wrap .dc-pager a {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 16px 18px;
	border: 1px solid var(--dc-border);
	border-radius: 10px;
	color: var(--dc-heading);
}
.dc-wrap .dc-pager a:hover { border-color: var(--dc-accent); text-decoration: none; }
.dc-pager em { display: block; font-style: normal; font-size: 12px; color: var(--dc-muted); }
.dc-pager-next { justify-content: flex-end; text-align: right; }

.dc-burger { display: none; }

/* ---- Responsive ---- */

@media (max-width: 820px) {
	.dc-layout { display: block; }
	.dc-wrap .dc-burger {
		display: inline-flex;
		align-items: center;
		gap: 8px;
		margin-bottom: 16px;
		padding: 8px 14px;
		border: 1px solid var(--dc-border);
		border-radius: 8px;
		background: transparent;
		color: inherit;
		font: inherit;
		font-size: 14px;
		cursor: pointer;
	}
	.dc-side { display: none; margin-bottom: 24px; }
	.dc-wrap.dc-menu-open .dc-side { display: block; }
	.dc-side-in { position: static; max-height: none; }
	.dc-wrap .dc-head h1 { font-size: 26px; }
	.dc-pager { grid-template-columns: 1fr; }
}
