/* Light mode */
/* @media (prefers-color-scheme: light) {
    blockquote {
      background: #f9f9f9;
    }

    a {
      color: #613DC1;
    }

    header {
      background: #613DC1;
    }

    .article-meta, .menu a {
      background: #E8DBC5;
      color: #000;
    }

    table {
      margin: auto;
      border-top: 1px solid #666;
      border-bottom: 1px solid #666;
    }
    table thead th { border-bottom: 1px solid #ddd; }
    th, td { padding: 5px; }
    tr:nth-child(even) { background: #eee }

}
*/

:root {
  --body-color: black;
  --bg-color: #faf7f0;
  --accent-color-1: #ff6e50;
  --accent-color-2: #4f040b;
  --accent-color-3: #ffd5c2;
  --secondary-color: #666;
}

body {
  max-width: 800px;
  margin: auto;
  padding: .2em;
  line-height: 1.5em;
  background-color: var(--bg-color);
  color: var(--body-color);
  font-size: 1.2rem;
}

h1 {
  line-height: 1.5em;
}

/* Table of Contents, if wanted

Add to yaml:

output:
  blogdown::html_page:
    toc: true

    */

#TableOfContents, #TOC {
  border: 1px solid #eee;
  border-radius: 5px;
}

/* Header and Footer */
.menu li { display: inline-block; }
.article-meta, .menu a {
  text-decoration: none;
  padding: 5px;
  border-radius: 5px;
  border-style: none;
  border-width: 1px;
  margin: 00px 0px 20px 0px;
  color: var(--accent-color-1);
  position: static;
  right: unset;
}

.terms { font-size: .9em; }
.menu, .article-meta, footer { text-align: center; }
.title { font-size: 1.1em; }
footer a { text-decoration: none; }

.pull-left {
    float: left
}
.pull-right {
    float: right
}

a {
  text-decoration: none;
  color: var(--accent-color-2);
}

a:hover {
  background-color: var(--accent-color-3);
  border-radius: 4px;
  transition-property: background;
  transition-duration: 0.2s;
}

/* Adjust background at your leisure! */
header {
    position: relative;
    width: 100%;
    height: 1.75rem;
    font-size: 1rem;
}

header ul,
header ol {
    margin: 0;
    padding: 0;
    list-style: none
}
header nav {
    padding: 0 0.5rem
}

header a {
	color: #000000;
    line-height: 1.75rem;
    padding: 0 0.5rem
}

/* Code Boxes */
pre {
  border: 2px solid #EBC3DB;
  padding: 0.3em 1em;
  line-height: 1em;
  overflow-x: auto;
  overflow-y: hidden;
}
pre code { background: none; }

code {
  background-color: light-dark(#D6D6D6, #888);
  border-radius: 3px;
  overflow-x: auto;
}


/* Images, tables, misc. */
img, iframe, video {
  max-width: 100%;
  height: auto;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

main {
  hyphens: auto;
  max-width: 650px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.1em;
  hyphens: auto;
  display: block;
  font-size: 1.1rem;
}
main a {
  font-weight: bold;
}

blockquote {
  border-left: 5px solid #ccc;
  padding: 0px 1em 0px;
  position: relative;
  right: 1.5em;
}

.content-wrapper {
  padding: 0px 12px 0px 12px;
}
#foxy {
  min-width: 40px;
  float: right;
  padding: 10px;
  display: block;
}

.home-link {
  margin-top: 5rem;
}

table {
      margin: auto;
      border-top: 1px solid #666;
      border-bottom: 1px solid #666;
    }
table thead th { border-bottom: 1px solid #666; }
th, td { padding: 5px; }
tr:nth-child(even) { background: #edd; }


/* Custom superscript styling to not interfere with line height */
sup { vertical-align: top; position: relative; top: -0.2em; font-size: 0.7em;}

/* Sidenotes, based on https://scottstuff.net/posts/2024/12/16/sidenotes-in-hugo-with-fixit/ */
span.sidenote {
  display: block;
  position: relative;
  float: right;
  clear: right;
  
  width: 28%;
  margin: 0;
  margin-bottom: 1.1rem;
  margin-top: 1.1rem;
  margin-right: -35%;
  padding: 0.5rem;
  padding-top: 0;
  padding-bottom: 0;
  box-sizing: border-box;
  text-align: left;

  font-size: 100%;
  line-height: 100%;
  color: var(--secondary-color);

  /* add a vertical bar on the left side */
  border: none;
  border-left-color: var(--accent-color-2);
  border-left-style: solid;
  border-left-width: 1px;
  
}

.nowrap {
  white-space: nowrap;
}

.float-right {
  float: right;
  margin-left: 1.5rem;
}

.float-left {
  float: left;
  margin-right: 1.5rem;
}

figcaption {
  color: var(--secondary-color);
  font-size: 80%;
}

figure {
  margin: 0;
}

/* Small devices, phones */
@media only screen and (max-width : 767px) {
  #foxy {
    min-width: 40px;
    float: center;
    padding: 10px 10px 10px 20px;
    display: block;
  }
}

/* Desktop styling */
@media screen and (min-width: 768px) {
    #table-of-contents {
        position: fixed; /* 固定定位，使其悬浮在页面上 */
        top: 50%; /* 上边距为50% */
        right: 15px; /* 右边距为0，将其放在右侧 */
        transform: translateY(-50%); /* 使用transform来垂直居中 */
        background-color: #f0f0f0; /* 设置背景颜色 */
        padding: 10px; /* 添加一些内边距以增加可读性 */
        box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.2); /* 添加阴影效果 */
        width: 250px; /* 设置宽度 */
        max-height: 70vh; /* 设置最大高度为视口的70% */
        overflow-y: auto; /* 添加垂直滚动条 */
    }
}