:root {
  --red: #c5004a;
  --darkred: #7f0036;
  --lightgray: #e0e0e0;
  --gray: #c0c0c0;
  --meddarkgray: #707070;
  --darkgray: #333;
  --navy: #17050f;
  --blue: #082840;
  --white: #fff;
  --bg: #ffffff;
  --text: #1c1c1c;
  --secondary: #525252;
  --accent: #4a7c59;
  --border: #e4e7e2;
  --code-font-size: 12px;
}
* {
  box-sizing: border-box;
  /* TODO - I quite like these fonts, decide on fonts */
  /* font-family: "Avenir", "Helvetica", sans-serif; */
}
::selection {
  background-color: rgba(74, 124, 89, 0.2);
  color: inherit;
}
::-moz-selection {
  background-color: rgba(74, 124, 89, 0.2);
  color: inherit;
}
html,
body {
  padding: 0;
  margin: 0 auto;
  max-width: 640px;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  line-height: 1.6;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background-color: var(--bg);
  font-size: 16px;
}
h2 {
  margin-top: 1em;
  color: var(--text);
}
strong {
  color: #555;
}
p:last-child {
  margin-bottom: 0;
  margin-top: 5px;
}
p,
.tmpl-post li,
li:not(header li):not(:last-child) {
  margin-bottom: 0.75rem;
  margin-top: 0.75rem;
}
img {
  display: block;
  margin: 1.5em auto;
  max-width: 100%;
  height: auto;
}
/* Applied to book reviews/summaries */
img[src*="#thumbnail"] {
  box-shadow: 1px 1px 5px #999;
  width: 60%;
  height: auto;
}
.tmpl-post li {
  display: list-item;
}
a {
  color: var(--accent);
}
/* a[href] {
  color: var(--blue);
}
a[href]:visited {
  color: var(--navy);
} */
blockquote {
  margin: 0 0 1.5em;
  padding: 0 1.5em;
  border-left: 3px solid var(--accent);
  font-style: italic;
  color: var(--secondary);
}
code {
  margin: 0;
  font-size: 85%;
  background-color: var(--color-markdown-code-bg);
  border-radius: 6px;
  background-color: rgba(27, 31, 35, 0.05);
}
footer {
  margin-bottom: 2rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  color: var(--secondary);
  font-size: 0.875rem;
}
.rss-footer {
  float: right;
}
.rss-footer:hover {
  color: var(--accent);
}
main {
  padding: 0;
}
header {
  padding: 1.5rem 0 1rem 0;
  background: transparent;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
}
header:after {
  content: "";
  display: table;
  clear: both;
}
table {
  font-size: 85%;
  margin: 1em 0;
  border-collapse: collapse;
  line-height: 0.9;
  margin-left: auto;
  margin-right: auto;
}
table tr {
  background: white;
  border-bottom: 1px solid;
}
table th,
table td {
  padding: 10px 20px;
}
table td span {
  background: #eee;
  color: dimgrey;
  display: none;
  font-size: 10px;
  font-weight: bold;
  padding: 5px;
  position: absolute;
  text-transform: uppercase;
  top: 0;
  left: 0;
}
/*
Use twrap class for responsive tables
Implemented on grokking-algorithms post
Source: https://code-boxx.com/css-responsive-table/
 */
.twrap {
  width: 100%;
  overflow-x: auto;
}
pre,
code {
  font-family: 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;
  line-height: 1.5;
}
pre {
  font-size: var(--code-font-size);
  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;
  -moz-hyphens: none;
  -ms-hyphens: none;
  hyphens: none;
  padding: 1em 1em;
  margin: 0.5em 0;
  background-color: #f6f6f6;
}
.highlight-line {
  display: block;
  padding: 0.125em 1em;
  text-decoration: none; /* override del, ins, mark defaults */
  color: inherit; /* override del, ins, mark defaults */
}
/* allow highlighting empty lines */
.highlight-line:empty:before {
  content: " ";
}
/* avoid double line breaks when using display: block; */
.highlight-line + br {
  display: none;
}
.highlight-line-isdir {
  color: #b0b0b0;
  background-color: #222;
}
.highlight-line-active {
  background-color: #444;
  background-color: hsla(0, 0%, 27%, 0.8);
}
.highlight-line-add {
  background-color: #45844b;
}
.highlight-line-remove {
  background-color: #902f2f;
}

/* Header */
.home {
  padding: 0;
  margin: 0;
  float: none;
  flex: 1;
}
.home h1 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0;
}
.home a {
  color: var(--text);
  text-decoration: none;
}
.home a:hover {
  color: var(--accent);
}
.home-tagline {
  font-size: 0.875rem;
  color: var(--secondary);
  margin: 0.25rem 0 0 0;
}

/* Nav */
.nav {
  padding: 0;
  list-style: none;
  margin: 0;
  display: flex;
  gap: 1.5rem;
  float: none;
  flex-shrink: 0;
  align-items: baseline;
  padding-top: 0.125rem;
}
.nav-item a {
  color: var(--secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 400;
  transition: color 0.2s ease;
}
.nav-item a:hover {
  color: var(--accent);
}
.nav-item-active a {
  color: var(--text);
  font-weight: 500;
}

/* Posts list */
.postlist {
  list-style: none;
  padding: 0;
  margin-top: 0;
}
.postlist-item {
  padding: 1.5rem 0;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  transition: all 0.2s ease;
  position: relative;
  cursor: pointer;
}
.postlist-item:last-child {
  border-bottom: none;
}
.postlist-item:hover {
  border-bottom-color: var(--accent);
}
.postlist-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-left: 3px solid transparent;
  transition: border-color 0.2s ease;
  pointer-events: none;
}
.postlist-item:hover::before {
  border-left-color: var(--accent);
}
.postlist-item:before {
  display: none;
}
.postlist-item-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.5rem;
}
.postlist-date {
  font-size: 0.8125rem;
  color: var(--secondary);
  white-space: nowrap;
  flex-shrink: 0;
}
.postlist-link {
  display: block;
  font-size: 1.3rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  line-height: 1.4;
  transition: color 0.2s ease;
  flex: 1;
}
.postlist-link::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
}
.postlist-item:hover .postlist-link {
  color: var(--accent);
}
.postlist-item-active .postlist-link {
  font-weight: bold;
}
.tmpl-home .postlist-link {
  font-size: 1.3rem;
  font-weight: 600;
}
.postlist-item p {
  font-size: 0.9375rem;
  color: var(--secondary);
  line-height: 1.6;
  margin: 0 0 0.75rem 0;
}
.postlist-item p a {
  font-size: 0.875rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
  position: relative;
  z-index: 2;
}
.postlist-item p a:hover {
  color: #3d6549;
}

/* Tags */
.post-tag {
  display: inline-block;
  vertical-align: text-top;
  text-transform: uppercase;
  font-size: 0.625em; /* 10px /16 */
  padding: 2px 4px;
  margin-left: 0.8em; /* 8px /10 */
  background-color: var(--red);
  color: var(--white);
  border-radius: 0.25em; /* 3px /12 */
  text-decoration: none;
}
a[href].post-tag,
a[href].post-tag:visited {
  color: #fff;
}
/* Warning */
.warning {
  background-color: #ffc;
  padding: 1em 0.625em; /* 16px 10px /16 */
}
.warning ol:only-child {
  margin: 0;
}
/* Direct Links / Markdown Headers */
.direct-link {
  font-family: sans-serif;
  text-decoration: none;
  font-style: normal;
  margin-left: 0.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;
}
/*
Following webkit may or may not work - seems to be the standard, but didn't have an effect on ny Android w. Firefox.
Original aim: Force scrollbars on mobile for divs that overflow to always display. As opposed to only when you try to scroll on the div
*/
::-webkit-scrollbar {
  -webkit-appearance: none;
}
::-webkit-scrollbar:vertical {
  width: 12px;
}
::-webkit-scrollbar:horizontal {
  height: 12px;
}
::-webkit-scrollbar-thumb {
  -webkit-box-shadow: 0 0 1px rgba(255, 255, 255, 0.5);
  border-radius: 10px;
  border: 2px solid #ffffff;
}
::-webkit-scrollbar-track {
  border-radius: 10px;
  background-color: #ffffff;
}

/* Lightbox */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  cursor: zoom-out;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.lightbox-overlay.active {
  opacity: 1;
  visibility: visible;
}
.lightbox-overlay img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  transform: scale(0.95);
  transition: transform 0.25s ease;
  margin: 0;
}
.lightbox-overlay.active img {
  transform: scale(1);
}
.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}
.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
}
/* Make post images clickable */
.tmpl-post img:not(.lightbox-overlay img) {
  cursor: zoom-in;
  transition: opacity 0.2s ease;
}
.tmpl-post img:not(.lightbox-overlay img):hover {
  opacity: 0.9;
}
