@import 'xtend-library/src/core/typography/_typography.less';

/**
 * font face
 */

@import (css) url(https://fonts.googleapis.com/css?family=Open+Sans:400,600);

.font-sans-regular() {
  font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 400;
  font-style: normal;
}

.font-sans-semibold() {
  font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 600;
  font-style: normal;
}

.font-monospace() {
  font-family: monaco, Consolas, 'Lucida Console', monospace;
  font-weight: normal;
  font-style: normal;
}

/**
 * rem
 */

// rem

html {
  // base font size for rem
  // 100% is 16px
  // value(%) = desired(px) * 100 / 16
  font-size: 56.25%; // 9px
  @media @min-md {
    font-size: 62.5%; // 10px
  }
  @media @min-xl {
    font-size: 68.75%; // 11px
  }
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  font-size-adjust: 100%;
}

body {
  .text-default();
  .font-sans-regular();
  .font-medium();
  .line-height-medium();
  -moz-osx-font-smoothing: grayscale;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-variant-ligatures: none;
}

/**
 * spacing
 */

.spacing-none {
  .margin(top, none);
  .margin(bottom, none);
}

.spacing-micro {
  .margin(top, mini);
  .margin(bottom, micro);
  .margin(y, layout);
}

.spacing-mini {
  .margin(top, tiny);
  .margin(bottom, mini);
  .margin(y, layout);
}

.spacing-tiny {
  .margin(top, small);
  .margin(bottom, tiny);
  .margin(y, layout);
}

.spacing-small {
  .margin(top, medium);
  .margin(bottom, small);
  .margin(y, layout);
}

.spacing-medium {
  .margin(top, large);
  .margin(bottom, medium);
  .margin(y, layout);
}

.spacing-large {
  .margin(top, big);
  .margin(bottom, large);
  .margin(y, layout);
}

.spacing-big {
  .margin(top, giant);
  .margin(bottom, big);
  .margin(y, layout);
}

.spacing-giant {
  .margin(top, huge);
  .margin(bottom, giant);
  .margin(y, layout);
}

/**
 * header
 */

h1, .h1 {
  .spacing-medium();
  .font-sans-semibold();
  .line-height-mini();
  font-size: 3rem;
  letter-spacing: 0;
  text-transform: none;
  @media @min-sm {
    font-size: 4rem;
  }
}

h2, .h2 {
  .spacing-medium();
  .font-sans-semibold();
  .line-height-mini();
  font-size: 3rem;
  letter-spacing: 0;
  text-transform: none;
  @media @min-sm {
    font-size: 3.5rem;
  }
}

h3, .h3 {
  .spacing-medium();
  .font-sans-semibold();
  .line-height-mini();
  font-size: 2.5rem;
  letter-spacing: 0;
  text-transform: none;
  @media @min-sm {
    font-size: 3rem;
  }
}

h4, .h4 {
  .spacing-tiny();
  .font-sans-semibold();
  .line-height-tiny();
  font-size: 2rem;
  letter-spacing: 0;
  text-transform: none;
  @media @min-sm {
    font-size: 2rem;
  }
}

h5, .h5 {
  .spacing-tiny();
  .font-sans-semibold();
  .line-height-tiny();
  font-size: 1.6rem;
  letter-spacing: 0;
  text-transform: none;
  @media @min-sm {
    font-size: 1.6rem;
  }
}

h6, .h6 {
  .spacing-tiny();
  .font-sans-semibold();
  .line-height-tiny();
  font-size: 13px;
  letter-spacing: .025em;
  text-transform: uppercase;
  @media @min-sm {
    font-size: 13px;
  }
}

// special

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
  & + & { // sequential spacing
    .margin(top, medium) !important;
  }
}

.header-line {
  .spacing-big();
  .padding(bottom, small);
  border-bottom: 3px solid @shade-100;
}

.header-block {
  .margin(top, big);
  .margin(bottom, big);
  .margin(y, layout);
  .padding(y, small);
  .padding(x, medium);
  border-radius: 6px;
  background: @shade-100;
  text-align: center;
}

/**
 * text
 */

p, .p {
  .margin(bottom, 1em);
  .margin(bottom, layout);
  .reset-text();
}

strong {
  .font-sans-semibold();
}

small {
  font-size: .8em;
}

.muted {
  opacity: .5;
}

.align-uppercase {
  position: relative;
  top: -.1em;
}

// variant

.text-inverse {
  color: @text-inverse;
}

.text-default {
  color: @text;
}

// font

.font-micro {
  font-size: 11px;
}

.font-mini {
  font-size: 12px;
}

.font-tiny {
  font-size: 1.3rem;
}

.font-small {
  font-size: 1.4rem;
}

.font-medium {
  font-size: 1.5rem;
}

.font-large {
  font-size: 1.6rem;
}

.font-big {
  font-size: 1.7rem;
}

.font-giant {
  font-size: 1.8rem;
}

.font-huge {
  font-size: 1.9rem;
}

// line-height

.line-height-mini {
  line-height: 1.2;
}

.line-height-tiny {
  line-height: 1.4;
}

.line-height-small {
  line-height: 1.6;
}

.line-height-medium {
  line-height: 1.8;
}

.line-height-large {
  line-height: 2;
}

.line-height-big {
  line-height: 2.2;
}

.line-height-giant {
  line-height: 2.4;
}

.line-height-huge {
  line-height: 2.6;
}

/**
 * ul ol
 */

ul, ol {
  .margin(bottom, 1em);
  .margin(bottom, layout);
  padding-left: 2rem;
  > li {
    .margin(bottom, small);
    > ul, > ol {
      .margin(y, small);
    }
  }
}

/**
 * dl
 */

dl {
  .margin(bottom, 1em);
  .margin(bottom, layout);
  .dl-block();
  dt {
    .font-sans-regular();
  }
  dd {
    .font-sans-semibold();
  }
}

// .dl-block

.dl-block {
  dt {
    .padding(top, small);
  }
  dd {
    .padding(top, tiny);
  }
}

// .dl-line

.dl-line {
  dt {
    .padding(top, none);
  }
  dd {
    .padding(top, none);
    .padding(left, small);
  }
}

// .dl-horizontal

.dl-horizontal {
  text-align: left;
  .margin-remove(top, tiny);
  dt {
    .padding(top, tiny);
    .padding(right, small);
    float: left;
    clear: left;
    width: 120px;
  }
  dd {
    .padding(left, small);
    .padding(top, tiny);
    margin-left: 120px;
  }
}
