// Compile from root directory using: `lessc --clean-css less/style.less > _includes/style.css`
@dark-green: #669900;
@light-green: #99cc00;

body {
  background: #fff;
  font-size: .95em;
  font-family: 'Asap', sans-serif !important;
  line-height: 1.5em;
}

#content {
  width: ~"calc(100% - 360px)";
  margin-right: 40px;
  float: left;
  h1 {
    font-family: 'Roboto', sans-serif;
    font-size: 2.75em;
    font-weight: 900; // mega-bold
    line-height: 1em;
    margin: 0 0 .5em;
    color: #222;
  }
  h2 {
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    font-size: 1.75em;
    line-height: 1.3em;
    margin: 0 0 1em;
    color: #222;
  }
  h3 {
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    font-size: 1.3em;
    margin: 1em 0 1em;
    color: #222;
    margin-top: 2em;
  }
  h4 {
    font-family: 'Roboto', sans-serif;
    font-weight: 400;
    font-size: 1.2em;
    margin: 0 0 1em;
  }
  h5 {
    font-weight: 700;
    margin: 2em 0 1em;
  }
  p {
    margin: 1em 0;
    &.lead {
      font-size: 1.5em;
      line-height: 1.6em;
      margin-top: 0;
    }
  }
  blockquote {
    color: #666;
    border-left: .5em @dark-green solid;
    padding: 0 1em;
    font-style: italic;
  }
  hr {
    border: 0;
    border-top: 1px #222 solid;
    margin: 20px 0;
    &.footnote-divider {
      width: 60%;
    }
  }
}

#info {
  float: right;
  width: 320px;
  h3 {
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    font-size: 1.3em;
    margin: 1em 0 1em;
    color: #222;
  }
  h4 {
    font-family: 'Roboto', sans-serif;
    font-weight: 400;
    font-size: 1.2em;
    margin: 0 0 1em;
  }
  p {
    margin: 1em 0;
    &.lead {
      font-size: 1.5em;
      line-height: 1.6em;
      margin-top: 0;
    }
  }
  .box {
    padding: 20px 0;
    border-top: 1px #eee solid;
    &:first-child {
      border: 0;
      margin-top: 0;
      padding-top: 0;
    }
  }
  .gbadge {
    padding: 40px 0 0;
    text-align: center;
  }
}

#blog-header {
  font-family: 'Roboto', sans-serif;
  font-weight: 400;
  font-size: 1.3em;
  margin: 0 0 1em;
}

#header {
  margin: 0 auto;
  padding: 10px 0;
  background: #222;
  ul li {
    padding-left: 30px;
    float: left;
  }
  nav {
    font-family: 'Roboto', sans-serif;
    text-transform: uppercase;
    font-size: .8em;
    margin: 50px -13px 0;
    a {
      color: @light-green;
      text-decoration: none;
      padding: 13px;
      border: 0;
    }
  }
  #blog-header {
    float: left;
    text-transform: uppercase;
    margin-top: 50px;
    a {
      margin-left: -9px;
      margin-top: -9px;
      color: #fff;
      text-decoration: none;
      padding: 9px;
      border-radius: 1px;
      -webkit-transition: background-color 0.4s;
      -moz-transition: background-color 0.4s;
      -o-transition: background-color 0.4s;
      transition: background-color 0.4s;
      &:hover {
        background: #000;
        color: @light-green;
      }
    }
  }
}

.post-title a {
  color: #222;
  -webkit-transition: color 0.3s;
  -moz-transition: color 0.3s;
  -o-transition: color 0.3s;
  transition: color 0.3s;
  font-weight: 700;
  &:hover {
    color: @dark-green;
    text-decoration: underline;
  }
}

a {
  color: @dark-green;
  text-decoration: none;
  &:hover {
    color: @light-green;
    text-decoration: underline;
  }
  code {
    color: @dark-green;
  }
  &:hover code {
    color: @light-green;
    text-decoration: underline;
  }
}

.no-border a,
a.no-border {
  text-decoration: none;
}

li {
  margin: 0.75em 0;
}

ul,
ol {
  padding-left: 2.5em;
}

td,
th {
  padding: .5em;
  border: 1px #ccc solid;
}

thead {
  background: #f5f5f5;
  border-bottom: 5px #ccc solid;
}

.highlighttable td,
.gist td {
  padding: 0;
  background: none;
  border: 0;
}

.container {
  width: 90%;
  margin: 0 auto;
  max-width: 1400px;
}

#social {
  background: url('/assets/images/android1x.png') no-repeat left bottom;
  padding-top: .5em;
  height: 32px;
  background-size: contain;
  text-align: right;
  font-size: 16px;
  a {
    text-decoration: none;
    color: #fff;
    background: #333;
    width: 32px;
    height: 32px;
    display: inline-block;
    border-radius: 32px;
    -webkit-transition: background-color 0.2s;
    -moz-transition: background-color 0.2s;
    -o-transition: background-color 0.2s;
    transition: background-color 0.2s;
    padding: 2px;
    text-align: center;
    &:hover {
      text-decoration: none;
    }
    &.rss {
      background: #ff8300;
      &:hover {
        background: #f07000;
      }
    }
    &.twitter {
      background: #00aced;
      &:hover {
        background: #0096cf;
      }
    }
    &.github {
      background: #4183c4;
      &:hover {
        background: #2d70b3;
      }
    }
    &.googleplus {
      background: #d14836;
      &:hover {
        background: #c23927;
      }
    }
    i {
      line-height: 32px;
    }
  }
}

.blog-index {
  padding: 20px 0;
}

.snippet {
  border-bottom: 1px #eee solid;
  padding-bottom: 50px;
  margin-bottom: 40px;
  footer {
    margin-top: 1em;
  }
  a[class=read-more] {
    background: #ececec;
    display: inline-block;
    padding: .5em 1em .4em 1em;
    margin-right: .5em;
    text-decoration: none;
    color: #6e6e6e;
    border-radius: 1px;
    border-bottom: 0px;
    -webkit-transition: background-color 0.4s;
    -moz-transition: background-color 0.4s;
    -o-transition: background-color 0.4s;
    transition: background-color 0.4s;
    &:hover {
      background: @dark-green;
      text-shadow: none;
      color: #f8f8f8;
    }
  }
}

.mod-pagination {
  text-align: center;
  .prev {
    float: left;
  }
  .next {
    float: right;
  }
}

#post-last-updated {
  font-style: italic;
  color: #777;
  margin: 1em 0;
}

.post-pagination {
  text-align: center;
  .prev {
    float: right;
  }
  .next {
    float: left;
  }
  &:after {
    content: " ";
    display: table;
    clear: both;
  }
}

.post-comments {
  padding-top: 20px;
}

.side {
  float: left;
  width: 180px;
  margin: 1em 0;
  h4 {
    margin-top: 0;
  }
}

.share-buttons {
  padding-top: 1em;
}

.snippet {
  .side {
    margin-top: 0;
    width: 120px;
  }
  .date-posted {
    font-style: normal;
    text-transform: uppercase;
  }
  .body {
    width: ~"calc(100% - 160px)";
  }
}

.date-block {
  width: 100%;
  text-align: center;
  display: inline-block;
  background: @dark-green;
  color: #fff;
  padding: .5em 0;
  border-radius: 1px;
  margin-top: -2px;
}

.related {
  padding: 0;
  li {
    border-bottom: 1px #ccc solid;
    list-style-type: none;
    margin: 0;
    &:last-child {
      border: 0;
    }
    a {
      background: #f5f5f5;
      padding: 20px;
      display: block;
      border: 0;
      &:hover {
        background: #f5f5f5;
        padding: 20px;
        display: block;
        border: 0;
      }
    }
    &.featured {
      a {
        background: #eaeaea;
      }
    }
  }
}

.body {
  float: right;
  width: ~"calc(100% - 220px)";
}

#copyright {
  padding: 20px 0;
  clear: both;
  text-align: center;
}

// TODO: wrap these ids in a 'adsense' class and update @media print below.
#responsive-home-page-first-ad {
  padding-bottom: 40px;
}

#responsive-home-page-bottom-ad {
  padding-top: 20px;
}

#responsive-post-bottom-ad {
  padding-top: 20px;
}

#responsive-post-header-ad {
  overflow: hidden;
}

#blog-archives {
  h3.year {
    float: left;
    width: 50px;
    margin-right: 10px;
    margin-top: 8px;
    line-height: normal;
  }
  ul {
    width: ~"calc(100% - 60px)";
    float: left;
    padding: 0;
    margin: 0;
    margin-bottom: 2em;
    &:last-child {
      border: 0;
    }
  }
  li {
    padding: .5em;
    list-style-type: none;
    margin: 0;
    &:last-child {
      border: 0;
    }
  }
  span {
    width: 60px;
    text-align: right;
    padding: 0 10px;
    display: block;
    float: left;
    margin-right: 10px;
    color: #666;
  }
}

code {
  font-size: 0.95em;
  color: #cc0000;
  font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Courier New', monospace;
  line-height: 1.3em;
}

pre {
  padding: 10px 10px;
  overflow-x: auto;
  border-radius: 1px;
  border: 1px #ccc solid;
  font-size: .85em;
  font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Courier New', monospace;
  line-height: 1.3em;
  background: #f5f5f5;
  code {
    font-size: 1em;
    color: #444;
    background: transparent;
    padding: 0;
  }
}

.linenos {
  width: 10px;
  pre {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
  }
}

.scrollable {
  overflow-x: auto;
  overflow-y: hidden;
}

.highlight {
  background: #f5f5f5;
}

.highlighttable {
  width: 100%;
  overflow: auto;
  .highlight pre {
    border-left: 0;
  }
}

.hidden-big {
  display: none;
}

.pull-right {
  float: right;
}

.clearfix {
  clear: both;
}

.cf:before,
.cf:after {
  content: " ";
  display: table;
}

.cf:after {
  clear: both;
}

.container:before,
.container:after {
  content: " ";
  display: table;
}

.container:after {
  clear: both;
}

@media (max-width: 1250px) {
  .main.container {
    width: 100%;
  }
  #content {
    float: none;
    width: 90%;
    padding: 0 5%;
  }
  #info {
    clear: both;
    width: 90%;
    padding: 40px 5%;
    margin-top: 40px;
    background: #f5f5f5;
    .right {
      width: ~"calc(100% - 340px)";
      margin: 0;
      float: right;
    }
    .gbadge {
      width: 300px;
      text-align: left;
      float: left;
      margin: 0;
      border: 0;
      padding: 0;
    }
    #promotion2048 {
      display: none;
    }
  }
}

@media (max-width: 960px) {
  .side,
  .body,
  header h1,
  .snippet .side,
  .snippet .body {
    width: 100%;
    float: none;
  }
  .date-block {
    width: 100px;
    padding: .5em;
  }
  .share-buttons div {
    display: inline;
  }
  .related {
    li,
    li:last-child {
      float: left;
      margin: 0 10px 10px 0;
      border: 1px #ccc solid;
      width: 22%;
    }
  }
  h2.post-title {
    margin-top: 0;
  }
  .author {
    display: inline;
  }
  .hidden-big {
    display: inherit;
  }
  .side h4 {
    margin-top: 1em;
  }
  .side.suggested {
    clear: both;
    border-top: 1px @light-green dotted;
    margin-top: 40px;
    padding-top: 40px;
  }
}

@media (max-width: 600px) {
  ul,
  ol {
    padding-left: 1em;
  }
  li {
    margin: 1em 0;
  }
  #content h1 {
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    font-size: 1.75em;
    line-height: 1.3em;
    margin: 0 0 1em;
    color: #222;
  }
  .responsive-figure {
    float: none !important;
    margin: 0 auto !important;
  }
  #social {
    text-align: center;
    background-image: none !important;
  }
  #info {
    .right {
      width: 100%;
      float: none;
      display: block;
      margin-top: 2em;
    }
    .box {
      border-top: 1px #eaeaea solid;
    }
    .gbadge {
      width: 100%;
      float: none;
      padding: 40px 0 0;
      text-align: center;
    }
    #promotion2048 {
      display: block;
    }
  }
  .related li,
  .related li:last-child {
    float: none;
    border: 0;
    border-bottom: 1px #ccc solid;
    list-style-type: none;
    margin: 0;
    width: 100%;
  }
  .related li:last-child {
    float: none;
    border: 0;
  }
  #header {
    padding: 10px 0;
    #blog-header {
      margin: 10px 0;
      width: 100%;
      text-align: center;
      a {
        margin: -2px;
        padding: 2px;
      }
    }
    nav {
      margin: 0;
      clear: both;
      float: none;
      text-align: center;
    }
  }
  #header nav a:hover,
  #header #blog-header a:hover {
    background: transparent;
  }
  #blog-archives {
    h3.year {
      display: block;
      float: none;
      line-height: 0px;
    }
    ul {
      width: 100%;
      float: none;
    }
    li {
      padding-left: 0;
      padding-right: 0;
      border-bottom: 1px #eee solid;
      span {
        padding: 0;
        padding-left: 5px;
        float: right;
        text-align: right;
        margin: 0;
        display: block;
        color: #666;
      }
    }
  }
  .side {
    margin-top: 0;
  }
  img#profile-picture {
    width: 140px !important;
    height: auto;
  }
}

img#profile-picture {
  border-radius: 50%;
  width: 200px;
  height: auto;
  margin-left: 5px;
  margin-bottom: 5px;
  float: right;
}

@media only screen and (-moz-min-device-pixel-ratio: 1.5),
only screen and (-o-min-device-pixel-ratio: 3/2),
only screen and (-webkit-min-device-pixel-ratio: 1.5),
only screen and (min-devicepixel-ratio: 1.5),
only screen and (min-resolution: 1.5dppx) {
  #social {
    background: url('/assets/images/android2x.png') no-repeat left bottom;
    background-size: contain;
  }
}

@media print {
  body {
    font-size: 0.75em;
  }
  #header,
  #social,
  .share-buttons,
  #info,
  #responsive-home-page-bottom-ad,
  #responsive-post-bottom-ad,
  #responsive-post-header-ad,
  .side,
  #copyright {
    display: none;
  }
  .post-pagination {
    visibility: hidden;
    page-break-after: always;
  }
  a[href]:after {
    content: none !important;
  }
}

html {
  -webkit-text-size-adjust: none;
}

.body {
  max-height: 999999px; // Arbitrarily large number.
}

// Force Facebook like button to align properly.
.fb-like.fb_iframe_widget span {
  vertical-align: top !important;
}
