/**
 * Contains entire article including title, published date, bodies and comments
 */
main > article {
  max-width:      44em;
  width:          100%;
  font-size:      1.1em;
  display:        -webkit-flex;
  display:        flex;
  -webkit-flex-direction: column;
  flex-direction: column;
  -webkit-align-items: center;
  align-items:    center;
}

@media all and (max-width: 850px) {
  main > article {
    font-size: 1em;
  }
}

/**
 * The article when in editing mode can contain two bodies (markdown+html)
 * so can double in width to accomodate them both
 */
main > article.editing {
  max-width: 88em;
}

/**
 * Title
 */
.page-title {
  position: relative;
}

article.editing .page-title {
  border: 1px solid #eee;
}

.page-title + em {
  text-align: center;
}

@media all and (max-width: 850px) {
  .page-title + em {
    font-size: 0.9em;
    margin-bottom: -0.5em;
  }
}

@media all and (max-width: 700px) {
  .page-title + em {
    font-size: 0.8em;
    margin-bottom: -1em;
  }
}

/**
 * Wraps HTML body, and also markdown body when in editing mode
 */
main > article .post-bodies {
  display: -webkit-flex;
  display:          flex;
  -webkit-justify-content: space-between;
  justify-content:  space-between;
  -webkit-align-self: stretch;
  align-self:       stretch;
}

/**
 * Both bodies
 */
main > article .post-body {
  max-width:   44em;
  -webkit-flex-grow: 1;
  flex-grow:   1;
  line-height: 2;
  word-wrap:   break-word;
  margin-top:  1em;
}

main > article .post-body p {
  line-height: 2.3;
}

main > article .post-body img {
  float:        left;
  margin-right: 1em;
}

/**
 * Both bodies when in editing mode
 */
main > article.editing .post-body {
  min-height: 2em;
  -webkit-flex-grow: 1;
  flex-grow:  1;
  display:    inline-block;
  border:     1px solid #eee;
  width:      100%;
  height:     100%;
  padding:    1em;
}

main > article.editing .post-body > *:first-child {
  margin-top: 0;
}

main > article .post-body.md {
  margin-left: 1em;
}
main > article .post-body.md > * {
  white-space:  pre-wrap;
  font-family:  monospace;
  font-size:    1.1em;
  width:        100%;
  height:       100%;
  display:      inline-block;
}

/**
 * Code blocks
 */
main > article code {
  display:          block;
  padding:          1em;
  background-color: #f7f7f7;
  white-space:      pre-wrap;
  position:         relative;
  overflow:         hidden;

  overflow-wrap:  break-word;
  -ms-word-break: break-all;
  word-break:     break-all;
  word-break:     break-word;
}

main > article code::after {
  content:          '';
  position:         absolute;
  top:              -1em;
  right:            -1em;
  width:            2em;
  height:           2em;
  transform:        rotate(45deg);
  background-color: rgba(155,155,255,0.15);
}

/**
 * Control Panel
 */
body:not(.with-js) main > article > .cp {
  display: none;
}
main > article > .cp {
  display: -webkit-flex;
  display:          flex;
  opacity:          0.75;
  position:         fixed;
  bottom:           0;
  right:            0;
  border-radius:    0.5em 0 0 0;
  background-color: #444;
  padding:          1em;
  -webkit-flex-direction: column;
  flex-direction:   column;
  overflow:         hidden;
  transition:       opacity 0.2s linear;
}

main > article > .cp:hover {
  opacity: 1;
}

main > article > .cp::before {
  content:        'Control Panel';
  margin-bottom:  0.6em;
  font-size:      1.2em;
  text-align:     center;
  color:          white;
}

main > article > .cp::after {
  content:          ' ';
  position:         absolute;
  top:              -1em;
  left:             -1em;
  transform:        rotate(45deg);
  background-color: #B9323D;
  width:            2em;
  height:           2em;
}
body.logged-in main > article > .cp::after {
  background-color: #3DB932;
}

/*

Google Code style (c) Aahan Krish <geekpanth3r@gmail.com>

*/

.hljs {
  display:    block;
  overflow-x: auto;
  padding:    0.5em;
  background: white;
  color:      black;
}

.hljs-comment,
.hljs-quote {
  color: #800;
}

.hljs-keyword,
.hljs-selector-tag,
.hljs-section,
.hljs-title,
.hljs-name {
  color: #008;
}

.hljs-variable,
.hljs-template-variable {
  color: #660;
}

.hljs-string,
.hljs-selector-attr,
.hljs-selector-pseudo,
.hljs-regexp {
  color: #080;
}

.hljs-literal,
.hljs-symbol,
.hljs-bullet,
.hljs-meta,
.hljs-number,
.hljs-link {
  color: #066;
}

.hljs-title,
.hljs-doctag,
.hljs-type,
.hljs-attr,
.hljs-built_in,
.hljs-builtin-name,
.hljs-params {
  color: #606;
}

.hljs-attribute,
.hljs-subst {
  color: #000;
}

.hljs-formula {
  background-color: #eee;
  font-style: italic;
}

.hljs-selector-id,
.hljs-selector-class {
  color: #9B703F
}

.hljs-addition {
  background-color: #baeeba;
}

.hljs-deletion {
  background-color: #ffc8bd;
}

.hljs-doctag,
.hljs-strong {
  font-weight: bold;
}

.hljs-emphasis {
  font-style: italic;
}
