@import "colors.less";
@import "mixins.less";
@import "vars.less";

* {
  box-sizing: border-box;
}

html, body {
  min-height: 100vh;
}

body {
  font-family: 'Barlow', Helvetica, Arial, sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
  color: @darker-grey;
  background: white;
}

.page-top {
  background: @blue-primary;

  .top-nav {
    max-width: @page-width;
    margin: 0 auto;
  }
}

.body-content {
  background: white;
  max-width: @page-width - @page-nav-width;
  flex-grow: 1;
}

.page-body {
  max-width: @page-width;
  margin: 0 auto;

  display: flex;
  flex-direction: row;

  .page-nav {
    width: @page-nav-width;
    flex-shrink: 0;
  }
}

a {
  color: @blue-secondary;
}

a:hover {
  color: @blue-primary;
}

a:visited {
  color: @grey-secondary;
}

a:hover {
  text-decoration: underline;
}

code, pre {
  font-family: 'Iosevka', monospace;
}

pre {
  background: @offer-white;
  color: @dark-grey;
  padding: .5rem;
  overflow-x: auto;
}

p, pre, .highlight, ul, ol, dl, iframe {
  margin: 0 0 1.5em;
}

dd, li {
  margin-bottom: 1em;
}

p:first-child, pre:first-child {
  margin-top: 0;
}

p:last-child, pre:last-child {
  margin-bottom: 0;
}

li:last-child,
dd:last-child {
  margin-bottom: 0;
}

dt code,
p code {
  font-size: .9em;
}

code code {
  font-size: 1em;
}

table, tr, td {
  padding: 0;
  border-collapse: collapse;
}

h1 code, h2 code, h3 code {
  font-weight: 600;
  font-size: .9em;
}

nav ul {
  list-style-type: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Roboto Slab', serif;
  font-weight: normal;
}

h1 {
  font-size: 32px;
  margin-top: 0;
  font-weight: 500;
}

h2 {
  font-size: 24px;
  font-weight: 500;
}

h3 {
  font-size: 20px;
}

h2, h3 {
  margin: 3rem 0 .8rem;
}

.top-logo, .top-nav, .top-search {
  background: @blue-primary;
  color: white;
  font-family: 'Roboto Slab', serif;
  line-height: @top-nav-height;
}

.page-nav {
  padding: 30px;
}

.page-partial h2 {
  margin-top: 0;
}

.page-content {
  background: white;
  position: relative;
  min-width: 300px;
}

.page-content, .page-partial {
  padding: 70px;
}

.top-nav {
  position: relative;
  white-space: nowrap;
  display: flex;
  flex-direction: row;
}

.top-link {
  color: white;
  font-size: 16px;
  text-transform: lowercase;
  line-height: @top-nav-height;
  display: inline-block;
  padding: 0 25px;

  &.logo-link {
    color: white;
    margin: 0;
    font-size: 22px;
    width: @page-nav-width;
    padding: 0 50px 0 @top-nav-height;
    line-height: @top-nav-height;
    display: inline-block;
    vertical-align: top;
    text-decoration: none;
    position: relative;
    text-transform: initial;

    @logo-size: 35px;

    img {
      width: @logo-size;
      height: @logo-size;
      vertical-align: middle;
      position: absolute;
      top: (@top-nav-height - @logo-size) / 2 - 2px;
      left: (@top-nav-height - @logo-size) / 2 - 3px;
    }
  }
}

.top-link, .top-link:visited {
  color: white;
  text-decoration: none;
}

.top-link:hover {
  color: white;
  text-decoration: underline;
}

.top-link.active {
  background: @blue-secondary;
  text-decoration: underline;
}

.icon-link {
  background-repeat: no-repeat;
  background-size: 22px 22px;
  background-position: 20px 30px;
  padding-left: 20px + 24px + 10px;
}

/* shoutout to hashicorp who i've pretty much copied this from */

.download-link {
  background-image: url("../images/icons/arrow-down-box.svg");
}

.github-link {
  background-image: url("../images/icons/github-box.svg");
}

.page-nav {
  font-family: 'Roboto Slab', serif;
  font-size: 14px;

  background: @darker-grey;
  color: @grey-secondary;
  display: flex;
  flex-direction: column;
}

.page-nav a {
  color: @grey-primary;
  text-decoration: none;
}

.page-nav a:hover {
  text-decoration: underline;
}

.page-content {
  background: white;
}

.page-content ul,
.page-content ol,
.page-content dl {
  padding-left: 30px;
}

.page-content code {
  background: fade(@darkest-grey, 7%);
  padding: 3px;
  border-radius: 5px;
}

.page-content pre code {
  background: transparent;
  padding: 0;
  border-radius: 0;
}

.page-content code code, .definition-thumb code {
  border: 0;
  padding: 0;
}

.page-content a code {
  color: @dark-grey;
}

.page-content a:hover code {
  color: @light-grey;
}

.page-content a:hover code strong {
  text-decoration: underline;
}

.page-content table {
  margin-bottom: 1em;
}

.page-content tr:first-child {
  font-family: 'Roboto Slab', serif;
  font-weight: 500;
  border-bottom: 2px solid @darker-grey;
}

.page-content td {
  padding: .3em 1em .3em 0;
}

.page-content td:last-child {
  padding-right: 0;
}
