/* Reading page for one published article. Iowan Old Style where the system has
   it (Apple); elsewhere Source Serif 4, self-hosted. The unicode-range keeps a
   browser that has Iowan from fetching the file for glyphs Iowan lacks (emoji). */
@font-face {
  font-family: "Source Serif 4 Web";
  src: url("/fonts/source-serif-4.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
:root {
  color-scheme: light dark;
  --fg: #23201b;
  --muted: #706a5f;
  --bg: #fbf9f4;
  --rule: #e4ded2;
  --thread: #e9e4d9;
  --link: #2c5a86;
  --link-line: rgb(44 90 134 / 0.35);
  --dead: #8c8679;
  --dot: #a39c8e;
  --ring: #e3dccd;
  --mark: #f6e7a1;
  --serif: "Iowan Old Style", "Source Serif 4 Web", Charter, Georgia, serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fg: #e8e3d9;
    --muted: #a49e91;
    --bg: #1a1916;
    --rule: #36322c;
    --thread: #2d2a25;
    --link: #9dc1e7;
    --link-line: rgb(157 193 231 / 0.4);
    --dead: #8f897c;
    --dot: #7e786c;
    --ring: #3d3933;
    --mark: #594a12;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--serif);
  font-size: clamp(17.5px, 0.95rem + 0.3vw, 20px);
  line-height: 1.6;
  font-kerning: normal;
  font-variant-ligatures: common-ligatures;
  font-variant-numeric: oldstyle-nums proportional-nums;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  hanging-punctuation: first allow-end;
  overflow-wrap: break-word;
}
::selection { background: var(--mark); }

main { max-width: 34em; margin: 0 auto; padding: 4.5em 1.25em 6em; }

h1, h2 { text-wrap: balance; font-weight: 600; }
p, li { text-wrap: pretty; }
h1 {
  font-size: 2.35em;
  line-height: 1.1;
  letter-spacing: -0.018em;
  margin: 0;
}
header { margin: 0 0 2.4em; }
header::after {
  content: "";
  display: block;
  width: 2.2rem;
  height: 2px;
  margin-top: 1.1em;
  background: var(--rule);
}
.byline {
  margin-top: 0.7em;
  color: var(--muted);
  font-size: 0.92em;
  font-variant-numeric: lining-nums;
}
/* Acronyms in small caps, spaced a touch so the letters don't crowd. */
.caps { font-variant-caps: all-small-caps; letter-spacing: 0.05em; }
h2 { font-size: 1.42em; line-height: 1.25; letter-spacing: -0.01em; margin: 0; }
p { margin: 0; }
strong { font-weight: 650; }

a {
  color: var(--link);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--link-line);
  text-underline-offset: 0.2em;
}
a:hover { text-decoration-color: currentColor; }
/* A link to a note that isn't published: still visibly a link, but quiet. */
a[href="/_/unpublished"] {
  color: inherit;
  text-decoration-style: dotted;
  text-decoration-color: var(--dead);
}
a[href="/_/unpublished"]:hover { color: var(--dead); }
mark { background: var(--mark); color: inherit; padding: 0 0.1em; border-radius: 2px; }
code { font: 0.86em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* Prose: top-level blocks, and a heading's children. */
.block { margin: 1em 0; }
.block.heading { margin: 2.6em 0 1em; }
.block > .row.label,
.block > details > summary.label { font-size: 1.1em; margin-top: 1.7em; }
.block > details > summary + * { margin-top: 0.55em; }
.block.heading > details > summary + * { margin-top: 0.8em; }

/* The outline below, with outliner bullets and thread lines. */
ul.outline { list-style: none; margin: 0.35em 0 0; padding-left: 1.45em; }
ul.outline > li { margin: 0.4em 0; }
li > details > ul.outline {
  margin-left: -0.93em;
  padding-left: calc(1.45em + 0.93em);
  border-left: 1px solid var(--thread);
}
.row { position: relative; display: block; }
.row > p + p { margin-top: 0.6em; }
ul.outline > li > .row::before,
ul.outline > li > details > summary::before {
  content: "";
  position: absolute;
  left: -1.1em;
  top: 0.64em;
  width: 0.34em;
  height: 0.34em;
  border-radius: 50%;
  background: var(--dot);
}
/* A collapsed bullet wears a ring, as in the app. */
ul.outline > li > details:not([open]) > summary::before { box-shadow: 0 0 0 0.22em var(--ring); }

summary { cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }

/* Prose blocks with children get a disclosure arrow in the margin. */
.block > details > summary::before {
  content: "▸";
  position: absolute;
  left: -1.15em;
  top: 0;
  color: var(--muted);
  font-size: 0.8em;
  line-height: 2;
  transition: transform 0.12s ease, opacity 0.12s ease;
}
.block.heading > details > summary::before { line-height: 2.25; }
.block > details[open] > summary::before { transform: rotate(90deg); opacity: 0; }
.block > details[open] > summary:hover::before { opacity: 1; }

@media (max-width: 40rem) {
  main { padding: 2.5em 1rem 4em; }
  h1 { font-size: 1.95em; }
  ul.outline { padding-left: 1.2em; }
  li > details > ul.outline { margin-left: -0.8em; padding-left: calc(1.2em + 0.8em); }
  ul.outline > li > .row::before,
  ul.outline > li > details > summary::before { left: -0.95em; }
  .block > details > summary::before { left: -0.95em; }
}

/* Replies from Bluesky, under the article. */
.replies { margin-top: 4em; padding-top: 1.6em; border-top: 1px solid var(--rule); }
.replies h2 { font-size: 1.15em; margin-bottom: 0.5em; }
.replies > p { color: var(--muted); font-size: 0.92em; margin: 0.4em 0; }
.replies-demo { font-style: italic; }
.replies-actions { display: flex; align-items: center; gap: 0.8em; }
.replies button {
  font: inherit;
  font-size: 0.95em;
  color: var(--fg);
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 0.25em 1em;
  cursor: pointer;
}
.replies button:hover { border-color: var(--dot); }
.replies button:disabled { cursor: progress; color: var(--muted); }
.reply-list { list-style: none; margin: 1.2em 0 0; padding: 0; }
.replies > .reply-list { font-size: 0.92em; }
.reply-list .reply-list { margin: 0.6em 0 0 0.68em; padding-left: 1.1em; border-left: 1px solid var(--thread); }
.reply { margin: 0 0 1.1em; }
.reply-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.15em 0.45em; font-size: 0.88em; color: var(--muted); }
.avatar { width: 22px; height: 22px; border-radius: 50%; background: var(--thread); flex: none; object-fit: cover; }
.reply-author { color: var(--fg); font-weight: 600; text-decoration: none; }
.reply-when { color: var(--muted); text-decoration: none; }
.reply-when::before { content: "·"; margin-right: 0.45em; }
.reply-text { margin: 0.25em 0 0; white-space: pre-wrap; }
.reply-more { display: inline-block; margin-top: 0.4em; font-size: 0.88em; }

/* Root index of published pages. */
.index { list-style: none; margin: 0; padding: 0; }
.index li { margin: 0 0 0.8em; font-size: 1.1em; }
.index-date { display: block; color: var(--muted); font-size: 0.82em; font-variant-numeric: lining-nums; }
