* {
  box-sizing: border-box;
  text-rendering: optimizelegibility;
  padding: 0;
  margin: 0;
}

body {
  background: white;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection {
  background: #fff0b9;
}

/* Header styles */
header {
  font-family: 'Roboto Condensed', sans-serif;
  font-weight: 300;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(0,0,0,0.1);
  padding: 1.25rem 1.5rem;
}

header a {
  text-decoration: none;
  color: darkgreen;
}

header #title h1 {
  font-family: 'Open Sans Condensed', sans-serif;
  font-size: 38px;
  font-weight: 700;
  font-style: normal;
  border-bottom: 1px solid transparent;
  margin-left: -1px;
}

header #title h1:hover {
  border-bottom: 1px solid darkseagreen;
}

header #title h2 {
  font-weight: 300;
  font-size: 17px;
  color: darkgray;
  letter-spacing: 0.4px;
}

header nav a.active {
  border-bottom: 1px solid darkseagreen;
}

header nav a {
  border-bottom: 1px solid transparent;
  display: inline-block;
  margin-right: 1rem;
  font-size: 18px;
}

header nav a:hover {
  border-bottom: 1px solid darkseagreen;
}

header nav a:last-child { margin-right: 0; }

/* Body styles */
section#main {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

article {
  width: 700px;
  font-family: 'Source Serif Pro', serif;
  font-size: 21px;
  color: rgba(0, 0, 0, 0.6);
  line-height: 1.6;
  margin-bottom: 3rem;
}

article a {
  color: rgba(0, 0, 0, 0.5);
}

article a:hover {
  color: forestgreen;
}

article a.wiki {
  text-decoration-style: dotted;
}

article img, article iframe {
  width: 100%;
}

article img.floatright {
  float: right;
  width: 50%;
  padding: 1rem;
  padding-right: 0rem;
}

article img.floatleft {
  float: left;
  width: 50%;
  padding: 1rem;
  padding-left: 0rem;
}

article img.center {
  padding: 1rem;
  width: auto;
  max-width: 100%;
  display: block;
  margin: 0 auto;
}

article h1.title {
  display: inline-block;
  font-size: 2.5rem;
  margin-top: 3rem;
  color: rgba(0, 0, 0, 0.8);
}

article:first-child h1.title {
  margin-top: 1rem;
}

article h1.title:hover {
  color: forestgreen;
}

article h1, article h2, article h3 {
  font-family: 'Open Sans Condensed', sans-serif;
  margin-top: 2rem;
  font-size: 2rem;
  font-style: normal;
  font-weight: 700;
}

article h3 {
  font-size: 1.7rem;
}

article p {
  letter-spacing: 0.15px;
  margin: 1rem 0;
}

article strong {
  font-weight: 700;
}

article pre {
  font-family: 'Inconsolata', monospace;
  font-size: 1.1rem;
  margin: 1rem 0;
  padding: 0.5rem;
  overflow: auto;
  border: solid 1px #ddd;
  border-radius: 2px;
  background: #f7f7f7;
}

article code {
  font-family: 'Inconsolata', monospace;
}

article ul, article ol {
  margin-left: 1.5rem;
}

article .subfooter {
  padding-top: 2rem;
  clear: both;
  font-family: 'Roboto Condensed', sans-serif;
}

article time.published {
  display: block;
  font-size: 1.3rem;
  color: rgba(0,0,0,0.5);
}

article .tombstone {
  float: right;
  transform: scale(2);
}

article .readmore {
  color: darkgreen;
  font-family: 'Roboto Condensed', sans-serif;
  float: right;
  text-decoration: none;
}
article .readmore:hover {
  color: rgba(0,0,0,0.5);
}

article blockquote {
  margin: 2rem;
  font-size: 1.5rem;
  opacity: 0.7;
  font-style: italic;
}

/* Footer styles */
footer {
  font-family: 'Roboto Condensed', sans-serif;
  font-weight: 300;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(0,0,0,0.1);
  padding: 1rem;
  color: darkgreen;
  margin-top: 5rem;
}

footer nav a {
  display: inline-block;
  margin-right: 1rem;
  text-decoration: none;
  color: darkgreen;
  border-bottom: 1px solid transparent;
}
footer nav a:hover {
  border-bottom: 1px solid darkseagreen;
}

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

/* Masonry.js related styles */
section#gallery-header {
  margin: 1rem auto;
  width: 700px;
  font-family: 'Source Serif Pro', serif;
  font-size: 1.4rem;
  color: rgba(0, 0, 0, 0.7);
  line-height: 1.5;
}
section#gallery {
  margin: 2rem auto;
}

section#gallery:after {
  clear: both;
  content: '';
}

section#gallery .item {
  display: flex;
  align-items: center;
  justify-content: center;

  font-family: 'Roboto Condensed', sans-serif;
  font-weight: 300;
  overflow: hidden;
  box-sizing: border-box;
  box-shadow: 0px 0px 10px rgba(0,0,0, 0.1);
}

section#gallery .item a {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  text-decoration: none;

  background-position: center;
  transition: transform 0.2s ease-in, -webkit-filter 0.2s ease-in;
  transform: scale(1);
  -webkit-filter: brightness(100%);
  filter: brightness(100%);
}

section#gallery .item:hover a {
  transform: scale(1.04);
  -webkit-filter: brightness(50%);
  filter: brightness(50%);
}

section#gallery .item label {
  color: white;
  font-size: 2em;
  text-align: center;
  opacity: 0;
  transition: opacity 0.2s ease-in-out;
  z-index: 1;
  cursor: pointer;
  pointer-events: none;
}

section#gallery .item:hover label {
  opacity: 1;
  background: black;
  padding: 4px 16px;
}

section#gallery .item time {
  color: white;
  position: absolute;
  bottom: 10px;
  right: 10px;
  opacity: 0;
  transition: opacity 0.2s ease-in-out;
  cursor: pointer;
}

section#gallery .item:hover time {
  opacity: 1;
}

section#gallery .item.sample {
  width: 320px;
  height: 240px;
}

/* About section image. */
#image-me {
  opacity: 0.1;
  position: fixed;
  left: 0;
  bottom: 0;
  z-index: -1;
  width: inherit;
}

/* Archives section */
section#archives ol {
  width: 700px;
  margin: 2rem auto;
  font-family: 'Source Serif Pro', serif;
  font-size: 1.5rem;
}

section#archives li {
  list-style-type: none;
  clear: both;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}
section#archives li:last-child {
  border-bottom: 0;
}

section#archives a {
  color: black;
  text-decoration: none;
  position: relative;
  display: block;
}


section#archives .title {
  display: inline-block;
  line-height: 1.2;
  margin-right: 6rem;
}

section#archives a:hover .title {
  color: darkseagreen;
}

section#archives time {
  position: absolute;
  right: 0;
  top: 0;
  color: rgba(0, 0, 0, 0.3);
}

/** Rated archives section */
section#archives .rating {
  position: absolute;
  margin-top: -4px;
  margin-left: -30px;
  opacity: 0.3;
}

hr {
  border: 1px solid #ddd;
  margin: 2em .5em;
}

table {
  border-collapse: collapse;
}
table th {
  font-family: Roboto Condensed,sans-serif;
  font-size: 1.2rem;
  padding: 0.5rem;
  line-height: 1.05;
}
table td {
  text-align: center;
  padding: 0.3rem;
}
table td + td {
  border-left: 1px solid #ccc;
}
table tr + tr {
  border-top: 1px solid #ccc;
}

.comments {
  margin-top: 0.5rem;
  display: none;
}

.resume-header {
  font-size: 32px;
  font-weight: bold;
}

article.type-book h1.title {
  font-size: 2rem;
  margin-top: 1rem;
  color: #444;
}
article.type-book time.published {
  font-size: 1.2rem;
}
article.type-book .subfooter {
  padding-top: 1rem;
}

video {
  max-width: 100%;
}

.book-cover {
  display: block;
  max-height: 400px;
  max-width: 100%;
  width: auto;
  margin: 1em auto;
  box-shadow: 3px 3px 5px #999;
}

/* Media queries to make the page responsive */
@media screen and (max-width: 720px) {

  /* Make the nav vertical */
  header nav a {
    display: block;
    float: left;
    clear: both;
  }

  header, footer {
    padding: 1rem;
  }

  article {
    margin: 0 4px;
    font-size: 1.2rem;
    width: 100%;
  }

  article h1.title {
    font-size: 2rem;
  }

  article.type-book h1.title {
    font-size: 1.5rem;
  }

  section#archives ol {
    width: 100%;
    font-size: 1.3rem;
    padding: 0 1rem;
  }

  section#gallery-header {
    width: 100%;
    padding: 0 1rem;
  }

  section#gallery {
    margin: 0;
  }
}

/* Dark mode 🌙 */
@media (prefers-color-scheme: dark) {
  body {
    color: #eee;
    background: #121212;
  }

  article, p {
    color: rgba(255, 255, 255, 0.6);
  }

  body a {
    color: #80ff80bd;
  }

  article h1.title {
    color: rgba(255, 255, 255, 0.9);
  }

  article.type-book h1.title {
    color: rgba(255, 255, 255, 0.7);
  }

  article .readmore {
    color: inherit;
  }
  article .readmore:hover {
    color: inherit;
  }

  article time.published {
    color: rgba(255, 255, 255,0.5);
  }

  section#archives a, section#gallery .item time {
    color: white;
  }

  section#archives time {
    color: rgba(255, 255, 255, 0.4);
  }

  .book-cover {
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 1);
  }

  ::selection {
    background: #413d2f;
  }
}
