@use "variables";
@import "colors";
@import "fonts";

:root {
  --sansfont: "Inter", "Helvetica", "Arial", "Liberation Sans", sans-serif;
  --monofont: "PragmataPro Mono Liga", "Roboto Mono", "Roboto Mono for Powerline", "Inconsolata",
    "Consolas", monospace;
}

body {
  background-color: var(--background-color);
  color: var(--text-color);

  margin: auto;
  width: 100%;
  height: 1px;
  min-height: 100vh;

  font-family: var(--sansfont);
  font-weight: normal;
}

*::selection,
body::selection,
div::selection,
code::selection {
  background: var(--heading-color) !important;
  color: var(--background-color) !important;
}

a {
  color: var(--link-color);
  text-decoration: none;
  padding: 2px 0;
  border-radius: 2px;

  &:hover {
    // text-decoration: underline;
    background-color: var(--link-hover-color);
  }
}

code {
  // font-size: 1.2em;
  font-family: var(--monofont);
  box-sizing: border-box;
  padding: 1px 5px;
  //   background-color: var(--faded-background-color);
  // color: $code-color;
}

pre > code,
pre.Agda {
  color: var(--text-color);
  display: block;
  padding: 5px;
  overflow-x: auto;
  font-family: var(--monofont);
  line-height: 1.15rem;
  background-color: var(--faded-background-color);
}

a code {
  color: var(--link-color);
}

blockquote {
  margin-inline: 0;
  color: var(--small-text-color);
  border-left: 4px solid var(--small-text-color);
  padding-left: 12px;
  font-size: 0.9rem;
}

small {
  color: var(--small-text-color);
}

// Letter spacing

body {
  letter-spacing: -0.025rem;
}

code,
pre > code {
  font-size: 0.95rem;
  letter-spacing: -0.035rem;
}

// Layout

.flex-wrapper {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: center;
}

.flex-wrapper > main {
  min-width: 0;
  max-width: variables.$breakpoint;
  flex-grow: 1;
  box-sizing: border-box;

  &.pad {
    padding: 20px;
  }

  &.hasToc {
    max-width: variables.$tocBreakpoint;
  }
}

@media screen and (max-width: variables.$breakpoint) {
  .flex-wrapper {
    flex-direction: column;
    .container {
      padding: 5px 20px;
    }
  }
}

@media screen and (min-width: variables.$breakpoint) {
  .flex-wrapper {
    flex-direction: row;
    .container {
      padding: 32px 40px 5px 40px;
    }
  }

  .flex-wrapper > main.pad {
    padding-left: 30px;
    padding-right: 30px;
  }
}
