.content {
	width: 100%;
	margin: 0;
	padding: var(--top-offset) var(--side-nav);
	tab-size: 2;
	-moz-tab-size: 2;
}

@media (min-width: 832px) {
	/* can't use vars in @media :( */
	.content {
		padding-left: calc(var(--sidebar-w) + var(--side-nav));
	}
}

.content h1 {
	font-size: 3.2rem;
	margin: 0;
}

.content h2 {
	margin-top: 8rem;
	padding: 2rem 1.6rem 4rem 0.2rem;
	border-top: 2px solid #ddd;
	line-height: 1;
	font-size: var(--h3);
	letter-spacing: 0.05em;
	text-transform: uppercase;
}

.content section:first-of-type > h2 {
	margin-top: 0;
}

.content .anchor {
	position: absolute;
	display: block;
	background: url(@sveltejs/site-kit/icons/link.svg) 0 50% no-repeat;
	background-size: 1em 1em;
	width: 1.4em;
	height: 1em;
	left: -1.3em;
	bottom: 0.3rem;
	opacity: 0;
	transition: opacity 0.2s;
	user-select: none;
}

.content h2 .anchor {
	bottom: 4rem;
}

.content h3 .anchor {
	bottom: 1rem;
}

@media (min-width: 400px) {
	.content h1 {
		font-size: 4.2rem;
	}
}

@media (min-width: 768px) {
	.content h1 {
		font-size: 5.4rem;
	}

	.content .anchor:focus,
	.content h2:hover .anchor,
	.content h3:hover .anchor,
	.content h4:hover .anchor,
	.content h5:hover .anchor,
	.content h6:hover .anchor {
		opacity: 1;
	}
}

.content h3 {
	margin: 7rem 0 1rem -1rem;
	padding-bottom: 1rem;
	color: var(--heading);
	max-width: var(--linemax);
	border-bottom: 1px solid #ddd;
	line-height: 1;
}

.content h4 {
	font-weight: 400;
	font-size: 2rem;
	color: var(--heading);
	margin: 5rem 0 1.6rem -1rem;
	padding-left: 0;
	line-height: 1;
	padding-top: 0;
	top: 0;
}

.content h3 + h4 {
	margin-top: 2.5rem !important;
}

.content h3 > code,
.content h4 code {
	background: transparent;
	color: inherit;
	font-family: inherit;
	top: 0;
	margin: 0;
	padding: 0;
	border-radius: 0 0 0 0;
	font-size: inherit;
}

.content h2,
.content h3,
.content h4 {
	scroll-margin-top: calc(var(--nav-h) + 4rem);
}

.content h4 > em {
	opacity: 0.7;
}

.content h5 {
	font-size: 2.4rem;
	margin: 2em 0 0.5em 0;
}

.content code {
	padding: 0.2rem 0.4rem;
	margin: 0 0.2rem;
	top: -0.1rem;
	background: var(--back-api);
}

.content pre code {
	padding: 0;
	margin: 0;
	top: 0;
	background: transparent;
}

.content pre {
	margin: 0;
	margin-bottom: 2rem;
	width: 100%;
	max-width: var(--linemax);
	padding: 1rem;
	box-shadow: inset 1px 1px 6px hsla(205.7, 63.6%, 30.8%, 0.06);
}

.content table {
	margin: 0;
	margin-bottom: 2em;
	max-width: var(--linemax);
}

.content section {
	padding: 0 0 0 1rem;
}

.content section p {
	font-size: 1.6rem;
	max-width: var(--linemax);
	margin: 1em 0;
}

.content small {
	font-size: var(--h5);
	float: right;
	pointer-events: all;
	color: var(--prime);
	cursor: pointer;
}

.content blockquote {
	color: rgba(0, 0, 0, 0.7);
	background-color: rgba(255, 62, 0, 0.1);
	border-left: 4px solid #ff3e00;
	padding: 1rem;
}

.content blockquote :first-child {
	margin-top: 0;
}

.content blockquote :last-child {
	margin-bottom: 0;
}

.content blockquote code {
	background: #d5e2ea;
}

.content blockquote pre code {
	background: transparent;
}

.content section a:hover {
	text-decoration: underline;
}

.content section a code {
	color: inherit;
	background: rgba(255, 62, 0, 0.1) !important;
}

.content ul ul {
	margin-bottom: 0;
}

.content ul > li {
	margin: 0.5em 0 !important;
}

/** hacky overrides to allow filenames inside code blocks —
    TODO change the CSS in site-kit so we can get rid of this */
.code-block {
	background-color: var(--code-bg);
	color: var(--code-base);
	border-radius: 0.5rem;
	margin: 0 0 2rem 0;
	font-size: 14px;
	max-width: var(--linemax);
	box-shadow: inset 1px 1px 6px hsla(205.7, 63.6%, 30.8%, 0.06);
	overflow: hidden;
}

.code-block pre {
	background-color: transparent;
	margin: 0;
	box-shadow: none;
}

.code-block h5 {
	font-family: var(--font-mono);
	font-size: 1.2rem;
	font-weight: 400;
	padding: 1rem 1rem 0.8rem 1rem;
	margin: 0;
	color: var(--text);
	background: var(--back-api);
	border-radius: var(--border-r) var(--border-r) 0 0;
	box-shadow: 0 1px 6px hsla(205.7, 63.6%, 30.8%, 0.06);
}

.code-block a {
	border-bottom: 1px dotted var(--prime);
}

.code-block a:hover {
	border-bottom: 1px solid var(--prime);
	text-decoration: none !important;
}

/** TODO another thing that belongs in site-kit */
pre.language-diff code {
	color: rgba(0, 0, 0, 0.4);
}

.language-diff .inserted,
.language-diff .deleted {
	position: relative;
}

.language-diff .inserted {
	color: hsl(120, 100%, 25%);
}

.language-diff .deleted {
	color: hsl(2, 80%, 47%);
	user-select: none;
}

.language-diff .inserted::before,
.language-diff .deleted::before {
	position: absolute;
	left: -0.6rem;
	top: -0.2rem;
	font-size: 1.2rem;
}

.language-diff .inserted::before {
	content: '+';
}

.language-diff .deleted::before {
	content: '-';
}

/** make long comments wrap on mobile */
.token.comment.wrapped {
	display: block;
	white-space: pre-wrap;
	padding-left: calc(var(--indent) + 2ch);
	text-indent: calc(-1 * var(--indent) - 2ch);
	min-height: 1.35em;
}
