/**
 * 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: #8292a2;
}

.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;
}
/* Defaults */
:root {
  --font-family: -apple-system, system-ui, 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;

  --text-color: var(--color-gray-90);
  --text-color-link: #082840;
  --text-color-link-active: #5f2b48;
  --text-color-link-visited: #17050f;

  --syntax-tab-size: 2;
}

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

@view-transition {
  navigation: auto;
}

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

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

/* 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;
}
video,
iframe {
  width: 100%;
  height: auto;
}
iframe {
  aspect-ratio: 16/9;
}

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

li {
  line-height: 1.5;
}

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

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

header {
  border-bottom: 1px dashed var(--color-gray-20);
}
header:after {
  content: "";
  display: table;
  clear: both;
}

.links-nextprev {
  display: flex;
  justify-content: space-between;
  gap: 0.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: 0.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;
}

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

/* Nav */
.nav {
  display: flex;
  padding: 0;
  margin: 0;
  list-style: none;
}
.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(--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: 0.25em;
  padding-right: 0.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;
  font-style: italic;
}
.postlist-item > .post-tag {
  align-self: center;
}

/* Tags list */
.post-metadata {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.5em;
  list-style: none;
  padding: 0;
  margin: 0;
}
.post-metadata time {
  margin-right: 1em;
}
:root {
  --footer-background-color: #f2f9e9;
  --solid-border-color: #ced7c2;
  --card-text-bg: rgba(255, 255, 255, 0.7);
}

html {
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

main {
  flex-grow: 1;
}

code {
  background-color: var(--footer-background-color);
  padding: 0 0.25em;
}
pre code {
  background-color: transparent;
  padding: 0;
}

code[class*="language-"],
pre[class*="language-"] {
  white-space: pre-wrap;
}

figure {
  margin: auto;
}

table {
  font-variant-numeric: slashed-zero oldstyle-nums tabular-nums;
}
td:last-of-type {
  text-align: right;
}
.post-metadata {
  margin-bottom: 1em;
}

model-viewer {
  width: 80%;
  height: auto;
  aspect-ratio: 4/3;
  margin: auto;
  border: 1px #c4c4c4 solid;
}

ul.task-list {
  list-style-type: none;
  padding-left: 1.5em;
  /* text-indent: -1.7em; */
}

li.task-list-item {
  display: flex;
  align-items: center;
  gap: 0.25em;
}

.task-list-item input[type="checkbox"]:disabled {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border: 1px solid var(--text-color-link);
  border-radius: 4px;
  outline: none;
  background-color: var(--footer-background-color);
  position: relative;
}

.task-list-item input[type="checkbox"]:disabled:checked::after {
  content: "✓";
  position: absolute;
  color: var(--text-color-link);
  font-size: 14px;
  font-weight: bolder;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

blockquote {
  margin-left: 2em;
  padding-left: 1em;
  border-left: 0.25em solid var(--solid-border-color);
}

footer {
  margin-top: 2em;
  padding-top: 0;
  border-top: 0.25em solid var(--solid-border-color);
  background-color: var(--footer-background-color);
}

nav.toc {
  padding: 0.5em 0;
  border-left: 0.25em solid var(--solid-border-color);
  margin-bottom: 1em;
}
nav.toc ol {
  margin: 0;
}

.columns {
  display: flex;
  flex-direction: column;
}

.postlist {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding: 0;
  list-style: none;
}
.postlist-item {
  flex: 1 0 200px; /* Flexible width with minimum of 280px */
  padding: 0;
  margin: 0;
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  max-width: none; /* Remove existing max-width */
}
/* Hide the counter numbers */
.postlist-item:before {
  display: none;
}
.postlist-link {
  display: block;
  text-decoration: none;
  color: inherit;
  width: 100%;
  height: 100%;
  position: relative;
}
.postlist-link picture {
  display: block;
  width: 100%;
  height: 0;
  padding-bottom: 100%; /* Creates a perfect square container */
  overflow: hidden;
  position: relative;

  transition: transform 0.2s ease;
}
.postlist-item:hover picture {
  transform: scale(1.05);
}
.postlist-link picture img,
.postlist-link picture source,
.postlist-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;

  display: block;
  aspect-ratio: 1/1 !important;
  object-fit: cover;
  object-position: center;
}
.postlist-title {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem;
  background-color: var(--card-text-bg);
  color: var(--text-color);
  font-weight: bold;
  backdrop-filter: blur(2px); /* Slight blur effect for modern browsers */
}
.postlist-date {
  display: block;
  position: absolute;
  top: 0;
  right: 0;
  padding: 0.5rem;
  background-color: var(--card-text-bg);
  color: var(--text-color);
  font-size: 0.75rem;
  border-bottom-left-radius: 8px;
}

.post {
  max-width: 75em;
}

@media (min-width: 768px) {
  .columns {
    flex-direction: row-reverse;
    gap: 1em;
  }
  article {
    flex-grow: 1;
    min-width: 0;
  }
  aside {
    flex: 0 0 33%;
  }
  nav.toc {
    position: sticky;
    top: 0;
    max-height: 100vh;
    overflow-y: auto;
  }
  .postlist-item {
    flex: 1 0 300px; /* Slightly wider on larger screens */
    max-width: calc(33.333% - 1rem); /* Limit to 3 per row */
  }
}