@import url(/css/markdown.css);
@import url(/css/font.css);

:root {
  /* Font families */
  --font-family-article: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", Arial, sans-serif;
  --font-family-code: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace;
  
  /* Font sizes */
  --font-size-smaller: 12px;
  --font-size-small: 13px;
  --font-size-normal: 15px;
  --font-size-medium: 17px;
  --font-size-large: 20px;
  --font-size-larger: 22px;
  --font-size-huge: 26px;
  --font-size-huger: 36px;
}

[data-theme="light"] {
  --color-text-rgb: 0, 0, 0;
  --color-text-primary:    rgba(0, 0, 0, 0.8);
  --color-text-0_7:        rgba(0, 0, 0, 0.7);
  --color-text-secondary:  rgba(0, 0, 0, 0.6);
  --color-text-0_5:        rgba(0, 0, 0, 0.5);
  --color-link-underline:  rgba(0, 0, 0, 0.4);
  --color-text-0_3:        rgba(0, 0, 0, 0.3);
  --color-border-dark:     rgba(0, 0, 0, 0.2);
  --color-border:          rgba(0, 0, 0, 0.1);
  /* - */
  --color-background-main: rgb(245, 245, 245);
  /* --color-background-darker: rgb(240, 240, 240);
  --color-background-darkerr: rgb(235, 235, 235); */
  --color-background-darker: rgba(128, 128, 128, 0.05);
  --color-background-darkerr: rgba(128, 128, 128, 0.1);
  /* Table colors */
  --color-table-border: rgba(208, 215, 222, 1);
  --color-table-bg: rgba(255, 255, 255, 1);
  --color-table-bg-alt: rgba(246, 248, 250, 1);
  --color-background-main-rgb: 245, 245, 245;
}

[data-theme="dark"] {
  --color-text-rgb: 255, 255, 255;
  --color-text-primary:    rgba(255, 255, 255, 0.8);
  --color-text-0_7:        rgba(255, 255, 255, 0.7);
  --color-text-secondary:  rgba(255, 255, 255, 0.6);
  --color-text-0_5:        rgba(255, 255, 255, 0.5);
  --color-link-underline:  rgba(255, 255, 255, 0.4);
  --color-text-0_3:        rgba(255, 255, 255, 0.3);
  --color-border-dark:     rgba(255, 255, 255, 0.2);
  --color-border:          rgba(255, 255, 255, 0.1);
  /* - */
  --color-background-main: rgb(29, 30, 31);
  /* --color-background-darker: rgb(25, 28, 31);
  --color-background-darkerr: rgb(21, 26, 31); */
  --color-background-darker: rgba(128, 128, 128, 0.05);
  --color-background-darkerr: rgba(128, 128, 128, 0.1);
  /* Table colors */
  --color-table-border: rgba(255, 255, 255, 0.3);
  --color-table-bg: rgba(255, 255, 255, 0.05);
  --color-table-bg-alt: rgba(255, 255, 255, 0.15);
  --color-background-main-rgb: 29, 30, 32;
}

html {
  font-family: var(--font-family-article);
  color: var(--color-text-primary);
  line-height: 1.6em;
  -ms-text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background-color: var(--color-background-main);
  /* background-color: rgba(229, 234, 239, 0.3); */
  /* Background Image [Start] */
  /* Light sky blue: #e8f2fc */
  /* background: #e6f2fd url(../assets/background.svg) no-repeat center center fixed; 
  -webkit-background-size: cover;
  -moz-background-size: cover;
  -o-background-size: cover;
  background-size: cover; */
  /* Background Image [End] */
}
body {
  color: var(--color-text-primary);
  font-size: var(--font-size-normal);
  font-family: var(--font-family-article);
  margin: 0;
  padding: 0;
  padding-top: 50px;
}

body.body-default,
body.body-post {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.content {
  flex: 1;
}

a {
  color: var(--color-text-primary);
  text-underline-offset: 1.6px;
  text-decoration-color: var(--color-link-underline);
}
a:hover {
  text-decoration-color: var(--color-text-primary);
}
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-family-article);
}
h1 {
  font-size: var(--font-size-huger);
  line-height: 1.2em;
}
h2 {
  font-size: var(--font-size-huge);
}
h3 {
  font-size: var(--font-size-larger);
}
h4 {
  font-size: var(--font-size-medium);
  /* color: rgba(0, 0, 0, 0.7); */
}
.clear {
  clear: both;
}
.hidden {
  display: none;
}
.mono {
  font-family: monospace;
}
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background-color: rgba(var(--color-background-main-rgb), 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px); /* For Safari */
  padding: 12px 30px;
  border-bottom: 1px solid var(--color-border);
}
.nav ul {
  list-style-type: none;
  padding-left: 0;
  margin: 0 auto;
  max-width: 700px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.nav ul li {
  display: inline-flex;
  align-items: center;
}
.nav ul li:last-child {
  margin-right: 0;
}
.nav-brand {
  margin-right: auto; /* This pushes everything else to the right */
}
.nav-brand a {
  font-family: 'Sacramento';
  font-size: var(--font-size-larger);
  color: var(--color-text-secondary);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.1s ease;
}
.nav-items, .nav-buttons {
  display: flex;
  align-items: center;
}
.nav-items {
  gap: 30px;
}
.nav-items a {
  color: var(--color-text-primary);
  font-size: var(--font-size-normal);
  text-decoration: none;
  position: relative;
  transition: color 0.1s ease;
}
.nav-brand a:hover,
.nav-items a:hover {
  color: rgb(var(--color-text-rgb));
}
.nav-separator {
  width: 1px;
  height: 20px;
  background-color: var(--color-border);
  margin: 0 20px 0 25px;
}
.nav-buttons {
  gap: 10px;
}
#search-toggle,
#theme-toggle {
  background: none;
  border: none;
  padding: 5px;
  cursor: pointer;
  color: var(--color-text-primary);
  border-radius: 5px;
  position: relative;
  width: 25px;
  height: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#search-toggle:hover,
#theme-toggle:hover {
  background-color: var(--color-background-darkerr);
}

#theme-toggle #sun,
#theme-toggle #moon {
  opacity: 1;
  transition: opacity 0.1s ease, transform 0.3s ease;
  position: absolute;
}

#theme-toggle #sun {
  opacity: 1;
  transform: rotate(0deg);
}

#theme-toggle #moon {
  opacity: 0;
  transform: rotate(-60deg);
}

[data-theme="dark"] #theme-toggle #sun {
  opacity: 0;
  transform: rotate(45deg);
}

[data-theme="dark"] #theme-toggle #moon {
  opacity: 1;
  transform: rotate(0deg);
}

.footer {
  /* background-color: #c4c4c4; */
  color: var(--color-text-secondary);
  text-align: center;
  /* margin-top: auto; */
  padding-top: 20px;
  padding-bottom: 15px;
}
.footer p {
  margin: 0;
  font-size: var(--font-size-smaller);
}
.wrap {
  max-width: 700px;
  padding: 0 30px;
  margin: 0 auto;
}
/* ---------------------------- */
/* || Blog Post ||  font-matter */
/* ---------------------------- */
.front-matter {
  padding-block: 40px;
  border-bottom: 1px solid var(--color-border);
  background-color: var(--color-background-darker);
}
.front-matter h1 {
  margin: 0;  /* Remove default margin (makes the layout of .front-matter easier to set) */
}
.front-matter h4 {
  font-weight: 600;
}
.front-matter .bylines .byline {
  /* margin-right: 20px; */
  float: left;
}
.front-matter .bylines .byline h3,
.front-matter .bylines .byline p {
  font-size: var(--font-size-small);
  margin: 0;
}


.front-matter .bylines .byline h3 {
  /* Used to be: PUBLISHED */
  /* Now changed to author name */
  /* text-transform: uppercase; */
  font-weight: 600;
  color: var(--color-text-0_5);
}

.front-matter .bylines .byline p { 
  /* Date */
  line-height: 1.6em;
}

/* ------------------ */
/* || Blog-Welcome || */
/* ------------------ */
#blog-welcome {
  padding: 40px 0;
  border-bottom: 1px solid var(--color-border);
}
#blog-welcome .quote {
  font-size: var(--font-size-normal);
  font-style: italic;
  line-height: 1.4em;
  margin-top: 40px;
}
#blog-welcome .quote p {
  margin-bottom: 5px;
}
#blog-welcome .styled-name {
  font-family: Sacramento;
  font-size: 25px;
  padding: 0 5px;
}

/* ---------- */
/* || Blog || */
/* ---------- */
#blog {
  font-size: var(--font-size-normal);
  margin-top: 50px;
  /* margin-bottom: 50px; */
  margin-bottom: 80px;
}
#blog #profile-picture {
  width: 30%; 
  float: right!important; 
  margin-top: 5px;
  margin-left: 20px;
  margin-bottom: 5px;
  border-radius: 2px !important;
}
#blog .post-date {
  text-transform: uppercase;
  color: var(--color-text-0_7);
  font-size: var(--font-size-small);
  font-weight: 600;
  margin-block: 4px 2px; 
  /* margin-block: 5px 3px is good as well*/
}
#blog .post-title {
  display: inline-block;
  font-weight: bold;
  margin-bottom: 0;
}
#blog .post-title a {
  font-size: var(--font-size-large);
  text-decoration: none;
}
#blog .post-title a:hover {
  text-decoration: underline;
}
#blog .post-subtitle {
  margin-top: 0;
  margin-bottom: 25px;
  line-height: 1.5em;
}

#blog .post-row .post-title,
#blog .post-row .post-subtitle {
  margin: 0;
}
#blog .post-row {
  padding: 0px;
  /* margin-bottom: 50px; */
}
#blog .post-divider,
#blog-welcome .post-divider {
  margin: 30px 0;
  border-bottom: 1px solid var(--color-border);
}

/* ---------------- */
/* || Blog ||  Tags */
/* ---------------- */
#tags {
  margin-inline: 5px;
  margin-block: 50px 70px;
  text-align: right;
}
#tags #tag-nav {
  list-style-type: none;
  padding: 0;
}
#tags #tag-nav li {
  display: inline;
  margin-left: 30px;
  margin-right: 0;
}
#tags #tag-nav li.tag-nav-item {
  display: inline-block;
}
#tags #tag-nav li a {
  font-weight: bold;
  text-decoration: none;  /* Remove underline */
  transition: color 0.1s ease;
}
#tags #tag-nav li a:hover {
  color: rgb(var(--color-text-rgb));
}
#tags #tag-nav li a.tag-selected {
  text-decoration: none;
  position: relative;
  color: var(--color-text-primary);
}
#tags #tag-nav li a.tag-selected::after {
  content: '';
  position: absolute;
  left: -3px;
  right: -3px;
  bottom: -4px;
  height: 2px;
  background-color: var(--color-text-primary);
}
#tags #tag-nav #tag-post-count {
  font-size: var(--font-size-smaller);
  font-weight: 500;
  color: var(--color-text-secondary);
  -webkit-user-select: none; /* Chrome, Safari, Opera */
  -moz-user-select: none;    /* Firefox */
  -ms-user-select: none;     /* Internet Explorer/Edge */
  user-select: none;
  cursor: default;
  position: relative;
  top: -6px;
  left: 3px;
}

/* -------------- */
/* || Tag Page || */
/* -------------- */
.tag-page h2#tag-title {
  border-bottom: 1px solid var(--color-border-dark);
  /*  */
  padding-bottom: 14px;
  margin-top: 46px;
  margin-bottom: 30px;
}

/* ----------------------- */
/* || Landing ||  anqi.ai  */
/* ----------------------- */
#landing {
	max-width: 700px;
	margin: 120px auto;
  padding: 0 15%;
}
#landing h3 {
  margin-block: 0;
  line-height: 30px;
}
#landing ul {
  list-style-type: none;
	padding-left: 0;
}
#landing ul li#email {
  padding-top: 2px;
}

#email {
  font-family: courier;
}

#blog #email {
  position: relative;
  top: -1px;
}

/* ------------------ */
/* || Katex Plugin || */
/* ------------------ */
.katex-html {
  padding: 12px;
  /* border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.1); */
  overflow: auto hidden;
  mask-image: linear-gradient(to right, 
                            rgba(0, 0, 0, 1) 90%, 
                            rgba(0, 0, 0, 0));
  mask-image: -webkit-linear-gradient(left, 
                                    rgba(0, 0, 0, 1) 90%, 
                                    rgba(0, 0, 0, 0));
  transition: mask-image 0.3s ease-out; /* Smooth transition */
}

.katex-display>.katex>.katex-html>.tag {
  position: initial !important;
  right: initial !important;
  margin-left: 30px;
  margin-right: -50px;  /* Move tag to right a bit, so that formula is centered */
  padding-right: 56px;
}

/* -------------------- */
/* || Github Comment || */
/* -------------------- */
.giscus {
  margin-top: 40px;
}

/* ------------------ */
/* || WeChat Popup || */
/* ------------------ */
.wechat #overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  justify-content: center;
  align-items: center;
}

.wechat #popup {
  border-radius: 10px;
  position: relative;
  width: fit-content;
}

.wechat #popup img {
  width: 300px;
  height: auto;
  border-radius: 10px;
  user-select: none;
  pointer-events: none;
}

.wechat #wechat-close {
  color: rgba(0, 0, 0, 0.8);
  width: fit-content;
  height: fit-content;
  position: absolute;
  top: 10px;
  right: 15px;
  border: none;
  background: none;
  font-size: 25px;
  cursor: pointer;
}

@media screen and (max-width: 500px) {
  .wrap, .nav {
    padding-left: 20px;
    padding-right: 20px;
  }
  #landing {
    padding: 0 10%;
  }
  #blog #profile-picture {
    /* width: 30%;  */
    margin-left: 10px;
  }
  .nav-brand {
    font-size: var(--font-size-normal);
  }
  .nav-items {
    gap: 20px;
  }
  .nav-buttons {
    gap: 15px;
  }
  .nav-separator {
    /* height: 20px; */
    margin: 0 12px 0 20px;
  }
  .nav-items a:hover:after {
    width: 0;
  }
  #search-toggle:hover,
  #theme-toggle:hover {
    background-color: transparent;
  }
}
