.postlist { counter-reset: start-from 4 }
/* This is an arbitrary CSS string added to the bundle */
/* Defaults */
:root {
	--font-family: Lexica-Ultralegible, system-ui, sans-serif;
	--font-family-monospace: Comic-Mono, Consolas, Menlo, Monaco, Andale Mono WT, Andale Mono, Lucida Console, Lucida Sans Typewriter, DejaVu Sans Mono, Bitstream Vera Sans Mono, Liberation Mono, Nimbus Mono L, Courier New, Courier, monospace !important;
	--content-max-width: 80em;
}

/* Theme colours */
:root {
  --colour-gray: #c9d5d7;
  --colour-gray-lighter: #f0dff4;
  --colour-gray-shade: #eadedc;
  --colour-purple: #5200e8;
  --colour-purple-dark: #3e00b3;
	--colour-gray-light: #eee2e0;
  --colour-teal: #00e8c6;
  --colour-teal-light: #14fcda;
  --colour-teal-dark: #00dbfd;
  --colour-orange: #ffa7a3;
	--colour-gray-20: #e0e0e0;
	--colour-gray-50: #C0C0C0;
	--colour-gray-90: #333;

  --colour-gray-purple: #dccbe0;
  --colour-gray-purple-dark: #c9afcf;
  --colour-gray-purple-darker: #c8b7f3;
  --colour-black-not: #0b0e0f;
  --colour-black-tint: #212a2c;
  --colour-black-tint-lighter: 374549;


  --colour-purple-default: #551a8b;

  --colour-red: #9a0000;
  --colour-blue-dark: #215d8f;
  --colour-blue: #2121cc;

	--text-colour: var(--colour-black-tint);
  --text-colour-bgblend: var(--colour-black-tint-lighter);
  --text-colour-tint: var(--colour-black-not);
  --background-colour: var(--colour-gray-purple);
  --text-shadow-colour: var(--colour-gray-purple-dark);
	--text-colour-link: var(--colour-blue);
	--text-colour-link-active: var(--colour-red);
	--text-colour-link-visited: var(--colour-blue-dark);

  /* high contrast colours */
  --colour-white: #fff;
  --colour-black: #000;

	--syntax-tab-size: 2;
}

@media (prefers-color-scheme: dark) {
	:root {
    --text-colour: var(--colour-gray);
    --background-colour: var(--colour-purple);
    --text-shadow-colour: var(--colour-purple-dark);
    --text-colour-bgblend: var(--colour-gray-purple-darker);
    --text-colour-tint: var(--colour-gray-lighter);

		--colour-gray-light: #1f2831;
		--colour-gray-20: #e0e0e0;
		--colour-gray-50: #C0C0C0;
		--colour-gray-90: #dad8d8;

		/* --text-colour is assigned to --colour-gray-_ above */
		--text-colour-link-visited: var(--colour-teal-dark);
		--text-colour-link-active: var(--colour-orange);
		--text-colour-link: var(--colour-teal-light);

    /* high contrast colours */
    --colour-contrast-bg: #090909;
    --colour-contrast-text: #efefef;

		/*--background-colour: #121a22;*/
	}
}

@font-face {
	font-family: Lexica-Ultralegible;
	src: url('../css/fonts/LexicaUltralegible-Regular.woff2') format('woff2');
	font-display: swap;
}

@font-face {
	font-family: Lexica-Ultralegible-Bold;
	src: url('../css/fonts/LexicaUltralegible-Bold.woff2') format('woff2');
	font-display: swap;
}

@font-face {
	font-family: Lexica-Ultralegible-Italic;
	src: url('../css/fonts/LexicaUltralegible-Italic.woff2') format('woff2');
	font-display: swap;
}

@font-face {
	font-family: Lexica-Ultralegible-BoldItalic;
	src: url('../css/fonts/LexicaUltralegible-BoldItalic.woff2') format('woff2');
	font-display: swap;
}

@font-face {
	font-family: Comic-Mono;
	src: url('../css/fonts/ComicMono.ttf') format('truetype');
	font-display: swap;
}

@font-face {
	font-family: Open-Dyslexic-Mono;
	src: url('../css/fonts/open_dyslexic_mono.otf') format('opentype');
	font-display: swap;
}

@font-face {
	font-family: Open-Dyslexic-Regular;
	src: url('../css/fonts/OpenDyslexic-Regular.woff2') format('woff2');
	font-display: swap;
}

@font-face {
	font-family: Open-Dyslexic-Bold;
	src: url('../css/fonts/OpenDyslexic-Bold.woff2') format('woff2');
	font-display: swap;
}

@font-face {
	font-family: Open-Dyslexic-Bold-Italic;
	src: url('../css/fonts/OpenDyslexic-Bold-Italic.woff2') format('woff2');
	font-display: swap;
}

/* Global stylesheet */
* {
	box-sizing: border-box;
  overflow-wrap: break-word;
}

@view-transition {
	navigation: auto;
}

/* differentiate normal text in disclosure widgets */
details p {
	/* maybe add a subtly different background colour instead or in addition */
	font-style: italic;
}

html,
body {
	padding: 0;
	margin: 0 auto;
	font-family: var(--font-family);
	color: var(--text-colour);
	background-color: var(--background-colour);
}
html {
	overflow-y: scroll;
}
body {
  max-width: clamp(80%, 90vw, var(--content-max-width));
	/* revisit this at some point
	width: 90%; */
}

/* size images correctly */
main img {
	display: block;
	max-width: 95%;
	height: auto;
	padding-left: 0.5em;
	padding-right: 0.5em;
	margin-left: auto;
	margin-right: auto;
}

/* these will hopefully be cleaned up with classes at some point */
figure {
	margin: 0 auto;
}
figure img {
	/* this needs to be specific to the terminal screenshots before I add more images */
	border-radius: 5px;
	padding: 0.2em;
	border: 1px solid var(--colour-gray-90);
	background-color: var(--colour-gray-50);
}
figcaption {
	/* copied from .visually-hidden below until I can add the actual class */
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	height: 1px;
	overflow: hidden;
	position: absolute;
	white-space: nowrap;
	width: 1px;
}



/* https://www.a11yproject.com/posts/how-to-hide-content/ */
.visually-hidden {
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	height: 1px;
	overflow: hidden;
	position: absolute;
	white-space: nowrap;
	width: 1px;
}

p:last-child {
	margin-bottom: 0;
}
p {
	line-height: 1.5;
}

li {
	line-height: 1.5;
}

a[href] {
	color: var(--text-colour-link);
}
a[href]:visited {
	color: var(--text-colour-link-visited);
}
a[href]:hover,
a[href]:active {
	color: var(--text-colour-link-active);
}

header a[href] {
  color: var(--text-colour);
}

header a[href]:active {
  color: var(--text-colour-tint);
}

header a[href]:visited {
  color: var(--text-colour-bgblend);
}

main,
footer {
	padding: 1rem;
}
main {
	padding-bottom: 2rem;
}
footer {
	padding-top: 0.2rem;
	border-top: 3px double var(--text-shadow-colour);
	font-size: 0.6em;
}
/* Stye the CC logos */
footer img {
	width: 12px;
	height: 12px;
	margin-left:1px;
	vertical-align:text-bottom;
}
main :first-child {
	margin-top: 0;
}

header {
	border-bottom: 3px double var(--text-shadow-colour);
  text-shadow: 1px 1px 2px var(--text-shadow-colour);
}
header:after {
	content: "";
	display: table;
	clear: both;
}

/* Indicate interactivity */
details summary {
	cursor: pointer;
}

.links-nextprev {
	display: flex;
	justify-content: space-between;
	gap: .5em 1em;
	list-style: "";
	border-top: 1px dashed var(--colour-gray-20);
	padding: 1em 0;
}
.links-nextprev > * {
	flex-grow: 1;
}
.links-nextprev-next {
	text-align: right;
}

table {
	margin: 1em 0;
}
table td,
table th {
	padding-right: 1em;
}

code,
code[class*="language-"],
pre[class*="language-"] {
	font-family: var(--font-family-monospace);
}
pre:not([class*="language-"]) {
	margin: .5em 0;
	line-height: 1.375; /* 22px /16 */
	-moz-tab-size: var(--syntax-tab-size);
	-o-tab-size: var(--syntax-tab-size);
	tab-size: var(--syntax-tab-size);
	-webkit-hyphens: none;
	-ms-hyphens: none;
	hyphens: none;
	direction: ltr;
	text-align: left;
	white-space: pre;
	word-spacing: normal;
	word-break: normal;
	overflow-x: auto;
}

/* I didn't like my code tag text being broken on mobile so I changed this.
/* I still want the code disclosure widgets styled the same though */
code {
	word-break: normal;
}
pre code {
	word-break: break-all;
}

.od-preview {
	font-family: Open-Dyslexic-Regular, sans-serif;
}

/* Header */
header {
	display: flex;
	gap: 1em .5em;
	flex-wrap: wrap;
	align-items: center;
	padding: 1em;
}
.home-link {
	font-size: 1em; /* 16px /16 */
	font-weight: 700;
	margin-right: 2em;
	color: var(--text-colour) !important;
}
.home-link:link:not(:hover) {
	text-decoration: none;
}

/* Nav */
.nav {
	display: flex;
	padding: 0;
	margin: 0;
	list-style: none;
  text-shadow: 1px 1px 1px var(--text-shadow-colour), -1px -1px 1px var(--text-shadow-colour), -1px 1px 1px var(--text-shadow-colour), 1px -1px 1px var(--text-shadow-colour);
}
.nav-item {
	display: inline-block;
	margin-right: 1em;
}
.nav-item a[href]:not(:hover) {
	text-decoration: none;
}
.nav a[href][aria-current="page"] {
	text-decoration: underline;
}

/* Posts list */
.postlist {
	list-style: none;
	padding: 0;
	padding-left: 1.5rem;
}
.postlist-item {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	counter-increment: start-from -1;
	margin-bottom: 1em;
}
.postlist-item:before {
	display: inline-block;
	pointer-events: none;
	content: "" counter(start-from, decimal-leading-zero) ". ";
	line-height: 100%;
	text-align: right;
	margin-left: -1.5rem;
}
.postlist-date,
.postlist-item:before {
	font-size: 0.8125em; /* 13px /16 */
	color: var(--colour-gray-90);
}
.postlist-date {
	word-spacing: -0.5px;
}
.postlist-link {
	font-size: 1.1875em; /* 19px /16 */
	font-weight: 700;
	flex-basis: calc(100% - 1.5rem);
	padding-left: .25em;
	padding-right: .5em;
	text-underline-position: from-font;
	text-underline-offset: 0;
	text-decoration-thickness: 1px;
}
.postlist-item-active .postlist-link {
	font-weight: bold;
}

/* Tags */
.post-tag {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	text-transform: capitalize;
	font-style: italic;
}
.postlist-item > .post-tag {
	align-self: center;
}

/* Tags list */
.post-metadata {
	display: inline-flex;
	flex-wrap: wrap;
	gap: .5em;
	list-style: none;
	padding: 0;
	margin: 0;
}
.post-metadata time {
	margin-right: 1em;
}