@import url("https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;600&display=swap");

:root {
  --skin: #ffffff;
  --landing-section-skin: #f7f7f7;
  --header-text: rgba(255, 255, 255, 0.904);
  --header-background: #4350af;
  --header-background-darker: #2e65a4;
  --link-transitiion-light: #7e9dc8;
  --link-transitiion-dark: #c57049;
  --link: #307bd9;
  --grey-text: rgb(105, 105, 105);
  --grey-text-darker: rgb(71, 71, 71);
  --inline-code-skin: #d5d7df;
}
html {
  scroll-behavior: smooth;
}
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-size: 20px;
  width: 100%;
  margin: 0;
  padding: 0;
  background: var(--skin);
}

/* Inline code style */
p code,
li code {
  font-size: 0.85em;
  background-color: var(--inline-code-skin);
  padding: 0.15em 0.28em;
  border-radius: 0.25em;
}

/* Main */

.main {
  display: flex;
  width: 80%;
  margin: 0.8em auto 2em auto;
  padding: 0 auto;
}

.main article.post {
  width: 71%;
  max-width: 80ch;
  margin: 0;
  padding-left: 0.34em;
  /* padding-right: 2%; */
}

.main aside {
  width: 25%;
  margin: 0.8em 0;
  padding: 0;
}

.article_header {
  margin: 1em 0 2em 0;
}

.article_header .titles {
  margin: 0 0 0.8em 0;
}

.article_header h1 {
  font-size: 1.88em;
  margin-bottom: 0;
  margin-top: 0;
}

.article_header .titles .subtitle {
  margin-top: 0.3em;
  padding-left: 1.2px;
  font-style: italic;
  font-weight: 600;
  font-size: 1.22em;
  word-spacing: 0.1em;
}

/* .article_content h2,
.article_content h3,
.article_content h4 {
  font-style: italic ;
} */

.article_content h4 {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-decoration-color: rgba(0, 0, 0, 0.651);
  text-underline-offset: 0.32em;
  /* border-bottom: 1px solid; */
}
.article_content h2 {
  display: block;
  padding-bottom: 0.15em;
  border-bottom: 1px solid rgba(199, 199, 199, 0.87);
}

.article_content h3,
.article_content h4 {
  /* margin-top: 1.5em; */
  margin-bottom: 0.45em;
}
.article_content,
.tippy-box {
  font-size: 18px;
  font-family: "Open Sans", "Arial", "Segoe UI", "EngCustom", Optima,
    "Lucida Sans", Calibri, Candara, sans-serif;
}

/* fallback for Zh */
.article_content:lang(zh),
.tippy-box:lang(zh) {
  font-family: "Noto Sans SC", "Chinese-Custom", "PingFang SC",
    "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}

.article_content p {
  line-height: 1.7;
  margin-bottom: 1.35em;
}
.article_content sup {
  padding: 0 0.08rem 0 0.15rem;
}
.article_content figure {
  margin: 0 0 2.2em 0;
}
.article_content figure,
.article_content img {
  /* max-width: 100%; */
  width: 100%;
  display: block;
  padding: 0 auto;
  margin: 1.34em auto 0.7em;
}
div.two-column {
  display: flex;
  flex-wrap: wrap;
  justify-content: around;
}
div.two-column > * {
  flex: 50%;
  margin: 0;
}
div.two-column > p > img {
  margin: 0;
}
.article_content figure > figcaption {
  text-align: center;
  width: 94%;
  font-size: 0.97em;
  color: rgb(58, 58, 58);
  margin: 1em auto 1.35em auto;
  padding: 0 auto;
  line-height: 1.26;
}

div.footnotes::before {
  content: "Notes";
  display: block;
  font-style: italic;
  font-weight: bold;
  font-size: 1.22em;
  margin-top: 2.5em;
  margin-bottom: -0.4em;
}

blockquote {
  border-left: 3.5px solid rgb(75, 127, 217);
  padding: 0 0.5em;
  margin: 0.3em 0 0.3em 2em;
  font-family: "Noto Sans SC", "Segoe UI", "Arial", "Kaiti SC", "楷体-简",
    "KaiTi", "楷体", "STKaiti", "华文楷体", serif;
}

blockquote p,
blockquote ul li,
blockquote ol li {
  color: rgb(89, 99, 110);
  margin: 0;
  padding: 0;
}

/* Article */
.container a,
.article_content a {
  color: var(--link);
  font-weight: 600;
  text-decoration: none;
  text-decoration: underline;
}

.container a:hover,
.article_content a:hover {
  color: var(--link-transitiion-dark);
  transition: 400ms;
  text-decoration: underline;
}

/* Tags Page */

.article_list ul {
  list-style-type: none;
  padding-left: 0;
}

.article_list li {
  margin: 0.7em 0;
}

.article_list li a {
  font-weight: bold;
  color: black;
  text-decoration: none;
  display: inline-block;
  vertical-align: top;
  max-width: 85ch;
}

.article_list li a:hover {
  text-decoration: underline;
  transition: 400ms;
  color: var(--link-transitiion-light);
}

.article_list span.published {
  display: inline-block;
  font-family: monego, Monaco, Consolas, "Lucida Console", "STKaiti", "KaiTi",
    "SimKai", monospace;
  font-size: 0.75em;
  margin-right: 1em;
  color: rgb(104, 104, 104);
  max-width: 16%;
  min-width: 2.9em;
}
.article_list section h2 {
  font-weight: 600;
  font-size: 1.35em;
  margin-bottom: 0;
  margin-top: 1.3em;
}

/* Post preview */
@media only screen and (min-width: 700px) {
  a[aria-label]:after {
    content: attr(aria-label);
    position: fixed;
    bottom: 0;
    right: 0;
    display: block;
    width: 55%;
    margin: 0;
    z-index: 20;
    background: var(--header-background-darker);
    color: white;
    font-weight: normal;
    /* font-style: italic; */
    font-size: 0.9em;
    line-height: 1.4;
    /* Hide scrollbars */
    /* Transitions */
    opacity: 0;
    max-height: 0;
    padding: 0;
    transition: opacity 0.85s;
  }
  a[aria-label]:hover:after {
    opacity: 1;
    max-height: 40vh;
    padding: 0.5rem 2% 0.5rem 43%;
  }
}

.article_list .subtitle {
  font-style: italic;
  font-size: 0.8em;
  border-left: 1px solid rgb(100, 100, 100);
  padding-left: 5px;
  margin-left: 5px;
  word-spacing: 0.1em;
}

/* Posts */
.post .meta {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
}

.article_header .tags {
  min-width: 300px;
  max-width: 750px;
}

.article_header .tags > a {
  display: inline-block;
  font-size: 0.85em;
  font-weight: bold;
  background: var(--header-background);
  color: white;
  padding: 0.1rem 0.38rem;
  margin: 0.15rem 0.12rem 0.2rem 0;
  border-radius: 0.5rem;
  text-decoration: none;
  line-height: 1.35;
}

.article_header .tags > a.highlight {
  background: #da0b15;
}

.post .article_header .tags > a:hover {
  text-decoration: underline;
}

.article_header .tags > a > sup {
  font-size: 0.68em;
}

.post .article_header .date {
  font-size: 0.85em;
  /* margin-left: auto */
}

.post .article_header .date > span.str {
  vertical-align: middle;
  margin-left: 0.1em;
  color: rgb(128, 128, 128);
}

.inline-icon > svg {
  height: 1em;
  vertical-align: middle;
}

/* Header Nav bar */

body > .header {
  width: 80%;
  margin: 0;
  padding: 20px 10%;
  background-color: var(--header-background);
  color: var(--header-text);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
}

body > .header > .header_title {
  min-width: 100px;
}

body > .header > .header_title .logo {
  margin-right: 0.5em;
}

body > .header > .site_nav {
  padding: 0;
  margin: 0;
}

body > .header > .site_nav > span {
  position: relative;
  display: inline-block;
  margin: 0 0.28em;
  padding: 0;
  top: 21%;
}

body > .header > .site_nav > span a {
  text-decoration: none;
  color: var(--header-text);
  margin: 0;
  padding: 0;
}

body > .header > .site_nav > span a:hover {
  color: var(--link-transitiion-light);
  transition: 320ms;
}

.header_title span {
  vertical-align: middle;
}

.header_title .logo > svg {
  display: inline-block;
  height: 1.92rem;
  width: 1.92rem;
  margin: 0;
  padding: 0;
}

/* Special DOM elements */
table {
  /* display: block; */
  border-collapse: collapse;
  width: 100%;
  /* margin: 1em auto; */
  overflow: auto;
}
table td,
table th {
  border: 2px solid rgba(170, 170, 170, 0.274);
  /* padding: 3px; */
  text-align: center;
}
table tr:nth-child(even) {
  background-color: var(--landing-section-skin);
}

table th {
  padding-top: 2px;
  padding-bottom: 2px;
  /* text-align: left; */
  background-color: var(--header-background);
  color: white;
}
.highlight pre {
  width: 98%;
  padding: 0.5em 1%;
  border-radius: 0.35em;
  line-height: 1.3;
  font-size: 0.95em;
  margin-left: 0;
  border-left: none;
}
pre {
  width: 98%;
  padding: 0.5em 0 0.5em 1.5%;
  margin: 0.8em 0 0.8em 0.5%;
  line-height: 1.2;
  font-size: 0.86em;
  color: rgb(33, 33, 33);
  overflow-x: auto;
  max-height: 500px;
  overflow-y: auto;
  border-left: 3px solid rgba(43, 21, 1, 0.8);
}

/* Footer */

footer {
  margin-top: auto;
  text-align: center;
  background-color: #3b4cc8;
  padding-top: 2em;
  padding-bottom: 1em;
  font-size: 0.8em;
  color: white;
}

footer a {
  font-weight: bold;
  text-decoration: none;
  color: white;
}

footer a:hover {
  text-decoration: underline;
  padding: 0;
  margin: 0;
}

div.social span.social {
  display: inline-block;
  background-color: #0072c5;
  border-radius: 50%;
  padding: 0.4rem;
  height: 1.1rem;
  width: 1.1rem;
}

div.social span.social.twitter {
  background-color: #1da1f2;
}

div.social span.social.github {
  background-color: black;
}

div.social .social > svg {
  display: inline-block;
  height: 1.1rem;
  width: 1.1rem;
  padding: 0;
  margin: 0;
}

div.social span.icon {
  margin: 0 0.2em;
  padding: 0;
}

div.social span a {
  text-decoration: none;
  color: black;
  padding: 0;
  margin: 0;
}

footer .theme_info {
  font-size: 0.85em;
}

footer .copyright {
  letter-spacing: 0.5px;
}

/* Box in article */
.Box {
  /* background: rgb(100, 209, 171); */
  border: 2px solid var(--header-background-darker);
  padding: 0.35em 2%;
  margin: 0;
  border-radius: 0.3em;
  width: 96%;
}
.Box::before {
  content: attr(title);
  font-weight: bold;
  font-style: italic;
  font-size: 1.05em;
}
.Box p {
  width: 100%;
}
.Box p:nth-child(1) {
  margin-top: 0.7em;
}
.Box p:last-child() {
  margin-bottom: 0;
}

/* Responsive design */

@media only screen and (max-width: 700px) {
  .article_content img,
  .article_content figure {
    width: 100%;
    display: block;
    margin: 0 auto;
  }
  body > .header {
    width: 90%;
    padding: 15px 5%;
  }
  body > .header > .header_title {
    min-width: 100px;
  }
  body > .header > .site_nav {
    min-width: 100px;
  }
  .main {
    display: flex;
    width: 90%;
  }
  .main article.post {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    padding-left: 0;
    padding-right: 0;
  }
  .main aside {
    display: none;
  }
  .article_content p {
    text-align: left;
    line-height: 1.57;
  }
  div.two-column {
    display: block;
  }
  div.two-column > * {
    width: 90%;
    margin: 0 auto;
    padding: 0 auto;
  }
}

/* GOAT Diagram */
/* Default size */
.goat.svg-container > svg {
  font-size: 16px;
  font-family: "Alegera", "Times New Roman", Times, serif;
  font-style: italic;
  max-height: 185px;
}
.lg .goat.svg-container > svg {
  max-height: 300px;
}
.sm .goat.svg-container > svg {
  max-height: 100px;
}

/* ToolTip */
.tippy-box {
  /* font-size: 18px; */
  max-width: 45ch !important;
  padding: 0em 0.9em;
}

#mmv-box {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
