/* The user guide's only stylesheet. Colors follow the app's tokens (src/routes/layout.css). */

:root {
	--background: #ffffff;
	--foreground: #0a0a0a;
	--muted: #f5f5f5;
	--muted-foreground: #737373;
	--border: #e5e5e5;
	--accent: #00786f;
	--accent-soft: #f0fdfa;
	--radius: 0.625rem;
	color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
	:root {
		--background: #0a0a0a;
		--foreground: #fafafa;
		--muted: #171717;
		--muted-foreground: #a3a3a3;
		--border: rgb(255 255 255 / 10%);
		--accent: #46ecd5;
		--accent-soft: rgb(70 236 213 / 8%);
	}
}

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

html {
	-webkit-text-size-adjust: 100%;
	scroll-padding-top: 4.5rem;
}

body {
	margin: 0;
	background: var(--background);
	color: var(--foreground);
	font:
		16px/1.65 system-ui,
		-apple-system,
		'Segoe UI',
		Roboto,
		sans-serif;
}

a {
	color: var(--accent);
	text-underline-offset: 2px;
}

img {
	max-width: 100%;
	height: auto;
}

.skip {
	position: absolute;
	left: -9999px;
}

.skip:focus {
	left: 1rem;
	top: 0.5rem;
	z-index: 10;
	background: var(--background);
	padding: 0.5rem 0.75rem;
}

.top {
	position: sticky;
	top: 0;
	z-index: 5;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.75rem 1rem;
	background: var(--background);
	border-bottom: 1px solid var(--border);
}

.brand {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	color: var(--foreground);
	font-weight: 600;
	text-decoration: none;
}

.open {
	padding: 0.4rem 0.8rem;
	border-radius: var(--radius);
	background: var(--accent);
	color: var(--background);
	font-size: 0.875rem;
	font-weight: 500;
	text-decoration: none;
	white-space: nowrap;
}

.layout {
	max-width: 72rem;
	margin: 0 auto;
	padding: 0 1rem 3rem;
}

aside {
	padding: 1rem 0;
	border-bottom: 1px solid var(--border);
}

/* Phones fold the page list away; desktops keep it open beside the page. */
.desktop {
	display: none;
}

@media (min-width: 768px) {
	.desktop {
		display: block;
	}
}

.contents summary {
	cursor: pointer;
	font-weight: 600;
}

.contents ol {
	margin: 0.5rem 0 0;
	padding: 0;
	list-style: none;
}

.contents a {
	display: block;
	padding: 0.3rem 0.6rem;
	border-radius: calc(var(--radius) - 2px);
	color: var(--foreground);
	text-decoration: none;
}

.contents a:hover {
	background: var(--muted);
}

.contents a[aria-current] {
	background: var(--accent-soft);
	color: var(--accent);
	font-weight: 600;
}

.languages {
	display: flex;
	gap: 0.75rem;
	margin-top: 0.75rem;
	font-size: 0.875rem;
}

.languages a {
	color: var(--muted-foreground);
}

.languages a[aria-current] {
	color: var(--foreground);
	font-weight: 600;
	text-decoration: none;
}

main {
	min-width: 0;
	max-width: 46rem;
}

h1 {
	margin: 1.5rem 0 1rem;
	font-size: 2rem;
	line-height: 1.2;
}

h2 {
	margin: 2.5rem 0 0.75rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--border);
	font-size: 1.4rem;
	line-height: 1.3;
}

h3 {
	margin: 1.75rem 0 0.5rem;
	font-size: 1.1rem;
}

h2 .anchor,
h3 .anchor {
	color: inherit;
	text-decoration: none;
}

h2 .anchor:hover::after,
h3 .anchor:hover::after {
	content: ' #';
	color: var(--muted-foreground);
}

code {
	padding: 0.1rem 0.35rem;
	border-radius: 0.3rem;
	background: var(--muted);
	font-size: 0.9em;
}

blockquote {
	margin: 1.25rem 0;
	padding: 0.75rem 1rem;
	border-left: 3px solid var(--accent);
	border-radius: 0 var(--radius) var(--radius) 0;
	background: var(--accent-soft);
}

blockquote p {
	margin: 0;
}

blockquote p + p {
	margin-top: 0.5rem;
}

table {
	display: block;
	overflow-x: auto;
	border-collapse: collapse;
	margin: 1rem 0;
	font-size: 0.9rem;
}

th,
td {
	padding: 0.5rem 0.75rem;
	border: 1px solid var(--border);
	text-align: left;
	vertical-align: top;
}

th {
	background: var(--muted);
}

main img {
	display: block;
	margin: 1.25rem 0;
	border: 1px solid var(--border);
	border-radius: var(--radius);
}

.toc {
	margin: 1rem 0 2rem;
	padding: 0.75rem 1rem;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	font-size: 0.925rem;
}

.toc p {
	margin: 0 0 0.25rem;
	color: var(--muted-foreground);
	font-weight: 600;
}

.toc ul {
	margin: 0;
	padding-left: 1.1rem;
}

.pager {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	margin-top: 3rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--border);
}

.pager a {
	display: grid;
	gap: 0.1rem;
	text-decoration: none;
}

.pager a span {
	color: var(--muted-foreground);
	font-size: 0.8rem;
}

.pager .next {
	text-align: right;
}

@media (min-width: 768px) {
	.layout {
		display: grid;
		grid-template-columns: 15rem minmax(0, 1fr);
		gap: 3rem;
		padding: 0 2rem 4rem;
	}

	aside {
		position: sticky;
		top: 4rem;
		align-self: start;
		max-height: calc(100vh - 4rem);
		overflow-y: auto;
		border-bottom: 0;
		padding-top: 1.5rem;
	}

	.phone {
		display: none;
	}
}
