/*! Contrast (light) - a Textus theme by @CatVinci-Studio
 *  Legibility after ITS Theme by SlRvb (an idea only; our own CSS)
 *  License: MIT
 *  Source: https://github.com/CatVinci-Studio/textus-themes
 */

/* High contrast for long reading: near-black on white or white on near-black, underlined links, a rule under each top heading. */

:root {
  --editor-bg: #f8fbff;
  --editor-text: #171c22;
  --editor-muted: #4f5a66;
  --editor-border: #9aa6b2;
  --editor-quote-border: #c14343;
  --editor-accent: #c14343;
  --editor-code-bg: #eef3fb;
  --editor-highlight-bg: rgba(255, 213, 0, 0.5);
  --editor-font: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  --theme-heading-font: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  --theme-mono: var(--font-mono, monospace);
  --theme-link: #2e6fae;
  --theme-strong: #171c22;
  --theme-quote-bg: transparent;
  --theme-quote-text: #4f5a66;
  --theme-code-text: #171c22;
  --theme-pre-bg: #eef3fb;
  --theme-th-bg: #eef3fb;
  --theme-th-text: #171c22;
  --theme-selection: rgba(255, 213, 0, 0.5);
  --theme-h1: #c14343;
  --theme-h2: #2f4f87;
  --theme-h3: #a76652;
  --theme-h4: #171c22;
  --theme-h5: #4f5a66;
  --theme-h6: #4f5a66;
  --tone-blue: #2e6fae;
  --tone-green: #2f7d4f;
  --tone-orange: #b5622a;
  --tone-purple: #6a4fb0;
  --tone-red: #c14343;
  --tone-teal: #1f7f86;
  --tone-yellow: #8a6a00;
  --tone-pink: #a8467a;
  --tone-gray: #5d6873;
}

body {
  background-color: var(--editor-bg);
  color: var(--editor-text);
}

#write {
  color: var(--editor-text);
  font-family: var(--editor-font);
  font-size: 18px;
  line-height: 1.75;
  color-scheme: light;
  --token-keyword: #6a4fb0;
  --token-function: #2e6fae;
  --token-string: #2f7d4f;
  --token-number: #b5622a;
  --token-tag: #c14343;
  --token-comment: #697580;
}

#write h1,
#write h2,
#write h3,
#write h4,
#write h5,
#write h6 {
  font-family: var(--theme-heading-font);
  font-weight: 750;
  line-height: 1.3;
}

#write h1 { font-size: 2.1em; color: var(--theme-h1); }
#write h2 { font-size: 1.55em; color: var(--theme-h2); }
#write h3 { font-size: 1.25em; color: var(--theme-h3); }
#write h4 { font-size: 1.08em; color: var(--theme-h4); }
#write h5 { font-size: 1em; color: var(--theme-h5); }
#write h6 { font-size: 0.92em; color: var(--theme-h6); }

#write a {
  color: var(--theme-link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

#write strong {
  color: var(--theme-strong);
}

#write blockquote {
  margin: 1.2em 0;
  padding: 0.5em 1.1em;
  border: 0;
  border-left: 3px solid var(--editor-quote-border);
  background-color: var(--theme-quote-bg);
  color: var(--theme-quote-text);
}

#write code {
  padding: 0.12em 0.38em;
  border-radius: 5px;
  background-color: var(--editor-code-bg);
  color: var(--theme-code-text);
  font-family: var(--theme-mono);
  font-size: 0.88em;
}

#write pre,
#write .md-fences {
  background-color: var(--theme-pre-bg);
  border: 1px solid var(--editor-border);
  border-radius: 8px;
  font-family: var(--theme-mono);
}

#write pre code {
  padding: 0;
  background: transparent;
  color: var(--editor-text);
}

#write table {
  border-collapse: collapse;
}

#write th,
#write td {
  padding: 0.5em 0.85em;
  border: 1px solid var(--editor-border);
}

#write th {
  background-color: var(--theme-th-bg);
  color: var(--theme-th-text);
  font-weight: 600;
}

#write hr {
  height: 1px;
  border: 0;
  background-color: var(--editor-border);
}

#write mark {
  background-color: var(--editor-highlight-bg);
  color: inherit;
}

#write input[type="checkbox"] {
  accent-color: var(--editor-accent);
}

#write ::selection {
  background-color: var(--theme-selection);
}

#write a { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
#write h1, #write h2 { padding-bottom: 0.25em; border-bottom: 3px solid currentColor; }
#write blockquote { border-left: 4px solid var(--editor-quote-border); color: var(--editor-text); }
#write code, #write pre { border: 1px solid var(--editor-border); }
#write strong { font-weight: 800; }
