/**
* Adapted from Tufte CSS
*/

@charset "UTF-8";

:root {
  font-family: Inter, sans-serif;
  font-feature-settings:
    "liga" 1,
    "calt" 1; /* fix for Chrome */
  --color: #111;
  --background-color: #fafafa;
  --background-color-shade: #f2f2f2;
  --text-width: 60ch;
  --heading-width: 30ch;
  --subtitle-width: 48ch;
  --font-size: 100%;
  --font-size-large-1: 115%; /* font size * 1.15 */
  --line-height: 1.25;
  --lem: 1.25em; /* font-size * line-height */
  --font-small-1: 0.8em;
  --font-small-2: 0.64em;
  --font-large-1: 1.25em;
  --font-large-2: 1.563em;
  --font-large-3: 1.953em;
  --font-large-4: 2.441em;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color: #b0b0b0;
    --background-color: #1e1e1e;
    --background-color-shade: #424242;
  }
}

@supports (font-variation-settings: normal) {
  :root {
    font-family: InterVariable, sans-serif;
  }
}

/**
* OM CSS
*/

html {
  font-size: var(--font-size);
  line-height: var(--line-height);
}

body {
  background-color: var(--background-color);
  color: var(--color);
  display: flex;
  flex-direction: column;
  align-items: center;
}

/** 
* Layout 
*/

#meta {
  padding: calc(var(--lem) * 2) 0;
  list-style: none;
}

.footer {
  padding: calc(var(--lem) * 3) 0 calc(var(--lem) * 1);
  max-width: calc(var(--text-width));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: calc(var(--lem));
}

.footer .logo-and-osequi {
  display: flex;
  align-items: center;
  gap: calc(var(--lem) / 2);
}

.footer .link-with-image {
  line-height: 0;
}

.footer .logo {
  width: calc(var(--lem));
  height: auto;
}

.logo {
  --bg-color: var(--background-color);
  --fg-color: var(--color);
}

body {
  padding: calc(var(--lem) * 3) calc(var(--lem) * 1);
}

article {
  max-width: calc(var(--text-width) * 1.3);
  width: 100%;
}

section {
  padding-bottom: calc(var(--lem) * 1);
}

li + li,
li > ul {
  margin-top: calc(var(--lem) / 2);
}

.marginnote {
  margin: calc(var(--lem) / 2) 0;
}

.marginnote blockquote {
  margin: calc(var(--lem) * 1) 0;
}

.table-container {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

table {
  font-size: var(--font-small-1);
  max-width: calc(var(--text-width) * 1.25);
  width: 100%;
  border-collapse: collapse;
}

figure {
  max-width: calc(var(--text-width));
}

blockquote {
  max-width: calc(var(--text-width));
}

blockquote > footer,
figure figcaption {
  text-align: center;
  max-width: 80%;
  margin: auto 10%;
}

figure + figure {
  margin-top: var(--lem);
}

pre {
  max-width: calc(var(--text-width) * 1.65);
  margin: 0;
}

pre > code {
  max-width: calc(100% - var(--lem) * 2);
}

pre code::before {
  content: ""; /* Prevent extra spacing */
  display: block;
}

/** 
* Typography 
*/

@media (min-width: 768px) {
  body {
    font-size: var(--font-size-large-1);
  }
}

p,
ol,
ul {
  max-width: var(--text-width);
}

h1,
h2,
h3,
h4 {
  line-height: 1.1;
  max-width: var(--heading-width);
}

p.subtitle {
  max-width: var(--subtitle-width);
}

h4 {
  font-size: var(--font-large-1);
}

h3 {
  font-size: var(--font-large-2);
}

h2 {
  font-size: var(--font-large-3);
}

h1 {
  font-size: var(--font-large-4);
  font-weight: 700;
}

p.subtitle {
  font-size: var(--font-large-1);
}

ul,
ol {
  margin: 0;
  padding: 0;
  padding-left: var(--lem);
}

blockquote {
  font-weight: 300;
  margin: 0;
  padding: 0;
  background-color: var(--background-color-shade);
  padding: calc(var(--lem));
}

@media (prefers-color-scheme: dark) {
  blockquote {
    background-color: var(--background-color);
    border-left: 1px solid;
    margin-left: calc((var(--lem)));
  }
}

blockquote > p {
  font-size: var(--font-large-1);
  line-height: 1.1;
}

.marginnote blockquote p {
  font-size: 100%;
}

table {
  border: 1px solid;
}

th,
td {
  border: 1px solid;
  padding: calc(var(--lem) / 2);
  text-align: left;
  font-weight: normal;
  white-space: normal;
  word-wrap: break-word;
}

thead th {
  border-bottom: 1px solid;
  background-color: var(--background-color-shade);
}

a,
a:visited {
  color: inherit;
}

code,
pre > code {
  font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;
  -webkit-text-size-adjust: 100%; /* Prevent adjustments of font size after orientation changes in iOS. See https://github.com/edwardtufte/tufte-css/issues/81#issuecomment-261953409 */
  font-size: var(--font-small-2);
}

pre > code {
  padding: calc(var(--lem));
  overflow: auto;
}

pre {
  display: flex;
  background-color: var(--background-color-shade);
}

code {
  background-color: var(--background-color-shade);
  font-size: var(--font-small-1);
}

@media (prefers-color-scheme: dark) {
  pre {
    background-color: var(--background-color);
    border: 1px solid;
  }
  pre > code {
    background-color: inherit;
  }
}

.hidden {
  visibility: hidden;
  line-height: 0;
  margin: 0;
  padding: 0;
}

figure {
  margin: 0;
  padding: 0;
}

figure.white img {
  border: 1px solid;
  padding: calc(var(--lem));
  max-width: calc(100% - var(--lem) * 2);
}

@media (prefers-color-scheme: dark) {
  figure.dark img {
    border: 1px solid;
    padding: calc(var(--lem));
    max-width: calc(100% - var(--lem) * 2);
  }
  figure.white img {
    border: none;
    padding: 0;
    max-width: calc(var(--text-width));
  }
}

img {
  width: 100%;
}

figcaption {
  font-size: var(--font-small-1);
  font-style: italic;
}

/** 
* Toogle 
*/

.sidenote,
.marginnote {
  float: right;
  clear: right;
  vertical-align: baseline;
  position: relative;
}

.sidenote,
.marginnote {
  display: none;
}

label.margin-toggle:not(.sidenote-number) {
  display: none;
}

label.margin-toggle:not(.sidenote-number) {
  display: inline;
}

.margin-toggle:checked + .sidenote,
.margin-toggle:checked + .marginnote {
  display: block;
  width: 100%;
  float: left;
  vertical-align: baseline;
  position: relative;
}

input.margin-toggle {
  display: none;
}

label {
  cursor: pointer;
}
