/* Markdown */
:root {
  --maincolor: #4a90e2;
  --bordercl: #d3d3d3;
  --callouctcolor: #87ceeb;
  --hovercolor: #357abd;
  --darkMaincolor: #81a1c1;
  --maxWidth: 1280px;
}

html {
  color: #232333;
  font-family: "Atkinson Hyperlegible", sans-serif;
  font-size: 18px;
  line-height: 1.8em;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0px auto;
  max-width: var(--maxWidth);
  background-color: #efefef;
  padding: 1em 1em;
}

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

::selection {
  background: var(--maincolor);
  color: #fff;
}

p {
  line-height: 1.5;
}

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

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

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

p a {
  border-bottom: 1px solid var(--maincolor);
}

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

ul {
  list-style: none;
  padding-left: 0;
  margin: 0 0 1em 0;
}
ul li {
  position: relative;
  padding: 0.4rem 0 0.4rem 2ch;
}

ul > li::before {
  content: "*";
  font-weight: bold;
  position: absolute;
  left: 0;
}
header nav ul > li::before {
  content: "";
  position: static;
}

/* Images */
img {
  max-width: 100%;
}

figure:not(".highlight") {
  box-sizing: border-box;
  display: inline-block;
  margin: 0;
  max-width: 100%;
}

figure img {
  max-height: 500px;
}

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

figure h4 {
  font-size: 1rem;
  margin: 0;
  margin-bottom: 1em;
}

figure h4::before {
  content: "↳ ";
}

/* Code blocks */
figure.highlight figcaption {
  padding-top: 0.25em;
  padding-left: 0.5em;
  padding-bottom: 0.25em;
}

code {
  background-color: #f1f1f1;
  padding: 0.1em 0.2em;
}

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

figure.highlight figcaption + pre {
  padding-top: 0;
  margin-top: 0;
}

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

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

/* Containers */
.content {
  flex: 1 0 auto;
  margin-bottom: 4em;
  padding: 0 1ch;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.content > main,
.content article,
.content section {
  max-width: 70ch;
  margin-inline: auto;
}

/* Header */
header {
  font-family: "Roboto Mono", monospace;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
}

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

#dark-mode-toggle {
  background: transparent;
  cursor: pointer;
  border: none;
  color: inherit;
}

header nav {
  width: auto;
}

@media (max-width: 720px) {
  header {
    flex-direction: column;
  }

  header .main {
    flex: 1 1 100%;
    text-align: center;
  }
  ,
  header nav {
    width: 100%;
    margin-top: 0.5em;
  }
  header nav ul {
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }
}

header nav ul {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  padding: 0;
  margin: 0;
}

header nav ul li:before {
  content: "";
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Roboto Mono", monospace;
  margin-top: 2em;
}
h1 {
  font-size: 1.3rem;
}

h2 {
  font-size: 1.2rem;
}

h3,
h4,
h5,
h6 {
  font-size: 1.1rem;
}

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: #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;
}

@media (max-width: 900px) {
  .toc {
    display: none;
  }
}

/* Footer */

@media (max-width: 700px) {
  footer div {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }
  footer div .border {
    width: 25%;
  }

  footer div .footer-info {
    text-align: center;
    margin-top: 0.5rem;
  }
}

footer {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  width: 100%;
  border-top: 0.4rem dotted var(--bordercl);
  padding: 2rem 0rem;
}

.soc {
  display: flex;
  align-items: center;
  border-bottom: none;
}
.border {
  margin-left: 0.5rem;
  margin-right: 0.5rem;
  border: 1px solid;
}
.footer-info {
  padding: var(--footer-padding);
}

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

time {
  color: grey;
}

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

/* Callout */
.callout {
  background-color: var(--callouctcolor);
  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(--callouctcolor);
}

.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: white;
}
.draft-label {
  color: var(--bordercl);
  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,
.highlight pre code[class*="language-md"]::before {
  content: "Markdown";
  background: royalblue;
  color: whitesmoke;
}
.highlight pre code[class*="language-ts"]::before {
  content: "TS";
  background: #3178c6;
  color: #fff;
}

/* 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;
}

/* Livestream page */
#livestream-container {
  align-items: center;
  position: relative;
}

iframe#owncast-stream {
  border: none;
  box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  overflow: hidden;
  margin: 0 auto;
}

iframe#owncast-chat {
  border: none;
  box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  overflow: hidden;
  margin: 0 auto;
  width: 100%;
}

@media screen and (min-width: 1820px) {
  iframe#owncast-chat {
    position: absolute;
    right: -480px;
    width: 450px;
  }
}
