/* The article form (ADR 0028): print first — the A4 PDF of a version is the publication; the screen shows the same
   sheet without page breaks. Loaded after style.css by the article, preview and reading-site pages; colours are the
   variables of style.css. The margins, the running header (title, status) and footer (version, pid, page n of m) are
   set by tools/lib/pdf.js. Numbers are in the text (headings, captions, references), never CSS counters. */
@page { size: A4; }

/* front matter: title, authors, status and citation on page one */
article.publication header.front-matter { margin-bottom: 1.25rem; }
article.publication header.front-matter h1 { margin: 0 0 .4rem; font-size: 1.9rem; }
p.authors { margin: 0 0 .5rem; font: 16px/1.45 system-ui, sans-serif; }
p.authors .author a { color: var(--text); text-decoration: none; }
p.authors a.orcid { color: var(--accent); font-size: 11px; vertical-align: super; text-decoration: none; }

/* abstract and keywords */
section.abstract { margin: 1.25rem 0 .5rem; padding: .75rem 1rem; background: var(--soft); border-left: 3px solid var(--accent); }
section.abstract h2 { margin: 0 0 .35rem; font-size: 1rem; text-transform: uppercase; letter-spacing: .05em; }
section.abstract p { margin: .35rem 0; }
p.keywords { margin: .4rem 0 1.5rem; font: 14px/1.45 system-ui, sans-serif; color: var(--dim); }
p.keywords strong { color: var(--text); }

/* numbered headings: the number is part of the text */
.article-body h2, .article-body h3, .article-body h4 { break-after: avoid; page-break-after: avoid; }
.article-body .secnum { margin-right: .45rem; color: var(--dim); font-variant-numeric: tabular-nums; }
.article-body p { orphans: 3; widows: 3; }

/* figures and tables: kept whole with their captions, labelled */
article.publication figure.artefact { break-inside: avoid; page-break-inside: avoid; }
figcaption .label { font-weight: 700; margin-right: .1rem; }
a.xref, a.cite { text-decoration: none; }
a.cite, span.cite { white-space: nowrap; }
.xref-unknown, .cite-unknown { color: var(--dim); border-bottom: 1px dotted var(--dim); }

/* the generated reference list: hanging indent, the number in the text */
section.references { margin-top: 2rem; }
section.references h2, section.contributions h2 { break-after: avoid; page-break-after: avoid; }
ol.references { list-style: none; padding: 0; margin: 0; font: 14px/1.5 Georgia, 'Times New Roman', serif; }
ol.references li { padding-left: 2.2rem; text-indent: -2.2rem; margin: .3rem 0; break-inside: avoid; page-break-inside: avoid; }
ol.references .ref-n { display: inline-block; min-width: 2.2rem; text-indent: 0; }
ol.references a { word-break: break-all; }
section.contributions { margin-top: 1.5rem; }

/* the preview's warnings (ADR 0028 decision 6): never printed */
.publication-warnings { margin: 0 0 1rem; padding: .5rem .75rem; background: var(--editing); font: 14px/1.4 system-ui, sans-serif; }
.publication-warnings ul { margin: .3rem 0 0; padding-left: 1.2rem; }

@media print {
  form.versions, .publication-warnings, a.download-pdf, .notice { display: none; }
  article.publication header.front-matter h1 { font-size: 20pt; }
  section.abstract { background: none; border-left: 2pt solid var(--accent); }
  section.references, section.contributions, section.rests-on { break-before: auto; }
  a { color: var(--text); text-decoration: none; }
  a.cite, a.xref, ol.references a { color: var(--accent); }
}
