@import "pattern";

html,
body {
  font-size: 16px;
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  line-height: 1.6;
  // from http://www.heropatterns.com
  background: fixed #191919 $grid-pattern center;

  color: $foreground;

  // for sticky footer
  display: flex;
  flex-direction: column;
  min-height: 100vh;

  // Stop long words from breaking mobile
  overflow-wrap: break-word;
}

img,
video {
  max-width: 100%;
  height: auto;
}

a {
  color: $link-color;
  text-decoration: none;
  cursor: pointer;
  border-bottom: 1px solid rgba(0, 124, 188, 0.25);

  &:hover {
    border-bottom: 1px solid $link-color;
  }

  &:visited {
    color: $link-color;
  }

  // totally taken from stripe
  &.button {
    outline: none;
    white-space: nowrap;
    display: inline-block;
    height: 40px;
    line-height: 40px;
    padding: 0 14px;
    box-shadow: 0 4px 6px rgba(50, 50, 93, 0.11), 0 1px 3px rgba(0, 0, 0, 0.08);
    background: #fff;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.025em;
    color: #191919;
    text-decoration: none;
    transition: all 0.15s ease;
    border-bottom: none;

    &:hover {
      transform: translateY(-1px);
      text-decoration: none;
      box-shadow: 0 7px 14px rgba(50, 50, 93, 0.1),
        0 3px 6px rgba(0, 0, 0, 0.08);
    }

    &:active {
      background-color: #f6f9fc;
      transform: translateY(1px);
    }
  }

  &.hero__download {
    background: $primary-color;
    color: $foreground;

    &:active {
      background-color: darken($primary-color, 5%);
    }
  }

  &.white {
    color: white;
    border-bottom-color: rgba(255, 255, 255, 0.25);

    &:hover {
      border-bottom-color: white;
    }

    &:visited {
      color: white;
    }
  }

  &.external {
    padding-right: 1em;
    background-size: 14px;
    background-image: $external-link-icon;
    background-repeat: no-repeat;
    background-position: center right;
  }
}

pre {
  padding: 1rem;
  overflow: auto;
}

pre[data-linenos] {
  padding: 1rem 0;
}

pre mark {
  // If you want your highlights to take the full width.
  display: block;
  // The default background colour of a mark is bright yellow
  background-color: rgba(254, 252, 232, 0.9);
}

pre table {
  width: 100%;
  border-collapse: collapse;
}

pre table td {
  padding: 0;
}

pre table td:nth-of-type(1) {
  text-align: center;
  user-select: none;
}

p code,
li code:not(pre code) {
  background-color: #f5f5f5;
  color: $primary-color;
  white-space: pre-wrap;
  padding: 5px;
  border-radius: 5px;
  font-size: 0.85rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 1px rgba(0, 0, 0, 0.1),
    0 2px 1px -1px rgba(0, 0, 0, 0.12);
}
