/* Shared "letter textbox" component -- the paper-styled, ruled-line
   textarea originally built for tools/letter.html (its .ltr-paper/.ltr-body/
   .ltr-counter), now reused as-is by the scrapbook's "Writing note" item.
   Colours/fonts come from the site's styles.css tokens (--rule/
   --brand-green/--ink/--slate-light/--font-display) except the paper's own
   cream tone, chosen to sit near --parchment without matching it exactly
   so it reads as a sheet of paper sitting on the page rather than blending
   into it.

   HOW TO ADD A NEW NOTE STYLE (a different paper look, e.g. lined legal
   pad or graph paper): add a modifier class here, e.g. .ltxt-paper--kraft,
   plus matching literal colour constants in assets/js/letter-textbox.js's
   exported constants (used when a canvas bitmap needs to match it, since
   canvas can't read CSS custom properties directly). tools/letter.html
   itself only ever uses the default look. */

.ltxt-paper {
  position: relative;
  background: #fffdf5;
  border: 1px solid var(--rule);
  border-left: 4px solid var(--brand-green);
  border-radius: 6px;
  padding: 1.5rem 1.5rem 1.25rem;
  box-shadow: 0 8px 24px rgba(30, 35, 48, 0.08);
}

.ltxt-body {
  display: block;
  width: 100%;
  min-height: 320px;
  resize: vertical;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--ink);
  line-height: 34px;
  background-image: linear-gradient(var(--rule) 1px, transparent 1px);
  background-size: 100% 34px;
  background-position: 0 33px;
}
.ltxt-body::placeholder { color: var(--slate-light); font-style: italic; opacity: 0.7; }

.ltxt-counter { text-align: right; font-size: 0.8rem; color: var(--slate-light); margin-top: 0.5rem; }
.ltxt-counter.is-near-limit { color: #b3401f; font-weight: 600; }

/* Only used when this component is mounted as a floating overlay (the
   scrapbook's editing mode) instead of a page's normal document flow
   (tools/letter.html). Position/size are set inline by whoever opens it;
   these rules just make the mounted textarea fill that box exactly,
   overriding the fixed min-height/manual-resize handle that make sense in
   letter.html's own layout but not for an overlay sized to match a
   specific canvas object. */
.ltxt-overlay { position: absolute; z-index: 500; margin: 0; }
.ltxt-overlay .ltxt-paper { height: 100%; box-sizing: border-box; }
.ltxt-overlay .ltxt-body { height: 100%; min-height: 0; resize: none; }
