@font-face {
  font-family: "JetBrains Mono";
  src: url("./JetBrainsMono-Regular.woff") format("woff"),
    url("./JetBrainsMono-Regular.ttf") format("truetype");
  font-display: swap;
}

body {
  font-family: system, -apple-system, ".SFNSText-Regular", "San Francisco",
    "Roboto", "Segoe UI", "Helvetica Neue", "Lucida Grande", sans-serif;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  display: flex;
  line-height: 1.75;
}

.examples .content {
  position: relative;
}

.btn-repl {
  background: #33b277;
  border-radius: 6px;
  border: 0;
  color: white;
  cursor: pointer;
  display: inline-flex;
  font-family: "JetBrains Mono", Consolas, "Andale Mono WT", "Andale Mono",
    "Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono",
    "Bitstream Vera Sans Mono", "Liberation Mono", "Nimbus Mono L", Monaco,
    "Courier New", Courier, monospace;
  margin: 0;
  padding: 6px 16px;
  text-decoration: none;
}

.btn-repl:hover {
  background: #20935e;
}

ul {
  margin: 0;
  padding: 0;
  padding-left: 16px;
  list-style-type: circle;
}

article {
  margin-bottom: 56px;
}

article h2 {
  margin-top: 4px;
}

article h3 {
  margin-bottom: 0;
}

code {
  font-family: "JetBrains Mono", Consolas, "Andale Mono WT", "Andale Mono",
    "Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono",
    "Bitstream Vera Sans Mono", "Liberation Mono", "Nimbus Mono L", Monaco,
    "Courier New", Courier, monospace;
}

.module-name {
  margin: 0;
}

aside .module-name {
  position: sticky;
  top: 92px;
  padding: 0 16px;
}

.module-name,
.name {
  font-family: "JetBrains Mono", Consolas, "Andale Mono WT", "Andale Mono",
    "Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono",
    "Bitstream Vera Sans Mono", "Liberation Mono", "Nimbus Mono L", Monaco,
    "Courier New", Courier, monospace;
}

.module-name.selected > a,
.name > a {
  color: #0275d8;
}

.repl {
  margin: 1em 0px;
  display: flex;
  flex-direction: column;
}

a {
  text-decoration: none;
  color: black;
}

aside {
  display: block;
  height: auto;
  bottom: 0;
  top: 0;
  left: 0;
  width: 100%;
  max-width: 288px;
  overflow: auto;
  position: sticky;
  flex-shrink: 0;
  max-height: 100vh;
  padding: 0;
  box-sizing: border-box;
  background: white;
  -webkit-overflow-scrolling: touch;
  box-sizing: content-box;
  border-right: 1px solid lightgray;
}

aside h1 {
  position: sticky;
  font-size: 1em;
  display: flex;
  align-items: center;
  padding: 0 16px;
  margin: 0;
  height: 56px;
  top: 0;
  z-index: 2;
  background: white;
}

aside h3 {
  min-height: 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: white;
  border: 1px solid lightgray;
  border-left-width: 0;
  border-right-width: 0;
  margin: 0;
  padding: 0;
}

.module {
  margin-bottom: 32px;
}

main {
  padding: 16px;
  width: 100%;
  margin: 0 auto;
  max-width: 640px;
  box-sizing: border-box;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.list {
  overflow: hidden;
}

.toc-item {
  font-family: "JetBrains Mono", Consolas, "Andale Mono WT", "Andale Mono",
    "Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono",
    "Bitstream Vera Sans Mono", "Liberation Mono", "Nimbus Mono L", Monaco,
    "Courier New", Courier, monospace;
  min-height: 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin: 0;
  padding: 0 16px;
}

.toc-item.selected {
  font-weight: bold;
  color: #0275d8;
}

aside .module-name:hover,
.toc-item:hover {
  background: #f2f2f2;
}

.breadcrumbs {
  background: white;
  position: sticky;
  top: 0;
  background: white;
  min-height: 56px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  margin: 0 -16px;
  padding: 8px 16px;
  flex-wrap: wrap;
}

.breadcrumbs > a {
  color: #0275d8;
}

.breadcrumbs > a:hover {
  color: #0275d8;
  text-decoration: underline;
}

.breadcrumbs > span {
  padding: 0 4px;
}

#searchInput {
  font-size: 16px;
  box-sizing: border-box;
  width: 100%;
  border: none;
  box-sizing: border-box;
  margin: 0;
  min-height: 36px;
  position: sticky;
  top: 56px;
  padding: 0 16px;
  z-index: 1;
}

aside {
  position: fixed;
  transform: translateX(-100%);
  z-index: 1;
}

body.toc-active aside {
  transform: translateX(0);
}

.toc-button {
  width: 36px;
  height: 36px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 0 !important;
  margin-right: 8px;
  user-select: none;
  margin-left: -10px;
  flex-shrink: 0;
  cursor: pointer;
}

@media (min-width: 640px) {
  .toc-button {
    display: none;
  }

  aside {
    position: sticky;
    transform: translateX(0);
  }
}

footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 40px;
  text-align: center;
}

footer a,
footer a:visited {
  color: #0275d8;
}

footer a:hover {
  color: #0275d8;
  text-decoration: underline;
}

.meta a,
.meta a:visited {
  color: #0275d8;
}

.meta a:hover {
  color: #0275d8;
  text-decoration: underline;
}
