/*!
 * Writ v0.2.1
 *
 * Copyright © 2015, Curtis McEnroe <curtis@cmcenroe.me>
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 *
 */

/* Fonts & Colors: fonts chosen from http://www.cssfontstack.com */

body {
  /*font-family: Georgia, Palatino, Lucida Bright, Book Antiqua, serif;*/
  font-size: 14px;
  color: #222;
}

* { line-height: 1.5em; }

/* Wrapped headings should be slightly tighter */
h1, h2, h3, h4, h5, h6 { line-height: 1.25em; }

code, pre, samp, kbd {
  font-family: Consolas, Liberation Mono, Menlo, Courier, monospace;
  color: #111;
}

kbd { font-weight: bold; }

/* Layout */

body { margin: 0; }

body > header { margin: 0 0 3em; }

body > article {
  max-width: 100ch;
  margin: auto;
  padding: 0 2ch 1em;
  /* For aside */
  position: relative;
}

body > article figure {
  float: right;
  margin: 0 0 0.5em 2ch;
}

body > article aside {
  position: absolute;
  left: 100%;
  width: 25ch;
  padding: 0 1ch;
  /* To align with p */
  margin-top: 0.5em;
}

/* Layout Visual */

body > header { text-align: center; }

body > article aside {
  /* To get border on screen when aside is off */
  margin-left: -1ch;
  border-left: solid 0.5ch #eee;
}

/* Copy Vertical Spacing */

h1, h2, h3, h4, h5, h6 { margin: 0.75em 0 0; }

p, ul, ol, dl, table, blockquote, pre { margin: 0.5em 0 0; }

ul ul, ol ol { margin-top: 0; }

/* With p margin, like a skipped line */
hr { margin: 1.5em 0 0; }

/* Font sizes */

h1, h2, h3, h4, h5, h6 { font-weight: normal; }

h1 { font-size: 2.25em;; }
h2 { font-size: 1.75em; }
h3 { font-size: 1.5em; }
h4 { font-size: 1.25em; }
h5 { font-size: 1.15em; }
h6 { font-size: 1em; }

small { font-size: 0.85em; }

/* Copy Blocks */

hr {
  border: none;
}

blockquote {
  margin-right: 3ch;

  margin-left: 1.5ch;
  border-left: solid 0.5ch #eee;
  padding: 0 0 0 1ch;
}

pre {
  padding: 5px;
  background-color: #eee;
  border: solid 1px #ddd;
  border-radius: 2px;
  font-size: 0.85em;

  overflow-x: auto;
}
pre code {
  padding: 0;
  border: none;
  background-color: transparent;
  font-size: inherit;
  white-space: inherit;
}

img { max-width: 100%; }

/* Lists */

ul, ol, dd { padding: 0 0 0 3ch; }

dd { margin: 0; }

ul li { list-style-type: disc; }
ul li li { list-style-type: circle; }
ul li li li { list-style-type: square; }

ol li { list-style-type: decimal; }
ol li li { list-style-type: lower-roman; }
ol li li li { list-style-type: lower-alpha; }

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

nav ul li {
  display: inline;
  padding-left: 1ch;
}

/* Tables */

table {
  width: 100%;
  overflow-x: auto;

  border-collapse: collapse;
}

th, td {
  padding: 3px;
  border: solid 1px #ddd;
}

thead, tfoot {
  background-color: #eee;
}

/* Copy Inline */

a {
  text-decoration: none;
  color: #00e;
}

a:visited { color: #60b; }

/* Don't color visited nav links */
nav a:visited { color: #00e; }

/* Smallcaps */
abbr { font-size: 2ex; }

sup, sub {
  font-size: 0.75em;
  /* To not mess up line spacing */
  line-height: 1em;
}

ins {
  text-decoration: none;
  padding: 1px;
  border: solid 1px #eee;
}

code, samp {
  padding: 0.1em 0.2em;
  background-color: #eee;
  border: solid 1px #ddd;
  border-radius: 2px;
  font-size: 0.85em;

  white-space: nowrap;
}

mark {
  padding: 1px;
  background-color: #fe0;
  color: inherit;
}
