:root {
  --font-size-base: 16px;
  --site-font: 'MiSans Latin VF', 'MiSans VF', system-ui, -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --code-font: 'Roboto Mono', ui-monospace, SFMono-Regular, Consolas, monospace;
  --prose-rule: #e4e4e7;
  --prose-link: var(--color-primary);
}

html[data-theme="dark"] {
  --prose-rule: #424247;
  --prose-link: var(--color-primary-dark);
}

html { font-family: var(--site-font); }
p, .callout p, :is(button, input, select, textarea) { font-family: inherit; }
pre, code, kbd, samp { font-family: var(--code-font); }

/* Align the header across pages without moving the content below it. */
.content > header,
.content > main > .site-description {
  position: relative;
  inset-block-start: -12px;
}

/* Post-title links are not ordinary links or navigation. */
html:root .list-item > h1.title a,
.posts > .post > a,
.search-result-title a {
  border-block-end: 0 !important;
  border-bottom: 0 !important;
  text-decoration: none !important;
}

.list-item > h1.title,
.post-content > .title > h1.title {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.post-content > .title > h1.title {
  font-size: clamp(1.6rem, 4vw, 2.15rem);
  line-height: 1.3;
  margin-block: 1.05em 0.3em;
}

.post-content > .title > h1.title::before,
.post-content > .body :is(h1, h2, h3, h4, h5, h6)::before {
  content: none;
}

.post-content > .body {
  font-size: 17px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.post-content > .body p {
  line-height: inherit;
  margin-block: 0.75em;
}

/* Let a prose label and its trailing link wrap as one paragraph.
   Keep authored breaks in quotes, lists and other content. */
.post-content > .body > p > br:has(+ a:last-child) {
  display: none;
}

.post-content > .body :is(h1, h2, h3, h4, h5, h6) {
  font-weight: 650;
  line-height: 1.4;
  margin-block: 1.55em 0.45em;
  scroll-margin-block-start: 1rem;
}

.post-content > .body :is(h1, h2) { font-size: clamp(1.2rem, 2.7vw, 1.4rem); }
.post-content[data-daily-news] > .body > h2 { font-weight: 550; }
.post-content[data-daily-news] > .body > h2 + ul > li > strong { font-weight: 500; }
.post-content > .body h3 { font-size: 1.15em; }
.post-content > .body :is(h4, h5, h6) { font-size: 1em; }
.post-content > .body > :first-child { margin-block-start: 0; }

.post-content > .body :is(ul, ol) {
  margin-block: 0.75em;
  padding-inline-start: 1.6em;
}
.post-content > .body ul { list-style: disc; }
.post-content > .body ul ul { list-style: circle; }
.post-content > .body ul > li { text-indent: 0; }
.post-content > .body ul > li::before { content: none; }
.post-content > .body li + li { margin-block-start: 0.25em; }
.post-content > .body li > :is(ul, ol) { margin-block: 0.25em; }
.post-content > .body ul.contains-task-list { list-style: none; }

.post-content > .body blockquote {
  margin-block: 1em;
  padding-inline-start: 0.9em;
  border-inline-start: 2px solid var(--prose-rule);
  font-style: normal;
}

.post-content > .body hr {
  border: 0;
  border-block-start: 1px solid var(--prose-rule);
  margin-block: 1.5em;
}

.post-content > .body pre { margin-block: 1em; line-height: 1.55; }
.post-content > .body pre > code { padding: 0; background: transparent; border-radius: 0; }

:root .post-content > .body a,
.post-content > .bookmarks-toc a {
  text-decoration-line: underline;
  text-decoration-color: var(--prose-link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

:root .post-content > .body :is(h1, h2, h3, h4, h5, h6) a {
  text-decoration: none;
}

.list-item > .title a:focus-visible,
.posts > .post > a:focus-visible,
.search-result-title a:focus-visible,
.post-content > .body a:focus-visible,
.post-content > .bookmarks-toc a:focus-visible {
  outline: 2px solid var(--prose-link) !important;
  outline-offset: 3px;
}

/* Structural styles for an article directory, when present. */
.post-content > .bookmarks-toc {
  margin-block: 1.25rem 1.5rem;
  padding: 0.65rem 0;
  border-block: 1px solid var(--prose-rule);
}
.post-content > .bookmarks-toc ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  margin: 0;
  padding: 0;
}
.post-content > .bookmarks-toc li { margin: 0; text-indent: 0; }
.post-content > .bookmarks-toc li::before { content: none; }

@media (max-width: 40em) {
  .list-item > h1.title,
  .post-content > .title > h1.title {
    word-break: break-all;
  }
  .post-content > .bookmarks-toc ul { flex-direction: column; }
}
