/* PT Serif — regular, Latin Extended */
@font-face {
  font-family: "PT Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/pt-serif-latin-ext-400-normal.woff2") format("woff2");
  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;
}

/* PT Serif — regular, Latin */
@font-face {
  font-family: "PT Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/pt-serif-latin-400-normal.woff2") format("woff2");
  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;
}

/* PT Serif — italic, Latin Extended */
@font-face {
  font-family: "PT Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/pt-serif-latin-ext-400-italic.woff2") format("woff2");
  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;
}

/* PT Serif — italic, Latin */
@font-face {
  font-family: "PT Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/pt-serif-latin-400-italic.woff2") format("woff2");
  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;
}

/* PT Serif — bold, Latin Extended */
@font-face {
  font-family: "PT Serif";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/pt-serif-latin-ext-700-normal.woff2") format("woff2");
  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;
}

/* PT Serif — bold, Latin */
@font-face {
  font-family: "PT Serif";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/pt-serif-latin-700-normal.woff2") format("woff2");
  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;
}

/* PT Serif — bold italic, Latin Extended */
@font-face {
  font-family: "PT Serif";
  font-style: italic;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/pt-serif-latin-ext-700-italic.woff2") format("woff2");
  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;
}

/* PT Serif — bold italic, Latin */
@font-face {
  font-family: "PT Serif";
  font-style: italic;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/pt-serif-latin-700-italic.woff2") format("woff2");
  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;
}

/* =========================================================
   Newsprint-inspired theme
   ========================================================= */

:root {
  --serif-font: "PT Serif", "Times New Roman", Times, serif;
  --mono-font: Menlo, Consolas, "Courier New", monospace;

  --bg: #f3f2ee;
  --text: #1f0909;
  --text-light: #656565;
  --border: #c5c5c5;
  --accent: #065588;
  --code-bg: #dadada;
  --table-stripe: #e8e7e7;
}


/* Base */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-family: var(--serif-font);
  font-size: 16px;
  line-height: 1.5;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  color: var(--text);
  background: var(--bg);
  font-family: var(--serif-font);
  font-size: 1rem;
  line-height: 1.5;

  display: grid;
  grid-template-columns: 1fr min(60rem, 90%) 1fr;
  grid-template-rows: auto 1fr auto;

  min-height: 100vh;
  min-height: 100dvh;

  margin: 0;
}

body > * {
  grid-column: 2;
}


/* Header */

body > header {
  grid-column: 1 / -1;
  padding: 1rem 0.5rem;
  text-align: right;
}

body > header div {
  max-width: 60rem;
  margin: 0 auto;
  font-weight:500;

  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}


/* Main content */

main {
  padding-top: 1.5rem;
}


/* Paragraphs */

p {
  margin-top: 0;
  margin-bottom: 1.5em;
}


/* Headings */

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--text);
  font-family: var(--serif-font);
}

h1 {
  font-size: 1.875em;
  line-height: 1.3;
  font-weight: normal;

  margin-top: 0em;
  margin-bottom: 0.5em;
  padding-bottom: 0.8125em;

  border-bottom: 1px solid var(--border);
}

h2,
h3 {
  font-size: 1.3125em;
  line-height: 1.15;

  margin-top: 2.285714em;
  margin-bottom: 0.75em;
}

h2 {
  font-weight: bold;
}

h3 {
  font-weight: normal;
}

h4 {
  font-size: 1.125em;
  margin-top: 2.67em;
  margin-bottom: 1.5em;
}

h5,
h6 {
  font-size: 1em;
  margin-top: 2em;
  margin-bottom: 1.5em;
}


/* Links */

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

a:hover,
a:active {
  text-decoration: underline;
}


/* Horizontal rule */

hr {
  border: 0;
  border-bottom: 1px solid var(--border);
  margin: 3em 0;
}


/* Blockquotes */

blockquote {
  color: var(--text-light);
  font-style: italic;

  border-left: 5px solid #bababa;

  margin: 0 0 1.5em 2em;
  padding-left: 1em;
}

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


/* Lists */

ul,
ol {
  margin: 0 0 1.5em 1.5em;
  padding: 0;
}

ul {
  list-style-type: disc;
}

ol {
  list-style-type: decimal;
}

li > ul,
li > ol {
  margin-top: 0.5em;
  margin-bottom: 0;
}

ol ol {
  list-style-type: lower-alpha;
}

ol ol ol {
  list-style-type: lower-roman;
}

p + ul,
p + ol,
h2 + ul,
h2 + ol,
h3 + ul,
h3 + ol,
h4 + ul,
h4 + ol,
h5 + ul,
h5 + ol,
h6 + ul,
h6 + ol {
  margin-top: 0.5em;
}


/* Tables */

.table-wrapper {
  width: 90%;
  overflow-x: auto;
  margin:auto;
}

table {
  width: 100%;
  min-width: max-content;
  border-collapse: collapse;
  font-size: smaller;
}

th,
td {
  text-align: center;
  vertical-align: top;
}

/* Units/format row */
table tr:nth-child(2) {
  font-style: italic;
  color: var(--text-light);
}

table tr:nth-child(n + 2):not(:last-child) td {
  border-bottom: 1px solid var(--border);
}


/* Inline code */

code {
  background: var(--code-bg);
  padding: 0 2px;
}


/* Code blocks */

pre,
code,
kbd,
samp {
  font-family: var(--mono-font);
  font-size: 0.875em;
  line-height: 1.714285;
}

pre {
  background: var(--code-bg);
  margin: 0 0 3em 2em;
  padding: 0.75em 1em;
  overflow-x: auto;
}

pre code {
  background: transparent;
  padding: 0;
  font-size: inherit;
}


/* Images */

img {
  max-width: 100%;
  height: auto;
}


/* Footer */

body > footer {
  padding: 4rem 1rem 1.5rem;

  color: var(--text-light);
  font-size: 0.9rem;
  text-align: center;
}

/* Pagination */

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: smaller;
  font-weight: bold;
}


/* Mobile */

@media (max-width: 40rem) {
  blockquote {
    margin-left: 1em;
  }

  pre {
    margin-left: 0;
  }
}

@media (max-width: 499px) {
  .optional {
    display: none;
  }
}