/* ----- @font-face rules ---------------------------------------------- {{{ */
/* BEGIN Taken from tufte-css */

/**
 * The MIT License (MIT)
 *
 * Copyright (c) 2014 Dave Liepmann
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */

/* Import ET Book styles
   adapted from https://github.com/edwardtufte/et-book/blob/gh-pages/et-book.css */

@font-face { font-family: "et-book";
             src: url("../fonts/et-book/et-book-roman-line-figures/et-book-roman-line-figures.eot");
             src: url("../fonts/et-book/et-book-roman-line-figures/et-book-roman-line-figures.eot?#iefix") format("embedded-opentype"), url("../fonts/et-book/et-book-roman-line-figures/et-book-roman-line-figures.woff") format("woff"), url("../fonts/et-book/et-book-roman-line-figures/et-book-roman-line-figures.ttf") format("truetype"), url("../fonts/et-book/et-book-roman-line-figures/et-book-roman-line-figures.svg#etbookromanosf") format("svg");
             font-weight: normal;
             font-style: normal; }

@font-face { font-family: "et-book";
             src: url("../fonts/et-book/et-book-display-italic-old-style-figures/et-book-display-italic-old-style-figures.eot");
             src: url("../fonts/et-book/et-book-display-italic-old-style-figures/et-book-display-italic-old-style-figures.eot?#iefix") format("embedded-opentype"), url("../fonts/et-book/et-book-display-italic-old-style-figures/et-book-display-italic-old-style-figures.woff") format("woff"), url("../fonts/et-book/et-book-display-italic-old-style-figures/et-book-display-italic-old-style-figures.ttf") format("truetype"), url("../fonts/et-book/et-book-display-italic-old-style-figures/et-book-display-italic-old-style-figures.svg#etbookromanosf") format("svg");
             font-weight: normal;
             font-style: italic; }

@font-face { font-family: "et-book";
             src: url("../fonts/et-book/et-book-bold-line-figures/et-book-bold-line-figures.eot");
             src: url("../fonts/et-book/et-book-bold-line-figures/et-book-bold-line-figures.eot?#iefix") format("embedded-opentype"), url("../fonts/et-book/et-book-bold-line-figures/et-book-bold-line-figures.woff") format("woff"), url("../fonts/et-book/et-book-bold-line-figures/et-book-bold-line-figures.ttf") format("truetype"), url("../fonts/et-book/et-book-bold-line-figures/et-book-bold-line-figures.svg#etbookromanosf") format("svg");
             font-weight: bold;
             font-style: normal; }

@font-face { font-family: "et-book-roman-old-style";
             src: url("../fonts/et-book/et-book-roman-old-style-figures/et-book-roman-old-style-figures.eot");
             src: url("../fonts/et-book/et-book-roman-old-style-figures/et-book-roman-old-style-figures.eot?#iefix") format("embedded-opentype"), url("../fonts/et-book/et-book-roman-old-style-figures/et-book-roman-old-style-figures.woff") format("woff"), url("../fonts/et-book/et-book-roman-old-style-figures/et-book-roman-old-style-figures.ttf") format("truetype"), url("../fonts/et-book/et-book-roman-old-style-figures/et-book-roman-old-style-figures.svg#etbookromanosf") format("svg");
             font-weight: normal;
             font-style: normal; }

/* END Taken from tufte-css */

/* }}} */

:root {
  /* --- Colors --- */

  --background-color: #fffff8;

  --color-text: #111;
  --color-text-secondary: #111;
  --color-link: inherit;
  --color-sidenote: #111;

  --color-inline-code: #111;
  --color-inline-code-bg: rgba(0, 0, 0, 0);

  /* TODO(jez) Double check these colors */
  --color-border: rgba(0, 0, 0, 0);
  --color-border-heavy: #000;

  /* TODO(jez) Make tables look more like tufte-pandoc-css */
  --color-table-heading: var(--background-color);

  /* --- Text --- */

  --font-family-prose: et-book, Palatino, "Palatino Linotype", "Palatino LT STD", "Book Antiqua", Georgia, serif;
  --font-family-heading: var(--font-family-prose);
  --font-family-code: Consolas, "Liberation Mono", Menlo, Courier, monospace;
  --side-note-number-font-family: et-book-roman-old-style, Palatino, Georgia, serif;

  --line-height: 30px;
  --font-size: 21px;

  --inline-code-font-size: 16px;
  --code-block-font-size: 15px;
  --line-numbers-font-size: 13px;

  --side-note-line-height: 24px;
  --side-note-font-size: 16px;
  --side-note-code-font-size: 12px;
  --side-note-baseline-offset: 4.5px;
  --side-note-text-indent: -8px;

  --heading-font-weight: 400;

  --title-font-size: 48px;
  --title-code-font-size: 39px;
  --title-line-height: 48px;
  --title-margin-top: 90px;

  --h1-font-size: 33px;
  --h1-code-font-size: 27px;
  --h1-line-height: 33px;
  --h1-margin-top: 60px;
  --h1-margin-bottom: 21px;

  --h2-font-size: 26px;
  --h2-code-font-size: 20px;
  --h2-line-height: 26px;
  --h2-margin-top: 60px;
  --h2-margin-bottom: 21px;

  --figcaption-line-height: 24px;
  --figcaption-font-size: 18px;
  --figcaption-code-font-size: 14px;
  --figcaption-gap: 7px;
  --captioned-figure-gap: 12px;

  --table-line-height: 26px;
  --table-font-size: 21px;
  --table-code-font-size: 16px;

  --nav-toc-font-size: 15px;
  --nav-toc-code-font-size: 12px;
  --nav-toc-indent: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background-color: #111;

    --color-text: #fffff8;
    --color-text-secondary: #fffff8;
    --color-link: inherit;
    --color-sidenote: #fffff8;

    --color-inline-code: #fffff8;
    --color-inline-code-bg: inherit;

    --color-border: inherit;
    --color-border-heavy: #fff;
  }
}

h1:not(.title), h2 {
  font-style: italic;
}

nav#TOC label
a, a:link, a:visited {
  text-decoration: underline;
}

@media screen and (min-width: calc(745px + 2 * (52px + 206px + 52px) - 1px)) {
  nav#TOC a {
    text-decoration: none;
  }
  nav#TOC a:hover,
  nav#TOC a:hover code {
    text-decoration: underline;
  }
}

table {
  border-width: 2px;
}

table, table td, table th {
  border-left: none;
  border-right: none;
}

table td {
  border-top: none;
  border-bottom: none;
}

table td, table th {
  min-width: 120px;
}
