/* Font imports */
@import url("https://fonts.googleapis.com/css2?family=Spectral:wght@300;400;600;700&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600&display=swap");

/* Root variables */
:root {
  --accent: #7b1b1b;
  --bg: #ffffff;
  --muted: #666;
  --max-width: 720px;
  --code-font-size: 15px;
  --code-font-size: 18px;
  --code-line-height: 1.45;
  --code-vertical-padding: 1rem;
  --code-horizontal-padding: 0.5rem;
}

/* Global styles */
html,
body {
  height: 100%;
  margin: 0;
  font-family: "Spectral", Georgia, serif;
  font-size: 18px;
  line-height: 1.75;
  color: #111;
  background: var(--bg);
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s;
}

/* Header */
header {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem;
  gap: 1rem;
}

header h1 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--accent);
}

header a {
  color: var(--accent);
  text-decoration: none;
}

nav a {
  margin: 0 0.5rem;
  color: var(--muted);
  text-decoration: none;
}

/* Main content */
main {
  max-width: var(--max-width);
  margin: 2rem auto;
  padding: 0 1rem;
  font-size: 1.15rem;
}

.post {
  margin-bottom: 2rem;
}

.post h2 {
  color: var(--accent);
  margin: 0 0 0.25rem;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
}

.post time {
  display: block;
  color: #333;
  font-size: 1.25rem;
  font-weight: 500;
  margin: 0 0 1rem 0;
}

.post-content {
  font-size: 1.15rem;
  line-height: 1.8;
}

.post-content a {
  color: #000;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1px;
  transition: color 0.2s;
}

.post-content a:hover,
.post-content a:focus {
  color: var(--accent);
  text-decoration-color: var(--accent);
  opacity: 0.9;
}

/* Blogroll / post list */
.blogroll-domain,
.post-list-item time {
  display: inline;
  color: #333;
  font-size: 1.25rem;
  font-weight: 500;
  margin: 0;
}

.post-list-item h3 {
  margin: 0 0 0.25rem;
  line-height: 1;
}

.post-list-item h3 a {
  text-decoration: none;
  color: var(--accent);
  font-size: 2rem;
  font-weight: 700;
}

.post-list-item h3 a:hover {
  opacity: 0.9;
}

/* Links */
.post-link {
  color: #000;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1px;
  transition: color 0.2s;
}

.post-link:hover,
.post-link:focus {
  color: var(--accent);
  text-decoration-color: var(--accent);
  opacity: 0.9;
}

a:not(.footer-social-links a):hover,
a:not(.footer-social-links a):focus {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Footer social links */
.footer-social-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5em;
  font-size: 1.1em !important;
}

.footer-social-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  color: #111;
  text-decoration: none;
  transition: color 0.2s;
}

.footer-social-links a i {
  font-size: 1.2em;
  color: #111;
  transition: color 0.2s;
}

.footer-social-links a:hover,
.footer-social-links a:focus,
.footer-social-links a:hover i,
.footer-social-links a:focus i {
  color: #b32d2d;
}

/* Code blocks */
pre {
  background: transparent;
  color: inherit;
  padding: 0;
  overflow: auto;
  border-radius: 0;
  margin: 0;
  white-space: pre;
  line-height: var(--code-line-height);
}

pre > code {
  display: block;
  font-family: "Fira Code", ui-monospace, SFMono-Regular, Menlo, Monaco,
    "Roboto Mono", monospace;
  font-size: var(--code-font-size);
  line-height: var(--code-line-height);
  padding: var(--code-vertical-padding) var(--code-horizontal-padding);
  white-space: pre;
  box-sizing: border-box;
}

/* Highlighting (thanks matklad.github.io) */
.hl-keyword,
.hl-literal {
  color: #000000;
  font-weight: bold;
}

.hl-type {
  color: #0086b3;
}

.hl-tag {
  color: #000080;
}

.hl-title.function_ {
  color: #990000;
  font-weight: bold;
}

.hl-title.class_ {
  color: #445588;
  font-weight: bold;
}

.hl-comment {
  color: #008000;
  font-style: italic;
}

.hl-built_in,
.hl-meta {
  color: #3c5d5d;
  font-weight: bold;
}

.hl-number {
  color: #009999;
}

.hl-string {
  color: #0b6fb5;
}

.hl-output {
  color: #2156a5;
}

.hl-subst {
  color: rgba(0, 0, 0, 0.9);
}

.hl-attr,
.hl-symbol {
  color: #008080;
}

.hl-line {
  background-color: #ffc;
}

figure.code-block > pre > code {
  display: flex;
  flex-direction: column;
  overflow-x: auto;
  overflow-y: clip;
  counter-reset: line;
  line-height: 1.2;
}

figure.code-block > pre > code > .line {
  counter-increment: line;
}

figure.code-block > pre > code > .line:before {
  content: counter(line);
  display: inline-block;
  width: 3ch;
  padding-right: 0.5ch;
  margin-right: 0.75ch;
  text-align: right;
  opacity: 0.45;
  border-right: 1px solid rgba(0, 0, 0, 0.12);
}

ol.callout {
  list-style: none;
  counter-reset: callout;
}

ol.callout > li {
  position: relative;
}

ol.callout > li::before {
  counter-increment: callout;
  content: counter(callout);
  position: absolute;
  top: 0.2rem;
  left: -1.1rem;
}

i.callout::after {
  content: attr(data-value);
}

ol.callout > li::before,
i.callout::after {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-size: 0.75rem;
  font-weight: bold;
  display: inline-block;
  width: 0.9rem;
  height: 0.9rem;
  line-height: 0.9rem;
  border-radius: 100%;
  background-color: black;
  color: white;
  text-align: center;
}

.hljs-empty-line {
  display: inline-block;
  width: 100%;
  color: transparent;
}

.line {
  display: block;
}

.line.hl-line {
  background-color: #ffc;
}

.callout {
  display: inline-block;
}

.has-line-numbers .code-wrapper {
  align-items: stretch;
}

.has-line-numbers pre {
  margin: 0;
}
