Files
business-report-templates/styles/print.css

389 lines
7.2 KiB
CSS

/* 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;
/* Extra left margin for rotated sidebar; bottom-left box = typst page chip */
margin: 2.5cm 2cm 2.5cm 2.8cm;
@bottom-center {
content: counter(page);
font-family: "IRNazanin", sans-serif;
font-size: 11pt;
}
@top-center {
content: element(report-header);
width: 100%;
}
/* WeasyPrint only updates counter(page) reliably in @page margin boxes
(not inside position:fixed). Place the black n/N chip at bottom-left. */
@bottom-left {
content: counter(page) " / " counter(pages);
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;
margin-left: -1.6cm;
direction: ltr;
}
}
@page :first {
@top-center {
content: none;
}
}
@media print {
html {
direction: rtl;
}
body {
font-family: "IRNazanin", sans-serif;
font-size: 13pt;
line-height: 1.2;
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) ===== */
.print-sidebar {
position: fixed;
left: 0.25cm;
/* Leave room at the bottom for the @page bottom-left page chip */
bottom: 3.4cm;
width: 16.5cm;
height: 20pt;
transform-origin: left bottom;
transform: rotate(-90deg);
display: flex;
flex-direction: row;
align-items: stretch;
font-family: "IRZar", "IRNazanin", sans-serif;
font-size: 13pt;
border-bottom: 1pt solid black;
direction: ltr;
z-index: 1000;
}
.print-sidebar .seg {
flex: 1 1 0;
display: flex;
align-items: center;
justify-content: center;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
padding: 0 6pt;
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;
direction: ltr;
}
.print-title-block .title-text {
direction: rtl;
text-align: right;
line-height: 0.95;
flex: 1 1 auto;
}
.print-title-block .company-line {
font-size: 21pt;
font-weight: bold;
margin: 0;
}
.print-title-block .company-line .subtitle {
font-size: 14pt;
font-weight: normal;
}
.print-title-block .report-title {
font-size: 14pt;
font-weight: bold;
margin: 2pt 0 0 0;
}
.print-title-block .logo {
height: 1.8cm;
width: auto;
}
/* Travel-report meta block (only when purpose is set) */
.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;
}
/* Level-1/2 headings get a full-width rule above (typst show heading) */
h1, h2 {
font-size: 14pt;
margin: 16pt 0 10pt 0;
padding-top: 8pt;
border-top: 1pt solid black;
}
/* First body heading after Quarto title header: no rule (typst skips at top) */
#title-block-header + h1,
.print-title-block + h1,
.print-travel-meta + h1 {
border-top: none !important;
padding-top: 0 !important;
margin-top: 8pt;
}
h3 {
font-size: 13pt;
margin: 12pt 0 8pt 0;
border: none;
}
p {
margin: 0.4em 0 0.7em 0;
text-align: justify;
}
ul, ol {
margin: 0.4em 0 0.8em 0;
padding-right: 1.4em;
padding-left: 0;
}
li {
margin: 0.2em 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 [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 */