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

html {
	height: 100%;
}

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%;
}

.mono-font {
	font-family: "JetBrainsMono NF", "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: #1C2229 !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 {
	font-size: 14px;
	padding-top: 6px;
	padding-left: 4px;
	margin-bottom: 12px;
}

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

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;
}

/* Haiku style */
.hero {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 16px;
	margin-block: 22px;
}

.hero p {
	margin: 0;
	font-weight: bold;
	font-style: italic;
}

/* For very thin screens, put the image and haiku below each other */
@media screen and (max-width: 400px) {
	.hero {
		flex-direction: column;
		justify-content: center;
	}

	.hero p {
		text-align: center;
	}
}

p:has(.badge) {
	line-height: 2em;
}

a:has(.badge) {
	text-decoration: none;
}

.badge {
	padding: 6px 11px;
	font-weight: bold;
	text-transform: uppercase;
	font-size: 12px;
	white-space: nowrap;
	letter-spacing: 2px;
	position: relative;
	overflow: clip;
	z-index: 1;
}

a .badge:hover::before {
	content: "";
	display: block;
	position: absolute;
	inset: 0;
	background: hsla(0, 0%, 100%, 0.2);
	z-index: -1;
}

.badge > svg {
	height: 1.8em;
	translate: 0 0.55em;
}

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

.webrings {
	text-align: center;
}

.webrings h3 {
	border: none;
	margin-bottom: 0.2em;
}

/* Webrings */
.webring {
	display: flex;
	gap: 0.25rem;
	justify-content: center;
	align-items: center;

	font-size: 1.2em;
}
.webring img {
	height: 1.5em;
}

/* Table of Contents style */
aside h2 {
	margin-bottom: 0;
}

aside ol {
	padding-left: 1em;
}

aside > nav > ol {
	padding-left: 0;
}

aside li {
	list-style-type: none;
}

@media screen and (min-width: 1800px) {
	aside {
		position: fixed;
		top: 0;
		left: 2em;
	}
}

/* Card styles */
.card * {
	padding: 0;
	margin: 0;
}

.card {
	border: 1px solid;
	padding: 8px;
	position: relative;

	display: flex;
	flex-direction: column;

	border-radius: 8px;
}

.card div.visuals {
	display: flex;
	flex-direction: row;
	gap: 16px;

	overflow-x: scroll;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	scroll-snap-stop: always;

	/*width: 100%;*/
	/*aspect-ratio: 16 / 9;*/
	/*object-fit: cover;*/
	/*overflow: clip;*/
	border-radius: 6px;

	margin-bottom: 8px;
}

.card div.visuals > * {
	min-width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;

	scroll-snap-align: start;

	border-radius: 6px;
}

.card-title-bar {
	display: flex;
	justify-content: space-between;
	margin-bottom: 0.2em;
}

.card .stars {
	font-weight: 500;
}

@media screen and (min-width: 1000px) {
	.two-col {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 4px;
	}
}

.blog-link {
	margin-top: 0.3em;
	font-style: italic;
	padding-left: 1ch;
	font-size: 0.9em;
}

.tags {
	margin-top: auto;
	padding: 0.8em 0 0.4em;
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	gap: 1.0em 0.3em;
}

.tags li {
	display: inline;
}

.tags a, .tags a:visited {
	background: black;
	border-radius: 100vw;
	padding: 0.4em 0.8em;
	color: unset;
}

.tags a:hover, .tags a:focus-within {
	background: #333;
}

/* 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;}

