/* Global styles */
:root {
	--main-text-colour: #EEEEEE;
	--link-colour: #58A6FF;
	--border-colour: #1C2229;
}

html {
	height: 100%;
	scrollbar-gutter: stable;
}

body {
	background: #151515;
	color: var(--main-text-colour);

	font-family: "Segoe UI", "Roboto", "Helvetica", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji";
	font-size: 16px;
}

img, video {
	max-width: 100%;
}

iframe {
	width: 100%;
	aspect-ratio: 16 / 10;
}

.mono-font {
	font-family: "JetBrains Mono", "ui-monospace", "SFMono-Regular", "SF Mono", "Menlo", "Consolas", "Liberation Mono", monospace;
}

h1, h2, h3, h4, h5, h6, .card {
	scroll-margin-top: 2em;
}

h1, h2, h3 {
	padding-bottom: 4px;
	border-bottom: solid 1px;
}

h2 > a.link,
h3 > a.link,
h4 > a.link {
	display: none;
	text-decoration: none;
}
/* These are emoji (🔗) which don't look good with a normal underline, so we do a full outline instead */
.link:hover {
	--radius: 0.03em;
	---radius: calc(-1 * var(--radius));
	--blur: 0.03em;
	text-shadow: var(---radius) var(---radius) var(--blur) var(--link-colour),
	0 var(---radius) var(--blur) var(--link-colour),
	var(--radius) var(---radius) var(--blur) var(--link-colour),
	var(--radius) 0 var(--blur) var(--link-colour),
	var(--radius) var(--radius) var(--blur) var(--link-colour),
	0 var(--radius) var(--blur) var(--link-colour),
	var(---radius) var(--radius) var(--blur) var(--link-colour),
	var(---radius) 0 var(--blur) var(--link-colour);
}

/* Anchor point for the link emoji */
h2, h3, h4 {
	position: relative;
}

h2:hover > a.link,
h3:hover > a.link,
h4:hover > a.link,
.card:hover a.link {
	display: inline;
	font-size: 0.7em;
	margin-left: 0.3em;
	position: absolute; /*do not actually take up any space, to prevent layout shifts*/
	top: 0.2em;
}
/* h2 needs a bit more offset */
h2:hover > a.link {
	top: 0.3em;
}

main, h1, h2, h3, .card {
	border-color: var(--border-colour) !important;
}

img, video, .badge {
	border-radius: 3px;
}

a, a:visited {
	color: var(--link-colour);
	text-decoration: none;
}

a:hover, a:focus-within {
	text-decoration: underline;
}

.stealth-link {
	color: var(--main-text-colour) !important;
}

summary {
	cursor: pointer;
	color: #aaaaaa;
}

/* Specific styles */
body {
	max-width: 1280px;
	margin: auto;
	padding: 0 2px;

	/* Push footer to bottom */
	min-height: 100%;
	display: flex;
	flex-direction: column;
}

header {
	display: flex;
	justify-content: space-between;

	font-size: 16px;
	padding: 12px 4px 10px;
}

/* For very thin screens, put the items in the header below each other */
@media screen and (max-width: 300px) {
	header {
		flex-direction: column;
		gap: 0.5em;
		align-items: center;
	}
}

header > nav {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
}

span.small {
	font-size: 12px;
	color: #8B949E;
}

header > nav > span.small {
	padding: 0 4px;
}

header > nav > span.small:last-child {
	padding: 0;
}

h1 {
	margin-top: 0;
}

main {
	/* Push footer to bottom */
	flex-grow: 1;

	margin: auto;
	padding: 24px;

	/* Prevent pages with little content from being thin */
	width: 100%;
	box-sizing: border-box;

	border: solid 2px;
	border-radius: 6px;
}

footer {
	text-align: right;
	font-size: 14px;
}

pre, :not(pre) > code {
	background-color: #333;
	border-radius: 4px;
	overflow-x: auto;
	tab-size: 4;
}

pre { padding: 1em 1.25em; }

:not(pre) > code { padding: 0.2em 0.4em; }

/* Tag colours */
/* Language colours from: https://github.com/github-linguist/linguist/blob/main/lib/linguist/languages.yml */
.tags > .Android {color: #32DE84;}
.tags > .AutoHotKey {color: #6594B9;}
.tags > .C {color: #555555;}
.tags > .Cpp {color: #F34B7D;}
.tags > .Cs {color: #178600;}
.tags > .Dart {color: #00B4AB;}
.tags > .Fonts {color: #A7C957;}
.tags > .Flutter {color: #02569B;}
.tags > .GXP-Engine {color: #8F70B8;}
.tags > .Java {color: #B07219;}
.tags > .JavaScript {color: #F1E05A;}
.tags > .Processing {color: #0096D8;}
.tags > .Python {color: #3572A5;}
.tags > .Stylus {color: #FF6347;}
.tags > .BlueMap {color: #006EDE;}
.tags > .Minecraft {color: #3CA92E;}
.tags > .CSS {color: #663399;}
.tags > .HTML {color: #e34c26;}
.tags > .Prize {color: #FFD701;}
.tags > .Premake, .tags > .Lua {color: #000080;}
.tags > .SFML {color: #8BC34B;}
.tags > .p5js {color: #ED225D;}
.tags > .Vulkan {color: #AC162C;}
.tags > .SDL_GPU {color: #6595b6;}
.tags > .Unreal-Engine {color: #313b7e;}
.tags > .Unity {color: #888888;}
.tags > .GitHub {color: #888888;}
.tags > .Discord {color: #5661EB;}
