/* General */
body {
  margin: 0;
  line-height: 1.5;
  font-family: helvetica, arial, sans-serif;
  overflow-wrap: break-word;
}

h1, h2, h3, h4, h5, h6 {
  margin-bottom: 0;
  margin-top: 1em;
}

h1 + p, h2 + p, h3 + p, h4 + p, h5 + p, h6 + p {
  margin-top: 0.5em;
}

audio {
  min-width: 75%;
  max-width: 100%;
}

figure {
  text-align: center;
  margin: 1.5em 0;
}

figure img, figure video {
  max-width: 100%;
}

figcaption {
  font-size: small;
}


/* Code */
pre, code, samp, kbd {
  font-family: monospace,monospace;
  font-size: 0.9em;
}

pre code, pre samp, pre kbd {
  font-size: 1em;
}

pre {
  padding: 0.5em;
  overflow: auto;
}

p kbd {
  border: thin solid;
  border-radius: 0.2em;
  padding: 0.1em 0.2em;
}

pre .cursor {
  border-bottom: 0.2em solid;
}


/* Blockquote */
blockquote {
  border-left: medium solid;
  margin-right: 0;
  margin-left: 0;
  padding: 0.5em;
}


/* Layout */
header, main, footer {
  max-width: 42em;
  margin-left: auto;
  margin-right: auto;
  padding: 0 1em;
}

hr {
  max-width: 44em;
  margin: 1em auto;
  border: 0;
  border-bottom: thin dotted gray;
}


/* Links */
a:link, a:visited {
  text-decoration: none
}

a:hover, a:active {
  text-decoration: underline
}

.links a {
  font-size: small;
  font-weight: bold;
  margin-right: 1em;
}

.links a:last-child {
  margin-right: 0;
}

/* Footer */
footer .links a {
  font-size: medium;
  font-weight: normal;
  margin-top: 1em;
  margin-bottom: 1em;
}

footer .links, footer .icons {
  margin-top: 1em;
  margin-bottom: 1em;
}

footer .icons a {
  margin-right: 0.5em;
}

footer .icons a:last-child {
  margin-right: 0;
}

footer .icons img {
  height: 1.25em;
}


/* Blog Listing */
ul.posts {
  padding-left: 1em;
}


/* Post */
.meta {
  font-size: small;
  font-style: italic;
}


/* Comments */
.comment h2 {
  font-size: 1em;
  margin-top: 0;
}

.comment :last-child {
  margin-bottom: 0;
}

.comment {
  border: thin solid;
  padding: 0.625em;
  margin: 1em 0;
}

.comment.author {
  border-width: medium;
  border-style: double;
}


/* Home page */
p.summary {
  margin-bottom: 0.25em;
}

.all {
  margin-top: 1em;
}


/* Remove margins from content in container elements. */
blockquote *:first-child, td *:first-child, .highlight *:first-child {
  margin-top: 0;
}

blockquote *:last-child, td *:last-child, .highlight *:last-child {
  margin-bottom: 0;
}


/* Generic text centering */
.textcenter {
  text-align: center;
}

/* Generic block element centering */
.center {
  margin-left: auto;
  margin-right: auto;
}

/* Highlight Box */
.highlight {
  /* Should be similar to pre style */
  padding: 0.5em;
}


/* Plain Table */
table {
  margin-top: 1em;
  margin-bottom: 1em;
}

th {
  text-align: left;
}

th, td {
  padding-right: 1.0em;
}


/* Grid Table */
table.grid {
  border-collapse: collapse;
}

table.grid th, table.grid td {
  border-width: thin;
  border-style: solid;
}

table.grid th, table.grid td {
  padding: 0.3em 0.4em;
}

/* Ruled Table */
table.ruled {
  border-collapse: collapse;
  border-top-width: medium;
  border-top-style: double;
  border-bottom-width: medium;
  border-bottom-style: double;
}

table.ruled thead {
  border-bottom-width: medium;
  border-bottom-style: double;
}

table.ruled tr {
  border-bottom-width: thin;
  border-bottom-style: solid;
}

table.ruled th, table.ruled td {
  padding: 0.3em 0.4em;
}

/* Top-align table content */
table.top td {
  vertical-align: top;
}

/* Email */
.email {
  border: thin solid gray;
  margin-top: 1em;
  margin-bottom: 1em;
}

.email .header, .email .body {
  margin: 1em;
}

noscript div {
  border: medium double #900;
  color: #900;
  padding-left: 1em;
  padding-right: 1em;
}


/* Colors */
body,
h1 a:link, h1 a:visited,
h2 a:link, h2 a:visited,
h3 a:link, h3 a:visited,
h4 a:link, h4 a:visited,
h5 a:link, h5 a:visited,
h6 a:link, h6 a:visited,
.links a:link, .links a:visited,
.posts a:link, .posts a:visited
{
  color: #333;
}

h1 a:hover, h1 a:active,
h2 a:hover, h2 a:active,
h3 a:hover, h3 a:active,
h4 a:hover, h4 a:active,
h5 a:hover, h5 a:active,
h6 a:hover, h6 a:active,
.links a:hover, .links a:active,
.posts a:hover, .posts a:active
{
  color: #555;
}

body.dark {
  background: #222;
}

body.dark,
.dark h1 a:link, .dark h1 a:visited,
.dark h2 a:link, .dark h2 a:visited,
.dark h3 a:link, .dark h3 a:visited,
.dark h4 a:link, .dark h4 a:visited,
.dark h5 a:link, .dark h5 a:visited,
.dark h6 a:link, .dark h6 a:visited,
.dark .links a:link, .dark .links a:visited,
.dark .posts a:link, .dark .posts a:visited
{
  color: #aaa;
}

.dark h1 a:hover, .dark h1 a:active,
.dark h2 a:hover, .dark h2 a:active,
.dark h3 a:hover, .dark h3 a:active,
.dark h4 a:hover, .dark h4 a:active,
.dark h5 a:hover, .dark h5 a:active,
.dark h6 a:hover, .dark h6 a:active,
.dark .links a:hover, .dark .links a:active,
.dark .posts a:hover, .dark .posts a:active
{
  color: #ccc;
}

/* Image background */
.soft img {
  opacity: 0.8; /* 1 - 0x33 / 0xff */
}

.dark .soft img {
  opacity: 0.667; /* 0xaa / 0xff */
}

/* Code and quote colors */
pre, code, samp, kbd {
  color: #006;
}

pre, blockquote {
  background: #eee;
}

p kbd {
  background: #eee;
  border-color: #ccc;
  border-bottom-color: #999;
  box-shadow: 0 0.15em 0.15em #999;
}

pre kbd {
  color: #050;
}

.dark pre, .dark code, .dark samp, .dark kbd {
  color: #6cf;
}

.dark pre, .dark blockquote {
  background: #111;
}

.dark p kbd {
  background: #111;
  border-color: #444;
  border-bottom-color: #333;
  box-shadow: 0 0.15em 0.15em #333;
}

.dark pre kbd {
  color: #9c9;
}

/* Quote border colors */
blockquote {
  border-left-color: #ccc;
}

.dark blockquote {
  border-left-color: #444;
}

/* Highlight colors */
.highlight {
  background: #eef;
}

.dark .highlight {
  background: #112;
  color: #bbb;
}

/* Link colors */
a:link, a:visited {
  color: #03c;
}

a:hover, a:active {
  color: #03f;
}

.dark a:link, .dark a:visited {
  color: #7ae;
}

.dark a:hover, .dark a:active {
  color: #8bf;
}

/* Meta link colors */
.meta, .meta a:link, .meta a:visited {
  color: #555;
}

.meta a:hover, .meta a:active {
  color: #333;
}

.dark .meta, .dark .meta a:link, .dark .meta a:visited {
  color: #999;
}

.dark .meta a:hover, .dark .meta a:active {
  color: #aaa;
}

/* Comment border colors */
.comment {
  border-color: #666;
}

.dark .comment {
  border-color: #999;
}

/* Form colors */
.dark input, .dark textarea, .dark button {
  background: #111;
  color: #bbb;
  border-color: #666;
}

/* Social media icon colors */
.icons img {
  opacity: 0.8; /* 1 - 0x33 / 0xff */
}

.icons img:hover {
  opacity: 0.6; /* 1 - 0x66 / 0xff */
}

.dark .icons img {
  opacity: 1;
  filter: invert(0.667); /* 0xaa / 0xff */
}

.dark .icons img:hover {
  opacity: 1;
  filter: invert(0.8);  /* 0xcc / 0xff */
}


/* Table rule colors */
table, thead, tr, th, td {
  border-color: #666;
}

.dark table, .dark thead, .dark tr, .dark th, .dark td {
  border-color: #999;
}
