html {
  font-size: clamp(15px, 1.2vw + 0.5rem, 19px);
}

html,
body {
  margin: 0;
  padding: 0;
  background: #fefefe;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: "Vollkorn", Palatino, Times, serif;
  color: #333;
  line-height: 1.6;
  text-align: justify;
  min-height: 100vh;
  max-width: clamp(320px, 90vw, 960px);
  margin: 0 auto;
  padding: clamp(15px, 4vw, 40px);
  box-sizing: border-box;
}

#write {
  max-width: clamp(320px, 90vw, 960px);
  margin: 0 auto;
  margin-bottom: 2em;
  line-height: clamp(1.6, 0.1vw + 1.5, 1.7);
  padding: clamp(15px, 4vw, 40px);
  box-sizing: border-box;
}

@media only screen and (min-width: 1400px) {
  body,
  #write {
    max-width: clamp(960px, 85vw, 1100px);
    padding: clamp(40px, 4vw, 60px);
  }
}

@media only screen and (max-width: 768px) {
  body,
  #write {
    padding: clamp(15px, 4vw, 25px);
    line-height: 1.6;
  }

  body {
    text-align: left;
  }
}

@media only screen and (max-width: 480px) {
  body,
  #write {
    padding: clamp(12px, 3vw, 20px);
  }
}

@media print {
  html {
    font-size: 13px;
  }
}

#write > h1:first-child,
h1 {
  margin-top: 1.6em;
  margin-bottom: 0.8em;
  font-weight: normal;
}

h1 {
  font-size: clamp(1.8em, 4vw, 3em);
  line-height: clamp(1.2, 0.05vw + 1.15, 1.2);
}

h2 {
  margin-top: clamp(1.5em, 3vw, 2em);
  margin-bottom: clamp(0.8em, 1.5vw, 1em);
  font-weight: normal;
  font-size: clamp(1.5em, 3.5vw, 2.5em);
  line-height: clamp(1.3, 0.05vw + 1.25, 1.3);
}

h3 {
  font-weight: normal;
  font-style: italic;
  font-size: clamp(1.2em, 2.5vw, 2em);
  margin-top: clamp(2em, 4vw, 2.5em);
  margin-bottom: clamp(0.6em, 1.2vw, 0.8em);
  line-height: clamp(1.4, 0.05vw + 1.35, 1.4);
}

h1,
h2,
h3 {
  text-align: center;
}

h2:after {
  border-bottom: 1px solid #2f2f2f;
  content: "";
  width: clamp(60px, 15vw, 100px);
  display: block;
  margin: 0 auto;
  height: 1px;
}

h1 + h2,
h2 + h3 {
  margin-top: 0.83em;
}

p,
.mathjax-block {
  margin-top: 0;
  margin-bottom: 1.2em;
  -webkit-hypens: auto;
  -moz-hypens: auto;
  hyphens: auto;
}

p + p {
  margin-top: 1em;
}

ul {
  list-style: square;
  padding-left: 1.2em;
  margin: 0 0 1.2em 0;
}

ol {
  padding-left: 1.2em;
  margin: 0 0 1.2em 0;
}

li {
  margin-bottom: 0.5em;
  line-height: 1.6;
}

@media print {
  ol {
    padding-left: clamp(20px, 5vw, 40px);
  }
}

blockquote {
  margin: clamp(1.2em, 2vw, 1.5em) 0;
  padding: clamp(0.6em, 1.5vw, 0.8em) clamp(1em, 2vw, 1.2em);
  border-left: clamp(2px, 0.5vw, 3px) solid #ddd;
  background: #f9f9f9;
  border-radius: 0 clamp(3px, 0.8vw, 4px) clamp(3px, 0.8vw, 4px) 0;
}
code,
pre {
  font-family: "Consolas", "Menlo", "Monaco", monospace, serif;
  font-size: 0.9em;
  background: white;
}
.md-fences {
  margin: clamp(1.2em, 2vw, 1.5em) 0;
  padding: clamp(0.8em, 1.5vw, 1em) clamp(1em, 2vw, 1.2em);
  border: 1px solid #ddd;
  border-radius: clamp(3px, 0.8vw, 4px);
  background: #fafafa;
  overflow-x: auto;
}

a {
  color: #2484c1;
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover {
  color: #1a6a9a;
  text-decoration: underline;
}
a img {
  border: none;
}
h1 a,
h1 a:hover {
  color: #333;
  text-decoration: none;
}
hr {
  color: #ddd;
  height: 1px;
  margin: clamp(2em, 4vw, 3em) auto;
  max-width: clamp(120px, 30vw, 200px);
  border-top: solid 1px #ddd;
  border-bottom: none;
  border-left: 0;
  border-right: 0;
}
.ty-table-edit {
  background: #ededed;
  padding-top: clamp(3px, 0.8vw, 4px);
}
table {
  margin: clamp(1.2em, 2vw, 1.5em) 0;
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  overflow-x: auto;
  display: block;
}

@media only screen and (min-width: 768px) {
  table {
    display: table;
    margin: clamp(1.2em, 2vw, 1.5em) auto;
  }
}

table th,
table td {
  padding: clamp(6px, 1.5vw, 10px) clamp(8px, 2vw, 12px);
  line-height: 1.5;
  vertical-align: top;
  border-top: 1px solid #ddd;
}

table th {
  background-color: #f8f8f8;
  font-weight: bold;
}
table thead th {
  vertical-align: bottom;
}
table caption + thead tr:first-child th,
table caption + thead tr:first-child td,
table colgroup + thead tr:first-child th,
table colgroup + thead tr:first-child td,
table thead:first-child tr:first-child th,
table thead:first-child tr:first-child td {
  border-top: 0;
}
table tbody + tbody {
  border-top: 2px solid #ddd;
}

.task-list {
  padding: 0;
}

.md-task-list-item {
  padding-left: 1.6rem;
}

.md-task-list-item > input:before {
  content: "\221A";
  display: inline-block;
  width: 1.33333333rem;
  height: 1.6rem;
  vertical-align: middle;
  text-align: center;
  color: #ddd;
  background-color: #fefefe;
}

.md-task-list-item > input:checked:before,
.md-task-list-item > input[checked]:before {
  color: inherit;
}
.md-tag {
  color: inherit;
  font: inherit;
}
#write pre.md-meta-block {
  min-height: clamp(25px, 5vw, 35px);
  padding: clamp(0.4em, 1vw, 0.5em) clamp(0.8em, 2vw, 1em);
}
#write pre.md-meta-block {
  white-space: pre;
  background: #f8f8f8;
  border: 0px;
  color: #999;

  width: 100vw;
  max-width: 100vw;
  margin-left: clamp(-20px, -4vw, -30px);
  border-left: clamp(20px, 4vw, 30px) #f8f8f8 solid;
  border-right: clamp(20px, 4vw, 30px) #f8f8f8 solid;

  margin-bottom: clamp(1.5em, 3vw, 2em);
  margin-top: -1.3333333333333rem;
  padding-top: clamp(18px, 4vw, 26px);
  padding-bottom: clamp(8px, 1.5vw, 10px);
  line-height: clamp(1.6em, 0.3vw + 1.5em, 1.8em);
  font-size: clamp(0.7em, 1.5vw, 0.9em);
  padding-left: 0;
}
.md-img-error.md-image > .md-meta {
  vertical-align: bottom;
}
#write > h5.md-focus:before {
  top: clamp(1px, 0.3vw, 2px);
}

.md-toc {
  margin-top: clamp(30px, 5vw, 40px);
  margin-bottom: clamp(20px, 4vw, 30px);
}

.md-toc-content {
  padding-bottom: clamp(15px, 3vw, 20px);
  line-height: clamp(1.6, 0.3vw + 1.5, 1.8);
}

.outline-expander:before {
  color: inherit;
  font-size: clamp(12px, 2vw, 14px);
  top: auto;
  content: "\f0da";
  font-family: FontAwesome;
}

.outline-expander:hover:before,
.outline-item-open > .outline-item > .outline-expander:before {
  content: "\f0d7";
}

.md-task-list-item > input {
  margin-left: -1.3em;
  margin-top: calc(1rem - clamp(8px, 1.5vw, 12px));
}

.md-mathjax-midline {
  background: #fafafa;
}

.md-fences .code-tooltip {
  bottom: clamp(-1.5em, -3vw, -2em) !important;
}

.dropdown-menu .divider {
  border-color: #e5e5e5;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: clamp(1.2em, 2vw, 1.5em) 0;
}

p code,
li code,
td code,
th code {
  padding: clamp(0.15em, 0.5vw, 0.2em) clamp(0.3em, 0.8vw, 0.4em);
  background: #f5f5f5;
  border-radius: clamp(2px, 0.5vw, 3px);
  font-size: clamp(0.85em, 1.2vw, 0.9em);
}

pre code,
.md-fences code {
  padding: 0;
  background: transparent;
}
