/* Print / PDF styles (WeasyPrint); table chrome matches HTML report.css */ @font-face { font-family: "IRNazanin"; src: url("../assets/fonts/IRNazanin.ttf") format("truetype"); font-weight: normal; font-style: normal; } @font-face { font-family: "IRNazanin"; src: url("../assets/fonts/IRNazanin-Bold.ttf") format("truetype"); font-weight: bold; font-style: normal; } @font-face { font-family: "IRZar"; src: url("../assets/fonts/IRZar.ttf") format("truetype"); font-weight: normal; font-style: normal; } @font-face { font-family: "IRZar"; src: url("../assets/fonts/IRZar-Bold.ttf") format("truetype"); font-weight: bold; font-style: normal; } :root { --text: #000000; --text2: #57606a; --stroke: #000000; --fill: #f6f8fa; } @page { size: A4; /* Match typst-templates: 2cm sides, 2.5cm top/bottom */ margin: 2.5cm 2cm 2.5cm 2cm; @bottom-center { content: none; } @top-center { content: element(report-header); width: 100%; } /* Page chip: counters only update in @page margin boxes (not position:fixed). Rotate the whole ۱/N string like typst's -90deg sidebar grid.cell (writing-mode: sideways-lr leaves numerals horizontal in WeasyPrint). */ @bottom-left { content: counter(page, persian) "/" counter(pages, persian); font-family: "IRZar", "IRNazanin", sans-serif; font-size: 11pt; color: #fff; background: #000; border: 1pt solid #000; width: 28pt; height: 20pt; text-align: center; vertical-align: middle; /* Align chip's content-facing (right) edge with the sidebar rule. */ margin-left: -1.66cm; margin-bottom: 0.35cm; direction: ltr; transform: rotate(-90deg); } } @page :first { @top-center { content: none; } } @media print { /* Keep html LTR so position:fixed + left/translateX for the sidebar use a sane containing block. WeasyPrint with html{direction:rtl} shifts fixed boxes far right and they clip before reaching the typst left-edge band. Document content stays RTL on body. */ html { direction: ltr; } body { direction: rtl; font-family: "IRNazanin", sans-serif; font-size: 13pt; /* typst-templates use par(leading: 1.2em) — additive space, not CSS 1.2× */ line-height: 1.65; color: var(--text); background: #ffffff; margin: 0; padding: 0; text-align: justify; hyphens: auto; max-width: none; } /* Hide Quarto / screen chrome in PDF */ #title-block-header, header#title-block-header, .quarto-title-block, .quarto-title, .quarto-title-meta, .quarto-title-meta-contents, header.quarto-title-block, h1.title, p.subtitle, nav.toc-active, #TOC, .sidebar.sidebar-navigation, #quarto-sidebar, #quarto-margin-sidebar, #quarto-back-to-top, .report-meta, .screen-only { display: none !important; } /* ===== Running header (page > 1) ===== */ /* RTL flex: first child (logo) packs to the right — matches typst header grid */ .print-running-header { position: running(report-header); display: flex; flex-direction: row; align-items: center; justify-content: flex-start; gap: 5pt; width: 100%; font-family: "IRNazanin", sans-serif; font-size: 11pt; padding-bottom: 4pt; border-bottom: 0.5pt solid black; direction: rtl; } .print-running-header img { height: 19pt; width: auto; border: 1pt solid black; } .print-running-header .pipe { margin: 0 2pt; } /* ===== Left rotated sidebar (every page) ===== */ /* Mirrors typst product_test_template / travel-report-template: rotate(-90deg) grid with columns ~(30%, 30%) + page chip in @bottom-left. Negative `left` is clipped by WeasyPrint; use translateX into the margin instead. */ .print-sidebar { position: fixed; left: 0; /* Keep >= 0 — negative bottom clips the rotated sidebar in WeasyPrint */ bottom: 0.05cm; /* Labels + chip-gap (~typst place dy:73% band through page chip) */ width: 11.5cm; height: 20pt; transform-origin: left bottom; /* Pull into left margin (negative left is clipped by WeasyPrint) */ transform: translateX(-0.75cm) rotate(-90deg); display: flex; flex-direction: row-reverse; align-items: stretch; font-family: "IRZar", "IRNazanin", sans-serif; font-size: 13pt; border-bottom: 1pt solid black; direction: ltr; z-index: 1000; } /* Extends the sidebar rule toward the @bottom-left page chip */ .print-sidebar .chip-gap { flex: 0 0 28pt; } .print-sidebar .seg { /* typst columns: 30% / 30% of the label band */ flex: 1 1 0; display: flex; align-items: center; /* typst: #h(1fr) text #h(5fr) — bias text toward the rule */ justify-content: flex-start; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 1pt 0 4pt; direction: rtl; } /* Page chip is drawn via @page @bottom-left (counters don't update in fixed) */ .print-sidebar .pagebox { display: none; } /* ===== Title block (first page) ===== */ /* LTR flex: logo (first) on left, title text (second) on right — typst grid */ .print-title-block { display: flex; flex-direction: row; justify-content: space-between; align-items: flex-start; width: 100%; margin: 0 0 16pt 0; padding-bottom: 64pt; border-bottom: 0.75pt solid #999999; direction: ltr; } .print-title-block .title-text { direction: rtl; text-align: right; line-height: 1.15; flex: 1 1 auto; } .print-title-block .company-line { font-size: 22.1pt; font-weight: bold; margin: 0; } .print-title-block .company-line .subtitle { font-size: 15.6pt; font-weight: normal; } .print-title-block .report-title { font-size: 15.6pt; font-weight: bold; margin: 6pt 0 0 0; } .print-title-block .logo { height: 1.8cm; width: auto; } /* Travel-report meta block (injected when report-type is travel) */ .print-travel-meta { margin: 12pt 0 24pt 0; } .print-travel-meta .rule { border: none; border-top: 1pt solid black; margin: 10pt 0; } .print-travel-meta h2 { font-size: 1.4em; text-align: center; margin: 8pt 0; border: none; padding: 0; } .print-travel-meta .meta-row { display: flex; gap: 2em; margin: 10pt 0; justify-content: flex-start; direction: rtl; } .print-travel-meta .meta-label { flex: 0 0 8em; text-align: right; } .print-travel-meta .meta-value { flex: 1; font-weight: bold; text-align: right; } /* ===== Headings ===== */ h1, h2, h3, h4 { font-family: "IRNazanin", sans-serif; font-weight: bold; text-align: right; line-height: 1.35; page-break-after: avoid; } h1, h2 { font-size: 14pt; margin: 16pt 0 10pt 0; } .print-title-block + h1, .print-travel-meta + h1 { margin-top: 8pt; } h3 { font-size: 13pt; margin: 12pt 0 8pt 0; border: none; } p { margin: 0.5em 0 0.85em 0; text-align: justify; } ul, ol { margin: 0.5em 0 0.9em 0; padding-right: 1.4em; padding-left: 0; } li { margin: 0.35em 0; text-align: justify; } /* ===== Tables (rounded chrome like HTML; black stroke) ===== */ table { border-collapse: separate; border-spacing: 0; width: auto; max-width: 100%; margin: 10pt auto; border: 1pt solid var(--stroke); border-radius: 8pt; overflow: hidden; font-size: 12.5pt; page-break-inside: avoid; } th, td { border: none; padding: 7pt 8pt; text-align: center; vertical-align: middle; } thead th, tr:first-child th { background: var(--fill); font-weight: bold; color: var(--text2); border-bottom: 1pt solid var(--stroke); line-height: 1.35; } tbody tr + tr td { border-top: 1pt solid var(--stroke); } .table-body-right tbody td { text-align: right; } .letter-date { margin: 0 0 12pt 0; } .letter-date p, .letter-signature p { text-align: left !important; } .letter-signature { margin: 56pt 0 0 0; padding-left: 2.5cm; } .expense-amounts { margin: 28pt 0 32pt 0; padding-right: 24pt; direction: rtl; } .expense-amounts > ul { list-style: circle; margin: 0; padding-right: 4em; padding-left: 0; direction: rtl; } .expense-amounts li { direction: rtl; unicode-bidi: embed; margin: 0.35em 0; text-align: right; } .expense-amounts .desc, .expense-amounts .amount, .expense-amounts .currency { direction: rtl; unicode-bidi: isolate; } .expense-amounts .desc { display: inline-block; min-width: 12.5rem; text-align: right; } .expense-amounts .amount { display: inline-block; min-width: 8.5rem; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; } .expense-amounts .currency { display: inline-block; min-width: 2.5rem; text-align: right; white-space: nowrap; } table [dir="ltr"], table .ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; } /* Summary box — same chrome as HTML (soft stroke) */ .summary-box { border: 1pt solid #d0d7de; border-radius: 8pt; background: var(--fill); padding: 10pt 12pt; margin: 10pt 0; page-break-inside: avoid; } .summary-box > :first-child { margin-top: 0; } .summary-box > :last-child { margin-bottom: 0; } .summary-box [dir="ltr"], .summary-box .ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; } code { direction: ltr; unicode-bidi: embed; font-size: 0.95em; } a { color: inherit; text-decoration: none; } main, .content, #quarto-content, .page-columns, .page-body { margin: 0 !important; padding: 0 !important; max-width: none !important; } } /* @media print */