/* Colors and fonts*/
:root {
  --lightgray: #e0e0e0;
  --gray: #C0C0C0;
  --darkgray: #333;
  --navy: #17050F;
  --blue: #082840;
  --white: #fff;
  --whitesmoke: whitesmoke;
  --red: #ca2017;
  --heading-family: 'Playfair Display', serif;
  --post-main-font-family: 'Georgia', serif;
}

/* Global stylesheet */
* {
  box-sizing: border-box;
}

html,
body {
  padding: 0;
  margin: 0;
  font-family: -apple-system, system-ui, sans-serif;
  color: var(--darkgray);
  background-color: var(--whitesmoke);
}
p:last-child {
  margin-bottom: 0;
}
p,
.tmpl-post li,
img {
  max-width: 50em;
}
p,
.tmpl-post li {
  line-height: 1.45;
}
a[href] {
  color: var(--blue);
}
a[href]:visited {
  color: var(--navy);
}
main {
  padding: 1rem;
}

.tmpl-post {
  background: white;
  width: 60%;
  max-width: 960px;
  margin: -100px auto;
  padding-left: 5%;
  padding-right: 5%;
}

@media screen and (min-width: 801px) and (max-width: 1260px) {
  .tmpl-post {
    width: 80%;
  }
}

@media screen and (min-width: 601px) and (max-width: 800px) {
  .tmpl-post {
    width: 90%;
  }
}

.tmpl-post h1 {
  font-family: var(--heading-family);
  font-size: 44px;
}



@media screen and (max-width: 600px) {
  .tmpl-post {
    width: 100%;
  }
  .tmpl-post h1 {
    font-size: 33px;
  }
}

.tmpl-post p, .tmpl-post ul, .tmpl-post ol {
  text-align: justify;
}

.tmpl-post .divider {
  border-top: #333 solid 1px;
}

.tmpl-post img {
  display: block;
  margin-top: 2em;
  max-width: 100%;
}

header {
  border-bottom: 1px dashed var(--lightgray);
}
header:after {
  content: "";
  display: table;
  clear: both;
}
table {
  margin: 1em 0;
}
table td,
table th {
  padding-right: 1em;
}

pre,
code {
  font-family: Consolas, Menlo, Monaco, "Andale Mono WT", "Andale Mono", "Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Liberation Mono", "Nimbus Mono L", "Courier New", Courier, monospace;
  line-height: 1.5;
}
pre {
  font-size: 14px;
  line-height: 1.375;
  direction: ltr;
  text-align: left;
  white-space: pre;
  word-spacing: normal;
  word-break: normal;
  -moz-tab-size: 2;
  -o-tab-size: 2;
  tab-size: 2;
  -webkit-hyphens: none;
  -moz-hyphens: none;
  -ms-hyphens: none;
  hyphens: none;
  padding: 1em;
  margin: .5em 0;
  background-color: #f6f6f6;
}
code {
  word-break: break-all;
}

/* Header */
.home {
  padding: 0 1rem;
  margin: 1rem 0; /* 16px /16 */
  font-size: 2em; /* 16px /16 */
  font-family: var(--heading-family);
}

.home-container {
  text-align: center;
}

.home :link:not(:hover) {
  text-decoration: none;
}

.header-image {
  background-image: url('../img/header.webp'), url('../img/header1024.webp'), url('../img/header512.webp');
  height: 40vh;
  background-size: cover;
  background-position-x: center;
  background-position-y: 40%;
}

@media screen and (max-width: 550px) {
  .header-image {
    background-position-y: 40%;
    height: 30vh;
  }
}

@media screen and (max-width: 920px) and (min-width: 551px){
  .header-image {
    height: 40vh;
    background-position-y: unset;
  }
}

@media screen and (max-width: 1500px) and (min-width: 921px) {
  .header-image {
    background-position-y: 40%;
  }
}

/* Nav */
.nav {
  padding: 0;
  list-style: none;
  margin-left: 1em;
}
.nav-item {
  display: inline-block;
  margin-right: 1em;
}
.nav-item a[href]:not(:hover) {
  text-decoration: none;
}
.nav-item-active {
  font-weight: 700;
  text-decoration: underline;
}

/* grid */
.container-grid {
  display: grid;
  grid-template-columns: 70% 30%;
}

/* flex container with recent posts*/
.recent-posts-full {
  grid-column: 1;
  padding: 10px;
  margin: -100px 10%;
  max-height: 200vh;
  display: flex;
  flex-direction:column;
}

.archive-posts {
  grid-column: 1;
  padding: 30px;
  margin: 0 10%;
  max-height: 200vh;
  display: flex;
  flex-direction:column;
  border: 1px solid var(--lightgray);
  background-color: var(--white);
}

.archive-posts h1 {
  font-family: var(--heading-family);
}

/* flex container with short recent posts and tags*/
.side-column {
  grid-column: 2;
}

@media screen and (max-width: 1450px) {
  .recent-posts-full {
    margin: -100px 5%;
  }
}

@media screen and (min-width: 931px) {
  .tag-list-bottom {
    display: none;
  }
}

@media screen and (max-width: 930px) {
  .side-column {
    display: none;
  }
  .container-grid {
    display: grid;
    grid-template-columns: 100%;
    padding-left:0;
    padding-right: 0;
  }
  .tag-list-bottom {
    display: unset;
    padding-bottom: 2em;
    padding: 0.5em;
  }
  .recent-posts-full {
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
  }

  .archive-posts {
    margin: -100px 0;
  }
}


/* full posts at home page*/
.post-item {
  margin: 1%;
  padding: 1em 3em;
  border: 1px solid var(--lightgray);
  background-color: var(--white);
}

.post-item .post-tags {
  padding-bottom: 1em;
}

.post-item p, .post-item ol, .post-item ul {
  font-family: var(--post-main-font-family);
  font-size: larger;
  text-align: justify;
}

.post-item img {
  max-width: 100%;
}

h1.post-title {
  font-family: var(--heading-family);
  padding-top: 0.5em;
  font-size: 44px;
}

.link-to-archive {
  margin-top: 1em;
  padding-bottom: 2em;
  padding: 0.5em;
}


/* recent posts at home page*/
.side-column h2, .tag-list-bottom h2 {
  border-bottom: 2px solid var(--red);
  display: inline-block;
  font-variant: small-caps;
}

.recent-posts li {
  list-style:none;
}

.recent-posts ul {
  padding-left: 20px;
}

.recent-posts .recent-post-icon {
  background-color: var(--white);
  display: block;
  background-color: #fff;
  border: 1px solid #eee;
  border-radius: 99px;
  height: 55px;
  padding: 2px;
  width: 55px;
}

.recent-posts .recent-post-icon:hover {
  box-shadow: 2px 2px 5px rgba(202, 32, 23, 0.1);
}

.recent-post-icon img {
  filter: invert(15%) sepia(55%) saturate(4551%) hue-rotate(351deg) brightness(115%) contrast(99%);
  left: 34%;
  position: relative;
  top: 34%;
}

.recent-posts .postlist-link {
  padding-left: .25em;
  padding-right: .25em;
  text-decoration: none;
  display: grid;
  grid-template-columns: 80px auto;
}

.recent-posts .post-container {
  margin-top: 7px
}

.recent-posts .post-container .post-heading {
  font-family: var(--heading-family);
  text-decoration: underline;
}


.recent-posts .post-container .postlist-date {
  text-decoration: none;
}

@media screen and (max-width: 930px) {
  .post-item {
    margin: 0;
    padding: 1em 1em;
  }

  h1.post-title {
    font-size: 33px;
  }
}


/* Generic posts list */
.postlist {
  list-style: none;
  padding: 0;
}

.postlist-item {
  line-height: 1.8;
  margin-top: 1em;
}
.postlist-item:before {
  display: inline-block;
  pointer-events: none;
  line-height: 100%;
  text-align: right;
}
.postlist-date {
  font-size: 0.8125em; /* 13px /16 */
  color: var(--darkgray);
}
.postlist-date {
  word-spacing: -0.5px;
}
.postlist-link {
  padding-left: .25em;
  padding-right: .25em;
  text-underline-position: from-font;
  text-underline-offset: 0;
  text-decoration-thickness: 1px;
}
.postlist-item-active .postlist-link {
  font-weight: bold;
}
.recent-posts-full .postlist-link {
  font-size: 1.1875em; /* 19px /16 */
  font-weight: 700;

}

.postlist-item-title {
  font-size: large;
  font-family: var(--heading-family);

}


/* Tags */
.post-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  font-size: 0.75em; /* 12px /16 */
  padding: 0.08333333333333em 0.3333333333333em; /* 1px 4px /12 */
  margin-left: 0.6666666666667em; /* 8px /12 */
  margin-top: 0.5em; /* 6px /12 */
  margin-bottom: 0.5em; /* 6px /12 */
  color: var(--darkgray);
  border: 1px solid var(--gray);
  border-radius: 0.25em; /* 3px /12 */
  text-decoration: none;
  line-height: 1.8;
}
a[href].post-tag,
a[href].post-tag:visited {
  color: inherit;
}
a[href].post-tag:hover,
a[href].post-tag:focus {
  background-color: var(--lightgray);
}
.postlist-item > .post-tag {
  align-self: center;
}

/* Warning */
.warning {
  background-color: #ffc;
  padding: 1em 0.625em; /* 16px 10px /16 */
}
.warning ol:only-child {
  margin: 0;
}

/* Direct Links / Markdown Headers */
.direct-link {
  font-family: sans-serif;
  text-decoration: none;
  font-style: normal;
  margin-left: .1em;
}
a[href].direct-link,
a[href].direct-link:visited {
  color: transparent;
}
a[href].direct-link:focus,
a[href].direct-link:focus:visited,
:hover > a[href].direct-link,
:hover > a[href].direct-link:visited {
  color: #aaa;
}
