@import url("vollkorn.css");
@import url("juliamono.css");
@import url("pluto/light_colors.css");
@import url("pluto/dark_colors.css");

/* @import url("https://fonts.googleapis.com/css?family=Alegreya+Sans:400,400i,500,500i,700,700i&display=swap&subset=cyrillic,cyrillic-ext,greek,greek-ext,latin-ext,vietnamese"); */
@import url("https://cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/400.css");
@import url("https://cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/500.css");
@import url("https://cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/700.css");
@import url("https://cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/400-italic.css");
@import url("https://cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/500-italic.css");
@import url("https://cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/700-italic.css");

/* Load theme for highlight.js */
@import url("espresso.min.css");

/* ==================================================================
    DEFAULT FONT AND LAYOUT
================================================================== */

html {
  font-family: "Alegreya Sans", sans-serif;
  font-size: 1em;
  font-weight: 400;
  color: var(--pluto-output-color);
}

/* ==================================================================
  BASIC GRID FOR PROFILE PIC
================================================================== */

.franklin-content .row {
  display: block;
}

.franklin-content .left {
  float: left;
  margin-right: 15px;
}

.franklin-content .right {
  float: right;
}

.franklin-content .container img {
  width: auto;
  padding-left: 0;
  border-radius: 10px;
}

.franklin-content .footnote {
  position: relative;
  top: -0.5em;
  font-size: 70%;
}

/* ==================================================================
  FOOT / COPYRIGHT
================================================================== */

.franklin-content .page-foot a {
  text-decoration: none;
}

.page-foot {
  font-size: 12px;
  text-align: center;
  line-height: 1.35em;
  border-top: 3px solid var(--toc-bg-color);
  padding-top: 1em;
  margin-bottom: 0.5em;
}

/* ==================================================================
  TEXT GEOMETRY
================================================================== */

.franklin-content {
  position: relative;
  padding-left: 12.5%;
  padding-right: 12.5%;
  line-height: 1.35em;
}

/* on wide screens, fix content width to a max value */
@media (min-width: 940px) {
  .franklin-content {
    width: 750px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* on narrow device, reduce margins */
@media (max-width: 480px) {
  .franklin-content {
    padding-left: 6%;
    padding-right: 6%;
  }
}

/* ==================================================================
  TITLES
================================================================== */

.franklin-content h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Vollkorn", serif;
  color: var(--pluto-output-h-color);
  text-align: left;
  text-decoration: none;
}

.franklin-content h1 {
  font-size: 2.2rem;
  border-bottom: 3px solid var(--rule-color);
  margin-top: 1.8rem;
  margin-bottom: 2rem;
}

.franklin-content h2 {
  font-size: 1.8rem;
  border-bottom: 2px dotted var(--rule-color);
  margin-top: 1.8rem;
  margin-bottom: 1.5rem;
}

.franklin-content h3 {
  margin-top: 1.8rem;
  font-size: 1.6rem;
  margin-bottom: 0.5rem;
}

.franklin-content h4 {
  margin-top: 1.4rem;
  margin-bottom: 0.5rem;
  font-size: 1.4rem;
}

.franklin-content h1 a {
  color: inherit;
  text-decoration: none;
}

.franklin-content h1 a:hover {
  text-decoration: none;
}

.franklin-content h2 a {
  color: inherit;
  text-decoration: none;
}

.franklin-content h2 a:hover {
  text-decoration: none;
}

.franklin-content h3 a {
  color: inherit;
  text-decoration: none;
}

.franklin-content h3 a:hover {
  text-decoration: none;
}

.franklin-content h4 a {
  color: inherit;
  text-decoration: none;
}

.franklin-content h4 a:hover {
  text-decoration: none;
}

.franklin-content h5 a {
  color: inherit;
  text-decoration: none;
}

.franklin-content h5 a:hover {
  text-decoration: none;
}

.franklin-content h6 a {
  color: inherit;
  text-decoration: none;
}

.franklin-content h6 a:hover {
  text-decoration: none;
}

.franklin-content table {
  margin-left: auto;
  margin-right: auto;
  border-collapse: collapse;
  text-align: center;
}

.franklin-content tr,
th {
  padding: 10px;
  border: 1px solid black;
}

.franklin-content td {
  padding: 10px;
  border: 1px solid black;
}

.franklin-content blockquote {
  margin-block-start: 0;
  margin-block-end: 15px;
  display: block;
  padding: 15px;
  border-radius: 15px;
  border-left: 0;
  color: var(--blockquote-color);
  background-color: var(--blockquote-bg);
}

.franklin-content blockquote p {
  display: inline;
}

/* ==================================================================
  GENERAL FORMATTING
================================================================== */

/* spacing between bullet points */
.franklin-content li p {
  margin: 0;
}

.franklin-content a {
  color: var(--index-clickable-text-color);
  text-decoration: underline;
}


.franklin-content a:hover {
  text-decoration: underline;
}

/* ==================================================================
  HYPERREFS AND FOOTNOTES
================================================================== */

.franklin-content .eqref a {
  color: green;
}

.franklin-content .bibref a {
  color: green;
}

.franklin-content sup {
  font-size: 70%;
  vertical-align: super;
  line-height: 0;
}

.franklin-content table.fndef {
  margin: 0;
  margin-bottom: 10px;
}

.franklin-content .fndef tr,
td {
  padding: 0;
  border: 0;
  text-align: left;
}

.franklin-content .fndef tr {
  border-left: 2px solid lightgray;
}

.franklin-content .fndef td.fndef-backref {
  vertical-align: top;
  font-size: 70%;
  padding-left: 5px;
}

.franklin-content .fndef td.fndef-content {
  font-size: 80%;
  padding-left: 10px;
}

/* ==================================================================
  IMAGES in CONTENT
================================================================== */
.franklin-content img {
  height: 100%;
  width: 100%;
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
}

.franklin-content .img-large img {
  width: 70%;
  text-align: center;
  padding-left: 10%;
}

.franklin-content .img-small img {
  width: 50%;
  text-align: center;
  padding-left: 20%;
}

/* ==================================================================
    KATEX
================================================================== */

body {
  counter-reset: eqnum;
}

.katex {
  font-size: 1em !important;
}

.katex-display .katex {
  /* Overwrite KaTeX settings. */
  display: inline-block;

  /* Allow display equations to wrap on small screens. */
  white-space: normal;
}

.katex-display::after {
  counter-increment: eqnum;
  content: "(" counter(eqnum) ")";
  position: relative;
  float: right;
  padding-right: 5px;
}

.nonumber .katex-display::after {
  counter-increment: nothing;
  content: "";
}

/* ==================================================================
    CODE & HIGHLIGHT.JS
================================================================== */

code {
  /* background-color: var(--pluto-output-bg-color); */
  color: var(--cm-editor--color);
  background-color: var(--process-item-bg);
  padding: 0.1em 0.2em;
  margin: 0.1em;
  border-radius: 6px;
  font: JuliaMono;
  font-variant-ligatures: none;
  font-size: 85%;
}

.hljs {
  position: relative;
  font: JuliaMono;
  font-variant-ligatures: none;
  padding-top: 5em;
  line-height: 1.35em;
  border-radius: 10px;
}

.hljs-meta { font-weight: bold;}

/* Use colors from theme specified in style.html */
.hljs-meta.prompt_ {color: #7ee787;}
.hljs-meta.help_ {color: #f2cc60;}
.hljs-meta.shell_ {color: #ff7b72;}
.hljs-meta.pkg_ {color: #6c99bb;}
.hljs-meta.infiltrator_ {color: #ffa657;}
.hljs-meta.debugger_ {color: #ffa657;}
.hljs-meta.debuggereval_ {color: #ffa657;}

/* Add language name to code blocks */
.hljs::before {
  content: "";
  position: absolute;
  color: var(--cm-editor--color);
  background-color: var(--process-item-bg);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  top: 0;
  left: 0;
  padding: 0.25rem 0.6rem 0.1rem;
  border-bottom-right-radius:10px;
}

/* Define language names shown in code blocks */
.language-bash::before       {content: "Shell";}
.language-toml::before       {content: "TOML";}
.language-ini::before        {content: "TOML";}
.language-julia::before      {content: "Julia";}
/* Special Franklin tags for Julia REPL modes */ 
.language-julia-repl::before {content: "Julia REPL";}
.julia-repl::before          {content: "Julia REPL";}
.julia-repl-pkg::before      {content: "Julia REPL: Pkg mode";}
.julia-repl-help::before     {content: "Julia REPL: Help mode";}
.julia-repl-shell::before    {content: "Julia REPL: Shell mode";}
/* Julia code after REPL prompts doesn't need a language tag */
.language-julia-repl .language-julia::before {content: "";}
.julia-repl          .language-julia::before {content: "";}
.julia-repl-pkg      .language-julia::before {content: "";}
.julia-repl-help     .language-julia::before {content: "";}
.julia-repl-shell    .language-julia::before {content: "";}
/* Julia code in doc strings printed via REPL Help mode is sometimes incorrectly 
recognized as Ruby code. Since we don't have any Ruby code in MJW, this is a quick fix. 
TODO: remove when not required anymore.
*/
.language-ruby::before {content: "Julia";}

.code-output {
  background: var(--output-background);
  border: 1px dashed #dbdbdb;
}

/* ==================================================================
  BOXES
================================================================== */

.franklin-content .colbox-blue {
  background-color: #EEF3F5;
  padding-top: 5px;
  padding-right: 10px;
  padding-left: 10px;
  padding-bottom: 5px;
  margin-left: 5px;
  margin-top: 5px;
  margin-bottom: 5px;
  border-radius: 0 10px 10px 0;
  border-left: 5px solid #4C9CF1;
}

/* ==================================================================
  ADMONITIONS
================================================================== */

/* 
Copyright (c) 2020 Fons van der Plas
From MIT licensed Pluto.jl source code:
https://github.com/fonsp/Pluto.jl/blob/f3d8946dd2743e605418d73cead26e6fcd79d11f/frontend/editor.css#L304-L365
*/

.admonition {
  border-radius: 8px;
  margin-block-start: 2em;
  margin-block-end: 1.5em;
}

.admonition .admonition-title {
  font-family: "Vollkorn", sans-serif;
  font-feature-settings: "lnum", "pnum";
  color: var(--admonition-title-color);
  font-weight: 600;
  margin-block-end: 0px;
  padding-left: 0.3em;
}

.admonition .admonition-title~* {
  margin-block-end: 0.5em;
  margin-block-start: 0.5em;
  transition: filter linear 0.1s;
}

.admonition {
  padding-left: 0.5rem;
  background: var(--jl-message-color);
  border: 5px solid var(--jl-message-accent-color);
}

.admonition .admonition-title {
  background: var(--jl-message-accent-color);
  margin: -1px;
  /* Fixes a rendering glitch in Chrome */
  margin-left: -0.55rem;
}

.admonition.note,
.admonition.info,
.admonition.hint {
  background: var(--jl-info-color);
  border: 5px solid var(--jl-info-accent-color);
}

.admonition.note .admonition-title,
.admonition.info .admonition-title,
.admonition.hint .admonition-title {
  background: var(--jl-info-accent-color);
}

.admonition.warning {
  background: var(--jl-warn-color);
  border: 5px solid var(--jl-warn-accent-color);
}

.admonition.warning .admonition-title {
  background: var(--jl-warn-accent-color);
}

.admonition.danger {
  background: var(--jl-danger-color);
  border: 5px solid var(--jl-danger-accent-color);
}

.admonition.danger .admonition-title {
  background: var(--jl-danger-accent-color);
}

.admonition.hint .admonition-title~* {
  filter: blur(0.25em);
}

.admonition.hint:hover .admonition-title~*,
.admonition.hint:focus-within .admonition-title~* {
  filter: blur(0em);
}