/* vim:ft=css:sw=2:ts=2:foldmethod=marker
 **/

/* This is a combination of picocss and docutils logic.
 * References:
 * - https://docutils.sourceforge.io/docs/howto/html-stylesheets.html
 * - https://picocss.com/
 */

/* Root variables {{{ */
:root {
  --original-pico-font-family: var(--pico-font-family);
  --original-pico-font-family-sans-serif: var(--pico-font-family-sans-serif);
  --original-pico-font-family-emoji: var(--pico-font-family-emoji);
  --sigmavirus24-emoji-and-icons: var(--pico-font-family-emoji), var(--fa-style-family-classic), var(--fa-style-family-brands);
  --sigmavirus24-font-family-serif: 'Atkinson Hyperlegible Next', 'Arvo', 'Roboto Slab', 'Calluna', serif, system-ui, 'Droid Serif', 'Noto Serif', Times, 'Times New Roman', 'TimesNewRomanPSMT';
  --sigmavirus24-font-family-sans-serif: 'Atkinson Hyperlegible Next', 'fira-sans', var(--pico-font-family-sans-serif), var(--sigmavirus24-emoji-and-icons);
  --sigmavirus24-font-family-monospace: 'Atkinson Hyperlegible Mono', monospace, var(--sigmavirus24-font-family-sans-serif);

  --pico-font-family: var(--sigmavirus24-font-family-serif), var(--sigmavirus24-emoji-and-icons);
  font-optical-sizing: auto;
  --pico-font-family-monospace: var(--sigmavirus24-font-family-monospace);
}
/* }}} */

/* Basic header settings {{{ */
h1,
h2,
h3,
h4,
h5,
h6 {
  --pico-font-family: var(--sigmavirus24-font-family-sans-serif);
  a {
    --pico-text-decoration: none;
    --pico-color: var(--pico-muted-color);
  }
}

h1 {
  --pico-font-weight: 900;
  --pico-font-size: 2rem;
}

h2 {
  --pico-font-weight: 700;
  --pico-font-size: 1.75rem;
}

h2 {
  --pico-font-weight: 500;
  --pico-font-size: 1.5rem;
}

h3 {
  --pico-font-weight: 400;
  --pico-font-size: 1.25rem;
}

h4 {
  --pico-font-weight: 350;
  --pico-font-size: 1.125rem;
}

h5 {
  --pico-font-weight: 325;
  --pico-font-size: 1.125rem;
}

h6 {
  --pico-font-weight: 300;
  --pico-font-size: 1.125rem;
}
/* }}} */

/* Fixed Header at top of page {{{ */
.fixed-header {
  position: sticky;
  z-index: 2;
  padding: 0;
  transition: border-top-color .4s ease-in-out,box-shadow .4s ease-in-out;
  top: 0;
}

/* Light/Dark theming for header {{{ */
[data-theme=light],
:root:not([data-theme=dark]),
:host:not([data-theme=dark]) {
  .fixed-header {
    background-color: var(--pico-background-color);
  }
}

[data-theme=dark],
:root:not([data-theme=light]),
:host:not([data-theme=light]) {
  .fixed-header {
    background-color: var(--pico-background-color);
  }
}
/* }}} */

/* Fix up spacing for site name/index link */
hgroup {
  margin-bottom: 0;
  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    padding: var(--pico-nav-element-spacing-vertical) var(--pico-nav-element-spacing-horizontal);
  }
}

/* Push navigation links in header to the right/end */
nav.justify-content-right {
  justify-content: flex-end;
  float: right;
  margin-botom: 0;
  display: flex;
}
/* }}} */

/* Actual Content CSS {{{ */
body {
  --pico-line-height: 1.8;
}

main {
  --pico-font-family: var(--sigmavirus24-font-family-serif);
}

article {
  /* --pico-card-box-shadow: none; */
  --pico-card-box-shadow: 0rem 0rem 0.5rem 0.125rem rgba(250, 250, 250, 0.9);
  font-family: var(--sigmavirus24-font-family-serif);

  header {
    --pico-card-sectioning-background-color: var(--pico-background-color);
    h2 {
      margin-top: var(--pico-typography-spacing-vertical);
      text-align: center;
      --pico-font-size: 2rem;
      a {
        --pico-text-decoration: none;
      }
    }
  }

  footer {
    p {
      margin-bottom: 0;
    }
    nav {
      li {
        padding-top: 0;
      }
    }
  }
}

/* Display an indicator that a link goes away from the blog {{{ */
a::after {
  font-family: var(--fa-style-family-classic);
  font-weight: 900;
  padding-left: 0.25rem;
  display: inline-block;
  font-size: calc(var(--pico-font-size) / 3);
  vertical-align: middle;
}

a.external::after {
  content: '\f35d';
}
/* }}} */
/* }}} */

/* CSS for reStructuredText note directive {{{ */
.admonition.note {
  --pico-color: var(--pico-muted-color);
  margin-left: 1.5rem;
  padding-left: 1.5rem;
  /* Borrowed from
   * https://github.com/picocss/pico/blob/1039a4788d6abc368d5485ae6bac84a8f0e3096f/css/pico.css#L878C1-L880C27
   * */
display: block;
border-left: 0.25rem dotted var(--pico-blockquote-border-color);
border-inline-start: 0.25rem dotted var(--pico-blockquote-border-color);
border-inline-end: none;
/* padding: var(--pico-spacing); */

.admonition-title {
  --pico-font-weight: 900;
}
}
/* }}} */

/* Tables in General {{{ */
table {
  caption-side: bottom;

  border-collapse: collapse;
  border-left-style: hidden;
  border-right-style: hidden;

  caption {
    font-size: 0.75em;
    font-style: italic;
    text-align: right;
  }

  thead {
    border-bottom: 0.125rem solid #000;
  }

  th {
    border-left-style: hidden;
    border-right-style: hidden;
    padding: calc(var(--pico-spacing) / 2) calc(var(--pico-spacing) * 1.5);
  }

  tbody {
    tr {
      border-bottom: 0.0625rem solid #ccc;
    }
    tr:last-of-type {
      border-bottom: 0.125rem solid #000;
    }
  }

  td {
    text-align: left;
    border-left-style: hidden;
    border-right-style: hidden;
  }
}

/* Footnotes and Citations table(s) {{{ */
table.citation,
table.footnote {
  margin-bottom: calc(var(--pico-typography-spacing-vertical) / 2);
  td {
    padding-bottom: 0;
    border-bottom: 0;
  }
  td.label {
    width: 10%;
    text-alignt: right;
  }
}

a.fn-backref {
  --pico-font-family: var(--sigmavirus24-font-family-monospace);
}

a.fn-backref::after {
  content: "\f148";
}
/* }}} */
/* }}} */

/* Base template footer {{{ */
footer {
  --pico-font-size: 1rem;
  border-top: 1px solid;

  address {
    float: left;
    margin-bottom: 0;
  }

  nav.socials {
    li {
      padding-top: 0;
    }
  }
}
/* }}} */

/* Code Style {{{ */
.highlight { background-color: #ffffcc }
.c { color: #999988; font-style: italic } /* Comment */
.err { color: #a61717; background-color: #e3d2d2 } /* Error */
.k { color: #000000; font-weight: bold } /* Keyword */
.o { color: #000000; font-weight: bold } /* Operator */
.cm { color: #999988; font-style: italic } /* Comment.Multiline */
.cp { color: #999999; font-weight: bold; font-style: italic } /* Comment.Preproc */
.c1 { color: #999988; font-style: italic } /* Comment.Single */
.cs { color: #999999; font-weight: bold; font-style: italic } /* Comment.Special */
.gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
.ge { color: #000000; font-style: italic } /* Generic.Emph */
.gr { color: #aa0000 } /* Generic.Error */
.gh { color: #999999 } /* Generic.Heading */
.gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
.go { color: #888888 } /* Generic.Output */
.gp { color: #555555 } /* Generic.Prompt */
.gs { font-weight: bold } /* Generic.Strong */
.gu { color: #aaaaaa } /* Generic.Subheading */
.gt { color: #aa0000 } /* Generic.Traceback */
.kc { color: #000000; font-weight: bold } /* Keyword.Constant */
.kd { color: #000000; font-weight: bold } /* Keyword.Declaration */
.kn { color: #000000; font-weight: bold } /* Keyword.Namespace */
.kp { color: #000000; font-weight: bold } /* Keyword.Pseudo */
.kr { color: #000000; font-weight: bold } /* Keyword.Reserved */
.kt { color: #445588; font-weight: bold } /* Keyword.Type */
.m { color: #009999 } /* Literal.Number */
.s { color: #d01040 } /* Literal.String */
.na { color: #008080 } /* Name.Attribute */
.nb { color: #0086B3 } /* Name.Builtin */
.nc { color: #445588; font-weight: bold } /* Name.Class */
.no { color: #008080 } /* Name.Constant */
.nd { color: #3c5d5d; font-weight: bold } /* Name.Decorator */
.ni { color: #800080 } /* Name.Entity */
.ne { color: #990000; font-weight: bold } /* Name.Exception */
.nf { color: #990000; font-weight: bold } /* Name.Function */
.nl { color: #990000; font-weight: bold } /* Name.Label */
.nn { color: #555555 } /* Name.Namespace */
.nt { color: #000080 } /* Name.Tag */
.nv { color: #008080 } /* Name.Variable */
.ow { color: #000000; font-weight: bold } /* Operator.Word */
.w { color: #bbbbbb } /* Text.Whitespace */
.mf { color: #009999 } /* Literal.Number.Float */
.mh { color: #009999 } /* Literal.Number.Hex */
.mi { color: #009999 } /* Literal.Number.Integer */
.mo { color: #009999 } /* Literal.Number.Oct */
.sb { color: #d01040 } /* Literal.String.Backtick */
.sc { color: #d01040 } /* Literal.String.Char */
.sd { color: #d01040 } /* Literal.String.Doc */
.s2 { color: #d01040 } /* Literal.String.Double */
.se { color: #d01040 } /* Literal.String.Escape */
.sh { color: #d01040 } /* Literal.String.Heredoc */
.si { color: #d01040 } /* Literal.String.Interpol */
.sx { color: #d01040 } /* Literal.String.Other */
.sr { color: #009926 } /* Literal.String.Regex */
.s1 { color: #d01040 } /* Literal.String.Single */
.ss { color: #990073 } /* Literal.String.Symbol */
.bp { color: #999999 } /* Name.Builtin.Pseudo */
.vc { color: #008080 } /* Name.Variable.Class */
.vg { color: #008080 } /* Name.Variable.Global */
.vi { color: #008080 } /* Name.Variable.Instance */
.il { color: #009999 } /* Literal.Number.Integer.Long */
.linenos { padding-right: 0.5em; opacity: 0.5 } /* Line numbering opacity */

/* Highlight code lines when specifying hl_lines in reStructuredText */
.hll {
  font-style: oblique;
  background-color: rgba(195, 127, 153, 0.25);
}
/* }}} */

/* Font-toggle Styling {{{ */
button.font-toggle {
  --pico-border-radius: 1rem;
  --pico-background-color: inherit;
  --pico-color: var(--pico-primary);
  --pico-font-family: var(--sigmavirus24-font-family-sans-serif);
  font-size: calc(var(--pico-font-size) * 0.6);
}
/* }}} */
