/*
Theme Name: Khanlou
Theme URI: http://khanlou.com/
Description: Theme for the khanlou.com blog.
Author: Soroush Khanlou
Version: 1.0
License: No permission granted for use
Tags: white, lots of text
*/


/* css reset */
html, body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, code, del, dfn, em, img, q, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td {margin:0;padding:0;border:0;font-weight:inherit;font-style:inherit;font-size:100%;font-family:inherit;vertical-align:baseline;}
body {line-height:1.5;}
table {border-collapse:separate;border-spacing:0;}
caption, th, td {text-align:left;font-weight:normal;}
table, td, th {vertical-align:middle;}
blockquote:before, blockquote:after, q:before, q:after {content:"";}
blockquote, q {quotes:"" "";}
a img {border:none;}

/* typography css */
body {font-size:85%;color:#222; font-family:"Helvetica Neue", Helvetica, Arial, sans-serif;}
h1, h2, h3, h4, h5, h6 {font-weight:bold;color:#111;}
h1 {font-size:1.8em;line-height:1;margin-top:0.5em;}
h2 {font-size:1.3em; }
h3 {font-size:1.2em;line-height:1;}
h4 {font-size:1em;margin-top: 0.5em;}
h5 {font-size:1em;font-weight:bold;margin-top:1.5em;}
h6 {font-size:1em;font-weight:bold;}
h1 img, h2 img, h3 img, h4 img, h5 img, h6 img {margin:0;}
p {margin:0 0 1.5em 0;}
p img.left {float:left;margin:1.5em 1.5em 1.5em 0;padding:0;}
p img.right {float:right;margin:1.5em 0 1.5em 1.5em;}
a:focus, a:hover {color:#868686;}
a {color:#0f3bc8;text-decoration:underline;}
blockquote {margin:1.5em;color:#666;font-style:italic;}
strong {font-weight:bold;}
em, dfn {font-style:italic;}
dfn {font-weight:bold;}
sup, sub {line-height:0;}
abbr, acronym {border-bottom:1px dotted #666;}
address {margin:0 0 1.5em;font-style:italic;}
del {color:#666;}
pre {margin:1.5em 0;white-space:pre;}
pre, code, tt, pre span {font:1em 'menlo', 'andale mono', 'lucida console', monospace;line-height:1.5;}
li ul, li ol {margin:0 1.5em;}
ul, ol {margin:0 0 1.5em 1.5em;}
ul {list-style-type:disc;}
ol {list-style-type:decimal;}
dl {margin:0 0 1.5em 0;}
dl dt {font-weight:bold;}
dd {margin-left:1.5em;}
table {margin-bottom:1.4em;width:100%;}
th {font-weight:bold;}
thead th {background:#c3d9ff;}
th, td {background:#e5ecf9; padding: 2px;}
tr:nth-of-type(even) td {background:#fff;}
tfoot {font-style:italic;}
caption {background:#eee;}
.small {font-size:.8em;margin-bottom:1.875em;line-height:1.875em;}
.large {font-size:1.2em;line-height:2.5em;margin-bottom:1.25em;}
.hide {display:none;}
.quiet {color:#666;}
.loud {color:#000;}
.highlight {background:#ff0;}
.added {background:#060;color:#fff;}
.removed {background:#900;color:#fff;}
.first {margin-left:0;padding-left:0;}
.last {margin-right:0;padding-right:0;}
.top {margin-top:0;padding-top:0;}
.bottom {margin-bottom:0;padding-bottom:0;}
a:active { outline: none !important; }
:focus {-moz-outline-style: none;}
/* forms.css */
label {font-weight:bold;}
fieldset {padding:1.4em;margin:0 0 1.5em 0;border:1px solid #ccc;}
legend {font-weight:bold;font-size:1.2em;}
input[type=text], input[type=password], input.text, input.title, textarea, select {background-color:#fff;border:1px solid #bbb;font-size:1em;}
input[type=text]:focus, input[type=password]:focus, input.text:focus, input.title:focus, textarea:focus, select:focus {border-color:#666;}
input.text, input.title {width:300px;padding:5px;}
input.title {font-size:1.5em;}
textarea {width:390px;height:250px;padding:5px;}
input[type=checkbox], input[type=radio], input.checkbox, input.radio {position:relative;top:.25em;}
form.inline {line-height:3;}
form.inline p {margin-bottom:0;}
.error, .notice, .success {padding:.8em;margin-bottom:1em;border:2px solid #ddd;}
.error {background:#FBE3E4;color:#8a1f11;border-color:#FBC2C4;}
.notice {background:#FFF6BF;color:#514721;border-color:#FFD324;}
.success {background:#E6EFC2;color:#264409;border-color:#C6D880;}
.error a {color:#8a1f11;}
.notice a {color:#514721;}
.success a {color:#264409;}

.clearfix:after, .container:after {content:"\0020";display:block;height:0;clear:both;visibility:hidden;overflow:hidden;}
.clearfix, .container {display:block;}
.clear {clear:both;}
.center{text-align: center;}

body {
  font-size:100%;
}

body img, body .wp-caption {
  max-width: 100%;
}

#page {
  max-width: 800px;
  width: 100%;
  margin: auto;
}


#header h1 {
  text-transform: uppercase;
  font-size: 1.5em;
  text-align: center;
  margin: 30px auto;
}

#header h1 a {
  text-decoration: none;
  color: #aaa;
  font-size: 1.0em;
}

.blogpost h2 {
  font-weight: bold;
  font-size: 2.0em;
}

h2 a {
  color: #333;
  text-decoration: none;
}

#primary {
  float: left;
  width: 90%;
  padding: 0 5%;
}

#secondary {
  width: 100%;
  margin: 0 auto;
  font-size: 100%;
  padding: 20px 0;
}

#secondary > li {
  list-style: none;
  display: block;
  float: left;
}

#secondary li#text-3 {
  width: 21%;
  margin: 0 2%;
}

#secondary li.widget_archive {
  float: right;
  width: 21%;
  margin: 0 2%;
}

#secondary li#text-2 {
  width: 46%;
  margin: 0 2%;
}

#secondary li#text-4 {
  text-align: right;
  width: 90%;
  margin: 0 5%
}


#secondary img {
  display: block;
  margin: auto;
}

#secondary h2 {
  font-size: 1.2em;
  background-color: #eee;
}

#content {
  padding:  0;
}

#content li p {
    margin-bottom: 0;
}

#secondary form label {
  display: none;
}

#secondary form input[type="text"] {
  width: 100px;
}

.blogpost {
  margin-bottom: 50px;
  padding-bottom: 50px;
  border-bottom: thin solid #333;
}

.blogpost .timestamp {
  float: right;
  color: #666;
  margin: 0px;
  margin-left: 5px;
  margin-top: 10px;
}

td.number-type, th.number-type {
    text-align: right;
}

.aligncenter {
  display: block;
  margin: auto;
}

.wp-caption {
  border: 1px solid #ddd;
  text-align: center;
  background-color: #f3f3f3;
  padding-top: 4px;
  margin: 0 auto 1.5em auto;
  -moz-border-radius: 3px;
  -khtml-border-radius: 3px;
  -webkit-border-radius: 3px;
  border-radius: 3px;
}
.wp-caption img {
  margin: 0;
  padding: 0;
  border: 0 none;
  width: 98% !important;
  height: inherit !important;
  
}

.wp-caption p.wp-caption-text {
  font-size: 11px;
  line-height: 17px;
  padding: 0 4px 5px;
  margin: 0;
}

.blogpost a {
  white-space: pre-wrap !important;
  word-wrap: break-word !important;

}

.blogpost pre, .blogpost code {
  tab-size: 4;
  padding: 0px 5px;
  white-space: nowrap;
  border: 1px solid #dedede;
  background-color: #f8f8f8;
  border-radius: 3px;
  font-size: 0.9em !important;
  font-family: Menlo, monospace !important;
  white-space: pre-wrap !important;
  word-wrap: break-word !important;
}

.blogpost pre {
  white-space: pre-wrap !important;
  word-wrap: break-word !important;
}

.blogpost pre code {
  padding: 0px;
  white-space: pre-wrap !important;
  word-wrap: break-word !important;
  border: none;
}

.blogpost pre span {
  white-space: pre-wrap !important;
  word-wrap: break-word !important;
}

.blogpost a code {
  color: #0f3bc8;
}

.blogpost a code:hover {
  color: #868686;
}

.more-link {
   display: none;
}

.wp_syntax {
  border: none !important;
  background: none !important;
}

td.code {
  background: white;
}

.navigation {
  text-align: center;
  margin-bottom: 2em;
}

ul#navigation {
  margin: 0;
}

ul#navigation li {
  list-style: none;
  float: left;
  padding: 0 15px;
}

ul#navigation a {
  color: #333;
  text-decoration: none;
}

ul#navigation li.selected {
  background-color: #777;
  border-radius: 10px;
  box-shadow: 0px -1px 0px black;
}

ul#navigation li.selected a {
  color: white;
  text-shadow: 0px 1px 0px black;
}

ul#navigation li a:hover {
  color: #999;
}



@media screen and (max-width:600px) {

  #secondary li#text-3 {
    width: 46%;
    margin: 0 2%;
  }
  
  #secondary li.widget_archive {
    float: right;
    width: 46%;
    margin: 0 2%;
  }
  
  #secondary li#text-2 {
    width: 90%;
    margin: 0 5%;
    margin-top: 20px;
  }
}

@media screen and (min-width:1200px) {
  #page {
    width: 1200px;
    max-width: 1200px;
    margin: auto;
  }
  
  #main {
    position: relative;
  }

  #primary {
    width: 720px;
    padding: 0px 100px;
    margin-left: 140px;
  }

  #secondary {
    float: left;
    width: 180px;
    border-radius: 8px;
    position: fixed;
    left: 50%;
    margin-left:380px;
    top: 20px;
  }
  
  #secondary li#text-3, #secondary li.widget_archive, #secondary li#text-2{
    width: 90%;
    padding: 0 5%;
    margin: 0;
    margin-bottom: 40px;
  }
  
  .blogpost:last-child {
    border: none;
  }
}

@media screen and (prefers-color-scheme: dark) {
  body {
    background-color: #222;
    color: #ddd;
  }

  th, td {
    background-color: #222;
  }

  thead th { background-color: #333;}

  tr:nth-of-type(even) td { background-color: #333; }

  h1, h2, h3, h4, h5, h6 {font-weight:bold;color:#eee;}

  blockquote {
    color: #999;
  }
  
  a {
    color: #59adee
  }
  
  h2 {
    color: #eee;
  }
  
  .blogpost h2 a {
    color: #eee;
  }
  
  .blogpost .timestamp {
    color: #888;
  }
  
  .blogpost pre, .blogpost code {
    border: 1px solid #555;
    background-color: #333;
  }

  .blogpost a code {
    color: #59adee;
  }

  .blogpost a code:hover {
    color: #868686;
  }
  
  #secondary {
    background-color: #444;
  }
  
  ul#navigation a {
    color: #999;
  }
  
  ul#navigation li a:hover {
    color: #eee;
  }
  
}

@media screen and (max-width:1200px) and (prefers-color-scheme: dark) {
  #secondary {
    background-color: #222;
  }
}
