@import "./variables.css";
@import "./vanilla.css";
@import "./pages.css";

body {
  background-color: var(--primary-background);
  font-family: var(--primary-font-stack);
  max-width: 520px;
  padding: 0 12px;
}

details > details {
  margin-left: 8px;
}

h1 { font-size: 225%; }
h2 { font-size: 175%; }

hr {
  background: var(--tertiary-color);
}

#sidebar {
  width: 200px;
  position: fixed;
  top: 0;
  left: 0;
  margin: 2em;
  font-size: small;
}

#nav-logo {
  display: flex;
  align-items: center;
  font-weight: bold;
}

#nav-tree {
  margin-top: 0.5em;
  margin-left: 2px;
}

#content {
  margin: 8em 0;
}

#content nav {
  border: 1px solid var(--tertiary-color);
  display: flex;
  justify-content: flex-end;
  width: 100%;
  padding: 4px;
}

#content nav * {
  padding: 0 8px;
}

#content header {
  margin: 2em 0 4em;
}

#content footer {
  margin: 4em 0 2em;
}

#homepage {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 50vh;
  transform: translateY(-50%);
  text-align: center;
  padding: 16px;
}

#homepage img {
  width: 120px;
}

#homepage * {
  margin: 1rem 0;
}

.footnotes {
  font-size: small;
  line-height: 1.35rem;
}

.footnote-ref {
  position: relative;
}

.footnote-ref:hover .footnote-snippet {
  display: block;
}

.footnote-snippet {
  position: absolute;
  line-height: 1.6em;
  background: var(--primary-background);
  border: 1px solid var(--text-color);
  padding: 9px 12px;
  display: none;
  top: 100%;
  left: 0;
  max-width: 520px;
  width: max-content;
  box-shadow: 2px 2px 0 var(--text-color);
}

.footnote-snippet p {
  margin: 0;
}

.footnote-snippet a,
.footnote-item a {
  text-decoration: underline;
  word-break: break-all;
}

@media screen and (max-width: 960px) {
  #sidebar {
    width: 100vw;
    height: 100vh;
    display: none;
  }

  body.sidebar-open #sidebar {
    display: block;
  }
}
