@import url('https://fonts.googleapis.com/css2?family=Alegreya:ital,wght@0,400..900;1,400..900');
@import url("https://fontsapi.zeoseven.com/379/main/result.css");

.smallcaps {
  font-variant-caps: small-caps;
}

.lining {
  font-variant: lining-nums;
}

body {
  background-color: black;
  color: white;
  margin: 1em 1.5em;
  font-size: 0.9rem;
  font-family: 'Alegreya', 'TW-Sung', sans-serif;
  max-width: 30em;
  hyphens: auto;
  text-align: justify;
  hanging-punctuation: force-end;
  word-wrap: break-word;
}

body.poem { max-width: 23em; }

p { margin-top: 0; margin-bottom: 0.2em; }
.poem p { text-indent: 0 !important; margin-bottom: 1.2em; }
p.sig { text-indent: 0; text-align: right; }

body:lang(zh):not(.poem) p { margin-bottom: 0; text-indent: 2em; }
body:lang(zh) p:last-of-type { margin-bottom: 0.2em; }
.han { font-family: "TW-Sung" !important; }
body:lang(zh) p, p:lang(zh) { line-height: 1.7; font-family: "TW-Sung" !important; }

body:lang(en) p + p { text-indent: 1.2em; }

h1 { font-size: 1.5em; margin: 0.25em auto; font-weight: 500; }
h2 { font-size: 1.5em; margin: 0.25em auto; font-weight: 400; }


hr { border: none; height: 1px; background-color: white; margin: 1em auto; }

u { text-decoration-style: dotted; text-underline-offset: 2px; }
a {
  text-underline-offset: 2px;
  color: white;
}
.toa a { text-decoration: none; }
u.han, u:lang(zh), a.han, a:lang(zh) { text-underline-offset: 4px; }
a:visited { color: white; }
a:hover { background-color: white; color: black; text-decoration: none; }

q {
  quotes: "“" "”";
  display: block;
  margin: 0.8em 2em;
  text-indent: var(--paragraph-indent);
}
h1 + q { margin-top: 0; }
q:last-child  { margin-bottom: 0; }

.toa { padding: 0 1em; margin: .5em 0em; }
.toc { padding: 0 2em; margin: .5em 1em; }
.toa li { list-style: none; }
.toa li::before { content: attr(date) ' - '; }
