/*
 * === Fonts definition ====
 *
 * - Main font: IBM Plex Serif
 * - Mono font: IBM Plex Mono
 * - URL: https://github.com/IBM/plex
 *
 * Licensed under the SIL Open Font License, Version 1.1.
 */

@font-face {
        font-family: 'IBM Plex Serif';
        font-style: normal;
        font-weight: 400;
        src: local("IBM Plex Serif Regular"), local("IBMPlexSerif-Regular"), url("../fonts/IBMPlexSerif-Regular-Latin1.woff2") format("woff2");
        unicode-range: U+0020-007E, U+00A0-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2013-2014, U+2018-201A, U+201C-201E, U+2020-2022, U+2026, U+2030, U+2039-203A, U+2044, U+20AC, U+2122, U+2212, U+FB01-FB02;
        font-display: swap;
}

@font-face {
        font-family: 'IBM Plex Serif';
        font-style: italic;
        font-weight: 400;
        src: local("IBM Plex Serif Italic"), local("IBMPlexSerif-Italic"), url("../fonts/IBMPlexSerif-Italic-Latin1.woff2") format("woff2");
        unicode-range: U+0020-007E, U+00A0-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2013-2014, U+2018-201A, U+201C-201E, U+2020-2022, U+2026, U+2030, U+2039-203A, U+2044, U+20AC, U+2122, U+2212, U+FB01-FB02;
        font-display: swap;
}


@font-face {
        font-family: 'IBM Plex Serif';
        font-style: normal;
        font-weight: 700;
        src: local("IBM Plex Serif Bold"), local("IBMPlexSerif-Bold"), url("../fonts/IBMPlexSerif-Bold-Latin1.woff2") format("woff2");
        unicode-range: U+0020-007E, U+00A0-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2013-2014, U+2018-201A, U+201C-201E, U+2020-2022, U+2026, U+2030, U+2039-203A, U+2044, U+20AC, U+2122, U+2212, U+FB01-FB02;
        font-display: swap;
}

@font-face {
      font-family: "IBM Plex Mono";
      font-style: normal;
      font-weight: 400;
      font-display: swap;
      font-variant-numeric: slashed-zero;
      font-feature-settings: "zero" 1;
      src: local("IBM Plex Mono"), local("IBMPlexMono"), url("../fonts/IBMPlexMono-Regular-Latin1.woff2") format("woff2");
      unicode-range: U+0020-007E, U+00A0-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2013-2014, U+2018-201A, U+201C-201E, U+2020-2022, U+2026, U+2030, U+2039-203A, U+2044, U+20AC, U+2122, U+2212, U+FB01-FB02;
}

/* === Variables === */

:root {
    --font-serif: "IBM Plex Serif", "Times New Roman", Georgia, serif;
    --font-mono: "IBM Plex Mono", "Courier New", monospace;
    --font-size: 1.12rem;
    --line-height: 1.6;
    --mesure: 80ch;
}

/* === Base typography === */
body {
    margin: auto;
    font-size: var(--font-size);
    font-family: var(--font-serif);
    line-height: var(--line-height);
    max-width: var(--mesure);
    padding: 8em 2em 4em 2em;
    color: var(--color-fg);
    background: var(--color-bg);
    text-justify: auto;
}

p {
    text-align: justify;
    text-justify: inter-word;
}

a, a:visited {
    color: var(--color-link);
    text-decoration: underline;
    text-decoration-color: var(--color-border);
    text-underline-offset: 4px;
}

a:hover {
    color: var(--color-link);
    text-decoration: underline;
    text-decoration-color: var(--color-link);
}

blockquote {
        font-style: italic;
        border-left: 0.2em solid var(--color-border);
        padding-left: 1em;
}

a.footnote-back, a.footnote-ref {
    text-decoration: none;
    color: var(--color-magenta);
}
a.footnote-back {
    padding-left: 0.2em;
}
a.footnote-ref {
    font-family: var(--font-mono);
    padding: 0.1em;
}

a code {
    font-family: var(--font-mono);
    color: var(--color-link);
    background: none;
}

code {
    padding: 0.1em;
    font-family: var(--font-mono);
    color: var(--color-code-fg);
    background: var(--color-code-bg);
    white-space: pre;
}

hr {
    border: 0;
    border-top: 1px solid var(--color-border);
}

/* === Titles and headers === */

nav#site-nav {
    text-align: center;
	padding-top: 0.5em;
	margin-top: 1.5em;
	border-top: 1px solid var(--color-border);
}

nav#site-nav a {
    color: var(--color-comment);
    font-family: var(--font-mono);
}

nav#site-nav a:hover {
    text-decoration-color: var(--color-border);
}

h1.title {
	font-size: calc(var(--font-size)*3);
	text-align: center;
}

h1.title code {
	white-space: normal;	
}

.prompt, .prompt code {
    color: var(--color-fg);
    background: none;
}

.prompt::before {
    content: "$: ";
    content: "$: " / "";
    font-family: var(--font-mono);
    color: var(--color-green);
}

.index ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.index li {
    display: flex;
}

.index li > a {
    font-family: var(--font-mono);
}

.index li > a:first-child { 
    flex: none;
    gap: 1ch; padding: .15rem 0;
    min-width: 16ch;
}

.index .desc {
    color: var(--color-comment);
}

.articles li .date, .articles li .lang {
	font-family: var(--font-mono);
	color: var(--color-comment);
}

.articles ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.articles li {
	display: grid;
	grid-template-columns: 11ch 1fr auto;
	gap: 0 1.5ch;
	align-items: baseline;
	padding: .25rem 0;
}

.see-also ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.see-also li a {
	font-family: var(--font-mono);
}

p.subtitle {
    text-align: center;
    font-weight: bold;
    font-size:  calc(var(--font-size)*1.5);
}

p.author {
	font-style: italic;
	text-align: center;
}

p.author code {
	background: none;
}

p.author a {
    text-decoration: none;
}

p.author a:hover {
    text-decoration: underline;
    text-decoration-color: var(--color-border);
}

p.date {
    text-align: center;
    color: var(--color-comment);
    margin-top: 0.5em;
    font-variant-numeric: oldstyle-nums proportional-nums;
}

.abstract-title { 
	font-weight: bold;
	text-align: center;
	padding: 0;
	margin-bottom: 0.5em;
}

.abstract {
	margin: 2em;
	text-align: left;
	font-size: 90%;
}

.abstract p {
	text-align: justify;
	text-justify: inter-word;
}

.footnotes-end-of-document {
    margin-top: 4em;
}

.footnotes-end-of-document p {
    text-justify: none;
}

/** === Code highlight === **/
pre code a { color: inherit !important; }
pre.sourceCode {
    background: var(--color-code-bg);
    color: var(--color-fg);
    padding:  1em;
}

code.sourceCode {
    color: var(--color-fg);
}

.st {
    color: var(--color-green);
}
.co {
    color: var(--color-comment);
}
.va {
    color: var(--color-red);
}
.op {
    color: var(--color-fg);
}
.fu {
    color: var(--color-blu);
}

@media (max-width: 600px) {
    body {
        font-size: 0.9em;
        padding: 1em;
        text-justify: auto;
    }
}
