/* Stylesheet for the AI4PLAN contractual documents published on legal.ai4plan.com.
   The « sobre » theme, build/themes/sobre.css followed by build/style.css, then the layout block
   below, specific to web publication.
   To regenerate it after a change to the theme:
     cat build/themes/sobre.css build/style.css > docs/assets/css/document.css
   then paste the « PAGE LAYOUT » block that follows back in. */

/* The « sobre » theme — the default one.
   Cambria: drawn for print, lining figures, crisp at small sizes. */

:root {
  --body-font: Cambria, 'Sitka Text', Georgia, serif;
  --heading-font: Cambria, 'Sitka Text', Georgia, serif;
  --margin-font: Calibri, 'Segoe UI', sans-serif;

  --base-size: 10.5pt;
  --line-height: 1.5;
  --text-align: left; /* left = ragged right; justify = justified */

  --ink: #23282d;
  --muted: #6b7076;
  --rule: #dfe3e7;
  --accent: #2e74b5; /* the blue of the original documents */

  --heading-weight: 600;
  --heading-color: var(--accent);
  --h1-size: 19pt;
  --h2-size: 12.5pt;
  --h3-size: 11pt;

  --callout-bg: #f4f7fa;
  --table-header-bg: #eef2f6;
}
/* Structure of the AI4PLAN contractual documents.
   The settings (fonts, sizes, colours, alignment) live in build/themes/. */

@page {
  size: A4;
}

html {
  font-size: var(--base-size);
}

body {
  font-family: var(--body-font);
  color: var(--ink);
  line-height: var(--line-height);
  text-align: var(--text-align);
  margin: 0;

  /* Lining, tabular figures: article references, rates and durations must read without
     ambiguity and line up in table columns. */
  font-variant-numeric: lining-nums tabular-nums;
  font-feature-settings: 'lnum' 1, 'tnum' 1;
}

/* ---------- Headings ---------- */

h1,
h2,
h3 {
  font-family: var(--heading-font);
  font-weight: var(--heading-weight);
  color: var(--heading-color);
  text-align: left;
  text-wrap: balance;
  hyphens: none;
}

h1 {
  font-size: var(--h1-size);
  line-height: 1.18;
  margin: 0 0 0.25em;
  letter-spacing: -0.005em;
}

h2 {
  font-size: var(--h2-size);
  margin: 1.7em 0 0.55em;
  padding-bottom: 0.22em;
  border-bottom: 1px solid var(--rule);
  break-after: avoid;
}

h3 {
  font-size: var(--h3-size);
  margin: 1.25em 0 0.35em;
  break-after: avoid;
}

h1 + p,
h2 + p,
h3 + p,
h2 + ul,
h3 + ul,
h2 + ol,
h3 + ol,
h2 + table,
h3 + table,
h2 + blockquote {
  break-before: avoid;
}

/* The effective-date line, under the document title */
h1 + p > strong:only-child {
  display: block;
  font-family: var(--margin-font);
  font-weight: 600;
  font-size: 9.5pt;
  color: var(--muted);
  letter-spacing: 0.01em;
  margin-bottom: 1.4em;
}

/* ---------- Body ---------- */

p {
  margin: 0 0 0.72em;
  orphans: 3;
  widows: 3;
}

strong {
  font-weight: 600;
}

ul,
ol {
  margin: 0 0 0.85em;
  padding-left: 1.45em;
}

li {
  margin-bottom: 0.3em;
  break-inside: avoid;
}

li::marker {
  color: var(--muted);
}

/* ---------- Callouts ---------- */

blockquote {
  margin: 1.15em 0;
  padding: 0.75em 1.05em;
  border-left: 3px solid var(--accent);
  background: var(--callout-bg);
  break-inside: avoid;
}

blockquote p:last-child {
  margin-bottom: 0;
}

/* ---------- Tables ---------- */

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.05em 0;
  font-size: 0.9em;
  break-inside: avoid;
}

th,
td {
  border: 1px solid var(--rule);
  padding: 0.45em 0.62em;
  text-align: left;
  vertical-align: top;
  hyphens: none;
}

th {
  background: var(--table-header-bg);
  font-weight: 600;
}

/* ---------- Sundries ---------- */

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 1.7em 0;
}

a {
  color: var(--ink);
  text-decoration: none;
}

code {
  font-family: Consolas, 'Courier New', monospace;
  font-size: 0.9em;
}

/* ---------- PAGE LAYOUT (web publication) ---------- */

/* 170 mm: the width the text column had on an A4 page once its margins were taken off. The
   line length stays the one the documents were set for. */
body {
  margin: 0;
  padding: 14mm 6mm 20mm;
  background: #fff;
}

main {
  max-width: 170mm;
  margin: 0 auto;
}

/* The statement block some documents carry at the end of the file, after a rule. */
main > hr:last-of-type ~ p:last-child {
  font-family: var(--margin-font);
  font-size: 8.5pt;
  color: var(--muted);
}

/* Printing from the browser restores the A4 format and the margins of the old PDFs. */
@media print {
  @page {
    size: A4;
    margin: 18mm 20mm 20mm;
  }

  body {
    padding: 0;
  }

  main {
    max-width: none;
  }
}
