@use "./variables.scss" as *;

html {
  box-sizing: border-box;
}
*,
*:before,
*:after {
  box-sizing: border-box;
}

body {
  margin: 0px;
  min-width: 340px;
  max-width: 100vw;
  line-height: 170%;

  background: #fcfcfc url("/background-top.svg") no-repeat;
  background-attachment: fixed;
  background-size: 100%;

  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-family: "Google Sans", Helvetica, Arial, sans-serif;
}

h1,
h2 {
  padding: 10px 0px;
  margin: 0px;
}

pre {
  padding: 5px 10px;
  background-color: $code-bg;
  font-family: "Roboto Mono", monospace;
  font-size: 14px;
  line-height: 20px;
  overflow: auto;

  code.hljs {
    font-family: "Roboto Mono", monospace;
    background: $code-bg;
  }
}

code {
  background-color: $code-bg;
  padding: 2px 0px;
  border-radius: 3px;
}

a {
  text-decoration: none;
  color: $blue;
}

table {
  width: 100%;
  text-align: left;
  background-color: #f8f9fa;
  border-collapse: collapse;
  word-wrap: break-word;
}

td {
  border-width: 0px;
  padding: 8px 8px;
  font-size: 14px;
}

th {
  background-color: $blue-gray;
  padding: 10px;
  font-weight: bold;
  color: white;
  white-space: nowrap;
}

tr {
  background-color: #f8f9fa;
  border-top: 1px solid #cfd8dc;

  td:first-of-type {
    white-space: nowrap;
  }
}

img[alt] {
  margin: 16px 0px;
}

.img-parent {
  padding: 20px 0px;
}

.img-parent img {
  max-width: 100%;
}

img.img-badge {
  margin: 0;
}

h1 {
  font-weight: 300;
  font-size: 34px;
  line-height: 40px;
  color: #757575;
}

ul {
  list-style-type: none;
  padding: 0;
}

li {
  margin: 0 10px;
}

.content_grid {
  display: grid;
  grid-template-columns:
    minmax($gutter-width, 1fr) minmax(min-content, $max-content-width)
    minmax($gutter-width, 1fr);
}

.page {
  word-break: break-word;
}

.col_gutter,
.col_main {
  max-width: $max-content-width;
  min-height: 10px;
}

.col_gutter {
  padding-left: $gutter-padding;
  padding-right: $gutter-padding;
}

@media (max-width: $tablet) {
  .content_grid {
    display: grid;
    grid-template-columns: 1fr minmax(min-content, $max-content-width) 1fr;
  }

  .col_gutter {
    width: 0;
    padding: 0;
  }

  .col_main {
    max-width: 100vw;
    //padding: 0px 20px;
  }
}

table {
  margin: 16px 0px;
}

.shadow_top {
  box-shadow: 0 -2px 2px -2px $shadow;
}

.shadow_bottom {
  box-shadow: 0 2px 2px -2px $shadow;
}

.shadow_left {
  box-shadow: -2px 0 2px -2px $shadow;
}

.shadow_right {
  box-shadow: 2px 0 2px -2px $shadow;
}

.shadow_top_left_right {
  box-shadow: 0 -2px 2px -2px $shadow, -2px 0 2px -2px $shadow,
    2px 0 2px -2px $shadow;
}

.shadow_bottom_left_right {
  box-shadow: 0 2px 2px -2px $shadow, -2px 0 2px -2px $shadow,
    2px 0 2px -2px $shadow;
}

.shadow_left_right {
  box-shadow: -2px 0 2px -2px $shadow, 2px 0 2px -2px $shadow;
}

.shadow_all {
  box-shadow: 0 0 2px $shadow;
}

.section-card {
  margin: 30px auto 30px auto;
  width: 100%;

  @media (max-width: $phone) {
    margin-top: 15px;
  }

  &:last-child:nth-child(2) {
    margin-top: 0px;
  }

  &:not(:first-child) {
    margin-top: 0px;
  }

  .content {
    @extend .shadow_left_right;

    background-color: white;
    padding: 20px;

    border-radius: 0px 0px 2px 2px;

    &:first-child {
      @extend .shadow_top_left_right;
      border-radius: 2px;
    }

    &:last-child {
      @extend .shadow_bottom_left_right;
    }
  }

  &:last-child {
    padding-bottom: 100px;
  }
}

p {
  padding: 0px;
  margin: 16px 0px;

  &[align="center"] {
    text-align: left;
  }
}

h3,
h4 {
  padding: 2px 0px;
  margin: 16px 0px 10px 0px;
  border-bottom: 1px solid #eee;
}

blockquote {
  background-color: #eee;
  margin: 0px;
  padding: 5px 10px;
  border-radius: 3px;
  p {
    padding: 0px;
    margin: 0px;
  }
}

.body-text {
  color: #757575;
  font-weight: 400;
}

// Bold orange text
.orange-title {
  color: #ff8f00;
  font-weight: bold;
  font-size: 18px;
}

// Layout that goes 3-->2-->1
.flexible-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);

  // In tablet layout, two projects per row
  @media (max-width: $tablet) {
    grid-template-columns: repeat(2, 1fr);
  }

  // In phone layout, only one project per row
  @media (max-width: $phone) {
    grid-template-columns: repeat(1, 1fr);
  }
}

.section-card-title {
  font-size: 24px;
  border-bottom: 1px solid #eceff1;
  height: 50px;
  padding: 0px 12px 12px 12px;

  span {
    color: #656565;
    font-family: "Google Sans", Helvetica, Arial, sans-serif;
  }

  button {
    position: relative;
    top: 4px;
  }

  .material-icons {
    font-size: 30px;
    position: relative;
    top: 7px;
    margin-right: 16px;
    opacity: 0.4;
  }
}

h1 button {
  position: relative;
  top: -4px;
}

.button-right {
  padding: 10px;
  float: right;
}

button {
  color: #039be5;
  background-color: transparent;
  border-width: 0px;
  font-weight: bold;
  border-radius: 2px;
  padding: 0px;

  transition: 0.1s linear background-color;

  &:hover {
    background-color: #9edfff;
    cursor: pointer;
  }
}

/**
 * These hacks suck but they work!
 */
@media (max-width:$phone) {
	.algolia-autocomplete .ds-dropdown-menu {
		z-index: 100!important;
		position: fixed!important;
		top: 50px!important;
		left: 0!important;
    right: 0!important;
    width: 100vw!important;
		display: block;
  }

  .algolia-docsearch-footer {
    float: left!important;
    margin-left: 8px;
  }
}
