/* Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 * 
 *   http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License. */

/**
* Reset some basic elements
*/
body, h1, h2, h3, h4, h5, h6,
p, blockquote, pre, hr,
dl, dd, ol, ul, figure {
  margin: 0;
  padding: 0;
}

body {
  background-repeat: no-repeat;
  background-size: contain;
  min-height: 100%;
  background-color: $grey-color-light;
  @media screen and (min-width: $on-palm) and (max-width: $on-laptop) {
    background-size: inherit;
  }
  @media screen and (max-width: $on-palm) {
    background-size: cover;
  }
}

table {
  color: $grey-color-dark !important;
}

/**
 * Basic styling
 */
body {
  font-family: $base-font-family;
  font-weight: $base-font-weight;
  font-size: $base-font-size;
  line-height: $base-line-height;
  color: $text-color;
  background-color: $color-mxnet;

  display: flex;
  min-height: 100vh;
  flex-direction: column;
}


/**
 * Set `margin-bottom` to maintain vertical rhythm
 */
h1, h2, h3, h4, h5, h6,
p, blockquote, pre,
ul, ol, dl, figure,
%vertical-rhythm {
  margin-bottom: $spacing-unit / 2;
}


/**
 * `main` element
 */
main {
  display: block; /* Default value of `display` of `main` element is 'inline' in IE 11. */
}

header {
  z-index: 10;
}

/**
 * Images
 */
img {
  max-width: 100%;
  vertical-align: middle;
}


/**
 * Figures
 */
figure > img {
  display: block;
}

figcaption {
  font-size: $small-font-size;
}


/**
 * Lists
 */
ul, ol {
  margin-left: $spacing-unit;
}

li {
  > ul,
  > ol {
    margin-bottom: 0;
  }
}


/**
 * Headings
 */
h1, h2, h3, h4, h5, h6 {
  font-weight: $base-font-weight;
}


h1 {
  font-weight: 200;
  @include relative-font-size(3.5);
  line-height: 120%;
}


/**
 * Links
 */
a {
  color: $color-mxnet;
  text-decoration: none;
  font-weight: 300;

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

  &:hover {
    color: $color-mxnet-dark;
    text-decoration: none;
  }

  .social-media-list &:hover {

  }
}

.clickable {
  &:hover {
    cursor: pointer;
  }
}

/**
 * Blockquotes
 */
blockquote {
  color: $grey-color;
  border-left: 4px solid $grey-color-light;
  padding-left: $spacing-unit / 2;
  @include relative-font-size(1.125);
  letter-spacing: -1px;
  font-style: italic;

  > :last-child {
    margin-bottom: 0;
  }
}


/**
 * Code formatting
 */
pre,
code {
  @include relative-font-size(0.9375);
  border: 1px solid $grey-color-light;
  border-radius: 3px;
  background-color: #eef;
}

code {
  padding: 1px 5px;
}

pre {
  padding: 8px 12px;
  overflow-x: auto;

  > code {
    border: 0;
    padding-right: 0;
    padding-left: 0;
  }
}

.span-accented {
  color: orangered;
  float: none !important;
  margin: 0 !important;
  font-size: 120%;
}

/**
 * Wrapper
 */
.wrapper {
  max-width: -webkit-calc(#{$content-width} - (#{$spacing-unit} * 2));
  max-width: calc(#{$content-width} - (#{$spacing-unit} * 2));
  margin-right: auto;
  margin-left: auto;
  padding-right: $spacing-unit;
  padding-left: $spacing-unit;
  @extend %clearfix;

  @include media-query($on-laptop) {
    max-width: -webkit-calc(#{$content-width} - (#{$spacing-unit}));
    max-width: calc(#{$content-width} - (#{$spacing-unit}));
    padding-right: $spacing-unit / 2;
    padding-left: $spacing-unit / 2;
  }
}


/**
 * Clearfix
 */
%clearfix:after {
  content: "";
  display: table;
  clear: both;
}


/**
 * Icons
 */

.svg-icon {
  width: 16px;
  height: 16px;
  display: inline-block;
  fill: $grey-color-light;
  padding-right: 5px;
  padding-top: 4px;
  vertical-align: text-top;
}

.social-media-list {
  li + li {
    padding-top: 5px;
  }
}


/**
 * Tables
 */
table {
  margin-bottom: $spacing-unit;
  width: 100%;
  text-align: $table-text-align;
  color: lighten($text-color, 18%);
  border-collapse: collapse;
  border: 1px solid $grey-color-light;

  tr {
    &:nth-child(even) {
      background-color: lighten($grey-color-light, 6%);
    }
  }

  th, td {
    padding: ($spacing-unit / 3) ($spacing-unit / 2);
  }

  th {
    background-color: lighten($grey-color-light, 3%);
    border: 1px solid darken($grey-color-light, 4%);
    border-bottom-color: darken($grey-color-light, 12%);
  }

  td {
    border: 1px solid $grey-color-light;
  }
}
