/* Markdown */
:root[data-theme="light"] {
  --maincolor: var(--blue1);
  --bordercl: var(--green1);
  --calloutcolor: var(--green1);
  --hovercolor: var(--blue2);
  --darkMaincolor: var(--bg);
}
:root[data-theme="dark"] {
  --maincolor: var(--yellow1);
  --hovercolor: var(--yellow2);
  --bordercl: var(--blue1);
  --calloutcolor: var(--aqua1);
  --darkMaincolor: var(--bg);
}
html {
  color: var(--fg);
  font-family: 'Hack Mono', monospace;
  line-height: 1.6em;
  scroll-behavior: smooth;
}
body{
  display: block;
  margin: 8px;
  background-color: var(--bg);
  color: var(--fg);
  overflow-wrap: break-word;
}
* {
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

::selection {
  background: var(--bg2);
}

p {
  font-family: 'Noto Sans', sans-serif;
  line-height: 1.5;
}

hr {
  border: 0;
  border-top: 3px dotted var(--bordercl);
  margin: 1em 0;
}

blockquote {
  border: 0.15rem solid var(--maincolor);
  background: var(--bg1);
  color: var(--fg3);
  margin: 0;
  display: flex;
  flex-direction: row;
  padding: 1rem;
  font-family: 'Noto Sans', sans-serif;
}

blockquote::before {
  content: ">";
  font-family: 'Hack Mono', monospace;
  font-weight: bold;
  color: var(--bordercl);
  margin-right: 1em;
}

blockquote.twitter-tweet::before {
  content: "> From Twitter:";
  margin-bottom: 1em;
}

blockquote.twitter-tweet {
  flex-direction: column;
}

blockquote > p {
  margin: 0;
}

/* the dark mode button should appear to be a link */
#dark-mode-toggle {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  height: 100%;
}

a, #dark-mode-toggle {
  color: var(--maincolor);
  text-decoration: none;
  border-bottom: 3px solid rgba(0,0,0,0);
}
a:hover, #dark-mode-toggle:hover {
  color: var(--hovercolor);
  border-bottom: 3px solid var(--hovercolor);
}
a.link--external::after {
  content: "\2009↗"
}

ul {
  list-style: none;
  padding-left: 2ch;
}
ul li {
  text-indent: -2ch;
}
ul > li::before {
  content: '* ';
  font-weight: bold;
}

/* Images */
img {
  border: 3px solid #ececec;
  max-width: 100%;
}

figure {
  box-sizing: border-box;
  display: inline-block;
  margin: 0;
  max-width: 100%;
}

figure img {
  max-height: 500px;
}

@media screen and (min-width: 600px) {
  figure {
    padding: 0 40px;
  }
}

figure h4 {
  font-size: 1rem;
  margin: 0;
  margin-bottom: 1em;
}
figure h4::before {
  content: '↳ ';
}

mark {
  background: var(--calloutcolor);
}

mark::selection {
  background: var(--maincolor);
}

/* Code blocks */
code {
  padding: .1em .2em;
  font-family: 'Fira Code', monospace;
  color: var(--maincolor);
  border-radius: 0.5rem;
  background: var(--bg1)
}

pre {
  line-height: 1.4;
  overflow-x: auto;
  padding: 1em;
}

.tldr::before {
  content: 'tldr: ';
  font-weight: bold;
  color: var(--bordercl)
}

.highlight pre ::selection {
  background: var(--bg2);
  color: inherit;
}

pre code {
  background-color: transparent;
  color: inherit;
  font-size: 100%;
  padding: 0;
  border: none;
}

/* Containers */
.content {
  margin-bottom: 4em;
  margin-left: auto;
  margin-right: auto;
  max-width: 800px;
  padding: 0 1ch;
  word-break: break-word;
}

/* Header */
header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  padding: 1em 0;
  line-height: 2.5em;
  color: var(--fg0);
}

nav {
  display: flex;
  align-items: center;
}

.feather {
  align-self: center;
}

header .main {
  font-size: 1.5rem;
  font-weight: 500;
}
h1, h2, h3, h4, h5, h6 {
  font-size: 1.5rem;
  margin-top: 2rem;
  font-weight: 500;
}

h1::before { color: var(--maincolor); content: '# '; }
h2::before { color: var(--maincolor); content: '## '; }
h3::before { color: var(--maincolor); content: '### '; }
h4::before { color: var(--maincolor); content: '#### '; }
h5::before { color: var(--maincolor); content: '##### '; }
h6::before { color: var(--maincolor); content: '###### '; }

.meta {
  color: var(--gray1);
  letter-spacing: -0.5px;
}

/* Footer */
footer {
  display: flex;
  border-top: 0.4rem dotted var(--bordercl);
  padding: 2rem 0rem;
  margin-top: 2rem;
  font-size: 0.9rem;
  color: var(--fg4);
  white-space: nowrap;
  flex-wrap: wrap;
}
.soc {
  display: flex;
  align-items: center;
  height: 1.6em;
}
.border {
  display: flex;
  margin-left: 0.5rem;
  margin-right: 0.5rem;
  align-self: center;
  border: 1px solid;
  height: 1.25em;
}

/* Common */
.title h1 {
  margin-bottom: 0;
}

time {
  color: var(--gray1);
}

/* Posts */
article .title {
  margin-bottom: 1em;
}


/* Callout */
.callout {
  background-color: var(--calloutcolor);
  color: var(--fg1);
  padding: 1em;
}

.callout p {
  font-family: 'Hack Mono', monospace;
  margin: 0;
}

.callout a {
  border-bottom: 3px solid #fff;
}

.callout a:hover {
  background-color: #fff;
  color: var(--calloutcolor);
}

.site-description {
display: flex;
justify-content: space-between;
}
.tags li::before{
  content: "";
}
svg{
  max-height: 15px;
}
.draft-label{ 
    color: var(--bordercl);
    text-decoration: none;
    padding: 2px 4px;
    border-radius: 4px;
    margin-left: 6px;
    background-color: var(--bg2);
}
.highlight {
  position: relative;
  -webkit-overflow-scrolling: touch;
}
.highlight pre code[class*="language-"] {
  -webkit-overflow-scrolling: touch;
}
.highlight pre code[class*="language-"]::before {
  background: var(--fg);
  border-radius: 0 0 0.25rem 0.25rem;
  color: var(--bg);
  font-size: 12px;
  letter-spacing: 0.025rem;
  padding: 0.1rem 0.5rem;
  position: absolute;
  right: 1rem;
  text-align: right;
  text-transform: uppercase;
  top: 0;
}

.highlight pre code[class=language-javaScript]::before,
.highlight pre code[class="language-js"]::before {
content: "js";
background: var(--yellow2);
color: var(--bg0_h);
}
.highlight pre code[class*='language-yml']::before,
.highlight pre code[class*='language-yaml']::before {
content: 'yaml';
background: var(--red2);
color: var(--bg0_h);
}
.highlight pre code[class*='language-shell']::before,
.highlight pre code[class*='language-bash']::before,
.highlight pre code[class*='language-sh']::before {
content: 'shell';
background: var(--green2);
color: var(--bg0_h)
}
.highlight pre code[class*='language-json']::before{
content: 'json';
background: var(--blue2);
color: var(--bg0_h)
}
.highlight pre code[class*='language-python']::before,
.highlight pre code[class*='language-py']::before {
content: 'py';
background: var(--blue2);
color: var(--bg0_h);
}
.highlight pre code[class*='language-css']::before{
content: 'css';
background: var(--aqua2);
color: var(--bg0_h);
}
.highlight pre code[class*='language-go']::before{
content: 'Go';
background: var(--aqua2);
color: var(--bg0_h);
}
.highlight pre code[class*='language-md']::before,
.highlight pre code[class*='language-md']::before{
content: 'Markdown';
background: var(--purple2);
color: var(--bg0_h);
}

.highlight pre code[class*='language-C']::before{
content: 'C';
background: var(--blue2);
color: var(--bg0_h);
}

.highlight pre code[class*='language-cpp']::before{
content: 'C++';
background: var(--blue2);
color: var(--bg0_h);
}

.highlight pre code[class*='language-rust']::before{
content: 'Rust';
background: var(--red2);
color: var(--bg0_h);
}

.highlight pre code[class*='language-html']::before{
  content: 'HTML';
  background: var(--blue2);
  color: var(--bg0_h);
}

/* table */
table {
  border-spacing: 0;
  border-collapse: collapse;
}

table th{
  padding: 6px 13px;
  border: 1px solid var(--gray1);
  font-size: large;
}

table td{
  padding: 6px 13px;
  border: 1px solid var(--gray1);
}
