/* The live lettering's type (apps.comics) — one copy, linked by the reader
   (templates/comics/reader.html) and the shelf (templates/comics/shelf.html), whose covers
   carry the same words. static/js/comics_lettering.js lays them out; the rules and numbers
   are in .claude/skills/comic-live-lettering/references/mechanism.md.

   Everything is scoped to `.comic-lettering` — the reader's <body>, each shelf cover's
   overlay and the meter's host on the shelf — and that scope resets every inherited
   property that changes how wide a run of text is. The layout measures each word in a
   hidden meter and must predict, to the pixel, where the browser ends each line of a box;
   so the meter and the boxes must set their words in exactly the same type wherever on a
   page they sit (the app's own pages set `text-rendering: optimizeLegibility` on <body>,
   for one). */
.comic-lettering {
  font-style: normal;
  font-variant: normal;
  font-feature-settings: normal;
  font-variation-settings: normal;
  font-kerning: auto;
  font-size-adjust: none;
  word-spacing: normal;
  text-transform: none;
  text-indent: 0;
  text-rendering: auto;
  line-break: auto;
  hyphenate-character: auto;
  text-wrap-style: auto;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
.comic-lettering .box { position: absolute; }
.comic-lettering .box .fl { float: left; clear: left; }
.comic-lettering .box .fr { float: right; clear: right; }
/* Every line of a balloon or caption is justified to its span and its last line centred; a
   word breaks only at a soft hyphen the layout put there (`hyphens: none` would switch
   those off too). */
.comic-lettering .txt {
  color: var(--letter, #15120e); /* the lettering's ink, on the comic's own paper */
  outline: none;
  white-space: pre-wrap;
  overflow-wrap: normal;
  word-break: normal;
  -webkit-hyphens: manual;
  hyphens: manual;
  text-align: justify;
  text-align-last: center;
  min-height: 1em;
}
/* Open Sans SemiBold at 90% width for Finglish and English, Vazirmatn for Persian
   (static/css/fonts.css). */
.comic-lettering .face-latin, .comic-lettering .latin .txt {
  font-family: "Open Sans", Inter, system-ui, sans-serif;
  font-weight: 600;
  font-stretch: 90%;
  letter-spacing: .02em;
}
.comic-lettering .face-persian, .comic-lettering .persian .txt {
  font-family: Vazirmatn, Tahoma, sans-serif;
  font-weight: 600;
}
.comic-lettering .meter {
  position: absolute; left: -99999px; top: 0; visibility: hidden; white-space: pre;
  font-size: 100px; line-height: 1;
}

/* ---- the shelf ----------------------------------------------------------------------- */
/* A cover is the comic's first page with its drawn words erased; static/js/comics_shelf.js
   lays that page's words back over it. The overlay is the page at its own pixel size,
   scaled and shifted onto the card's picture by the same crop the picture takes, under
   the card's marks; it takes no clicks, so the card stays one link. */
.comic-cover-letters {
  position: absolute; left: 0; top: 0; z-index: 1; transform-origin: 0 0;
  pointer-events: none; user-select: none;
}
.comic-meter-host { position: absolute; left: 0; top: 0; width: 0; height: 0; overflow: hidden; }
