/* Imports */
@import url("fonts.css");
@import url("pygment.css");

/* Layout */
article, figcaption, figure, footer, header, nav, section, time {
  display: block;
}

html {
  font-size: 100%;
  -ms-text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Source Sans Pro', sans-serif;
  line-height: 150%;
  text-align: left;
  padding: 0;
  min-width: auto;
  background: linear-gradient(0deg, #FFFFFF, #FEFEFE) repeat scroll 0% 0% transparent;
  margin: 0 25%;
}

header {
  border-top: 4px solid #090596;
  border-bottom: 4px solid #090596;
  height: 50px;
  line-height: 50px;
  padding: 0 1em;
  margin-bottom: 1.5em;
  margin-top: 0.25em;
}

.wrapper {
  display: flex;
  width: 100%;
  flex-direction: row;
}

.content {
  width: 75%;
  padding: 0 20px 1em 20px;
  order: 1;
}

.sidebar {
  width: 25%;
  padding: 0 20px 1em 3%;  
  order: 2;
}

footer {
  border-top: 1px dotted #D6D6D6;
  line-height: 30px;
  padding: 0 1em;
  font-size: 0.8em;
  text-align: center;
}

/* Header */
header a {
  border-bottom: none;
}

header a.title {
  font-size: 1.5em;
}

header .feeds a {
  display: block;
  float: right;
  padding-right: 5px;
  width: 30px;
}

header .feeds a:hover,
header .feeds a:active {
  border-bottom: none;
}

header .pages {
  float: right;
  padding-right: 20px;
}

header .pages a {
  font-size: 1.1em;
  margin-left: 0.5em;
}

/* Sidebar */
#sidebar-container-fixed.sticky {
  padding-bottom: 100px;
  position: fixed;
  top: 85px;
  transition: opacity 3s ease-in-out 0s;
}

.sidebar ol,
.sidebar ul {
  margin-left: 0;
  color: #4D4D4C;
}

/* Titles */
h1 a {
  color: inherit;
  border-bottom: none;
}

/* Texts */
a {
  text-decoration: none;
  border-bottom: 1px dotted #4D4D4C;
  color: #4D4D4C;
  transition: color 0.2s, border-color 0.2s;
}

a:hover, a:active {
  text-decoration: none;
  border-bottom: 1px dotted #4271AE;
  color: #4271AE;
}

.literal {
  border: 1px solid #F0F0F0;
  padding: 0px 5px;
}

pre {
  font-family: 'Source Code Pro', monospace;
  background: #F0F0F0;
  border-radius: 2px;
  font-size: 0.9em;
  font-style: normal;
  letter-spacing: 0.015em;
  line-height: 130%;
  padding: 0.7em;
  white-space: pre-wrap;
  word-wrap: break-word;
}

hr {
  margin: 40px 5% 60px 5%;
  color: #d6d6d6;
  box-shadow: 0.1em 0.1em 0.1em #EFEFEF;
  border-radius: 5px;
}

/* Article */
article.summary {
  margin-bottom: 40px;
  clear: both;
}

article.summary > div {
  margin-left: 28%;
}

article.full .metadata,
article.summary .metadata {
  padding: 1%;
  font-style: italic;
  text-align: right;
}

article.full .metadata {
  width: 25%;
  float: right;
  margin: 0 0 2% 1%;
}

article.summary .metadata {
  width: 23%;
  float: left;
  margin: 0 1% 2% 0;
}

.metadata p,
.metadata address {
  margin: 0;
  text-align: right;
}

/* Listings */
ol.archive li {
  margin: 8px 0;
}

ol.archive li time,
ol.archive li .tags {
  line-height: 140%;
  font-size: 0.8em;
  margin: 0;
}

/* Social */
.social {
  list-style-type: none;
  padding-left: 20px;
}

.social li {
  clear: both;
}

.social a {}

.social i { 
  float: left;
  margin-right: 3px;
  padding-top: 4px;
}

.social a[href*='twitter.com'] + i:before { content: url('../images/icons/twitter-18px.png'); }
.social a[href*='linkedin.com'] + i:before { content: url('../images/icons/linkedin-18px.png'); }
.social a[href*='github.com'] + i:before { content: url('../images/icons/github-18px.png'); }
.social a[href*='stackoverflow.com'] + i:before { content: url('../images/icons/stackoverflow-18px.png'); }
.social a[href*='rss.xml'] + i:before,
.social a[href*='atom.xml'] + i:before { content: url('../images/icons/feed-18px.png'); }
.social a[href*='paypal.me'] + i:before { content: url('../images/icons/paypal-18px.png'); }

/* Tag cloud */
ul.tagcloud {
  list-style: none;
  padding: 0;
  width: 50%;
  margin: 0 auto;
  line-height: 200%;
}

ul.tagcloud li {
  display: inline-block;
}

li.tag-1 { font-size: 175%; margin: 0 1em; }
li.tag-2 { font-size: 150%; margin: 0 1em; }
li.tag-3 { font-size: 125%; margin: 0 1em; }
li.tag-4 { font-size: 110%; margin: 0 1em; }

/* Pagination */
.pagination {
  width: 100px;
  margin: 1em auto;
}

/* Light TinyTypo overrides */
.box {
  border-color: #D6D6D6;
}

.box.only-list ul,
.box.only-list ol {
  margin-top: 0;
}

/* Table styling */
table {
  border-collapse: collapse;
  width: 100%;
  margin: 1.5em 0;
  font-family: 'Source Sans Pro', sans-serif;
  color: #40403F;
  line-height: 1.5;
  background-color: #F9F9F9;
  border: 1px solid #E5E5E3;
  border-radius: 4px;
  overflow: hidden;
}

table th,
table td {
  padding: 0.75em 1em;
  text-align: left;
  border-bottom: 1px solid #E5E5E3;
}

table th {
  background-color: #E5E5E3;
  font-weight: 600;
  color: #40403F;
}

caption {
  caption-side: bottom;
  text-align: center;
  font-size: 0.85em;
  color: #7F7F7E;
  padding-top: 0.5em;
}

@media (max-width: 979px) {
  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  body {
    margin: 0 4%;
  }
}

/* Global link color */
a {
  color: #061C30;
  text-decoration: none;
  border-bottom: 2px dotted #090696;
}

a:hover {
  color: #090596;
  border-bottom: 1px dotted #4271AE;
}

/* About section */
.about {
  display: flex;
}

.about .text {
  width: 100%;
  align-items: flex-start;
}

.about .portrait {
  width: 50%;
  aspect-ratio: 1/1;
  border: solid 2px #090596;
  align-items: flex-end;
  justify-content: center;
  border-radius: 100%;
}

.about img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 60%;
  display: block;
}

mjx-container {
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
  box-sizing: border-box;
}

/* Desktop: Sidebar on the right */
@media (min-width: 768px) {
  .wrapper {
    flex-direction: row; /* Main content first, sidebar second */
    width: 100%;

  }

  .content {
    width: 75%;
    order: 1;
  }

  .sidebar {
    width: 25%;
    order: 2;
  }
}

/* Mobile */
@media (max-width: 767px) {
  body {
    margin: 0 2%;
    font-size: 0.95em;
  }

  header {
    height: auto;
    line-height: 1.4;
    padding: 1em;
    text-align: center;
  }

  header nav {
    margin-top: 1em;
  }

  header .pages,
  header .feeds {
    float: none;
    text-align: center;
    padding: 0;
  }

  .wrapper {
    flex-direction: column; /* Stack vertically */
    width: 90%;
  }

  .sidebar {
    width: 100%;
    order: 2;
  }

  .sidebar aside p {
    text-align: center;
  }

  .sidebar::before {
    content: "";
    display: block;
    width: 100%;
    height: 1px;
    margin: 1em 0;
    background-color: #ccc;
  }

  .content {
    width: 100%;
    order: 1;
  }

  article.full .metadata,
  article.summary .metadata {
    float: none;
    width: 100%;
    text-align: center;
  }

  article.summary > div {
    margin-left: 0;
  }

  article.full .metadata * {
    text-align: center;
  }

  article.full h1 {
    text-align: center;
    text-wrap: wrap;
  }

  .pagination {
    width: auto;
    text-align: center;
  }

  ul.tagcloud {
    width: 100%;
  }

  .about {
    flex-direction: column;
  }

  .about .portrait {
    width: 60%;
    margin: 0 auto 1em auto;
  }

  #sidebar-container-fixed.sticky {
    position: static;
    padding-bottom: 0;
  }
}
