@import 'fonts.css';

/* Global Styles */
:root {
  --heading-color: rgb(29, 31, 32);
  --text-color: rgba(29, 31, 32, .85);
  --text-color-faded: rgb(29, 31, 32, 0.5);
  --primary-color: rgb(156, 213, 56);
  --background-color: rgba(156, 213, 56, .15);
  --callout-background: rgba(156, 213, 56, .08);
  --primary-font: "Inter Variable", "Inter", -apple-system, BlinkMacSystemFont, Helvetica, Arial, sans-serif;
  --heading-font: "Wremena", "Times", "Times New Roman", serif;
  /* Set headings to large size by increasing :root em font size */
  /* Calc with vw makes font sizes intrinsically responsive */
  font-size: calc(1.75em + 0.5vw);
  line-height: 1.7;
  letter-spacing: -0.015em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Reset non-headings to a smaller size while retaining visual rhythm */
main>*>:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6), footer *, nav * {
  font-size: .6rem;
}

/* Full bleed reset */
body, html {
  margin: 0;
  padding: 0;
}

/* Body Styles */
body {
  background-color: var(--background-color);
  font-family: var(--primary-font);
  color: var(--text-color);
  max-width: 1750px;
  margin: 0 auto;
  padding: 4vh 6vw;
  overflow-x: hidden;
}

::selection {
  color: black;
  background: var(--primary-color);
}

::-moz-selection {
  color: black;
  background: var(--primary-color);
}

/* Hyphenate long headings and links */
h1, h2, h3, h4, h5, h6, a {
  word-break: break-word;
  word-wrap: break-word;
  hyphens: auto;
}

/* Heading Styles */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--heading-font);
  color: var(--heading-color);
  margin-bottom: 0;
  padding-bottom: 0;
  font-weight: 100;
  line-height: 1.3;
}

h1:first-of-type {
  font-size: 200%;
  line-height: 1;
}

h2+h3 {
  margin-top: 0.25em;
}

h1+p, h2+p, h3+p {
  margin-top: 0.25em;
}

h3 {
  font-weight: 400;
  font-size: 0.900rem;
}

nav {
  margin: 1em 0 3em
}

#notes-entry-container, main {
  display: grid;
  grid-gap: 2em;
  grid-template-columns: 3fr 1fr;
  grid-template-areas: "article aside"
}

article {
  display: grid;
}

main section {
  grid-column: 1 / -1;
}

@media (max-width: 1200px) {
  content, side, article, aside {
    grid-column: 1 / -1;
    max-width: calc(100vw - 12vw)
  }
}

section.callout {
  padding: 3em 2em;
  background: var(--callout-background);
  border-radius: 4px;
  margin: 1em 0;
}

/* Backlink box */
aside {
  display: grid;
  grid-gap: 1em;
  align-content: start;
}

.backlink-box {
  background: var(--callout-background);
  padding: 1em;
  border-radius: 4px;
  font-size: 0.5rem;
}

/* Article */
header, .archive span {
  font-feature-settings: "ss01"1, "zero"1, "case"1;
  font-variant-numeric: slashed-zero;
}

header p {
  color: var(--text-color-faded);
  font-size: 0.5rem;
  margin-top: 0;
  padding-bottom: 2em;
}

img {
  width: 100%;
  display: block;
  margin: 0 auto;
  border-radius: 4px
}

blockquote {
  padding: 1.5em;
  margin: 0;
  font-size: 0.88em;
  background: var(--callout-background);
  border-radius: 4px
}

blockquote p {
  margin: 0
}

hr {
  width: 100%;
  border: 0;
  height: 1px;
  margin: 1.5em 0;
  /* background: #d9d9d9 */
}

strong, b {
  font-weight: 600;
  color: var(--heading-color);
}

/* Footer */
footer {
  margin: 2em 0;
  /* color: var(--text-color-faded); */
  padding-top: 1em
}

/* Archive Page */
ul.archive, .archive li {
  list-style-type: none;
  margin-left: 0;
  padding-left: 0
}

.archive li {
  margin: 1em 0 1.25em
}

.archive p {
  margin-top: 0
}

.archive span {
  opacity: 0.6
}

/* Tables in Markdown */
table {
  max-width: min-content;
}

table, table>*>*>* {
  border: 1px solid var(--text-color-faded);
  border-collapse: collapse;
  color: var(--heading-color);
}

table th, table td {
  padding: 0.25em 0.5em
}

/* Links */
a {
  transition: all 300ms;
  font-weight: 600;
  color: var(--heading-color);
  border-bottom: 4px solid var(--primary-color);
  text-decoration: none;
}

a:hover, a:focus {
  transition: all 300ms;
  background: var(--primary-color);
}

a::after {
  font-size: 0.7em;
  content: "↗";
  color: var(--text-color-faded);
  top: -0.5em;
  position: relative;
}

/* Need to exclude a img arrow for external links eventually */
a.internal-link:after, a.footnote-backref:after {
  content: "";
}

*:focus {
  background: var(--primary-color);
}

.invalid-link {
  color: var(--text-color-faded);
  cursor: help;
  background: var(--callout-background);
  padding: 0 0.1em
}

.invalid-link-brackets {
  color: #ccc;
  cursor: help
}

/* Footnotes */
.footnote-ref a, a.footnote-backref {
  background-color: var(--primary-color);
  border-radius: 10em;
  padding: 0 .3em;
}

.footnote-ref a {
  font-feature-settings: "sups"1;
  letter-spacing: 1px;
  height: 1em;
  display: table-caption;
}

.footnote-ref a::before {
  content: "["
}

.footnote-ref a::after {
  content: "]";
  top: inherit;
  color: inherit;
  font-size: inherit;
}

/* Graph */
.links line {
  stroke: #ccc;
  opacity: 0.5;
}

.nodes circle {
  cursor: pointer;
  fill: var(--primary-color);
  transition: all 0.15s ease-out;
}

.text text {
  cursor: pointer;
  fill: #333;
  text-shadow: -1px -1px 0 #fafafabb, 1px -1px 0 #fafafabb, -1px 1px 0 #fafafabb, 1px 1px 0 #fafafabb;
}

.nodes [active],
.text [active] {
  cursor: pointer;
  fill: black;
}

.inactive {
  opacity: 0.1;
  transition: all 0.15s ease-out;
}

#graph-wrapper {
  background: var(--callout-background);
  border-radius: 4px;
  height: auto;
}

/* Code blocks */
code {
  background: var(--callout-background);
  padding: 0 0.2em;
  border-radius: 4px;
  /* vertical-align: middle;
  font-size: 1.3em; */
}

pre code {
  padding: 0;
  background: transparent;
}

pre {
  background: var(--callout-background);
  padding: 0.5em 1em;
  border-radius: 4px;
  overflow-x: scroll
}

div.highlight {
  background: var(--callout-background);
  border-radius: 4px;
  font-size: 1em;
  font-size: 0.9em;
  overflow: scroll;
  margin: 1em 0;
  display: grid
}

div.highlight pre {
  margin: 1em;
  background: transparent;
}

.highlight .c {
  color: #999988;
  font-style: italic
}

.highlight .err {
  color: #a61717;
  background-color: #e3d2d2
}

.highlight .k {
  font-weight: bold
}

.highlight .o {
  font-weight: bold
}

.highlight .cm {
  color: #999988;
  font-style: italic
}

.highlight .cp {
  color: #999999;
  font-weight: bold
}

.highlight .c1 {
  color: #999988;
  font-style: italic
}

.highlight .cs {
  color: #999999;
  font-weight: bold;
  font-style: italic
}

.highlight .gd {
  color: #000000;
  background-color: #ffdddd
}

.highlight .gd .x {
  color: #000000;
  background-color: #ffaaaa
}

.highlight .ge {
  font-style: italic
}

.highlight .gr {
  color: #aa0000
}

.highlight .gh {
  color: #999999
}

.highlight .gi {
  color: #000000;
  background-color: #ddffdd
}

.highlight .gi .x {
  color: #000000;
  background-color: #aaffaa
}

.highlight .go {
  color: #888888
}

.highlight .gp {
  color: #555555
}

.highlight .gs {
  font-weight: bold
}

.highlight .gu {
  color: #aaaaaa
}

.highlight .gt {
  color: #aa0000
}

.highlight .kc {
  font-weight: bold
}

.highlight .kd {
  font-weight: bold
}

.highlight .kp {
  font-weight: bold
}

.highlight .kr {
  font-weight: bold
}

.highlight .kt {
  color: #445588;
  font-weight: bold
}

.highlight .m {
  color: #009999
}

.highlight .s {
  color: #d14
}

.highlight .na {
  color: #008080
}

.highlight .nb {
  color: #0086B3
}

.highlight .nc {
  color: #445588;
  font-weight: bold
}

.highlight .no {
  color: #008080
}

.highlight .ni {
  color: #800080
}

.highlight .ne {
  color: #990000;
  font-weight: bold
}

.highlight .nf {
  color: #990000;
  font-weight: bold
}

.highlight .nn {
  color: #555555
}

.highlight .nt {
  color: #000080
}

.highlight .nv {
  color: #008080
}

.highlight .ow {
  font-weight: bold
}

.highlight .w {
  color: #bbbbbb
}

.highlight .mf {
  color: #009999
}

.highlight .mh {
  color: #009999
}

.highlight .mi {
  color: #009999
}

.highlight .mo {
  color: #009999
}

.highlight .sb {
  color: #d14
}

.highlight .sc {
  color: #d14
}

.highlight .sd {
  color: #d14
}

.highlight .s2 {
  color: #d14
}

.highlight .se {
  color: #d14
}

.highlight .sh {
  color: #d14
}

.highlight .si {
  color: #d14
}

.highlight .sx {
  color: #d14
}

.highlight .sr {
  color: #009926
}

.highlight .s1 {
  color: #d14
}

.highlight .ss {
  color: #990073
}

.highlight .bp {
  color: #999999
}

.highlight .vc {
  color: #008080
}

.highlight .vg {
  color: #008080
}

.highlight .vi {
  color: #008080
}

.highlight .il {
  color: #009999
}