/* Defaults */
:root {
	--font-family: Verdana, Helvetica, sans-serif;
	--font-family-monospace: 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;
}

/* Theme colors */
:root {
	--color-gray-20: #e0e0e0;
	--color-gray-50: #C0C0C0;
	--color-gray-90: #333;

	--background-color: #fff;
	--background-color-box-out: #c9afa6;
	--background-color-translucent: rgba(255, 255, 255, 0.6);
	--background-body: #656267;
	--highlight-color: rgba(50, 50, 50, 0.8);
	--color-flurish: #663344;
	--color-flurish-reversable: #663344;

	--text-color: var(--color-gray-90);
	--text-color-link: #0060df;
	--text-color-link-active: #0f55b0;
	--text-color-link-visited: #8324db;
	--box-outline-color: rgba(30, 30, 30, 0.5);

	--syntax-tab-size: 2;
}

@media (prefers-color-scheme: dark) {
	:root {
		--color-gray-20: #282828;
		--color-gray-50: #999;
		--color-gray-90: #ccc;

		--text-color: var(--color-gray-90);
		--text-color-link: #4A90ED;
		--text-color-link-active: #194b8d;
		--text-color-link-visited: #B073EA;

		--background-color: #15202b;
		--background-color-box-out: #421f04;
		--background-body: #656267;
		--highlight-color: rgba(50, 50, 50, 0.8);
		--background-color-translucent: rgba(0, 0, 0, 0.6);
		--box-outline-color: rgba(90, 90, 90, 0.5);
		--color-flurish-reversable: #9D7E89;
	}
}


/* Global stylesheet */
* {
	box-sizing: border-box;
}

@view-transition {
	navigation: auto;
}

html {
	padding: 0;
	margin: 0;
	font-family: var(--font-family);
	color: var(--text-color);
}
html {
	overflow-y: scroll;
}


body {
	background-image: url(/img/006-Frozen-spiders-web.jpg);
	background-position: center top;
	background-attachment: fixed;
	background-repeat:  no-repeat;
	background-size: cover;
	background-size: 100%;
	background-color: var(--background-body);
	line-height: 1.5;
	margin: 0;
	font-size: 1rem;
	min-width: 320px; 
	scroll-padding: 2em;
}
@media (prefers-reduced-motion: reduce) {
	body{
		background-attachment: scroll;
	}
}

main, header, footer, aside.sidebar {
	max-width: 40em;
}

main, aside.sidebar, footer {
	background-color: var(--background-color);
	border: 1px var(--highlight-color) solid;
}
aside.sidebar, footer {
	margin-top: 0.5rem;
}

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

/* Fluid images via https://www.zachleat.com/web/fluid-images/ */

img{
  max-width: 100%;
}
img[width][height] {
  height: auto;
}
img[src$=".svg"] {
  width: 100%;
  height: auto;
  max-width: none;
}
img.img-right, img.img-left {
	border: 5px var(--color-flurish) solid;
	border-radius: 5px; 
}
img.img-right {
	float: right;
	margin: 0 0 1rem 0.5rem;
	max-width: 50%;
}
img.img-left {
	float: left;
	margin: 0 0.5rem 1rem 0;
	max-width: 50%;
}

video,
iframe {
	width: 100%;
	height: auto;
}
iframe {
	aspect-ratio: 16/9;
}

p:last-child {
	margin-bottom: 0;
}

a[href] {
	color: var(--text-color-link);
}
a[href]:visited {
	color: var(--text-color-link-visited);
}
a[href]:hover,
a[href]:active {
	color: var(--text-color-link-active);
}
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 300; 
}

h2, h3, h4, h5 {
	clear:both;
}
h1 {
  font-size: 1.8rem;
  margin: 0.5rem 0 0.5rem;
  font-weight: 600;
  color: var(--color-flurish-reversable); }

h2 {
  font-size: 1.5rem;
  margin: 0.5rem 0 0.2rem;
}

h3 {
  font-size: 1.3rem;
  margin: 1.5rem 0 0; }

h4 {
  font-size: 1.2rem;
  margin: 1.3rem 0 0;
  font-weight: 600; }

h5 {
  font-size: 1.1rem;
  margin: 1.2rem 0 0; }

h6 {
  font-size: 1rem;
  margin: 1rem 0 0; }

abbr[title] {
  border-bottom: 1px dotted; }

b,
strong {
  font-weight: 600; }

dfn {
  font-style: italic; }


figure {
  margin: 0;
  text-align: center;
  border: 1px #999 solid;
  border-width: 0 0 0 2px;
  padding: 6px;
  margin: 0 0 1em 0; }

figcaption {
  font-size: 90%; }

blockquote,
q {
  hyphens: none;
  quotes: none; }

blockquote {
  background: var(--background-color-box-out);
  color: var(--color-gray-90);
  margin: 0 0.5rem 2.3rem 1.5rem;
  padding: 0.7rem;
  border-radius: 5px; 
  border: 1px var(--color-flurish) solid;
  border-left-width: 3px;
}

blockquote p:last-child,
blockquote p:last-of-type {
  margin-bottom: 0; }

main li {
	margin: 0 0 1rem 0;
}

table {
  border-bottom: 1px solid var(--color-gray-90);
  border-collapse: collapse;
  border-spacing: 0;
  font-size: 0.9rem;
  line-height: 2;
  margin: 0 0 20px;
  width: 100%; }

caption,
th,
td {
  font-weight: normal;
  text-align: left; }

caption {
  font-size: 1rem;
  margin: 20px 0; }

th {
  font-weight: bold;
  text-transform: uppercase; }

td {
  border-top: 1px solid #ededed;
  padding: 6px 10px 6px 0; }

del {
  color: var(--color-gray-20); }

ins {
  background: var(--background-color-box-out);
  text-decoration: none; }

hr {
  margin: 0 0 24px; }

.notice {
  outline: 1px var(--color-flurish-reversable) solid;
  padding: 5px;
  background-color: #aea36f3b;
  margin: 2rem 0.5rem 2rem;
}

.centered {
  text-align: center;
  padding-bottom: 1.5rem;
}
ul.logos {
	list-style: none;
}
.logos li {
	line-height: 30px;
}
ul.logos a{
	display: block;
}
.logos img {
	width: 24px;
	height: 24px;
	vertical-align: middle;
}

/* Layout and blocks */

main,
footer, aside.sidebar {
	padding: 1rem;
}
main :first-child {
	margin-top: 0;
}

header {
	border-bottom: 1px solid var(--color-gray-20);
}

#skip-link {
	text-decoration: none;
	background: var(--background-color);
	color: var(--text-color);
	padding: 0.5rem 1rem;
	border: 1px solid var(--color-gray-90);
	border-radius: 2px;
}

/* Prevent visually-hidden skip link fom pushing content around when focused */
#skip-link.visually-hidden:focus {
	position: absolute;
	top: 1rem;
	left: 1rem;
	/* Ensure it is positioned on top of everything else when it is shown */
	z-index: 999;
}

.links-nextprev {
	display: flex;
	justify-content: space-between;
	gap: .5em 1em;
	list-style: "";
	border-top: 1px dashed var(--color-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;
}

pre,
code {
	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;
}
code {
	word-break: break-all;
}

#caveat:target  {
  animation: highlight 3s;
}

@keyframes highlight {
  from {
    background-color: yellow;
  }
}


/* Header */
header {
	display: flex;
	gap: 1em;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	padding: 0.5rem;
	margin: 0 0 1rem 0;
	background-color: var(--background-color-translucent);
	backdrop-filter: blur(3px);
	border-radius: 0.5rem;
}
a.home-link {
	flex-grow: 1;
	font-size: 1rem;
	max-width: 12rem;
	font-weight: 700;
	margin: 0;
	padding: 7px;
	line-height: 1;
	color: #ddd;
	background: var(--color-flurish);
	text-decoration: none;
	text-align: center;
	vertical-align: top;
	-webkit-background-clip: padding-box;
	/* enables the transparency on the border */
	background-clip: padding-box; 
}
a[href]:visited.home-link {
	color: #ddd;
}
@media (prefers-color-scheme: dark) {

}

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

/* Posts list */
.postlist {
	counter-reset: start-from var(--postlist-index);
	list-style: none;
	padding: 0;
	padding-left: 2rem;
}
.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: -2rem;
}
.postlist-date,
.postlist-item:before {
	font-size: 0.8125rem; /* 13px /16 */
	color: var(--color-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: .25rem;
	padding-right: .5rem;
	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 0 0.5rem 0;
	border-bottom: 1px grey solid;
}
.post-metadata time {
	margin-right: 1em;
}
.post-metadata li {
	margin-bottom: 0;
}

/* Footer */

footer {
	text-align: center;
}

/* Larger screen styles */

@media screen and (min-width: 40rem) {

	main, header, footer, aside.sidebar {
		margin: 1rem 5% 0 5%;
	}

	main, aside.sidebar, footer {
		outline: 5px var(--box-outline-color) solid;
	}
}

@media screen and (min-width: 80rem) {

	.colwrapper {
		margin: 1rem 0 1rem 5%;
	}
	.colwrapper {
		display: flex;
		justify-content: space-between;
		max-width: 65rem;
	}
	.colwrapper > main {
		margin: 0;
	}
	.colwrapper > aside.sidebar {
		margin: 0 0 0 auto;
		align-self: flex-start;  
		max-width: 30rem;
	}
}

/* Bundled from elsewhere */
/**
 * okaidia theme for JavaScript, CSS and HTML
 * Loosely based on Monokai textmate theme by http://www.monokai.nl/
 * @author ocodia
 */

code[class*="language-"],
pre[class*="language-"] {
	color: #f8f8f2;
	background: none;
	text-shadow: 0 1px rgba(0, 0, 0, 0.3);
	font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
	font-size: 1em;
	text-align: left;
	white-space: pre;
	word-spacing: normal;
	word-break: normal;
	word-wrap: normal;
	line-height: 1.5;

	-moz-tab-size: 4;
	-o-tab-size: 4;
	tab-size: 4;

	-webkit-hyphens: none;
	-moz-hyphens: none;
	-ms-hyphens: none;
	hyphens: none;
}

/* Code blocks */
pre[class*="language-"] {
	padding: 1em;
	margin: .5em 0;
	overflow: auto;
	border-radius: 0.3em;
}

:not(pre) > code[class*="language-"],
pre[class*="language-"] {
	background: #272822;
}

/* Inline code */
:not(pre) > code[class*="language-"] {
	padding: .1em;
	border-radius: .3em;
	white-space: normal;
}

.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
	color: slategray;
}

.token.punctuation {
	color: #f8f8f2;
}

.token.namespace {
	opacity: .7;
}

.token.property,
.token.tag,
.token.constant,
.token.symbol,
.token.deleted {
	color: #f92672;
}

.token.boolean,
.token.number {
	color: #ae81ff;
}

.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
	color: #a6e22e;
}

.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string,
.token.variable {
	color: #f8f8f2;
}

.token.atrule,
.token.attr-value,
.token.function,
.token.class-name {
	color: #e6db74;
}

.token.keyword {
	color: #66d9ef;
}

.token.regex,
.token.important {
	color: #fd971f;
}

.token.important,
.token.bold {
	font-weight: bold;
}
.token.italic {
	font-style: italic;
}

.token.entity {
	cursor: help;
}
