/* The letter reading experience (web) — an author-editable theme surface.
 * Blobs hold semantic HTML only, so this file can be redesigned at any
 * point without touching content or re-encrypting anything.
 * Its keepsake-book sibling is assets/epub.css. */

.letter-head {
  text-align: center;
  margin: var(--sp-6) 0 var(--sp-8);
}

.letter-head .no {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.letter-head h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--text-2xl);
  line-height: 1.2;
  color: var(--ink);
  margin: var(--sp-2) 0;
}

.letter-head .postmark-line {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--ink-soft);
  letter-spacing: 0.06em;
}

.letter-head hr {
  border: none;
  border-top: 1px solid var(--paper-edge);
  width: 30%;
  margin: var(--sp-6) auto 0;
}

.letter-body {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  line-height: 1.65;
  color: var(--ink);
}

/* Reader text size (store.textScale). Step 1 is the size above; installed
 * PWAs often lose pinch-zoom, so a long read gets a real control. */
[data-scale="2"] .letter-body { font-size: calc(var(--text-lg) * 1.15); line-height: 1.7; }
[data-scale="3"] .letter-body { font-size: calc(var(--text-lg) * 1.3); line-height: 1.75; }

.letter-body p { margin: 0 0 0.25em; text-indent: 1.4em; }
.letter-body p:first-of-type { text-indent: 0; }

.letter-body p:first-of-type::first-letter {
  font-family: var(--font-display);
  font-size: 1.6em;
  line-height: 1;
}

.letter-body h1, .letter-body h2, .letter-body h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.25;
  margin: 1.4em 0 0.4em;
}

.letter-body h1 { font-size: var(--text-xl); }
.letter-body h2 { font-size: var(--text-lg); }
.letter-body h3 { font-size: var(--text-md); font-style: italic; }

.letter-body blockquote {
  margin: 1em 0;
  padding-left: var(--sp-4);
  border-left: 2px solid var(--brass);
  font-style: italic;
  color: var(--ink-soft);
}

.letter-body img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.2em auto;
  border: 1px solid var(--paper-edge);
  border-radius: 2px;
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.12);
}

.letter-body a { color: var(--brass-soft); }

.letter-body hr {
  border: none;
  text-align: center;
  margin: 1.6em 0;
}

.letter-body hr::after {
  content: "\2042"; /* asterism */
  color: var(--ink-soft);
  font-size: var(--text-md);
}
