@import "prismjs/themes/prism-okaidia.min.css";

/* Defaults */
:root {
  --font-family: Century Gothic,Avant Garde,Avenir,TeXGyreAdventorRegular,Verdana,sans-serif;
  --font-family-monospace: 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;
}

/* Theme colors */
:root {
  --color-gray-20: #e0e0e0;
  --color-gray-50: #C0C0C0;
  --color-gray-90: #333;
  --color-green-1: #004953;
  --color-green-2: #57c183;

  --background-color: #fff;
  --background-color-toc: #F2F7F6;

  --text-color: rgba(0,0,10,.8);
  --text-color-sub: rgba(0,0,10,.55);;
  --text-color-secondary: var(--color-green-1);
  --text-color-tertiary: var(--color-green-2);
  --text-color-link: var(--color-green-1);
  --text-color-link-active: var(--color-green-1);
  --text-color-toc: #1C4852;
}

/*@media (prefers-color-scheme: dark) {*/
/*  :root {*/
/*    --color-gray-20: #e0e0e0;*/
/*    --color-gray-50: #C0C0C0;*/
/*    --color-gray-90: #dad8d8;*/

/*    !* --text-color is assigned to --color-gray-_ above *!*/
/*    --text-color: var(--color-gray-20);*/
/*    --text-color-secondary: var(--color-gray-90);*/
/*    --text-color-tertiary: var(--color-green-2);*/
/*    --text-color-link: #1493fb;*/
/*    --text-color-link-active: #6969f7;*/
/*    --text-color-link-visited: #a6a6f8;*/

/*    --background-color: #15202b;*/
/*  }*/
/*}*/


/* Global stylesheet */
* {
  box-sizing: border-box;
}

html,
body {
  padding: 0;
  margin: 0;
  font-family: var(--font-family);
  color: var(--text-color);
  background-color: var(--background-color);
  scroll-behavior: smooth;
}

main {
  max-width: 1200px;
  margin: 0 auto;

  display: flex;
}
.main-content {
  margin: auto;
  width: 1200px;
}

.left-side, .right-side {
  position: sticky;
  top: 1rem;
  align-self: flex-start;
}
.left-side {
  padding-right: 60px;
  min-width: 360px;
  max-width: 360px;
}
.right-side {
  min-width: 300px;
  max-width: 300px;
}

.table-of-contents {
  background: var(--background-color-toc);
  border-radius: 5px;
  padding: 1.625rem 0.7rem;
}

.table-of-contents ul {
  list-style: none;
  margin: 0;
  padding: 0;

  li ul {
    margin-bottom: 1rem;
  }

  li {
    line-height: 17px;
    margin-bottom: 1rem;

    a {
      font-weight: bold;
      font-size: 0.875rem;
      color: var(--text-color-toc);
      text-decoration: none;
      &:hover {
        text-decoration: underline;
      }
    }
  }
  li:last-child {
    margin-bottom: 0;
  }
}

.table-of-contents > ul ul {
  margin-top: 10px;
}

.table-of-contents > ul ul li {
  margin: 0 0 0 0.7rem;
  line-height: 17px;
  a {
    font-weight: normal;
  }
}

.table-of-contents > ul ul li+li {

}

.table-of-contents > ul ul li+li,
.table-of-contents > ul ul li:first-child {
  margin-bottom: .5rem;
}

.right-side {
  padding-left: 60px;
}

.right-side .title,
nav .title {
  color: var(--text-color-secondary);
  font-weight: 700;
}

nav .title{
  font-size: 1.8rem;
}

nav {
  margin-bottom: 5rem;
}

.right-side .tags,
nav .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.right-side .links,
nav .links{
  padding: 0;
  list-style: none;
}

.right-side .tags,
.right-side .links,
nav .tags,
nav .links {
  padding: 0;
  margin: 12px 0 23px 0;
  list-style: none;
}

h1 {
  color: var(--text-color-secondary);
  font-style: normal;
  font-size: 3rem;
  font-weight: 700;
  margin: 3rem 0 2rem;
}

h2 {
  color: var(--text-color-secondary);
  font-size: 1.8rem;
  font-style: normal;
  font-weight: 700;
  letter-spacing: .02rem;
  margin: 3rem 0 2rem;
}

h3 {
  color: var(--text-color-secondary);
  font-size: 1.4rem;
  font-style: normal;
  font-weight: 700;
}

p, li {
  font-size: 1.125rem;
  line-height: 1.5rem;
}

p {
  margin: 0;
}

p + p {
  margin-top: 1.5rem;
}

p ~ ul {
  margin-top: .5rem;
}

a {
  color: var(--text-color-link);
}
a:hover {
  color: var(--text-color-link-active);
}

main {
  padding: 8rem 1rem 4rem 1rem;
}
main :first-child {
  margin-top: 0;
}

.main-title {
  margin-bottom: 0;
}

.sub-title {
  margin: 0.5rem 0 5rem;
  color: var(--text-color-sub);
}

table {
  margin: 1em 0;
}
table td,
table th {
  padding-right: 1em;
}

hr {
  margin: 4rem 15vw;
}

figure + h2,
pre + h2 {
  margin-top: 2rem;
}

img {
  max-width: 100%;
}

figure {
  text-align: center;
  margin: 2rem;
}

figure img {
  box-shadow: 8px 5px 5px rgba(0,0,10,.20);
}

figure figcaption {
  margin-top: 6px;
  font-size: 0.875rem;
  color: var(--text-color-sub);
}

/* Header */
.main-header {
  background: var(--background-color);
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
  width: 100%;
  z-index: 1000;
  height: 60px;
}
.main-header div {
  align-items: center;
  display: flex;
  margin: auto;
  max-width: 1400px;
  height: 60px;
}
.main-header-logo {
  margin: 0 23px;
  text-decoration: none;
}

.main-menu {
  display: flex;
  flex-grow: 1;
}

/*!* Posts list *!*/
.post-list {
  display: flex;
  flex-wrap: wrap;
  gap: 3rem;
}
.post-list-item {
  max-width: 410px;
  padding: 2rem;
  border-radius: 5px;
  box-shadow: 0 5px 10px rgba(0,0,0,0.3);
}
.post-list-item p {
  margin: 2rem 0;
}
.post-list-header h2 {
  margin-bottom: 1.5rem;
}
.post-list-link {
  flex-basis: calc(100% - 1.5rem);
  padding-right: .5em;
  text-decoration: none;
}
.post-list-footer {
  text-align: right;
}

/* Tags */
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: 0.5rem 0;
  list-style: none;
  padding: 0;
}
.post-tag {
  padding: 4px;
  border-radius: 5px;
  background: var(--text-color-tertiary);
}
.article-tags {
  margin: 0;
}
.post-tag a {
  color: var(--text-color);
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
}

/* Tags list */
.post-metadata {
  display: flex;
  flex-direction: column;
  gap: .5em;
  font-size: 0.875rem;
  color: var(--text-color-sub);
}

.post-list .post-metadata {
  flex-direction: column;
}

h1 + .post-metadata {
  margin: 0 0 4rem;
}

.post-metadata .post-metadata__header {
  flex-grow: 1;
  font-size: 0.875rem;
  color: var(--text-color-sub);
}
.post-nav ul {
  display: flex;
  gap: 1rem;
  margin: 0;
  justify-content: space-around;
  list-style: none;
  padding: 0;

  a {
    display: flex;
    flex-direction: row;
    text-decoration: none;
    align-items: center;
    padding: 1.5rem;
    color: var(--text-color);
    height: 100%;
  }
  .icon {
    font-size: 36px;
  }
  .previous, .next {
    flex-basis: 50%;
    background: var(--color-gray-20);
    border-radius: 8px;

    &:hover {
      background: var(--color-gray-50);
    }
  }
  .previous {
    .icon {
      margin-left: 2rem;
    }
  }
  .next {
    .icon {
      margin-right: 2rem;
    }
  }
}

.main-footer {
  align-items: center;
  background: var(--color-green-1);
  display: flex;
  height: 300px;
  padding: 0 103px;
}

.main-footer,
.main-footer a {
  color: var(--background-color);
}

.footer-contact {
  display: flex;
  flex: 0 20%;
  flex-direction: column;
  font-size: 1rem;
  line-height: 1.5em;
}

.footer-contact p {
  margin: 0;
  padding: 0;
}

.footer-contact-title {
  color: var(--background-color);
  font-size: 1.2rem;
  font-style: normal;
  font-weight: 700;
  letter-spacing: .04rem;
  line-height: 1.7rem;
  text-transform: uppercase;
}

.footer-contact div:last-child {
  padding-top: 23px;
}

.footer-links {
  display: flex;
  padding: 0;
  list-style: none;
  gap: 12px;
}

.footer-center {
  flex: 0 60%;
  text-align: center;
  > p {
    margin-bottom: 12px;
  }
}

/*
 * New diff- syntax
 */
pre[class*="language-diff-"] {
  --eleventy-code-padding: 1.25em;
  padding-left: var(--eleventy-code-padding);
  padding-right: var(--eleventy-code-padding);
  margin: 1.5rem 0;
}
.token.deleted {
  background-color: hsl(0, 51%, 37%);
  color: inherit;
}
.token.inserted {
  background-color: hsl(126, 31%, 39%);
  color: inherit;
}

/* Make the + and - characters unselectable for copy/paste */
.token.prefix.unchanged,
.token.prefix.inserted,
.token.prefix.deleted {
  -webkit-user-select: none;
  user-select: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-top: 2px;
  padding-bottom: 2px;
}
.token.prefix.inserted,
.token.prefix.deleted {
  width: var(--eleventy-code-padding);
  background-color: rgba(0,0,0,.2);
}

/* Optional: full-width background color */
.token.inserted:not(.prefix),
.token.deleted:not(.prefix) {
  display: block;
  margin-left: calc(-1 * var(--eleventy-code-padding));
  margin-right: calc(-1 * var(--eleventy-code-padding));
  text-decoration: none; /* override del, ins, mark defaults */
  color: inherit; /* override del, ins, mark defaults */
}

@media only screen and (max-width: 1200px) {
  main {
    max-width: 100%;
    flex-direction: column;
    padding-top: 1rem;
  }
  .main-content{
    max-width: 100%;
  }
  .right-side {
    position: relative;
    width: 100%;
    padding: 5rem 0;
  }
  .left-side {
    position: relative;
    order: 2;
    width: 100%;
    padding-right: 0;
  }
  h1 + .post-metadata {
    flex-direction: column;
  }

  h1 + .post-metadata ul {
    flex-wrap: wrap;
  }
  .main-footer {
    flex-direction: column-reverse;
    height: auto;
    padding: 23px 0;
  }
  .post-nav ul {
    flex-direction: column;
  }
  .footer-contact {
    flex-direction: row;
    justify-content: space-between;
    padding: 0 23px;
    width: 100%;
  }
  .footer-center {
    padding: 0 23px 23px;
  }
}