html {
  overflow-y: scroll;
  font-weight: 400;
  scroll-behavior: smooth;
}

:root {
  --bgcolor: #f0ece5;
  --fontcolor: rgb(50, 50, 50);
  --linkcolor: #black;
  --visitedcolor: black;
  --precolor: #f0ece5;
  --prebgcolor: #000;
}

h3,
h4,
h5,
h6,
p,
div,
article {
  font-weight: 500;
}

* {
  /* font-family: "Noto Serif TC", serif; */
  letter-spacing: 0.1pt;
  line-height: 1.6rem;
}

/* @media (prefers-color-scheme: dark) {
  :root {
    --bgcolor: black;
    --fontcolor: white;
    --linkcolor: #5bf;
    --visitedcolor: #ae5ee0;
    --precolor: #fff;
    --prebgcolor: #383838;
  }
} */

/* pre.mermaid {
  background-color: transparent !important;
} */

p {
  /* margin: 24pt auto; */
  font-size: 14.5px !important;
}

body {
  font-size: 14.5px;
  color: var(--fontcolor);
  background: var(--bgcolor);
  font-weight: 300;
  margin: 0;
  -webkit-text-size-adjust: none;
}

a:link {
  color: var(--linkcolor);
}

a:visited {
  color: var(--visitedcolor);
}

a:active {
  color: var(--visitedcolor);
}

h1,
h2,
h3 {
  line-height: 1.2;
}

h1,
h2 {
  font-size: 30px;
  font-weight: 300;
}

h1.post {
  font-size: 60px;
  margin: 50px auto 16px auto;
}

p > code {
  color: var(--precolor);
  background: var(--prebgcolor);
  padding: 2px;
  font-family: "LXGW WenKai Mono TC", monospace !important;
  font-size: 0.9rem;
}

code {
  font-family: "LXGW WenKai Mono TC", monospace !important;
}

pre {
  color: var(--precolor);
  background: var(--prebgcolor);
  padding: 24px;
  overflow-x: auto;

  font-family: "LXGW WenKai Mono TC", monospace;
}

article {
  padding: 24px 0;

  .preview p {
    margin: auto auto 24pt auto;
  }
  .titlebox {
    h1 {
      margin-top: 0;
      margin-bottom: 50pt;
    }
  }

  p {
    margin: 24pt auto;
  }

  h1,
  h2 {
    margin-top: 50pt;
  }
}

.center {
  display: block;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

figcaption {
  color: #888;
  font: 12px/1.5 monospace;
  text-align: center;
}

figure {
  margin: auto;
}

img {
  display: block;
  max-width: 80vmin;
  height: auto;
  margin: 30px 0;
}

footer {
  margin-top: auto;
  border-top: 1.5px solid black;
  padding: 24px;
}

header {
  z-index: 100;
  border-bottom: 1.5px solid black;
  display: flex;
  flex-direction: row;

  top: 0;
  background-color: var(--bgcolor);
  position: sticky;
}

header > .title {
  padding: 16px;
  border-right: 1.5px solid black;
  box-sizing: content-box;
  display: inline-block;
  white-space: nowrap;
}

main {
  margin: 40px auto;
  max-width: 800px;
  padding: 0 24px;

  min-height: calc(100vh - 230px);
}

a.no-underline {
  text-decoration: none;
}

aside {
  display: inline-block;
  box-sizing: content-box;
  margin: 64px 0;
  /* padding: 24px 32px; */
  padding: 16px 24px;
  border: 2.5px solid black;
  box-shadow: 5px 5px 0px black;
  min-width: min(500px, 70vw);
}

.summary:not(:first-child) {
  border-top: 2px solid black;
}

.summary {
  /* padding: 24px 32px; */
  /* padding-top: 26px; */
  /* border: 2.5px solid black; */
  /* box-shadow: 5px 5px 0px black; */
  min-width: min(calc(100% - 60px), 500px);
  /* margin: 64px 0; */
  margin-bottom: 64px;

  display: flex;
  flex-direction: row;
  flex-flow: row wrap;
  gap: 24px;

  transition: box-shadow 0.15s;
  -webkit-transition: box-shadow 0.15s;
}

.summary > div {
  justify-self: stretch;
}

.summary .titlebox {
  /* min-width: 30vmax; */
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 250px;
}

.summary .preview {
  flex: 2;
  min-width: 300px;
}

.summary .preview > figure {
  /* width: 100%; */
  justify-self: stretch;
  /* width: fit-content; */
  box-sizing: border-box;
  width: 100%;
  object-fit: cover;
  object-position: center;
}

.preview > figure img {
  width: 100%;
  box-sizing: border-box;
}

.preview:first-child {
  display: hidden;
}

/* .titlebox h1 {
  margin-top: 1rem;
} */

.titlebox h1 a {
  /* margin-inline-end: 16px; */
  word-wrap: break-word;
  text-decoration: none;
  font-weight: 400;
}

div.preview:first {
  margin-top: 0;
}

article .content {
  margin-top: 60px;
}

.title.menu {
  border-right: 0;
  border-left: 1.5px solid black;
}

.wrapper {
  flex-grow: 1;
  overflow: hidden;

  /* box-sizing: content-box;
  display: inline-flex;

  flex-direction: row; */
  margin: auto;
}

.marquee {
  white-space: nowrap;
  overflow: hidden;
  display: inline-block;
  animation: marquee 30s linear infinite;

  margin-bottom: -0.2rem;
}

.marquee * {
  display: inline-block;
  /* padding: 16px; */
  margin: 0;
  color: black;
  font-size: 14.5px;
}

@keyframes marquee {
  0% {
    transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(-50%, 0, 0);
    -webkit-transform: translate3d(-50%, 0, 0);
  }
}

blockquote {
  /* border: 2px solid black; */
  border-left: 2px solid black;
  /* border-radius: 8px; */
  margin: 0;
  padding: 0 1rem;

  /* font-style: italic; */
}

.footnotes {
  word-wrap: break-word;
}

.preview p:has(img) {
  img {
    width: 100%;

    margin-top: 0;
    margin-bottom: 0;
  }
}
