/* Markdown */
:root {
  --maincolor: #FB4D3D;
  --borderColor: #345995;
  --calloutColor: #564787;
  --hovercolor: #fff;
  --darkMainColor: #24d05a;
  --darkHoverColor: #EA2B1F;
  --night: #1B1B1E;
  --highlight: #e9bc3f;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #333333;
  ;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background-color: #9c9c9c;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background-color: #ccc;
}

html {
  color: var(--night);
  font-family: "Space Mono", monospace;
  font-optical-sizing: auto;
  font-weight: 400;
  font-style: normal;
  font-variation-settings:
    "wdth" 100;
  font-size: 22px;
  line-height: 1.7em;
}

body {
  display: block;
  margin: 8px;
}

* {
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

::selection {
  background: var(--highlight);
  color: black;
}

p {
  line-height: 1.5;
}

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

blockquote {
  border-left: 3px solid var(--borderColor);
  color: #737373;
  margin: 0;
  padding-left: 1em;
}

a {
  border-bottom: 3px solid var(--maincolor);
  color: inherit;
  text-decoration: none;
}

a:hover {
  background-color: var(--hovercolor);
  color: #fff;
}

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: '↳ ';
}

/* Code blocks */
code {
  font-family: 'Roboto Mono', monospace;
  background-color: #f1f1f1;
  padding: .1em .2em;
}

pre {
  background-color: #ececec;
  line-height: 1.4;
  overflow-x: auto;
  padding: 1em;
}

.highlight pre ::selection {
  background: rgba(255, 255, 255, 0.2);
  color: inherit;
}

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

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

/* Header */
header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  margin: 1em 0;
  line-height: 2.5em;
}

header .main {
  font-size: 1.5rem;
}

h1 {
  font-size: 1.4rem;
  margin-top: 2em;
}

h2,
h3,
h4,
h5,
h6 {
  font-size: 1.2rem;
  margin-top: 2em;
}

h1::before {
  color: var(--maincolor);
  font-size: 1.4rem;
  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: #999;
  letter-spacing: -0.5px;
}

.post-container {
  align-items: flex-start;
  display: flex;
  gap: 20px;
}

.post-content {
  flex: 3;
  min-width: 0;
}

.toc {
  background-color: #ececec;
  border-radius: 5px;
  color: #232333;
  flex: 0 0 auto;
  height: auto;
  margin-left: 20px;
  max-width: 300px;
  overflow-y: auto;
  padding: 10px;
  position: sticky;
  top: 20px;
}

/* Footer */
footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 0.4rem dotted var(--borderColor);
  padding: 2rem 0rem;
  margin-top: 2rem;
}

.soc {
  display: flex;
  align-items: center;
  border-bottom: none;
}

.border {
  margin-left: 0.5rem;
  margin-right: 0.5rem;
  border: 1px solid var(--borderColor);
}

.separator {
  margin: 0 0.5rem;
  width: 4px;
  height: 4px;
  border-radius: 2px;
  background-color: var(--borderColor);
  align-self: center;
}

.footer-info {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  font-size: 0.9rem;
}


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

time {
  color: grey;
}

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


/* Callout */
.callout {
  background-color: var(--calloutColor);
  color: #fff;
  padding: 1em;
}

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

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

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

.callout-alert {
  color: #000000;
  background-color: transparent;
  border-width: 3px;
  border-style: solid;
  border-color: #ff6347;
}

.callout-custom {
  color: #000000;
}

.callout-tip {
  color: #000000;
  background-color: transparent;
  border-width: 3px;
  border-style: solid;
  border-color: dodgerblue;
}

.callout-warning {
  color: #000000;
  background-color: transparent;
  border-width: 3px;
  border-style: solid;
  border-color: #ffd700;
}

.site-description {
  display: flex;
  justify-content: space-between;
}

.tags li::before {
  content: "⌗ ";
}

.tags a {
  border-bottom: 3px solid var(--maincolor);
}

.tags a:hover {
  color: white;
  background-color: var(--hovercolor);
}

svg {
  max-height: 15px;
}

.soc:hover {
  color: var(--hovercolor);
}

.draft-label {
  color: var(--borderColor);
  text-decoration: none;
  padding: 2px 4px;
  border-radius: 4px;
  margin-left: 6px;
  background-color: #f9f2f4;
}

.highlight {
  position: relative;
  -webkit-overflow-scrolling: touch;
}

.highlight pre code[class*="language-"] {
  -webkit-overflow-scrolling: touch;
}

.highlight pre code[class*="language-"]::before {
  background: black;
  border-radius: 0 0 0.25rem 0.25rem;
  color: white;
  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: #f7df1e;
  color: black;
}

.highlight pre code[class*='language-yml']::before,
.highlight pre code[class*='language-yaml']::before {
  content: 'yaml';
  background: #f71e6a;
  color: white;
}

.highlight pre code[class*='language-shell']::before,
.highlight pre code[class*='language-bash']::before,
.highlight pre code[class*='language-sh']::before {
  content: 'shell';
  background: green;
  color: white
}

.highlight pre code[class*='language-json']::before {
  content: 'json';
  background: dodgerblue;
  color: #000000
}

.highlight pre code[class*='language-python']::before,
.highlight pre code[class*='language-py']::before {
  content: 'py';
  background: blue;
  color: yellow;
}

.highlight pre code[class*='language-css']::before {
  content: 'css';
  background: cyan;
  color: black;
}

.highlight pre code[class*='language-go']::before {
  content: 'Go';
  background: cyan;
  color: royalblue;
}

.highlight pre code[class*='language-md']::before,
main .highlight pre code[class*='language-md']::before {
  content: 'Markdown';
  background: royalblue;
  color: whitesmoke;
}

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

table th {
  padding: 6px 13px;
  border: 1px solid #dfe2e5;
  font-size: large;
}

table td {
  padding: 6px 13px;
  border: 1px solid #dfe2e5;
}

.feather {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

#logo {
  font-weight: 600;
  font-family: "Bytesized", sans-serif;
}

#dark-mode-toggle {
  cursor: pointer;
}

#language-switch {
  font-size: smaller;
  margin: 0 10px;
}

#language-switch a {
  text-decoration: none;
  border: 0;
}

/*Mobile menu */
.mobile-menu {
  display: none;
  align-items: center;
}

.menu-icon {
  cursor: pointer;
  display: flex;
  align-items: center;
  position: relative;
  z-index: 90;
}

.menu-icon .navicon {
  width: 30px;
  height: 3px;
  background-color: #fff;
  position: relative;
  transition: all 0.3s ease-in-out;
}

.menu-icon .navicon::before,
.menu-icon .navicon::after {
  content: '';
  width: 30px;
  height: 3px;
  background-color: #fff;
  position: absolute;
  transition: all 0.3s ease-in-out;
}

.menu-icon .navicon::before {
  top: -10px;
}

.menu-icon .navicon::after {
  top: 10px;
}

#menu-toggle:checked+.menu-icon .navicon {
  background-color: transparent;
}

#menu-toggle:checked+.menu-icon .navicon::before {
  transform: rotate(45deg);
  top: 0;
}

#menu-toggle:checked+.menu-icon .navicon::after {
  transform: rotate(-45deg);
  top: 0;
}

.menu {
  display: none;
  flex-direction: column;
  position: absolute;
  align-items: center;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  padding: 10px;
  padding-top: 200px;
  border-radius: 5px;
}

#menu-toggle:checked+.menu-icon+.menu {
  display: flex;
}

.menu a {
  font-size: 1.5rem;
  font-weight: 500;
  text-decoration: none;
  border: none;
  color: #fff;
  padding: 10px;
  transition: background-color 0.3s ease-in-out;
}

.menu a:hover {
  color: #f0f0f0;
}

.menu a:active {
  color: #e0e0e0;
}

#menu-toggle:checked+.menu-icon+.menu a {
  display: block;
}

@media screen and (max-width: 600px) {
  footer {
    flex-direction: column;
  }

  .footer-info {
    margin-top: 20px;
  }

  .main-nav {
    display: none;
  }

  .mobile-menu {
    display: flex;
  }
}
