/* Defaults */
@font-face {
  font-family: "Newsreader";
  src: url("/fonts/Newsreader-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "ABC Favorit Mono";
  src: url("/fonts/ABCFavoritMono-Light.woff2") format("woff2"),
       url("/fonts/ABCFavoritMono-Light.woff") format("woff");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

:root {
  --font-family: "Newsreader", -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;
  --font-family-date: "ABC Favorit Mono", var(--font-family-monospace);
}

/* Type scale */
:root {
  --main: 16px;
}
@media (min-width: 600px) {
  :root { --main: 17px; }
}
@media (min-width: 900px) {
  :root { --main: 18px; }
}
@media (min-width: 1440px) {
  :root { --main: 23px; }
}

/* 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-visited: #17050F;

  --nav-color-active: #000;
  --text-color-muted: #767676;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-gray-20: #e0e0e0;
    --color-gray-50: #C0C0C0;
    --color-gray-90: #dad8d8;

    /* --text-color is assigned to --color-gray-_ above */
    --text-color-link: #1493fb;
    --text-color-link-visited: #a6a6f8;

    --background-color: #15202b;

    --nav-color-active: #fff;
    --text-color-muted: #8a8a8a;
  }
}


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

html,
body {
  padding: 0;
  margin: 0;
}

body {
  padding: 5vh 5vw;
  font-family: var(--font-family);
  font-size: var(--main);
  transition: font-size 0.3s ease;
  color: var(--text-color);
  background-color: var(--background-color);
}

h1, h2, h3, h4, h5, h6,
strong, b {
  font-weight: 400;
}
h1, h2, h3, h4, h5, h6 {
  font-size: 1em; /* 16px /16 */
}

p:last-child {
  margin-bottom: 0;
}
p,
.tmpl-post li,
img {
  max-width: 37.5em; /* 600px /16 */
}
p,
.tmpl-post li {
  line-height: 1.45;
}

/* Lists */
main ul:not(.postlist):not(.post-nav) {
  padding-left: 1.25em;
  margin: 0 0 1em;
  max-width: 37.5em; /* 600px /16 */
  list-style-type: disc;
}
main ul:not(.postlist):not(.post-nav) li {
  line-height: 1.45;
}

.hover-image {
  color: var(--text-color-link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.12em;
  text-underline-position: from-font;
  cursor: pointer;
}
.hover-image:hover,
.hover-image:focus-visible {
  text-decoration-thickness: 2px;
}
.hover-image img {
  position: fixed;
  top: 0;
  left: 0;
  width: 16em;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  max-width: none;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 2;
  transform: translate(0.75em, 0.75em);
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
@media (hover: hover) {
  .hover-image:hover img,
  .hover-image:focus-visible img {
    opacity: 1;
    visibility: visible;
  }
}

a[href] {
  color: var(--text-color-link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.12em;
  text-underline-position: from-font;
}
a[href]:visited {
  color: var(--text-color-link-visited);
}
a[href]:hover {
  text-decoration-thickness: 2px;
}

/* Layout */
.layout {
  display: grid;
  grid-template-columns: 1fr minmax(0, 600px) 1fr;
  gap: 2rem;
  margin: 0 auto;
  padding: 1rem;
}
.layout-col-main {
  min-width: 0;
}
@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .layout-col-empty {
    display: none;
  }
}

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

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

pre,
code {
  font-family: var(--font-family-monospace);
  line-height: 1.5;
}
pre {
  font-size: 1em; /* 16px /16 */
  line-height: 1.375;
  direction: ltr;
  text-align: left;
  white-space: pre;
  word-spacing: normal;
  word-break: normal;
  -moz-tab-size: 2;
  -o-tab-size: 2;
  tab-size: 2;
  -webkit-hyphens: none;
  -ms-hyphens: none;
  hyphens: none;
  padding: 1em;
  margin: .5em 0;
  background-color: #f6f6f6;
}
code {
  word-break: break-all;
}

/* Header */
.home {
  margin: 0; /* 16px /16 */
  font-size: 1em; /* 16px /16 */
}
.home :link:not(:hover) {
  text-decoration: none;
}
.home-description {
  color: var(--text-color-muted);
}

/* Nav */
.nav {
  padding: 0;
  margin: 0;
  list-style: none;
}
.nav-item {
  display: inline-block;
}
.nav-item:not(:last-child) {
  margin-right: 5px;
}
.nav-item:not(:last-child)::after {
  content: ", ";
  color: var(--text-color-muted);
}
.nav-item a[href],
.nav-item a[href]:visited {
  color: var(--text-color-muted);
  text-decoration: none;
}
.nav-item-active a[href],
.nav-item-active a[href]:visited {
  color: var(--nav-color-active);
}

/* Work */
.work-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5em;
  margin: 1em 0;
}
.work-image {
  aspect-ratio: 4 / 5;
  background-color: var(--color-gray-20);
}
.work-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.work-meta {
  font-family: var(--font-family-date);
  font-size: 0.75em; /* 12px at the 16px root */
  color: var(--text-color-muted);
  margin: 1.5em 0 0;
}
.work-title {
  margin: 0.25em 0;
}
.work-blurb {
  margin: 0;
}

/* Posts list */
.postlist {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5em;
  margin: 1em 0;
}
.postlist-date, .post-date {
  display: block;
  font-family: var(--font-family-date);
  font-size: 0.75em; /* 12px at the 16px root */
  color: var(--text-color-muted);
  word-spacing: -0.5px;
}
.post-date {
  
}
.postlist-title {
  margin: 0;
}
.postlist-blurb {
  margin: 0;
}
.postlist-link {
  text-underline-position: from-font;
  text-underline-offset: 0;
  text-decoration-thickness: 1px;
}
.postlist-item-active .postlist-link {
  font-weight: 400;
}
.post-nav {
  list-style: none;
  padding: 0;
  margin: 1.5em 0 0;
}
.post-nav li {
  display: block;
}


/* Tags */
.post-tags {
  margin-bottom: 1.5em;
}
a[href].post-tag,
a[href].post-tag:hover,
a[href].post-tag:visited {
  margin-right: 0.5em;
  font-size: 0.75em; /* 12px at the 16px root */
  text-decoration: none;
}

/* Infobox */
:root {
  --color-infobox: #ffc;
}
@media (prefers-color-scheme: dark) {
  :root {
    --color-infobox: #082840;
  }
}

.infobox {
  background-color: var(--color-infobox);
  color: var(--color-gray-90);
  padding: 1em 0.625em; /* 16px 10px /16 */
}
.infobox ol:only-child {
  margin: 0;
}

/* Direct Links / Markdown Headers */
.direct-link {
  font-family: sans-serif;
  text-decoration: none;
  font-style: normal;
  margin-left: .1em;
}
a[href].direct-link,
a[href].direct-link:visited {
  color: transparent;
}
a[href].direct-link:focus,
a[href].direct-link:focus:visited,
:hover > a[href].direct-link,
:hover > a[href].direct-link:visited {
  color: #aaa;
}
