/* Sane box model */
* {
  box-sizing: border-box;
}


/* Make headings smaller */
h1 { font-size: 1.8em }
h2 { font-size: 1.4em }
h3 { font-size: 1.1em }
h1, h2, h3 { margin: 1em 0 }

/* Heading anchors */
.anchor::before {
  content: '🔗';
  font-size: 80%;
  opacity: 0;
  margin-right: -1.1em;
  position: relative;
  left: -1.2em;
  z-index: 1;
}
.header-section-number,
.anchor::before { transition: opacity 0.3s ease 0.1s }
.anchor { text-decoration: none }

h1:hover > .anchor::before,
h2:hover > .anchor::before,
h3:hover > .anchor::before { opacity: 1; }
h1:hover > .header-section-number,
h2:hover > .header-section-number,
h3:hover > .header-section-number { opacity: 0; }


/* Match math and normal mode fonts */
  body { font-size: 1.1em }
.katex { font-size: 1.0em !important }

/* Fix spacing of numbered equations */
td .katex-display { margin: 0 }


/* Center the title */
header { text-align: center }

/* Inline the authors */
header .author {
  display: inline-block;
  padding: 0 0.5em;
}

/* Increase caption/table spacing */
div[id^="tbl"] table { margin: 2.5em 0; }
div[id^="tbl"] table caption {
  font-weight: bold;
  margin-bottom: 1em;
}

/* Increase table row spacing*/
div[id^="tbl"] table td { padding: 0.2em }

/* Proper table header lines */
div[id^="tbl"] table { border-collapse: collapse }
div[id^="tbl"] table th {
  border-top: 1px solid #1a1a1a;
  border-bottom: 1px solid #1a1a1a;
  padding: 0.25em 0.5em 0.25em 0.5em;
}

/* Links color */
a:link, a:visited { color: #1a1a1a }
a:hover { color: #35d7bb }

body {
  /* center horizontally */
  margin: 0 auto;
  padding: 2em;
  /* right-shift by the sidebar width */
  padding-left: calc(clamp(14em, 30vw, 20em) + 2em);
  /* use all remaining width */
  width: calc(60vw + clamp(14em, 30vw, 20em) + 2em);
  /* override pandoc style */
  max-width: initial;
}

/* Navigation sidebar */
nav {
  z-index: 1;
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  width: clamp(14em, 30vw, 20em);
  background: #373d49;
  color: #d0d6e2;
  padding: 1.2em;
  padding-left: 0;
  overflow-y: scroll;
}
nav a:link { text-decoration: none }
nav a:link, a:visited { color: #d0d6e2 }
nav a:hover { color: #35d7bb }

nav ul {
  list-style: none;
  padding-left: 1.2em
}
nav li { margin-top: 0.4em }

/* Logo */
nav::before {
  content: "GRAY";
  text-align: center;
  font-weight: bold;
  font-size: 1.6em;
  position: absolute;
  left: calc(50% - 1.6em);
}
nav > ul { padding-top: 2em }