/*
  Line sheet layout, shared by the free maker (public/assets/linesheet.js, /tools/line-sheet-maker),
  the guide's example and the app's PDF export (App\LineSheets, rendered by the private renderer).
  Keep the markup identical in all three:

  <div class="ls-doc ls-letter ls-per-6">            (ls-letter | ls-a4, ls-per-4 | ls-per-6 | ls-per-9)
    <section class="ls-page">
      <header class="ls-head">
        <img class="ls-logo" src="…" alt="">              (optional)
        <div class="ls-brand"><b>Brand</b><span>Title · Season</span></div>
        <div class="ls-contact"><span>line</span>…</div>
      </header>
      <div class="ls-grid">
        <article class="ls-item">
          <div class="ls-photo"><img src="…" alt="…"></div>   (empty div when there is no photo)
          <h3 class="ls-name">Name</h3>
          <p class="ls-sku">SKU CH-104</p>
          <p class="ls-prices"><span><small>Wholesale</small>$28</span><span><small>Retail</small>$56</span></p>
          <p class="ls-meta">Min. order 6 · Sage, Rust</p>
          <p class="ls-note">Note</p>
        </article>
      </div>
      <footer class="ls-foot"><span class="ls-terms">Terms</span><span class="ls-page-no">Page 1 of 2</span></footer>
    </section>
  </div>

  Pages have a fixed physical size. The printing page adds @page { size: letter | A4; margin: 0 }.
  Nothing here loads a font or an image from the network (the renderer blocks it).
  Every rule starts with .ls-doc so page styles around a preview (such as .prose h3) cannot leak in.
*/
.ls-doc{--ls-ink:#16150f;--ls-ink-2:#55524a;--ls-ink-3:#8b877c;--ls-line:#e4e1d8;--ls-photo:#f5f4f0;--ls-accent:var(--ls-brand,#16150f);
  --ls-cols:3;--ls-rows:2;--ls-photo-h:62%;color:var(--ls-ink);font-family:"Helvetica Neue",Helvetica,Arial,"Liberation Sans",sans-serif;
  font-size:10pt;line-height:1.3;text-align:left;-webkit-print-color-adjust:exact;print-color-adjust:exact}
.ls-doc .ls-page,.ls-doc .ls-page *{box-sizing:border-box;margin:0;padding:0;max-width:none;letter-spacing:normal}
.ls-doc.ls-letter{--ls-w:8.5in;--ls-h:11in}
.ls-doc.ls-a4{--ls-w:210mm;--ls-h:297mm}
.ls-doc.ls-per-4{--ls-cols:2;--ls-rows:2;--ls-photo-h:66%}
.ls-doc.ls-per-6{--ls-cols:3;--ls-rows:2;--ls-photo-h:62%}
.ls-doc.ls-per-9{--ls-cols:3;--ls-rows:3;--ls-photo-h:56%}

.ls-doc .ls-page{width:var(--ls-w);height:var(--ls-h);padding:.45in .5in .4in;background:#fff;display:flex;flex-direction:column;gap:.22in;overflow:hidden;break-after:page;page-break-after:always}
.ls-doc .ls-page:last-child{break-after:auto;page-break-after:auto}

.ls-doc .ls-head{display:flex;align-items:center;gap:.2in;padding-bottom:.16in;border-bottom:2px solid var(--ls-accent)}
.ls-doc .ls-logo{height:.55in;width:auto;max-width:1.6in;object-fit:contain}
.ls-doc .ls-brand{flex:1;min-width:0;display:flex;flex-direction:column;gap:2pt}
.ls-doc .ls-brand b{font-size:17pt;line-height:1.1;font-weight:700;letter-spacing:-.01em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ls-doc .ls-brand span{font-size:9.5pt;line-height:1.3;color:var(--ls-ink-2);text-transform:uppercase;letter-spacing:.08em}
.ls-doc .ls-contact{display:flex;flex-direction:column;align-items:flex-end;gap:1pt;font-size:8.5pt;line-height:1.3;color:var(--ls-ink-2);text-align:right;max-width:2.6in}

.ls-doc .ls-grid{flex:1;min-height:0;display:grid;grid-template-columns:repeat(var(--ls-cols),minmax(0,1fr));grid-template-rows:repeat(var(--ls-rows),minmax(0,1fr));gap:.2in .24in}
.ls-doc .ls-item{min-height:0;overflow:hidden;display:flex;flex-direction:column;gap:2.5pt}
/* Every photo box has the same height, so photos line up across a row whatever the text below them.
   The photo keeps its own shape and background; an item without a photo shows an empty tile. */
.ls-doc .ls-photo{flex:none;height:var(--ls-photo-h);display:flex;align-items:flex-end;justify-content:flex-start;margin-bottom:4pt}
.ls-doc .ls-photo:empty{background:var(--ls-photo);border-radius:4pt}
.ls-doc .ls-photo img{max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain;border-radius:4pt;display:block}
.ls-doc .ls-name{font-size:10.5pt;line-height:1.2;font-weight:700;color:var(--ls-ink);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.ls-doc .ls-sku{font-size:8pt;line-height:1.25;color:var(--ls-ink-3);letter-spacing:.04em;text-transform:uppercase}
.ls-doc .ls-prices{display:flex;gap:.18in;font-size:10.5pt;line-height:1.15;font-weight:700;color:var(--ls-ink);font-variant-numeric:tabular-nums}
.ls-doc .ls-prices span{display:flex;flex-direction:column;line-height:1.15}
.ls-doc .ls-prices small{font-size:7pt;line-height:1.3;font-weight:400;color:var(--ls-ink-3);text-transform:uppercase;letter-spacing:.06em}
.ls-doc .ls-meta,.ls-doc .ls-note{font-size:8pt;line-height:1.3;color:var(--ls-ink-2);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.ls-doc .ls-note{font-style:italic}
.ls-doc.ls-per-9 .ls-name,.ls-doc.ls-per-9 .ls-prices{font-size:9.5pt}
.ls-doc.ls-per-9 .ls-note{-webkit-line-clamp:1}
.ls-doc.ls-per-4 .ls-name,.ls-doc.ls-per-4 .ls-prices{font-size:12pt}

.ls-doc .ls-foot{display:flex;justify-content:space-between;gap:.3in;padding-top:.1in;border-top:1px solid var(--ls-line);font-size:7.5pt;line-height:1.3;color:var(--ls-ink-3)}
.ls-doc .ls-terms{flex:1;min-width:0}
.ls-doc .ls-page-no{white-space:nowrap}

/* On screen (the free maker's preview, the app's preview) pages sit in a scaled box: wrap the doc in .ls-preview */
@media screen{
  .ls-preview{overflow:hidden;position:relative}
  /* Out of the flow: a transform only scales how the page looks, so an in-flow 8.5in page would still
     widen the layout (a phone then zooms the whole screen out). The scripts set the box's height. */
  .ls-preview .ls-doc{position:absolute;transform-origin:top left}
  .ls-preview .ls-doc .ls-page{box-shadow:0 1px 2px rgba(0,0,0,.06),0 8px 24px -8px rgba(0,0,0,.18);margin-bottom:24px}
}
