/* Printed pages, covers and imposed sheets. Physical units throughout. */

.bk {
  --pw: 89mm; --ph: 140mm;
  --mt: 8mm; --mb: 8mm; --mi: 10mm; --mo: 7mm;
  --hd-h: 5mm;
  --he-font: "Taamey Frank CLM"; --he-size: 10pt; --he-lh: 1.5; --he-wt: 400;
  --tr-font: "EB Garamond"; --tr-size: 8pt; --tr-lh: 1.28;
  --cm-font: "Frank Ruhl Libre"; --cm-size: 7.5pt; --cm-lh: 1.36; --cm-tr-size: 7pt;
  --align: justify;
}

.pg {
  width: var(--pw); height: var(--ph);
  box-sizing: border-box;
  padding: var(--mt) var(--mi) var(--mb) var(--mo);
  display: flex; flex-direction: column;
  background: #fff; color: #000;
  overflow: hidden; position: relative;
  font-family: var(--he-font), "Taamey Frank CLM", var(--tr-font), serif;
  font-kerning: normal; text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  font-synthesis: weight style;
}
.pg.spL { padding-left: var(--mi); padding-right: var(--mo); }
.pg.spR { padding-right: var(--mi); padding-left: var(--mo); }

.pg-hd {
  height: var(--hd-h); flex: none; position: relative;
  font-size: 6.4pt; line-height: 1.25; white-space: nowrap; overflow: hidden;
  text-align: center; color: #000;
}
.pg-hd .hd-t { display: inline-block; max-width: 78%; overflow: hidden; text-overflow: clip; }
.pg-hd .hd-n { position: absolute; top: 0; font-weight: 700; }
.pg.spL .hd-n { right: 0; }
.pg.spR .hd-n { left: 0; }
.pg.lang-he .pg-hd { font-family: var(--he-font), "Taamey Frank CLM", serif; direction: rtl; font-size: 7pt; }
.pg.lang-tr .pg-hd { font-family: var(--tr-font), var(--he-font), "Taamey Frank CLM", serif; font-style: italic; }
.pg.lang-tr .pg-hd .hd-n { font-style: normal; }
.bk.no-header .hd-t { visibility: hidden; }

.pg-body { flex: 1 1 0; min-height: 0; overflow: hidden; }
.pg-flow { display: flow-root; }
.pg-main p, .pg-cm p { margin: 0; }

/* main text */
.sg, .run { text-align: var(--align); overflow-wrap: break-word; }
.sg.he, .run.he {
  font-family: var(--he-font), "Taamey Frank CLM", var(--tr-font), serif; font-size: var(--he-size);
  line-height: var(--he-lh); font-weight: var(--he-wt); direction: rtl;
}
.sg.tr, .run.tr {
  font-family: var(--tr-font), var(--he-font), "Taamey Frank CLM", serif; font-size: var(--tr-size);
  line-height: var(--tr-lh); hyphens: auto; -webkit-hyphens: auto;
}
.sg.tr.ltr, .run.tr.ltr, .cmg.tr.ltr { direction: ltr; }
.sg.tr.rtl, .run.tr.rtl, .cmg.tr.rtl { direction: rtl; }
.sg + .sg.he { margin-top: 0.12em; }
.sg.he + .sg.tr { margin-top: 0.05em; }
.sg.tr + .sg.he { margin-top: 0.5em; }
.sg.tr + .sg.tr { margin-top: 0.3em; }
.run { text-indent: 1.1em; }
.run.cont, .sg.cont { text-indent: 0; }
.brk { text-align-last: justify; }
.bk.ragged .brk { text-align-last: auto; }

.vn {
  font-size: 0.62em; font-weight: 700; margin-inline-end: 0.4em;
  font-feature-settings: "lnum"; position: relative; top: -0.28em; line-height: 0;
}
.he .vn { font-size: 0.66em; top: -0.2em; }
.chn { font-size: 1.5em; font-weight: 700; line-height: 0; margin-inline-end: 0.3em; }
small { font-size: 0.8em; }

.hsec {
  margin: 0.55em 0 0.3em; text-align: center; font-weight: 700; line-height: 1.25;
  break-after: avoid;
}
.pg-main > .hsec:first-child { margin-top: 0; }
.hsec.he { font-family: var(--he-font), "Taamey Frank CLM", serif; font-size: calc(var(--he-size) * 1.08); direction: rtl; }
.hsec.tr {
  font-family: var(--tr-font), serif; font-size: calc(var(--tr-size) * 1.05);
  letter-spacing: 0.06em; font-variant-caps: all-small-caps; font-weight: 600;
}
.hsec.node { font-size: calc(var(--he-size) * 1.2); margin-bottom: 0.15em; }
.hsec.node.tr { font-size: calc(var(--tr-size) * 1.25); }

/* commentary */
.pg-cm { border-top: 0.3pt solid #000; margin-top: 1.5mm; padding-top: 1.1mm; }
.pg-cm:empty { display: none; }
.pg-main:empty + .pg-cm { border-top: 0; margin-top: 0; padding-top: 0; }
.cmg { text-align: var(--align); line-height: var(--cm-lh); overflow-wrap: break-word; }
.cmg.he { font-family: var(--cm-font), var(--he-font), "Taamey Frank CLM", serif; font-size: var(--cm-size); direction: rtl; }
.cmg.tr {
  font-family: var(--tr-font), var(--he-font), "Taamey Frank CLM", serif; font-size: var(--cm-tr-size);
  hyphens: auto; -webkit-hyphens: auto; line-height: 1.25;
}
.cmg + .cmg { margin-top: 0.9mm; }
.cmn { font-family: var(--he-font), "Taamey Frank CLM", var(--tr-font), serif; font-weight: 700; margin-inline-end: 0.35em; }
.cmg.tr .cmn { font-family: var(--tr-font), serif; font-variant-caps: all-small-caps; letter-spacing: 0.04em; }
.cv { font-weight: 700; margin-inline-end: 0.3em; font-size: 0.9em; }

/* title page */
.pg.title { text-align: center; justify-content: space-between; padding-top: 16mm; padding-bottom: 9mm; }
.pg.title .tp-he { font-family: var(--he-font), "Taamey Frank CLM", serif; direction: rtl; font-weight: 700; font-size: 21pt; line-height: 1.15; }
.pg.title .tp-en { font-family: var(--tr-font), serif; font-size: 12pt; margin-top: 2.5mm; letter-spacing: 0.02em; }
.pg.title .tp-with { font-size: 8pt; margin-top: 3mm; line-height: 1.35; }
.pg.title .tp-with .he { font-family: var(--he-font), "Taamey Frank CLM", serif; direction: rtl; display: block; font-size: 9pt; }
.pg.title .tp-with .en { font-family: var(--tr-font), serif; font-style: italic; display: block; }
.pg.title .tp-mid { margin: auto 0; }
.pg.title .tp-rule { width: 12mm; border: 0; border-top: 0.4pt solid #000; margin: 4mm auto; }
.pg.title .tp-vol-he { font-family: var(--he-font), "Taamey Frank CLM", serif; direction: rtl; font-size: 11pt; font-weight: 500; }
.pg.title .tp-vol-en { font-family: var(--tr-font), serif; font-size: 8.5pt; font-variant-caps: all-small-caps; letter-spacing: 0.08em; margin-top: 1mm; }
.pg.title .tp-range { font-size: 8.5pt; margin-top: 2mm; line-height: 1.4; }
.pg.title .tp-range .he { font-family: var(--he-font), "Taamey Frank CLM", serif; direction: rtl; display: block; font-size: 9.5pt; }
.pg.title .tp-range .en { font-family: var(--tr-font), serif; display: block; }
.pg.title .tp-colo { font-family: var(--tr-font), serif; font-size: 5.4pt; line-height: 1.3; color: #000; overflow-wrap: anywhere; }
.pg.title .tp-owner { margin-bottom: 3mm; }
.pg.title .tp-owner-lbl { font-family: var(--tr-font), serif; font-size: 6pt; font-variant-caps: all-small-caps; letter-spacing: 0.1em; }
.pg.title .tp-owner-name { font-family: var(--tr-font), var(--he-font), "Taamey Frank CLM", serif; font-size: 9.5pt; margin-top: 0.6mm; }
.pg.title .tp-owner-phone { font-family: var(--tr-font), serif; font-size: 7.5pt; margin-top: 0.4mm; letter-spacing: 0.03em; font-feature-settings: "lnum"; }
.cv-owner-name { font-family: var(--cv-en), var(--cv-he), "Taamey Frank CLM", serif; line-height: 1.15; }
.pg.blank { }

/* ---- covers ---- */
.cover {
  position: relative; display: flex; overflow: hidden;
  background: var(--c-bg); color: var(--c-ink);
  --c-bg: #1f2a44; --c-ink: #c8a24a; --c-soft: rgba(200, 162, 74, 0.55);
  font-family: var(--cv-he), var(--cv-en), serif;
}
.cover .panel { position: relative; height: 100%; flex: none; box-sizing: border-box; overflow: hidden; }
.cover .spine { position: relative; height: 100%; flex: none; overflow: hidden; box-sizing: border-box; }
.cover .front, .cover .back { display: flex; flex-direction: column; align-items: center; text-align: center; }
.cv-title-he { font-family: var(--cv-he), "Taamey Frank CLM", serif; direction: rtl; font-weight: 700; line-height: 1.08; }
.cv-title-en { font-family: var(--cv-en), serif; line-height: 1.15; letter-spacing: 0.03em; }
.cv-with { line-height: 1.3; }
.cv-with .he { font-family: var(--cv-he), "Taamey Frank CLM", serif; direction: rtl; display: block; }
.cv-with .en { font-family: var(--cv-en), serif; font-style: italic; display: block; }
.cv-vol-he { font-family: var(--cv-he), "Taamey Frank CLM", serif; direction: rtl; font-weight: 500; }
.cv-vol-en { font-family: var(--cv-en), serif; font-variant-caps: all-small-caps; letter-spacing: 0.1em; }
.cv-range { line-height: 1.35; }
.cv-range .he { font-family: var(--cv-he), "Taamey Frank CLM", serif; direction: rtl; display: block; }
.cv-range .en { font-family: var(--cv-en), serif; display: block; }
.cv-small { font-family: var(--cv-en), serif; line-height: 1.3; }

.spine .sp-in {
  position: absolute; left: 50%; top: 36%; transform: translate(-50%, -50%) rotate(90deg);
  display: flex; align-items: center; justify-content: space-between; gap: 2.5mm;
  white-space: nowrap; padding: 0 0 0 6mm; box-sizing: border-box; line-height: 1; overflow: hidden;
}
.spine .sp-title { display: flex; gap: 0.8em; align-items: baseline; direction: rtl; }
.spine .sp-he { font-family: var(--cv-he), "Taamey Frank CLM", serif; font-weight: 700; direction: rtl; }
.spine .sp-en { font-family: var(--cv-en), serif; letter-spacing: 0.04em; direction: ltr; }
.spine .sp-vol { font-family: var(--cv-he), "Taamey Frank CLM", serif; font-weight: 700; direction: rtl; }
.spine .sp-mark { position: absolute; left: 0; right: 0; background: var(--c-ink); }

/* ---- imposed sheets ---- */
.sheet { position: relative; background: #fff; overflow: hidden; }
.sheet .slot { position: absolute; }
.sheet .mark { position: absolute; background: #000; }
.sheet .note {
  position: absolute; font: 5pt/1 "Heebo", sans-serif; color: #000; white-space: nowrap;
}

#print-root { display: none; }
@media print {
  html, body { background: #fff !important; margin: 0 !important; padding: 0 !important; height: auto !important; overflow: visible !important; }
  body > *:not(#print-root) { display: none !important; }
  #print-root { display: block !important; }
  #print-root .sheet, #print-root .pg-wrap { contain: strict; break-after: page; page-break-after: always; break-inside: avoid; }
  #print-root .sheet:last-child, #print-root .pg-wrap:last-child { break-after: auto; page-break-after: auto; }
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
}
