/* ============================================
   Design Tokens (replaces @import + $variables)
   ============================================ */
:root {
  /* Imported from 'colors' and 'dimensions' — fill these in from those files */
  --mobile-threshold: 900px;

  --c1: #1695A3;
  --c2: #EA2E49;
  --c3: #F0F0F0;
  --navbar-color: #374140;
  --footer-color: --c3;
  --footer-font-color: #555555;
  --greyed-out: #999;

  --code-border: #CCC;
  --code-background: #EEEEEE;


  --header-font: 'Droid Serif', serif;
  --body-font: 'Open Sans', sans-serif;
  --body-color: #222222;
  --logo-font: "DejaVu Sans Mono", Monospace;
  --nav-links-font: "DejaVu Sans Mono", Monospace;
  --nav-padding: 2px;
  --font-size: 1em;
  --line-height: 1.6em;
  --max-site-width: 640px;
}

/* ============================================
   Base
   ============================================ */
html {
  overflow-y: scroll;
}

html, body {
  height: 100%;
}

body {
  display: flex;
  margin: 0px;
  min-height: 100vh;
  flex-direction: column;
  background-color: var(--c3);
}

/* ============================================
   Layout
   ============================================ */

.container {
  width: var(--max-site-width);
  margin-right: auto;
  margin-left: auto;
}

/* ============================================
   Links
   ============================================ */
a {
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  cursor: pointer;
}

/* ============================================
   Header / Navbar
   ============================================ */
header.navbar {
  background-color: var(--navbar-color);
}

header.navbar .container {
  padding-left: 5px;
  padding-right: 5px;
}

header.navbar .container nav {
  display: inline-block;
  float: right;
  vertical-align: bottom;
  padding: var(--nav-padding);
}

header.navbar .container nav .nav-links {
  color: var(--c3);
  font-family: var(--nav-links-font);
}

header.navbar .container nav a {
  display: inline-block;
  padding: 6px 10px 0px 10px;
}

header.navbar .container #logo {
  display: inline-block;
  font-size: 1.6em;
  padding: var(--nav-padding);
  font-family: var(--logo-font);
}

header.navbar .container #logo a:hover {
  text-decoration: none;
}

header.navbar .container #logo #logo-xiao {
  color: var(--c1);
}

header.navbar .container #logo #logo-di {
  color: var(--c2);
  position: relative;
  top: 1px;
}

header.navbar .container #logo #logo-li {
  color: var(--c3);
}

/* ============================================
   Main Content
   ============================================ */
main {
  width: var(--max-site-width);
  margin-right: auto;
  margin-left: auto;
  padding: 0px 5% 2em 5%;
  font-family: var(--body-font);
  font-size: var(--font-size);
  line-height: var(--line-height);
  color: var(--body-color);
  flex: 1;
}

main h1 {
  font-family: var(--header-font);
  font-weight: normal;
}

main h2,
main h3 {
  font-family: var(--header-font);
  font-weight: normal;
  color: var(--navbar-color);
}

main a,
main a:visited {
  color: var(--c1);
}

/* Inline code */
code {
  position: relative;
  bottom: 2px;
  border: 1px solid var(--code-border);
  padding: 1px 3px;
  white-space: nowrap;
  color: var(--c2);
  background: var(--code-background);
}

/* Block code */
pre {
  position: relative;
  bottom: 2px;
  border: 1px solid var(--code-border);
  border-left: 1em solid var(--c2);
  padding: 1em 1em;
  background: var(--code-background);
}

/* ============================================
   Footer
   ============================================ */
footer {
  background-color: var(--footer-color);
  height: 2em;
}

footer > div.container {
  text-align: center;
  font-family: var(--body-font);
  color: var(--footer-font-color);
  padding: 5px 10px 5px 10px;
}

footer div.container small.footer-message > a {
  color: var(--footer-font-color);
}

/* ============================================
   Figures / Pictures
   ============================================ */
.figure {
  text-align: center;
  width: 100%;
}

.figure p img {
  text-align: center;
  width: 95%;
}

.figure p {
  font-style: italic;
  text-align: center;
}

/*
Reduces the space between the image and the caption text:

div.figure
  p
    img
  p
    span
*/
.figure > p:nth-child(1) {
  margin-bottom: 0em;
}

.figure > p:nth-child(2) {
  margin-top: 0em;
}

/* https://emacs.stackexchange.com/questions/17619/how-can-i-turn-off-numbering-for-figures */
.figure-number {
    display: none;
}
/* ============================================
   Syntax Highlighting (highlight.js)
   ============================================ */
.hljs-string,
.hljs-string a,
.hljs-string a:visited {
  color: var(--c2);
}

.hljs-attr {
  color: var(--c2);
}

/* ============================================
   Code with Annotation
   ============================================ */
.code-with-annotation {
  overflow-y: auto;
}

.code-with-annotation pre {
  background: white;
}

.code-with-annotation div.annotation {
  text-align: center;
  font-style: italic;
}

/* ============================================
   Mobile / Responsive
   ============================================ */
@media screen
  and (max-width: 900px)
  and (-webkit-min-device-pixel-ratio: 3),
  (-webkit-min-device-pixel-ratio: 2)
  and (orientation: portrait) {

  .container {
    width: auto !important;
    padding-left: 5% !important;
    padding-right: 5% !important;
  }

  main {
    width: auto !important;
    font-size: 0.8em !important;
  }

  header #logo {
    font-size: 1.2em !important;
  }

  header nav {
    font-size: 0.8em !important;
  }

  header nav a {
    padding: 4px 0px 0px 4px !important;
  }

  small.footer-message {
    font-size: xx-small !important;
  }

  figure.picture {
    padding-bottom: 1em !important;
    padding-top: 1em !important;
    margin-bottom: 0px !important;
  }
}


/* For handling of orgmode generated footnotes e.g. [fn:1] */
p.footpara,div.footpara { display: inline; }
a.footnum:before { content: "["; }
a.footnum:after { content: "]"; }
a.footref:before { content: "["; }
a.footref:after { content: "]"; }
