File size: 4,971 Bytes
9b7d64e
76fc93a
 
 
 
 
 
 
 
 
 
 
 
9b7d64e
 
 
 
 
 
 
76fc93a
9b7d64e
 
 
 
76fc93a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9b7d64e
 
 
76fc93a
 
 
 
 
 
 
 
 
 
 
 
 
 
9b7d64e
 
 
 
 
 
 
 
 
 
 
 
 
 
76fc93a
 
 
 
 
 
9b7d64e
 
 
 
 
76fc93a
9b7d64e
 
 
 
 
 
 
76fc93a
9b7d64e
 
76fc93a
9b7d64e
76fc93a
9b7d64e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
76fc93a
9b7d64e
 
76fc93a
9b7d64e
 
76fc93a
9b7d64e
 
 
 
 
 
 
 
 
 
 
 
76fc93a
 
9b7d64e
 
 
 
 
 
 
 
76fc93a
 
 
 
 
 
9b7d64e
76fc93a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9b7d64e
 
 
76fc93a
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
/* ============================================================================ */
/* Print styles                                                                  */
/* ============================================================================ */

/*
 * The .pdf-toc node is injected at print time by the PDF generator. It is
 * hidden in the browser (web view of the published article) and shown only
 * when emulating print media during PDF generation.
 */
.pdf-toc {
  display: none;
}

@media print {

  html,
  body {
    background: #fff;
  }

  /* Margins are handled by Playwright; avoid extra global margins */
  body {
    margin: 0;
  }

  /* Paragraphs: balanced break behaviour for long-form reading */
  p,
  li,
  blockquote {
    orphans: 3;
    widows: 3;
  }

  p {
    hyphens: auto;
    -webkit-hyphens: auto;
  }

  /* Hide non-essential UI */
  #theme-toggle,
  .toc-mobile-toggle,
  .toc-mobile-backdrop,
  .toc-mobile-sidebar,
  .right-aside,
  .sync-indicator,
  .top-bar {
    display: none !important;
  }

  /* Sidebar TOC is replaced by .pdf-toc in print */
  .table-of-contents {
    display: none !important;
  }

  main > nav:first-of-type {
    display: none !important;
  }

  /* Force single column to reduce widows/orphans and awkward breaks */
  .content-grid {
    grid-template-columns: 1fr !important;
  }

  /* Links: remove underline and background */
  .content-grid main a {
    text-decoration: none;
    background: none;
    border-bottom: 1px solid rgba(0, 0, 0, .2);
  }

  /* Soft page breaks around main headings */
  .content-grid main h2 {
    page-break-before: auto;
    page-break-after: avoid;
    break-after: avoid-page;
  }

  .content-grid main h3,
  .content-grid main h4 {
    break-after: avoid-page;
    page-break-after: avoid;
  }

  /* Small icon labels not needed when printing */
  .code-lang-chip {
    display: none !important;
  }

  /* More contrasty colors for print */
  :root {
    --surface-bg: #fff;
    --border-color: rgba(0, 0, 0, .2);
    --link-underline: rgba(0, 0, 0, .3);
    --link-underline-hover: rgba(0, 0, 0, .4);
  }

  /* Avoid breaks inside complex visual blocks */
  .hero,
  .hero-banner,
  .html-embed,
  .html-embed__card,
  .html-embed-container,
  .js-plotly-plot,
  figure,
  pre,
  table,
  blockquote,
  .wide,
  .full-width,
  .stack > *,
  .card,
  .palettes,
  .palette-card,
  .color-picker,
  .note {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  /* Keep hero + meta together at the top of page 1 */
  .hero {
    page-break-after: avoid;
    break-after: avoid;
  }

  /* Constrain hero banner after rasterization */
  .hero-banner {
    width: 100% !important;
    max-width: 980px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    overflow: hidden;
  }

  .hero-banner > *,
  .hero-banner svg,
  .hero-banner canvas,
  .hero-banner img,
  .hero-banner video,
  .html-embed-container > img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    margin-left: auto !important;
    margin-right: auto !important;
    display: block;
  }

  /* References / bibliography: start on a new page and stay together */
  .references-block,
  .bibliography-content {
    break-before: page;
    page-break-before: always;
  }

  .bibliography-title {
    break-after: avoid;
    page-break-after: avoid;
  }

  /* Footer: the web view uses a 3-column grid (~1160px wide) that does
     not fit the ~673px printable width. Drop the grid so each block
     flows naturally, headings stacked above their content. */
  .footer-inner { display: block; }
  .citation-block,
  .references-block,
  .reuse-block,
  .doi-block,
  .template-credit { display: block; }
  .footer-heading {
    text-align: left !important;
    padding-right: 0 !important;
  }

  /* PDF TOC: visible only in print */
  .pdf-toc {
    display: block;
    break-after: page;
    page-break-after: always;
    max-width: 780px;
    margin: 0 auto 12mm;
    padding: 0 16px;
  }

  .pdf-toc__title {
    font-size: 1.3rem;
    margin: 0 0 12px;
    border-bottom: 1px solid rgba(0, 0, 0, .2);
    padding-bottom: 8px;
  }

  .pdf-toc__list {
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .pdf-toc__item {
    margin: 4px 0;
    font-size: 0.95rem;
    line-height: 1.4;
  }

  .pdf-toc__item--sub {
    margin-left: 20px;
    font-size: 0.88rem;
    color: rgba(0, 0, 0, .7);
  }

  .pdf-toc__item a {
    color: inherit;
    text-decoration: none;
    border-bottom: none;
  }

  /* Meta container (authors, affiliations, PDF link): keep tight under hero */
  .meta-container,
  .hero-meta {
    break-after: avoid;
    page-break-after: avoid;
  }

  /* Hide the PDF download cell in the generated PDF itself (self-referential) */
  .meta-container-cell--pdf {
    display: none !important;
  }

  /* Hide published-side tooltips in print */
  .pub-tooltip {
    display: none !important;
  }
}