/* =====================================================================
   Custom Properties
   ===================================================================== */

:root {
  /* Colors */
  --link-color: #a92878;
  --link-color-hover: #ca308f;
  --link-color-visited: #6b194c;
  --link-color-active: #8c2163;

  --text-color: #222;
  --text-color-light: #aaa;

  --page-bg: #fefefe;
  --main-bg: #f8f8f8;
  --header-bg: transparent;
  --title-color: #000;
  --subtitle-color: #949494;

  --nav-bg: #c5dcbb;
  --nav-bg-gradient: linear-gradient(#dcead6, #c5dcbb, #a5c896);
  --nav-border-top: #f0f6ed;
  --nav-border-bottom: #7db067;
  --nav-border-left: #a5c896;
  --nav-border-right: #d9e8d3;
  --nav-color: #5d8c49;
  --nav-color-hover: #25381d;
  --nav-search-bg: #f0f6ed;
  --nav-search-border: #a8ca9a;
  --nav-search-shadow: #cbdfc2;
  --nav-text-shadow: #e7f1e3;

  --sidebar-bg: #f0f0f0;
  --sidebar-border: #dedede;
  --sidebar-color: #4b4b4b;
  --sidebar-link-color: #466da6;
  --sidebar-link-color-hover: #63a04a;
  --sidebar-link-color-subdued: #7e7e7e;
  --sidebar-shadow: #fdfdfd;

  --footer-bg: #ccc;
  --footer-bg-gradient: linear-gradient(#e0e0e0, #ccc, #b0b0b0);
  --footer-border-top: #f2f2f2;
  --footer-color: #888;
  --footer-link-color: #6b6b6b;
  --footer-link-color-hover: #484848;
  --footer-text-shadow: #d9d9d9;

  --page-border-bottom: #bfbfbf;

  --pre-bg: #fffffa;
  --pre-border: #e3e3e3;
  --pre-color: #586e75;

  /* Fonts */
  --font-sans: "PT Sans", "Helvetica Neue", Arial, sans-serif;
  --font-serif: "PT Serif", Georgia, Times, "Times New Roman", serif;
  --font-mono: Menlo, Monaco, "Andale Mono", "lucida console", "Courier New", monospace;
  --font-heading: "PT Serif", "Georgia", "Helvetica Neue", Arial, sans-serif;

  /* Layout */
  --max-width: 1250px;
  --pad-min: 18px;
  --pad-narrow: 25px;
  --pad-medium: 35px;
  --pad-wide: 55px;
  --sidebar-width-medium: 240px;
  --sidebar-pad-medium: 15px;
  --sidebar-pad-wide: 20px;
  --sidebar-width-wide: 350px;

  --noise-bg: url("/images/noise2.png") top left;
  --dotted-border: url("/images/dotted-border.png");
}

/* =====================================================================
   Reset
   ===================================================================== */

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

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
main, menu, nav, output, ruby, section, summary,
time, mark, audio, video {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  font: inherit;
  vertical-align: baseline;
}

article, aside, details, figcaption, figure,
footer, header, hgroup, main, menu, nav, section, summary {
  display: block;
}

body {
  line-height: 1;
}

ol, ul {
  list-style: none;
}

blockquote, q {
  quotes: none;
}

blockquote:before, blockquote:after,
q:before, q:after {
  content: '';
  content: none;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* =====================================================================
   Base: Links
   ===================================================================== */

a {
  color: var(--link-color);
  transition: color .3s;

  &:hover  { color: var(--link-color-hover); }
  &:focus  { color: var(--link-color-hover); }
  &:visited { color: var(--link-color-visited); }
  &:active { color: var(--link-color-active); }
}

/* =====================================================================
   Base: Typography
   ===================================================================== */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  text-rendering: optimizelegibility;
  margin-bottom: 1em;
  font-weight: bold;
}

body {
  font-family: var(--font-serif);
  line-height: 1.5em;
  color: var(--text-color);
}

h1 {
  font-size: 2.2em;
  line-height: 1.2em;
}

h2, section h1 {
  font-size: 1.5em;
}

h3, section h2, section section h1 {
  font-size: 1.3em;
}

h4, section h3, section section h2, section section section h1 {
  font-size: 1em;
}

h5, section h4, section section h3 {
  font-size: .9em;
}

h6, section h5, section section h4, section section section h3 {
  font-size: .8em;
}

@media only screen and (min-width: 992px) {
  body { font-size: 1.15em; }
  h1   { font-size: 2.6em; line-height: 1.2em; }
}

p, blockquote, ul, ol {
  margin-bottom: 1.5em;
}

ul {
  list-style-type: disc;

  & ul {
    list-style-type: circle;
    margin-bottom: 0;

    & ul {
      list-style-type: square;
      margin-bottom: 0;
    }
  }
}

ol {
  list-style-type: decimal;

  & ol {
    list-style-type: lower-alpha;
    margin-bottom: 0;

    & ol {
      list-style-type: lower-roman;
      margin-bottom: 0;
    }
  }
}

ul, ul ul, ul ol,
ol, ol ul, ol ol {
  margin-left: 2.3em;
}

strong, dfn { font-weight: bold; }
em, dfn     { font-style: italic; }
del, s      { text-decoration: line-through; }
small       { font-size: .8em; }
big         { font-size: 1.2em; }
hr          { margin-bottom: 0.2em; }

abbr, acronym {
  border-bottom: 1px dotted;
  cursor: help;
}

sup, sub {
  font-size: 0.8em;
  position: relative;
  display: inline-block;
  line-height: 0;
}

sup { top: -.5em; }
sub { bottom: -.5em; }

q {
  font-style: italic;

  &:before { content: "\201C"; }
  &:after  { content: "\201D"; }
}

blockquote {
  font-style: italic;
  position: relative;
  font-size: 1.2em;
  line-height: 1.5em;
  padding-left: 1em;
  border-left: 4px solid rgba(170, 170, 170, 0.5);

  & cite {
    font-style: italic;

    & a {
      color: var(--text-color-light) !important;
      word-wrap: break-word;
    }

    &:before {
      content: '\2014';
      padding-right: .3em;
      padding-left: .3em;
      color: var(--text-color-light);
    }
  }

  @media only screen and (min-width: 992px) {
    padding-left: 1.5em;
  }
}

.pullquote-right:before,
.pullquote-left:before {
  padding: 0;
  border: none;
  content: attr(data-pullquote);
  float: right;
  width: 45%;
  margin: .5em 0 1em 1.5em;
  position: relative;
  top: 7px;
  font-size: 1.4em;
  line-height: 1.45em;
}

.pullquote-left:before {
  float: left;
  margin: .5em 1.5em 1em 0;
}

.force-wrap {
  white-space: pre-wrap;
  word-wrap: break-word;
}

pre, code, tt {
  font-family: var(--font-mono);
}

/* =====================================================================
   Base: Layout
   ===================================================================== */

html {
  background: var(--page-bg) var(--noise-bg);
}

body {
  -webkit-text-size-adjust: 100%;
  max-width: var(--max-width);
  position: relative;
  margin: 0 auto;

  & > header,
  & > nav,
  & > footer {
    padding-left: var(--pad-min);
    padding-right: var(--pad-min);

    @media only screen and (min-width: 480px) {
      padding-left: var(--pad-narrow);
      padding-right: var(--pad-narrow);
    }

    @media only screen and (min-width: 768px) {
      padding-left: var(--pad-medium);
      padding-right: var(--pad-medium);
    }

    @media only screen and (min-width: 992px) {
      padding-left: var(--pad-wide);
      padding-right: var(--pad-wide);
    }
  }

  & > header {
    font-size: 1em;
    padding-top: 1.5em;
    padding-bottom: 1.5em;
  }

  @media only screen and (min-width: 768px) {
    -webkit-text-size-adjust: auto;
  }
}

@media only screen and (min-width: 768px) {
  body > header { font-size: 1.2em; }
}

@media only screen and (min-width: 992px) {
  body > header { font-size: 1.3em; }
}

#main {
  display: flex;
  flex-direction: column;
}

#content {
  display: flex;
  flex-direction: column;
  align-items: stretch;

  & > div,
  & > article {
    padding: var(--pad-min);

    @media only screen and (min-width: 480px) { padding: var(--pad-narrow); }
    @media only screen and (min-width: 768px) { padding: 17.5px var(--pad-medium); }
    @media only screen and (min-width: 992px) { padding: 27.5px var(--pad-wide); }
  }

  & div.pagination {
    padding: 0 var(--pad-min);

    @media only screen and (min-width: 480px) { padding: 0 var(--pad-narrow); }
    @media only screen and (min-width: 768px) { padding: 0 var(--pad-medium); }
    @media only screen and (min-width: 992px) { padding: 0 var(--pad-wide); }
  }

  @media only screen and (min-width: 768px) {
    flex-direction: row;
    align-items: flex-start;

    & > div:first-child,
    & > article:first-child {
      flex: 1 1 0;
      min-width: 0;
    }
  }
}

aside.sidebar {
  padding: 0 var(--pad-min) 1px;
  border-top: 1px solid var(--sidebar-border);

  @media only screen and (min-width: 768px) {
    flex: 0 0 var(--sidebar-width-medium);
    width: var(--sidebar-width-medium);
    padding: 0 var(--sidebar-pad-medium) var(--sidebar-pad-medium);
    border-top: none;
  }

  @media only screen and (min-width: 992px) {
    flex: 0 0 var(--sidebar-width-wide);
    width: var(--sidebar-width-wide);
    padding: 1.2em var(--sidebar-pad-wide) var(--sidebar-pad-wide);
  }
}

.flex-content {
  max-width: 100%;
  height: auto;
}

.basic-alignment {
  &.left  { float: left;  margin-right: 1.5em; }
  &.right { float: right; margin-left: 1.5em; }
  &.center { display: block; margin: 0 auto 1.5em; }
  &.left, &.right { margin-bottom: .8em; }
}

/* =====================================================================
   Base: Theme / Background
   ===================================================================== */

body > div {
  background: var(--sidebar-bg) var(--noise-bg);
  border-top: 1px solid white;
  border-bottom: 1px solid var(--page-border-bottom);

  & > div > div:first-child {
    background: rgba(255, 255, 255, 0.3);
    border-right: 1px solid var(--sidebar-border);
  }
}

/* =====================================================================
   Header
   ===================================================================== */

body > header {
  background: var(--header-bg);
  border-bottom: 1px solid #e5e5e5;

  & h1 {
    font-family: var(--font-heading);
    font-size: 2.2em;
    font-weight: normal;
    line-height: 1.2em;
    display: inline-block;
    margin: 0;

    & a,
    & a:visited,
    & a:hover {
      color: var(--title-color);
      text-decoration: none;
    }
  }

  & h2 {
    font-family: var(--font-sans);
    margin: .2em 0 0;
    font-size: 1em;
    color: var(--subtitle-color);
    font-weight: normal;
  }
}

/* =====================================================================
   Navigation
   ===================================================================== */

body > nav {
  position: relative;
  background-color: var(--nav-bg);
  background: url("/images/noise.png"), var(--nav-bg-gradient);
  border-top: 1px solid var(--nav-border-top);
  border-bottom: 1px solid var(--nav-border-bottom);
  padding-top: .35em;
  padding-bottom: .35em;

  & form {
    background-clip: padding-box;
    margin: 0;
    padding: 0;

    & .search {
      padding: .3em .5em 0;
      font-size: .85em;
      font-family: var(--font-sans);
      line-height: 1.1em;
      width: 95%;
      border-radius: .5em;
      background-clip: padding-box;
      box-shadow: var(--nav-search-shadow) 0 1px;
      background-color: var(--nav-search-bg);
      border: 1px solid var(--nav-search-border);
      color: #888;

      &:focus {
        color: #444;
        border-color: #80b1df;
        box-shadow: #80b1df 0 0 4px, #80b1df 0 0 3px inset;
        background-color: #fff;
        outline: none;
      }
    }
  }

  & fieldset[role=search] {
    float: right;
    width: 48%;
  }

  & fieldset.mobile-nav {
    float: left;
    width: 48%;

    & select {
      width: 100%;
      font-size: .8em;
      border: 1px solid #888;
    }
  }

  & ul {
    display: none;
  }

  @media only screen and (min-width: 550px) {
    font-size: .9em;

    & ul {
      list-style: none;
      padding: 0;
      margin: 0;
      float: left;
      display: block;
      padding-top: .15em;

      & > li {
        display: inline-block;
        float: left;
      }
    }

    & ul.subscription {
      margin-left: .8em;
      float: right;

      & li:last-child a { padding-right: 0; }
    }

    & ul li {
      margin: 0;
    }

    & a {
      color: var(--nav-color);
      font-family: var(--font-sans);
      text-shadow: var(--nav-text-shadow) 0 1px;
      float: left;
      text-decoration: none;
      font-size: 1.1em;
      padding: .1em 0;
      line-height: 1.5em;

      &:hover   { color: var(--nav-color-hover); }
      &:visited { color: var(--nav-color); }
    }

    & li + li {
      border-left: 1px solid var(--nav-border-left);
      margin-left: .8em;

      & a {
        padding-left: .8em;
        border-left: 1px solid var(--nav-border-right);
      }
    }

    & form {
      float: right;
      text-align: left;
      padding-left: .8em;
      width: 175px;

      & .search {
        width: 93%;
        font-size: .95em;
        line-height: 1.2em;
      }
    }

    & ul[data-subscription$=email] + form {
      width: 97px;

      & .search { width: 91%; }
    }

    & fieldset.mobile-nav    { display: none; }
    & fieldset[role=search]  { width: 99%; }
  }

  @media only screen and (min-width: 992px) {
    & form { width: 265px; }
    & ul[data-subscription$=email] + form { width: 197px; }
  }
}

.no-placeholder body > nav .search {
  background: var(--nav-search-bg) url("/images/search.png") .3em .25em no-repeat;
  text-indent: 1.3em;
}

/* =====================================================================
   Article / Blog
   ===================================================================== */

article {
  padding-top: 1em;

  & a {
    white-space: pre-wrap;
    word-wrap: break-word;
  }

  & header {
    position: relative;
    padding-top: 2em;
    padding-bottom: 1em;
    margin-bottom: 1em;
    background: var(--dotted-border) bottom left repeat-x;

    & h1 {
      margin: 0;

      & a {
        text-decoration: none;
        &:hover { text-decoration: underline; }
      }
    }

    & p {
      font-size: .9em;
      color: var(--text-color-light);
      margin: 0;

      &.meta {
        font-family: var(--font-sans);
        text-transform: uppercase;
        position: absolute;
        top: 0;
      }
    }

    @media only screen and (min-width: 768px) {
      margin-bottom: 1.5em;
      padding-bottom: 1em;
      background: var(--dotted-border) bottom left repeat-x;
    }
  }

  & h2 {
    padding-top: 0.8em;
    background: var(--dotted-border) top left repeat-x;
  }

  .entry-content & h2:first-child,
  & header + h2 {
    padding-top: 0;
  }

  & h2:first-child,
  & header + h2 {
    background: none;
  }

  & .feature {
    padding-top: .5em;
    margin-bottom: 1em;
    padding-bottom: 1em;
    background: var(--dotted-border) bottom left repeat-x;
    font-size: 2em;
    font-style: italic;
    line-height: 1.3em;
  }

  & img,
  & video,
  & .flash-video {
    max-width: 100%;
    height: auto;
    border-radius: 0.3em;
    box-shadow: rgba(0, 0, 0, 0.15) 0 1px 4px;
    box-sizing: border-box;
    border: #fff 0.5em solid;
  }

  & video,
  & .flash-video {
    margin: 0 auto 1.5em;
  }

  & video {
    display: block;
    width: 100%;
  }

  & .flash-video > div {
    position: relative;
    display: block;
    padding-bottom: 56.25%;
    padding-top: 1px;
    height: 0;
    overflow: hidden;

    & iframe,
    & object,
    & embed {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
    }
  }

  & > footer {
    font-family: var(--font-sans);
    padding-bottom: 2.5em;
    margin-top: 2em;

    & p.meta {
      margin-bottom: .8em;
      font-size: .85em;
      clear: both;
      overflow: hidden;
    }

    & .byline + time:before,
    & time + time:before,
    & .comments:before,
    & .byline ~ .categories:before {
      content: "\2022 ";
      padding: 0 .4em 0 .2em;
      display: inline-block;
    }
  }
}

.blog-index article + article {
  background: var(--dotted-border) top left repeat-x;
}

#content .blog-index {
  padding-top: 0;
  padding-bottom: 0;

  & article {
    padding-top: 2em;
  }

  & article header {
    background: none;
    padding-bottom: 0;
  }

  & article h1 {
    font-size: 2.2em;

    & a {
      color: inherit;
      &:hover { color: var(--link-color-hover); }
    }
  }

  & a[rel=full-article] {
    font-family: var(--font-serif);
    background: #ebebeb;
    display: inline-block;
    padding: .4em .8em;
    margin-right: .5em;
    text-decoration: none;
    color: #666;
    transition: background-color .5s;

    &:hover {
      background: var(--link-color-hover);
      text-shadow: none;
      color: var(--main-bg);
    }
  }

  & footer {
    font-family: var(--font-sans);
    margin-top: 1em;
  }
}

.separator {
  content: "\2022 ";
  padding: 0 .4em 0 .2em;
  display: inline-block;
}

#content div.pagination {
  text-align: center;
  font-size: .95em;
  position: relative;
  background: var(--dotted-border) top left repeat-x;
  padding-top: 1.5em;
  padding-bottom: 1.5em;

  & a {
    text-decoration: none;
    color: var(--text-color-light);

    &.prev { position: absolute; left: 0; }
    &.next { position: absolute; right: 0; }
    &:hover { color: var(--link-color-hover); }

    &[href*=archive]:before,
    &[href*=archive]:after {
      padding: 0 .3em;
    }
  }
}

.entry-content {
  text-align: justify;
}

/* =====================================================================
   Sharing
   ===================================================================== */

p.meta + .sharing {
  padding-top: 1em;
  padding-left: 0;
  background: var(--dotted-border) top left repeat-x;
}

#fb-root {
  display: none;
}

/* =====================================================================
   Syntax Highlighting
   ===================================================================== */

.highlight,
html .gist .gist-file .gist-syntax .gist-highlight {
  border: 1px solid var(--pre-border) !important;

  & table td.code { width: 100%; }

  & .line-numbers {
    text-align: right;
    font-size: 13px;
    line-height: 1.45em;
    background: white var(--noise-bg) !important;
    border-right: 1px solid #ebebeb !important;
    box-shadow: white -1px 0 inset;
    text-shadow: whitesmoke 0 -1px;
    padding: .8em !important;
    border-radius: 0;

    & span { color: #93a1a1 !important; }
  }
}

figure.code, .gist-file, pre {
  box-shadow: rgba(0, 0, 0, 0.06) 0 0 10px;

  & .highlight pre { box-shadow: none; }
}

html .gist .gist-file {
  margin-bottom: 1.8em;
  position: relative;
  border: none;
  padding-top: 20px !important;

  & .gist-syntax {
    border-bottom: 0 !important;
    background: none !important;

    & .gist-highlight {
      background: var(--pre-bg) !important;
    }
  }

  & .gist-meta {
    font-family: var(--font-sans);
    padding: .6em 0.8em;
    color: #93a1a1;
    font-size: .7em !important;
    background: white var(--noise-bg);
    border: 1px solid var(--pre-border) !important;
    border-top: 1px solid white !important;
    line-height: 1.5em;

    & a {
      color: #76888b !important;
      text-decoration: none;

      &:hover {
        text-decoration: underline;
        color: #586e75 !important;
      }
    }

    & a[href*='#file'] {
      position: absolute;
      top: 0;
      left: 0;
      right: -10px;
      color: #474747 !important;
      /* code-title styles applied below */
      text-align: center;
      font-size: 13px;
      line-height: 2em;
      text-shadow: #cbcccc 0 1px 0;
      font-weight: normal;
      margin-bottom: 0;
      border-top-left-radius: 5px;
      border-top-right-radius: 5px;
      font-family: "Helvetica Neue", Arial, "Lucida Grande", "Lucida Sans Unicode", Lucida, sans-serif;
      background: #aaaaaa url("/images/code_bg.png") top repeat-x;
      border: 1px solid #565656;
      border-top-color: #cbcbcb;
      border-left-color: #a5a5a5;
      border-right-color: #a5a5a5;
      border-bottom: 0;

      &:hover { color: var(--link-color) !important; }
    }

    & a[href*=raw] {
      /* download-source styles */
      position: absolute;
      right: .8em;
      top: .4em;
      text-decoration: none;
      color: #666 !important;
      z-index: 1;
      font-size: 13px;
      text-shadow: #cbcccc 0 1px 0;
      padding-left: 3em;

      &:hover { text-decoration: underline; }
    }
  }
}

pre {
  font-family: var(--font-mono);
  background: var(--pre-bg) var(--noise-bg);
  border-radius: .4em;
  border: 1px solid var(--pre-border);
  line-height: 1.45em;
  font-size: 13px;
  margin-bottom: 2.1em;
  padding: .8em 1em;
  color: var(--pre-color);
  overflow: auto;
}

h3.filename {
  text-align: center;
  font-size: 13px;
  line-height: 2em;
  text-shadow: #cbcccc 0 1px 0;
  color: #474747;
  font-weight: normal;
  margin-bottom: 0;
  border-top-left-radius: 5px;
  border-top-right-radius: 5px;
  font-family: "Helvetica Neue", Arial, "Lucida Grande", "Lucida Sans Unicode", Lucida, sans-serif;
  background: #aaaaaa url("/images/code_bg.png") top repeat-x;
  border: 1px solid #565656;
  border-top-color: #cbcbcb;
  border-left-color: #a5a5a5;
  border-right-color: #a5a5a5;
  border-bottom: 0;

  & + pre {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
  }
}

p code,
li code {
  font-family: var(--font-mono);
  display: inline-block;
  white-space: nowrap;
  background: #fff;
  font-size: .8em;
  line-height: 1.5em;
  color: #555;
  border: 1px solid #ddd;
  border-radius: .4em;
  padding: 0 .3em;
  margin: -1px 0;
}

p pre code,
li pre code {
  font-size: 1em !important;
  background: none;
  border: none;
}

.pre-code,
.highlight code,
html .gist .gist-file .gist-syntax .gist-highlight pre {
  font-family: var(--font-mono) !important;
  overflow-y: hidden;
  display: block;
  padding: .8em !important;
  overflow-x: auto;
  line-height: 1.45em;
  background: var(--pre-bg) var(--noise-bg) !important;
  color: var(--pre-color) !important;

  & *::selection {
    background: white;
    color: inherit;
    text-shadow: var(--pre-bg) 0 1px;
  }

  & span {
    color: var(--pre-color) !important;
    font-style: normal !important;
    font-weight: normal !important;
  }

  & .c, & .cm, & .cp, & .c1 { color: #93a1a1 !important; font-style: italic !important; }
  & .cs   { color: #93a1a1 !important; font-weight: bold !important; font-style: italic !important; }
  & .err  { color: #dc322f !important; background: none !important; }
  & .k    { color: #cb4b16 !important; }
  & .o    { color: var(--pre-color) !important; font-weight: bold !important; }
  & .p    { color: var(--pre-color) !important; }
  & .ow   { color: #2aa198 !important; font-weight: bold !important; }
  & .gd   { color: var(--pre-color) !important; background-color: #f6ccc7 !important; display: inline-block; }
  & .gd .x { color: var(--pre-color) !important; background-color: #f3b7b3 !important; display: inline-block; }
  & .ge   { color: var(--pre-color) !important; font-style: italic !important; }
  & .gh   { color: #93a1a1 !important; }
  & .gi   { color: var(--pre-color) !important; background-color: #e7ebc8 !important; display: inline-block; }
  & .gi .x { color: var(--pre-color) !important; background-color: #ced696 !important; display: inline-block; }
  & .gs   { color: var(--pre-color) !important; font-weight: bold !important; }
  & .gu   { color: #6c71c4 !important; }
  & .kc   { color: #859900 !important; font-weight: bold !important; }
  & .kd   { color: #268bd2 !important; }
  & .kp   { color: #cb4b16 !important; font-weight: bold !important; }
  & .kr   { color: #d33682 !important; font-weight: bold !important; }
  & .kt   { color: #2aa198 !important; }
  & .n, & .na, & .nb { color: #268bd2 !important; }
  & .nb   { color: #859900 !important; }
  & .nc   { color: #d33682 !important; }
  & .no, & .nn, & .nx { color: #b58900 !important; }
  & .nl   { color: #859900 !important; }
  & .ne, & .nf, & .nt { color: #268bd2 !important; font-weight: bold !important; }
  & .vg, & .vi, & .nv { color: #268bd2 !important; }
  & .m, & .mf, & .mh, & .mi { color: #2aa198 !important; }
  & .s, & .sd, & .s2, & .sr, & .s1 { color: #2aa198 !important; }
  & .se   { color: #dc322f !important; }
  & .si   { color: #268bd2 !important; }

  & div .gd, & div .gd .x,
  & div .gi, & div .gi .x {
    display: inline-block;
    width: 100%;
  }
}

.highlight,
.gist-highlight {
  margin-bottom: 1.8em;
  background: var(--pre-bg);
  overflow-y: hidden;
  overflow-x: auto;

  & pre {
    background: none;
    border-radius: 0;
    border: none;
    padding: 0;
    margin-bottom: 0;
  }
}

pre::-webkit-scrollbar,
.highlight::-webkit-scrollbar,
.gist-highlight::-webkit-scrollbar {
  height: .5em;
  background: rgba(0, 0, 0, 0.15);
}

pre::-webkit-scrollbar-thumb:horizontal,
.highlight::-webkit-scrollbar-thumb:horizontal,
.gist-highlight::-webkit-scrollbar-thumb:horizontal {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 4px;
}

.highlight code {
  background: #000;
}

figure.code {
  background: none;
  padding: 0;
  border: 0;
  margin-bottom: 1.5em;

  & pre { margin-bottom: 0; }

  & figcaption {
    position: relative;
    text-align: center;
    font-size: 13px;
    line-height: 2em;
    text-shadow: #cbcccc 0 1px 0;
    color: #474747;
    font-weight: normal;
    margin-bottom: 0;
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
    font-family: "Helvetica Neue", Arial, "Lucida Grande", "Lucida Sans Unicode", Lucida, sans-serif;
    background: #aaaaaa url("/images/code_bg.png") top repeat-x;
    border: 1px solid #565656;
    border-top-color: #cbcbcb;
    border-left-color: #a5a5a5;
    border-right-color: #a5a5a5;
    border-bottom: 0;

    & a {
      position: absolute;
      right: .8em;
      text-decoration: none;
      color: #666 !important;
      z-index: 1;
      font-size: 13px;
      text-shadow: #cbcccc 0 1px 0;
      padding-left: 3em;

      &:hover { text-decoration: underline; }
    }
  }

  & .highlight { margin-bottom: 0; }
}

/* =====================================================================
   Archive
   ===================================================================== */

#archive #content > div,
#archive #content > div > article {
  padding-top: 0;
}

#blog-archives {
  color: var(--text-color-light);

  & article {
    padding: 1em 0;
    position: relative;
    background: var(--dotted-border) bottom left repeat-x;

    &:last-child { background: none; }

    & footer { padding: 0; margin: 0; }
  }

  & h1 {
    color: var(--text-color);
    margin-bottom: .3em;
    font-size: 1.5em;

    & a {
      text-decoration: none;
      color: inherit;
      font-weight: normal;
      display: inline-block;

      &:hover {
        text-decoration: underline;
        color: var(--link-color-hover);
      }
    }
  }

  & h2 { display: none; }

  & a.category,
  & time {
    font-family: var(--font-sans);
    color: var(--text-color-light);
  }

  & .entry-content { display: none; }

  & time {
    font-size: .9em;
    line-height: 1.2em;

    & .month,
    & .day { display: inline-block; }

    & .month { text-transform: uppercase; }
  }

  & p { margin-bottom: 1em; }

  & a,
  & .entry-content a {
    color: inherit;
    &:hover { color: var(--link-color-hover); }
  }

  @media only screen and (min-width: 550px) {
    & article {
      margin-left: 5em;
      padding-left: 4.5em;
      padding-bottom: .7em;
    }

    & h2 {
      margin-bottom: .3em;
      font-weight: normal;
      display: inline-block;
      position: relative;
      top: -1px;
      float: left;

      &:first-child { padding-top: .75em; }
    }

    & time {
      position: absolute;
      text-align: right;
      left: 0;
      top: 1.8em;
    }

    & .year { display: none; }

    & a.category { line-height: 1.1em; }
  }
}

#content > .category {
  & article {
    margin-left: 0;
    padding-left: 6.8em;
  }

  & .year { display: inline; }
}

/* =====================================================================
   Sidebar
   ===================================================================== */

aside.sidebar {
  overflow: hidden;
  color: var(--sidebar-color);
  text-shadow: white 0 1px;

  & a {
    color: inherit;
    transition: color .5s;
    white-space: pre-wrap;
    word-wrap: break-word;
  }

  & section {
    font-family: var(--font-sans);
    font-size: .8em;
    line-height: 1.4em;
    margin-bottom: 1.5em;

    & h1 {
      margin: 1.5em 0 0;
      padding-bottom: .2em;
      border-bottom: 1px solid var(--sidebar-border);
      box-shadow: var(--sidebar-shadow) 0 1px;

      & + p { padding-top: .4em; }
    }
  }

  & img {
    max-width: 100%;
    height: auto;
    border-radius: 0.3em;
    box-shadow: rgba(0, 0, 0, 0.15) 0 1px 4px;
    box-sizing: border-box;
    border: #fff 0.3em solid;
  }

  & ul {
    margin-bottom: 0.5em;
    margin-left: 0;
  }

  & li {
    list-style: none;
    padding: .5em 0;
    margin: 0;
    border-bottom: 1px solid var(--sidebar-border);
    box-shadow: var(--sidebar-shadow) 0 1px;

    & p:last-child { margin-bottom: 0; }
  }

  &:hover a {
    color: var(--sidebar-link-color);
    &:hover { color: var(--sidebar-link-color-hover); }
  }
}

aside.sidebar a {
  color: var(--sidebar-link-color);

  &:hover  { color: var(--sidebar-link-color-hover); }
  &:focus  { color: var(--sidebar-link-color-hover); }
  &:active { color: var(--link-color-active); }
}

aside.sidebar:hover a {
  color: var(--link-color);

  &:hover  { color: var(--link-color-hover); }
  &:focus  { color: var(--link-color-hover); }
  &:active { color: var(--link-color-active); }
}

.aside-alt-link {
  color: var(--sidebar-link-color-subdued);

  &:hover { color: var(--sidebar-link-color-hover); }
}

aside form {
  background-clip: padding-box;
  margin: 0;
  padding: 0;

  & .search {
    padding: 0.3em 0.3em 0.3em 23px;
    font-size: .85em;
    font-family: var(--font-sans);
    width: 90%;
    border-radius: .5em;
    background-clip: padding-box;
    box-shadow: whitesmoke 0 1px;
    background: rgba(255, 255, 255, 0.5) url("/images/search.png") 4px 50% no-repeat;
    border: 1px solid var(--sidebar-border);
    color: #888;

    &:focus {
      color: #444;
      border-color: #80b1df;
      box-shadow: #80b1df 0 0 4px, #80b1df 0 0 3px inset;
      background-color: #fff;
      outline: none;
    }
  }
}

@media only screen and (min-width: 768px) {
  .toggle-sidebar {
    outline: none;
    position: absolute;
    right: -10px;
    top: 0;
    bottom: 0;
    display: inline-block;
    text-decoration: none;
    color: #cdcdcd;
    width: 9px;
    cursor: pointer;

    &:hover {
      background: #e7e7e7;
      background: linear-gradient(to right, rgba(222, 222, 222, 0.5), rgba(222, 222, 222, 0));
    }

    &:after {
      position: absolute;
      right: -11px;
      top: 0;
      width: 20px;
      font-size: 1.2em;
      line-height: 1.1em;
      padding-bottom: .15em;
      border-bottom-right-radius: .3em;
      text-align: center;
      background: var(--main-bg) var(--noise-bg);
      border-bottom: 1px solid var(--sidebar-border);
      border-right: 1px solid var(--sidebar-border);
      content: "\00BB";
      text-indent: -1px;
    }

    .collapse-sidebar & {
      text-indent: 0;
      right: -20px;
      width: 19px;

      &:hover { background: #e7e7e7; }

      &:after {
        border-left: 1px solid var(--sidebar-border);
        text-shadow: #fff 0 1px;
        content: "\00AB";
        left: 0;
        right: 0;
        text-align: center;
        text-indent: 0;
        border: 0;
        background: none;
      }
    }
  }
}

/* =====================================================================
   Footer
   ===================================================================== */

body > footer {
  font-family: var(--font-sans);
  font-size: .8em;
  color: var(--footer-color);
  text-shadow: var(--footer-text-shadow) 0 1px;
  background-color: var(--footer-bg);
  background: url("/images/noise.png"), var(--footer-bg-gradient);
  border-top: 1px solid var(--footer-border-top);
  position: relative;
  padding-top: 1em;
  padding-bottom: 1em;
  margin-bottom: 3em;
  border-bottom-left-radius: .4em;
  border-bottom-right-radius: .4em;
  z-index: 1;

  & a {
    color: var(--footer-link-color);

    &:hover   { color: var(--footer-link-color-hover); }
    &:visited { color: var(--footer-link-color); }
  }

  & p:last-child { margin-bottom: 0; }
}

/* =====================================================================
   Disqus
   ===================================================================== */

#disqus_thread {
  font-size: 0.85em;
}
