/*
 * The Proportional Web
 * By Oskar Wickström
 *
 * Altered by Matthew Knight for this user manual.
 *
 * Licensed under the MIT License (https://github.com/owickstrom/the-proportional-web/blob/main/LICENSE.md)
 */

@import url('https://fonts.googleapis.com/css2?family=Lekton:ital,wght@0,400;0,700;1,400&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Courier+Prime:ital,wght@0,400;0,700;1,400;1,700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,300;1,400;1,500;1,600;1,700&display=swap');

/* === Public Sans (self-hosted, from Google Fonts) === */
@font-face {
    font-family: 'Public Sans';
    src: url('fonts/public-sans/PublicSans-Latin.woff2') format('woff2');
    font-weight: 300 700;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Public Sans';
    src: url('fonts/public-sans/PublicSans-LatinExt.woff2') format('woff2');
    font-weight: 300 700;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Public Sans';
    src: url('fonts/public-sans/PublicSans-Vietnamese.woff2') format('woff2');
    font-weight: 300 700;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
    font-family: 'Public Sans';
    src: url('fonts/public-sans/PublicSans-Italic-Latin.woff2') format('woff2');
    font-weight: 400 700;
    font-style: italic;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Public Sans';
    src: url('fonts/public-sans/PublicSans-Italic-LatinExt.woff2') format('woff2');
    font-weight: 400 700;
    font-style: italic;
    font-display: swap;
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Public Sans';
    src: url('fonts/public-sans/PublicSans-Italic-Vietnamese.woff2') format('woff2');
    font-weight: 400 700;
    font-style: italic;
    font-display: swap;
    unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
    font-family: 'Iosevka Slab';
    src: url('fonts/iosevka-slab/IosevkaSlab-Regular.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Iosevka Slab';
    src: url('fonts/iosevka-slab/IosevkaSlab-Bold.woff2') format('woff2');
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Iosevka Slab';
    src: url('fonts/iosevka-slab/IosevkaSlab-Italic.woff2') format('woff2');
    font-weight: normal;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Iosevka Slab';
    src: url('fonts/iosevka-slab/IosevkaSlab-BoldItalic.woff2') format('woff2');
    font-weight: bold;
    font-style: italic;
    font-display: swap;
 }

html,
body,
div,
span,
applet,
object,
iframe,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
a,
abbr,
acronym,
address,
big,
cite,
code,
del,
dfn,
em,
img,
ins,
kbd,
q,
s,
samp,
small,
strike,
strong,
sub,
sup,
tt,
var,
b,
u,
i,
center,
dl,
dt,
dd,
ol,
ul,
li,
fieldset,
form,
label,
legend,
table,
caption,
tbody,
tfoot,
thead,
tr,
th,
td,
article,
aside,
canvas,
details,
embed,
figure,
figcaption,
footer,
header,
hgroup,
menu,
nav,
output,
ruby,
section,
summary,
time,
mark,
audio,
video {
  padding: 0;
  border: 0;
  font-size: 100%;
  font: inherit;
  vertical-align: baseline;
}

article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
menu,
nav,
section {
  display: block;
}

body {
  line-height: 1;
}

ol, ul {
  list-style: none;
}

blockquote, q {
  quotes: none;
}

blockquote:before, blockquote:after, q:before, q:after {
  content: "";
  content: none;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

:root {
  --font-family: "Public Sans", Helvetica, serif;
  --font-family-code: "Iosevka Slab", monospace;
  --line-height: 1.20rem;
  --border-thickness: 1.5px;
  --text-color: #000;
  --background-color: #fff;
  --horizontal-margin: 3ch;
  --body-inner-width: 66ch;
  --body-max-width: calc(var(--body-inner-width) + var(--horizontal-margin) * 2);
  --font-weight-normal: 300;
  --font-weight-medium: 400;
  --font-weight-bold: 800;
  font-family: var(--font-family);
  font-optical-sizing: auto;
  font-weight: var(--font-weight-normal);
  font-style: normal;
  font-variant-numeric: oldstyle-nums;
  font-feature-settings: "onum";
  font-size: 16px;
}

* {
  box-sizing: border-box;
}

* + * {
  margin-top: var(--line-height);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: var(--font-weight-normal);
  margin: calc(var(--line-height) * 2) 0 var(--line-height);
  line-height: var(--line-height);
}

.header-section-number {
  font-family: var(--font-family);
  font-size: .875rem;
  font-weight: 500;
  font-variant: initial;
  letter-spacing: 0;
  margin-right: .5ch;
  font-style: normal;
}

body h1,
h2#toc-title {
  font-family: var(--font-family);
  font-variant: titling-caps;
  font-size: 1.25rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  padding: var(--line-height) 0 calc(var(--line-height) - var(--border-thickness));
  border-bottom: var(--border-thickness) solid var(--text-color);
}

h1 .header-section-number {
  display: none;
}

h2 {
  font-family: var(--font-family);
  font-size: 1.25rem;
  font-variant: all-small-caps;
  font-weight: 450;
  line-height: var(--line-height);
  letter-spacing: 0.125em;
}

h3 {
  font-style: italic;
  margin: var(--line-height) 0;
}

h4 {}

table {
  width: 100%;
  border-collapse: collapse;
  margin: calc(var(--line-height) * -0.5) 0 calc(var(--line-height) * 1.5);
  padding: 0;
  border: 1.5px solid black;
}

th, td {
  padding: calc(var(--line-height) / 2) .5ch;
  line-height: var(--line-height);
  vertical-align: top;
  text-align: left;
  border-right: 1.5px solid black;

}

th {
  font-size: 1.125em;
  font-variant: all-small-caps;
  font-weight: 500;
  letter-spacing: 0.075em;
  border: 1.5px solid black;
}

thead tr:last-child th {
  border-bottom: var(--border-thickness) solid var(--text-color);
}

blockquote {
  padding: 0;
  margin: var(--line-height) 3ch;
}

blockquote p {
  text-indent: 0;
  white-space: normal;
}

blockquote p:first-of-type:before {
  display: inline;
  content: "\201c";
}

blockquote p:last-of-type::after {
  display: inline;
  content: "\201d";
}

blockquote footer {
  order: 9999;
  margin-top: var(--line-height);
  font-style: normal;
}

blockquote footer > * {
  margin: 0;
}

blockquote .author {
  font-family: var(--font-family);
  font-size: 1.125em;
  font-variant: all-small-caps;
  font-weight: 450;
  line-height: var(--line-height);
  letter-spacing: 0.075em;
  height: 1rem;
  line-height: 1rem;
}

blockquote cite {
  font-style: italic;
  margin: 0;
  line-height: var(--line-height);
}

blockquote .year {
  display: block;
}

details {
  margin: var(--line-height) 0;
  border-top: var(--border-thickness) solid var(--text-color);
  border-bottom: var(--border-thickness) solid var(--text-color);
  padding: var(--line-height) 0;
}

summary {
  font-weight: var(--font-weight-normal);
  font-style: italic;
  cursor: pointer;
}

details[open] summary {
  margin-bottom: var(--line-height);
}

details ::marker {
  content: "";
}

details summary::before {
  display: inline-block;
  content: "\bb";
  margin: 0 .5ch 0 0;
  font-style: normal;
}

details[open] summary::before {
  transform: rotate(90deg);
}

details :last-child {
  margin-bottom: 0;
}

aside {
  position: relative;
  font-size: 0.875rem;
  line-height: var(--line-height);
  margin: var(--line-height) 0;
}

aside:before {
  display: inline-block;
  content: "\2767";
  font-size: 1rem;
  height: .875rem;
  margin-right: .5ch;
  line-height: var(--line-height);
}

@media screen and (min-width: 95ch) {
  aside {
    position: absolute;
    width: 20ch;
    top: anchor(top);
    left: 100%;
    margin: 0;
    text-align: left;
  }
  aside:before {
    display: none;
  }
  p + aside + p {
    margin-top: 0;
    text-indent: 3ch;
  }
}

figure {
  margin: calc(var(--line-height) * 2) var(--horizontal-margin);
  overflow-x: auto;
  overflow-y: hidden;
}

figure > *:first-child {
  margin-top: 0;
}

figure > *:last-child {
  margin-bottom: 0;
}

figcaption {
  display: block;
  margin-top: var(--line-height);
}

figcaption .author {
  font-family: var(--font-family);
  font-size: 1.125em;
  font-variant: all-small-caps;
  font-weight: 450;
  line-height: var(--line-height);
  letter-spacing: 0.075em;
  height: 1rem;
  line-height: 1rem;
}

figcaption cite {
  font-style: italic;
  margin: 0;
  line-height: var(--line-height);
}

figure pre {
  margin: 0;
}

hr {
  position: relative;
  display: block;
  height: var(--line-height);
  margin: calc(var(--line-height) * 1.5) 0;
  border: none;
  color: var(--text-color);
}

hr:before {
  display: block;
  content: "";
  position: absolute;
  top: calc(var(--line-height) / 2);
  left: 0;
  width: 100%;
  border-top: var(--border-thickness) solid var(--text-color);
  height: 0;
}

hr:after {
  display: inline-block;
  content: "\2767";
  position: absolute;
  top: 0;
  left: calc(50% - 1ch);
  width: 2ch;
  text-align: center;
  font-size: 2rem;
  background: var(--background-color);
}

a {
  text-decoration-thickness: var(--border-thickness);
}

a:link, a:visited {
  color: var(--text-color);
}

p {
  margin: var(--line-height) 0 0;
  text-align: justify;
  word-break: break-all;
}

p + p {
  margin-top: 0;
  text-indent: 3ch;
}

h1 + p,
h2 + p,
h3 + p,
h4 + p,
hr + p {
  text-indent: 0;
}

strong {
  font-weight: var(--font-weight-bold);
}

em {
  font-style: italic;
}

abbr {
  font-size: 1.125em;
  font-variant: all-small-caps;
  font-weight: 500;
  letter-spacing: 0.05em;
}

sub {
  position: relative;
  display: inline-block;
  margin: 0;
  vertical-align: sub;
  line-height: 0;
  width: calc(1ch / 0.75);
  font-size: .75rem;
}

p {
  word-break: break-word;
  text-wrap: pretty;
  hyphens: auto;
  hyphenate-limit-chars: 3;
}

img, video {
  display: block;
  width: 100%;
  object-fit: contain;
  overflow: hidden;
}

img {
  font-style: italic;
  color: var(--text-color);
}

pre {
  white-space: pre;
  margin: var(--line-height) 0;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

pre, code {
  font-family: var(--font-family-code);
  font-weight: 450;
}

ul, ol {
  padding: 0;
  margin: var(--line-height) 0 var(--line-height);
}

ul {
  list-style-type: none;
  padding: 0;
  margin-top: 1em;
}

ul li:before {
  content: "\2022";
  margin-right: 1ch;
}

ol {
  list-style-type: none;
  counter-reset: item;
  padding: 0;
}

ol ul,
ol ol,
ul ol,
ul ul {
  padding: 0 0 0 2ch;
  margin: 0;
}

ol li:before {
  font-size: .875rem;
  font-weight: 500;
  content: counters(item, ".") ". ";
  counter-increment: item;
}

li {
  margin: 0;
  padding: 0;
}

li::marker {
  line-height: 0;
}

html {
  display: flex;
  width: 100%;
  margin: 0;
  padding: 0;
  flex-direction: column;
  align-items: left;
  background: var(--background-color);
  color: var(--text-color);
}

body {
  position: relative;
  width: 100%;
  margin: 0;
  padding: var(--line-height) var(--horizontal-margin);
  max-width: var(--body-max-width);
  line-height: var(--line-height);
  overflow-x: hidden;
}

@media screen and (min-width: 112ch) {
  html {
    align-items: center;
  }
}

@media screen and (max-width: 480px) {
  :root {
    font-size: 14px;
  }
  body {
    padding: var(--line-height) 1.5ch;
  }
}

.toc-section-number {
  height: 1rem;
  font-size: .875rem;
  font-weight: 500;
  letter-spacing: 0;
  margin-right: .5ch;
  font-style: normal;
}

#TOC > ul {
  padding: 0;
}

#TOC ul li:before {
  content: "";
  margin: 0;
}

#TOC a {
  display: block;
  height: var(--line-height);
  text-decoration: none;
}

#TOC a:hover {
  text-decoration: underline;
}

@media print {
  body {
    max-width: initial;
  }
  body > h1,
  img {
    break-before: page;
  }
}

header {
  margin: calc(var(--line-height) * 3) 0;
  margin-top: 1rem;
}

header h1 {
  font-family: var(--font-family);
  font-variant: all-small-caps;
  font-size: 3.5rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  line-height: calc(2 * var(--line-height));
  margin: 0;
  padding-bottom: 0;
  border-bottom: none;
  text-align: center;
}

header .subtitle {
  font-size: 1.25rem;
  line-height: calc(2 * var(--line-height));
  margin: calc(var(--line-height) * .5) 0;
}

header p {
  text-indent: 0;
  text-align: left;
}

.canonical-name {
  font-family: var(--font-family);
  font-size: 1.125em;
  font-variant: all-small-caps;
  font-weight: 450;
  line-height: var(--line-height);
  letter-spacing: 0.075em;
}

/* Manual specific stuff */

.front-page {
    padding-right: 48px;
    padding-left: 48px;
}

.site-title {
    font-weight: bold;
}

.comment {
    font-style: italic;
}

h1 a,
h2 a,
h3 a,
h4 a,
h5 a,
h6 a {
    text-decoration: none;
}
