/* Pidgeroo DevHub manual. Colours and type follow DevHub (src/lib/styles/app.css). */
:root {
	--bg: #e3dedb;
	--surface: #f6f3f1;
	--surface-2: #ece7e4;
	--ink: #241e30;
	--ink-2: #5e5468;
	--ink-3: #7d7386;
	--line: #d6cfcf;
	--accent: #5f4d86;
	--accent-soft: color-mix(in srgb, var(--accent) 12%, var(--surface));
	--amber: #946022;
	--green: #3d6b3f;
	--font-display: 'Faculty Glyphic', Georgia, serif;
	--font-body: 'Public Sans', system-ui, -apple-system, sans-serif;
	--font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
	--radius: 10px;
}
@media (prefers-color-scheme: dark) {
	:root {
		--bg: #16142c;
		--surface: #1e1b3a;
		--surface-2: #25223f;
		--ink: #eeeaf4;
		--ink-2: #bcb4cb;
		--ink-3: #8d86a3;
		--line: #302b50;
		--accent: #b9a7ea;
		--amber: #d9a45c;
		--green: #8cc48e;
	}
}

* {
	box-sizing: border-box;
}
html {
	scroll-padding-top: 1rem;
}
body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font: 16px/1.6 var(--font-body);
}
a {
	color: var(--accent);
}

.layout {
	display: grid;
	grid-template-columns: 250px minmax(0, 1fr);
	min-height: 100vh;
}

/* ---- sidebar (filled in by manual.js) ---- */
.sidebar {
	position: sticky;
	top: 0;
	height: 100vh;
	overflow-y: auto;
	padding: 1.25rem 0.9rem;
	background: var(--surface);
	border-right: 1px solid var(--line);
}
.brand {
	display: block;
	font-family: var(--font-display);
	font-size: 1.25rem;
	color: var(--ink);
	text-decoration: none;
	padding: 0 0.5rem 1rem;
}
.brand small {
	display: block;
	font-family: var(--font-body);
	font-size: 0.72rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--ink-3);
}
.sidebar h2 {
	margin: 1rem 0.5rem 0.3rem;
	font: 600 0.72rem var(--font-body);
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--ink-3);
}
.sidebar a {
	display: block;
	padding: 0.35rem 0.6rem;
	border-radius: 6px;
	color: var(--ink-2);
	text-decoration: none;
	font-size: 0.93rem;
}
.sidebar a:hover {
	color: var(--ink);
	background: var(--surface-2);
}
.sidebar a[aria-current='page'] {
	color: var(--accent);
	background: var(--accent-soft);
	font-weight: 600;
}

/* ---- content ---- */
main {
	max-width: 860px;
	padding: 2.5rem 2.5rem 4rem;
}
h1,
h2,
h3 {
	font-family: var(--font-display);
	font-weight: 400;
	line-height: 1.2;
}
h1 {
	font-size: 2.3rem;
	margin: 0 0 0.4rem;
}
.lede {
	color: var(--ink-2);
	font-size: 1.1rem;
	margin: 0 0 2rem;
}
h2 {
	font-size: 1.55rem;
	margin: 2.5rem 0 0.6rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--line);
}
h3 {
	font-size: 1.2rem;
	margin: 1.6rem 0 0.4rem;
}
p,
ul,
ol,
table {
	margin: 0 0 1rem;
}
li {
	margin: 0.2rem 0;
}
code {
	font-family: var(--font-mono);
	font-size: 0.88em;
	padding: 0.1em 0.35em;
	border-radius: 4px;
	background: var(--surface-2);
}
pre {
	overflow-x: auto;
	padding: 0.9rem 1rem;
	border-radius: var(--radius);
	background: var(--surface);
	border: 1px solid var(--line);
	font-size: 0.85rem;
	line-height: 1.5;
}
pre code {
	padding: 0;
	background: none;
}
.ui {
	/* A label as it appears in DevHub */
	font-weight: 600;
}
table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.93rem;
	background: var(--surface);
	border-radius: var(--radius);
	overflow: hidden;
}
th,
td {
	text-align: left;
	vertical-align: top;
	padding: 0.55rem 0.75rem;
	border-bottom: 1px solid var(--line);
}
th {
	font-weight: 600;
	color: var(--ink-2);
	background: var(--surface-2);
}
tr:last-child td {
	border-bottom: 0;
}
figure {
	margin: 1.25rem 0 1.75rem;
}
figure img {
	display: block;
	max-width: 100%;
	height: auto;
	border-radius: var(--radius);
	border: 1px solid var(--line);
	box-shadow: 0 2px 12px rgb(36 30 48 / 0.08);
}
figcaption {
	margin-top: 0.5rem;
	color: var(--ink-3);
	font-size: 0.88rem;
}
.note,
.tip {
	margin: 1.25rem 0;
	padding: 0.8rem 1rem;
	border-radius: var(--radius);
	border-left: 4px solid var(--accent);
	background: var(--accent-soft);
}
.tip {
	border-left-color: var(--green);
	background: color-mix(in srgb, var(--green) 10%, var(--surface));
}
.note strong:first-child,
.tip strong:first-child {
	display: block;
	margin-bottom: 0.15rem;
}
.note p:last-child,
.tip p:last-child {
	margin-bottom: 0;
}
.pager {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	margin-top: 3rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--line);
}
.pager a {
	text-decoration: none;
}
.pager small {
	display: block;
	color: var(--ink-3);
}

/* ---- small screens: sidebar on top ---- */
@media (max-width: 820px) {
	.layout {
		grid-template-columns: minmax(0, 1fr);
	}
	.sidebar {
		position: static;
		height: auto;
		border-right: 0;
		border-bottom: 1px solid var(--line);
	}
	.sidebar nav {
		display: flex;
		flex-wrap: wrap;
		gap: 0.2rem;
	}
	.sidebar h2 {
		width: 100%;
	}
	main {
		padding: 1.5rem 1rem 3rem;
	}
	h1 {
		font-size: 1.9rem;
	}
}
