/*
  Article typography overrides and page-specific font usage.
*/

:root {
  --article-line-height: 1.5;
  --post-cover-clearance: 1.25rem;
}

article,
.post-header .post-header-inner h1,
.post-header .post-header-description {
  font-family: var(--font-serif-stack);
}

article :is(h1, h2, h3, h4, h5) {
  font-family: var(--font-serif-stack);
}

article {
  font-size: 1.0625rem;
}

article p {
  margin: 0.75em 0;
}

article :is(p, li, dd, blockquote, td, th) {
  line-height: var(--article-line-height);
}

article :is(ul, ol) {
  margin-left: 0;
  padding-inline-start: 2em;
  line-height: var(--article-line-height);
}

article :is(ul, ol) > li {
  margin: 0;
  padding: 0;
}

article :is(ul, ol) > li:not(:last-child) {
  margin-bottom: 0;
}

article :is(ul, ol) > li > p {
  margin: 0;
  line-height: var(--article-line-height);
}

.post-header.post-category-poem .post-header-inner h1,
.post-header.post-category-poem .post-header-description,
article.post-category-poem {
  font-family: var(--font-poem-stack);
}

article.post-article.has-cover > section {
  margin-top: var(--post-cover-clearance);
}

article.post-article.has-cover .post-cover {
  display: flex;
  justify-content: center;
  margin: 0 0 var(--post-cover-clearance) 0;
}

article.post-article.has-cover .post-cover + :where(p, h1, h2, h3, h4, h5, ul, ol, blockquote, figure, pre) {
  margin-top: 0;
}

article.post-article.has-cover .post-cover > * {
  max-width: 100%;
}

article.post-article.has-cover .post-cover img,
article.post-article.has-cover .post-cover svg {
  max-width: 100%;
  height: auto;
}

article .poem-frame {
  display: flex;
  width: 100%;
  margin: 1em 0;
}

article .poem-frame.poem-frame-align-left {
  justify-content: flex-start;
}

article .poem-frame.poem-frame-align-center {
  justify-content: center;
}

article .poem-frame.poem-frame-align-right {
  justify-content: flex-end;
}

article .poem-frame-inner {
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  width: fit-content;
  max-width: 100%;
  text-align: left;
}

article .poem-frame-inner.poem-frame-inner-align-center {
  text-align: center;
}

article .poem-frame-inner.poem-frame-inner-align-right {
  text-align: right;
}

article .poem-frame-line {
  display: block;
  line-height: var(--article-line-height);
}

article .poem-frame-run {
  white-space: pre-wrap;
}

article .poem-frame-run-latin {
  font-family: var(--font-serif-stack);
}

article .poem-frame-run-cjk {
  font-family: var(--font-kai-stack);
}

article.post-category-poem :is(h1, h2, h3, h4, h5) {
  font-family: var(--font-poem-stack);
}

article > section {
  margin-top: 1.25rem;
}

article nav[role="doc-toc"] {
  margin-top: 0;
}

article nav[role="doc-toc"] > h2 {
  margin-top: 0;
  margin-bottom: 0.75rem;
}

article nav[role="doc-toc"] > :is(ol, ul) {
  margin-top: 0;
}

article nav[role="doc-toc"] a:visited {
  color: var(--link);
}

article nav[role="doc-toc"]::after {
  content: "";
  display: block;
  width: 100%;
  margin-top: 0.75em;
  border-bottom: 0.5pt solid currentColor;
  opacity: 0.65;
}
