/* CSS variables */
:root {
  --base-font-family: "Lucida Grande", Tahoma, Verdana, Roboto, sans-serif;
  --serif-font-family: Georgia, Times, "Times New Roman", serif;
  
  --base-font-size:   100%; /* 16px */
  --small-font-size:  calc(var(--base-font-size) * 0.875);
  --base-line-height: 1.5; /* bootstrap 4 = 1.15/1.5x, normalize = 1.15x (feels too small)*/
  
  /* padding */
  --spacing-unit:     30px;
  --left-right-padding: 1em; /* was 130px */
  

  /* BLOCKQUOTE box */
  --quote-color:    gray;
  --quote-margin-color: gray;
  --quote-bg-color: rgba(0,0,0,.1);
  
  /* main COLORS */
  --text-color:       #000;
  --bg-color: #fdfdfd;
  /* --brand-color:      #2a7ae2; */
  /* --primary-color:      #2a7ae2; */
  /* --primary-light-color: #99b9e2; */
  /* --primary-color:     hsl(214,76%,53%) ; */
  /* --primary-light-color: hsl(214,76%,95%); */
  /* --primary-dark-color: hsl(214,76%,25%); */

  /* new darker blue: #0e0e8e */
  --primary-color: hsl(240,82%,31%);
  --primary-light-color: hsl(240,82%,95%);
  --primary-dark-color: hsl(240,82%,11%);

  
  --footer-bg-color: #ccc;
  
  /* --heading-color: #ddd;  /* h1-h6 */ */

  /* columns  */
  --two-column-main-width: 70%;
  --two-column-sidebar-width: 35%;

  /* tags and category */
  --category-text-color: white;
  --tag-bg-color: #AAA;
  --category-bg-color: #888;
  
  /* Code */
  --code-font-family: consolas, menlo, monaco, 'andale mono', monospace;
  --code-font-size: 16px;
  
  /* --header-height: 250px; */
  --header-height: 25vmin; /* scalable */
  /* if vmin causes problem, switch to calc(16px + 1vw) */

  /* --article-title-padding: 50px 0; */

  /* make site title scale with resolution, with maximum of 5% */
  /* --site-title-font-size: 3em;   */
  --site-title-font-size: 5vmin;  /* was 3em */
  /* if vmin causes problem, switch to calc(16px+1vw) */

  /* Width of the content area */
  /* no longer used */
  /* --content-width:   1000px;  */
  /* --max-content-width: 1600px; */
  
  /* not used, as it is hard-coded below */
  /* --on-palm:          640px; */

  /* not used, as it is hard-coded below */
  /* --on-laptop:        1000px;  */
  
  /* // Twitter, Github, RSS icons (inline SVG) */
  --social-icon-color: Gray; 

}
/**
 * CSS Reset some basic elements
 */
/* body, h1, h2, h3, h4, h5, h6, */
/* p, blockquote, pre, hr, */
/* dl, dd, ol, ul, figure { */
/*   margin: 0; */
/*   padding: 0; } */

/* CSS Reset - based on Meyer's CSS Reset */
	html, body, div, span, applet, object, iframe,
	h1, h2, h3, h4, h5, h6, p, blockquote, pre,
	a, abbr, acronym, address, big, cite, code,
	del, dfn, em, img, ins, kbd, q, s, samp,
	small, strike, strong, sub, sup, tt, var,
	b, u, i, center,
	dl, dt, dd, ol, ul, li,
	fieldset, form, label, legend,
	table, caption, tbody, tfoot, thead, tr, th, td,
	article, aside, canvas, details, embed, 
	figure, figcaption, footer, header, hgroup, 
	menu, nav, output, ruby, section, summary,
	time, mark, audio, video {
		margin: 0;
		padding: 0;
		border: 0;
		font-size: 100%;
		font: inherit;
		vertical-align: baseline;
	}
  /* ol, ul { list-style: none; } */

	blockquote, q { quotes: none; }
	blockquote:before, blockquote:after,
	q:before, q:after {
		content: '';
		content: none;
	}
	table {
		border-collapse: collapse;
		border-spacing: 0;
	}

/* enable sane box model */
/* https://css-tricks.com/inheriting-box-sizing-probably-slightly-better-best-practice/ */
html { box-sizing: border-box; }
*, *:before, *:after { box-sizing: inherit; }


/**
 * Basic styling
 */
body {
  font-family: var(--base-font-family);
  font-size: var(--base-font-size);
  line-height: var(--base-line-height);
  font-weight: normal; /* 400 */
  color: var(--text-color);
  background-color: var(--bg-color);
  -webkit-text-size-adjust: 100%; 
  min-width: 320px; 
}

/**
 * Set `margin-bottom` to maintain vertical rhythm
 * Disabled - currently to make it more compact
 * usually it's about 15px margin...
 */
/*
h1, h2, h3, h4, h5, h6,
p, blockquote, pre,
ul, ol, dl, figure,
.highlight {
  margin-bottom: calc(var(--spacing-unit)/2);
}
*/

/**
 * Images
 */
img {
  max-width: 100%;
  /* ensures responsiveness of image */
  vertical-align: middle; }

/**
 * Figures
 */
figure > img {
  display: block; }

figcaption {
  font-size: 14px; }

/**
 * Lists
 */
ul, ol {
  margin-left: var(--spacing-unit); }

li > ul,
li > ol {
  margin-bottom: 0; }

/**
 * Headings
 */
h1, h2, h3, h4, h5, h6 {
  font-weight: normal; /* 400;*/ 
  color: var(--primary-dark-color);
}

h1 {
  font-size: 1.5rem;
  text-transform: capitalize;
  font-family: var(--serif-font-family);
  border-bottom: 1px solid #eee; 
  /* font-weight: bold; */
}

h2 {
  font-size: 1.3rem; }

h3, h4, h5, h6 {
  font-size: 1.2rem; }

/* Add padding to h1 since it looks strange without it
	TODO: move this to .article-list/title instead?
	h1,h2 is also used commonly for markdown text, 
	so I used similar style from github's markdown examples.
*/
h1, h2 {
  margin-top: 1em; }

/* h1, draw line after text */

/**
 * Links
 */
a {
  /* color: var(--brand-color); */
  color: var(--primary-color);
  text-decoration: none; }
  a:hover {
    /* color: var(--primary-dark-color); */
    color: var(--primary-color);
    text-decoration: underline; }

/**
 * Blockquotes
 */
blockquote {
  color: var(--quote-color);
  /* background-color: var(--primary-light-color); */
  background-color: var(--quote-bg-color);
  /* border-left: 4px solid var(--quote-margin-color); */
  /* font-size: 18px; */
  /* letter-spacing: -1px; */
  /* padding-right: calc(var(--spacing-unit)/2); */
  font-style: italic; 
  border-radius: 5px;

  border-left: 4px solid var(--quote-margin-color);
  /* remove - Looked ugly for sidebar */
  padding-left: calc(var(--spacing-unit)/2);
  /* border-left: 4px solid var(--quote-margin-color); */

  /* OLD */
  /* padding-left: 0px; */
  
}
  /* blockquote > :last-child { margin-bottom: 0; }  */

/* element after 1-blockquote only */
:not(blockquote) > blockquote >:not(blockquote)  {
  padding-left: calc(var(--spacing-unit)/2);
  padding-right: calc(var(--spacing-unit)/2);
}
/* elements after 2-blockquotes only */
:not(blockquote) > blockquote > blockquote >:not(blockquote) {
  padding-left: calc(var(--spacing-unit)/2);
  padding-right: calc(var(--spacing-unit)/2);
}
/* special case: 3 blockquotes indicate special aside */
/* for column on the right side */
:not(blockquote) > blockquote > blockquote > blockquote, #TableOfContents, #TOC-header, #TOC-button {
  /* brand-color was too dark, so lighter version of it */
  background-color: var(--primary-light-color);
  border: 1px solid var(--primary-color);
  font-style: normal; 
  color: var(--text-color);
  /* padding-right: 1rem;  float: right;  width: 40%;  clear: right;  margin: 1px; */
  border-radius: 5px;
  margin-left: calc(var(--spacing-unit)/2);
  margin-bottom: 0.5em;
  
  /* margin-right: calc(var(--spacing-unit)/2); */
  padding-left: calc(var(--spacing-unit)/2);
  padding-right: calc(var(--spacing-unit)/2);
}

/* Table of Contents TOC styling */

/* Hide all TOC item H3-H6 */
/* this was the only way to hide TOC H3-H6 because it was not configurable in Hugo TOC */
#TableOfContents > ul > li > ul > li > ul  * { display: none; }

/* fix problem where h3-h6 exists without h1,h2 - orphan lists */
/* this highlights problem h3-h6 */
#TableOfContents > ul > li > ul > li > ul {background-color: red; }

#TableOfContents > ul { color: var(--primary-color);}
#TableOfContents > ul { list-style-type: decimal;}
#TableOfContents > ul > li > ul { list-style-type: lower-alpha;}

/* #TableOfContents::before { */
/*   font-family: var(--serif-font-family); */
/*   font-weight: bold; */
/* } */

#TableOfContents {
  border-radius: 0px;
  /* border-top-width: 0px; */
  margin-top: 0px;
  /* padding-top: 0px; */
  /* display: var(--TOC-display); */

  /* in Mobile view, hide the TOC by default */
  display: none;
}

/* #TOC-header { */
/*   margin-bottom: 0px; */
/*   padding-top: 0px; */
/*   border-bottom-width: 2px; */
/*   border-radius: 0px; */
/* } */

#TOC-button {
  /* border:0; */
  font-family: var(--serif-font-family);
  font-size: 1em;
  font-style: normal; 
  color: var(--primary-light-color);
  background-color: var(--primary-color);
  /* color: var(--text-color); */
  /* background-color: var(--primary-light-color); */
  border-bottom-width: 0px ;
  margin-bottom: 0px;
  padding-top: 0px;
  /* border-bottom-width: 2px; */
  border-radius: 0px;
  /* border: 1px solid var(--primary-color); */
}
#TOC-button::after {
  /* font-family: var(--serif-font-family); */
  /* border-bottom: 1px solid black; */
  /* color: var(--primary-color); */
  font-size: 10px;
  content:  var(--TOC-text);
  
}

/**
 * Definition list
 * Used similar to AsciiDoc's admonition
 */
dl {
  /* margin: 1rem; */
  padding: 1rem;
  background-color: var(--primary-light-color);
  border: 1px solid var(--primary-color);
  border-radius: 5px;
  display:block;
}
dt {
  /* float: left; */
  /* width: 3rem; */

  /* clear: left; */
  /* text-align: right; */
  /* font-weight: bold; */
  /* font-size: 2.5rem; */
}
dd {
  /* margin: 0 0 0 3rem; */
  padding-left: 1em;
  /* border-width: 1px; */
  border-left-width: 1em;
  border-color: var(--primary-color);
  border-style: ridge;
  /* not needed? */
  /* padding: 0 0 0.5em 0; */
}

/**
 * Code formatting
 *
 *
 */
pre,
code {
  font-family: var(--code-font-family);
  font-size: var(--code-font-size);
  border: 1px solid lightGray;
  border-radius: 5px;
  color: lightGray;
  padding: 8px 12px;
  overflow-x: auto;
  white-space: pre-wrap; /* enable word-wrap  */
  /* background-color: #222; */
  background-color: initial; /* allow Chroma/pygment color to show and not be overriden */
  }

code{
  background-color: #444;
  padding: 1px 3px;
}

pre{
}
  pre > code {
    border: 0;
    background-color: initial; /* allow Chroma/pygment color to show and not be overriden */
    padding-right: 0;
    padding-left: 0; 
  }

/**
 * Icons
 Renamed from .icon to .social-icon
 */
.social-icon > svg {
  display: inline-block;
  width: 16px;
  height: 16px;
  vertical-align: middle; }
  .social-icon > svg path {
    fill: var(--social-icon-color); }

/* wraps around main area, including content and sidebar */
/* responsive */
/* default, including phone, narrow layout */
main {
    width: 100%;
    /* temp testing*/
    /* background-color: green; */
    
  margin-right: auto;
  margin-left: auto;

  /* padding-left: var(--left-right-padding); */
  /* padding-right: var(--left-right-padding); */

  /* padding-left: calc(var(--left-right-padding) + 2%); */
  /* padding-right: calc(var(--left-right-padding) + 2%); */
  padding: 1em calc(var(--left-right-padding) + 2%);
}
    
aside {
  box-sizing: border-box;
  margin: 1rem;
  /* padding: 20px;  */
  padding: 1rem; 
  background-color: #FEF;
  border-radius: 20px;
  box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
}

.two-column-content {
  width: 100%; }

/*********************** NORMAL layout, make it 2 column ********************/
@media screen and (min-width: 640px) {
  /* TODO: arbitrary for now */
  /* :root { */
    /* --left-right-padding: 120px; */
  /* } */
  
  main {
    /* width: 100%; */

    /* this is set in wrapper */
    /* margin: 0 auto; */

    /* padding: 20px; */

    /* temp testing*/
    /* width: 70%; */
    
  }
  
  .two-column-content {
    width: var(--two-column-main-width);
    /* float: left; */
  }

  aside {
    width: var(--two-column-sidebar-width); /* width: 30%; */
    /* Move the floated box higher, looks better especially if it's on right side */
    position: relative;
    /* move floated box higher */
    top: -100px; 
    margin-top: 100px;  
    /* increase top margin to match above*/
    /* remove excess space below, since box moved higher up */
    /* margin-bottom: -150px;  */
    float: right;
    box-sizing: content-box;
  } 
  
  /* show indentations with various depths */
  blockquote {
    /* padding-left: calc(var(--spacing-unit)/2); */
    /* padding-right: calc(var(--spacing-unit)/2); */

    /* border-left: 4px solid var(--quote-margin-color); */
    /* width: 69%; */
  }

  /* Currently not possible to select element except child with same element */
  /* :not(blockquote) > blockquote:??? { */
  /*   background-color:green; */
  /*   padding-left: calc(var(--spacing-unit)/2); */
  /*   padding-right: calc(var(--spacing-unit)/2); */
  /*   border-left: 4px solid var(--quote-margin-color); */
  /*   padding-left: calc(var(--spacing-unit)/2); */
  /*   padding-right: calc(var(--spacing-unit)/2); */
  /* } */

  /* 2 blockquotes only */
  :not(blockquote) > blockquote_OLD2 > blockquote:last-of-type {
    /* background-color:purple; */
    /* padding-right: calc(var(--spacing-unit)/2); */

    border-left: 4px solid var(--quote-margin-color);
    /* padding-left: calc(var(--spacing-unit)/2); */
  }

  /* special case: 3 blockquotes indicate special aside */
  /* make it float right */
  :not(blockquote) > blockquote > blockquote > blockquote, #TableOfContents, #TOC-button {
    /* background-color: red; */
    float: right;
    width: var(--two-column-sidebar-width); /*30%;*/
    clear: both;
    /* padding-left: calc(var(--spacing-unit)/2); */
    /* padding-right: calc(var(--spacing-unit)/2); */
  /* display: block; */
  }

  /* at wide view, always start with showing TOC */
  /* no longer using variable. Instead, using js directly to show/hide */
  /* :root { --TOC-display: block; }  */

  #TableOfContents {
    display: block;
  }

  /* special case: 3 blockquotes indicate special aside */
  /* make it float right */
  :not(blockquote) > blockquote2 > blockquote > blockquote, #TableOfContents, #TOC-button{
    /* background-color: red; */
    float: right;
    width: var(--two-column-sidebar-width); /*30%;*/
    clear: both;
    /* padding-left: calc(var(--spacing-unit)/2); */
    /* padding-right: calc(var(--spacing-unit)/2); */
  }
}

/* Tag Detail page contains multi-column
 May rename to something else, in case tags are not 2 col
*/
.tag-detail {
  -webkit-column-count: 2;
  -moz-column-count: 2;
  column-count: 2; }

/**
 * Wrapper - Original Jekyll wrapperc
	Useful for <main>...</main> content wrapper
	has significant left,right margin
 */
.wrapper_OLD {
  /* max-width: var(--max-content-width); */
  /* min-width: 320px;  */
  /* 320px is considered minimum for modern devices */
  /* disabled auto margin for now, so that I can fit second column on right 
   * for occassional float boxes
   * 70% main, 30% float/right
   */
  margin-right: auto;
  margin-left: auto;
  padding-right: var(--left-right-padding);
  padding-left: var(--left-right-padding);
  padding-bottom: 1em;
  /* background-color: green; */
}

/* mobile and small screen */ 
/* @media screen and (max-width: var(--on-laptop)) { */
/* var doesn't work on @media in CSS yet  */
/* @media screen and (max-width: 1000px) {  */
/*  */
/*     .wrapper { */
/*       padding-right: calc(var(--spacing-unit)); */
/*       padding-left: calc(var(--spacing-unit));  } */
/*  */
/*     } */

/* Clearfix - modern version IE8+ */
.wrapper:after, .group:after, .footer-col-wrapper:after, .main:after {
  content: ""; display: table; clear: both; }

/**
 * Site header
 */
.site-header {
  /* min-height: 56px; */
  position: relative;
  height: var(--header-height); }

.site-header a:link {
  text-decoration: none; }

.site-title {
  font-family: var(--serif-font-family);
  font-size: var(--site-title-font-size);
  /* line-height: 56px; */
  letter-spacing: -1px; /* compact spacing between letters */
  margin-bottom: 0;
  float: left;  /* title on left side of image banner */
  vertical-align: top; /* try to keep site title aligned to top, looks more natural */
  text-shadow: 2px 2px 8px black, -2px -2px 8px black; }

  .site-title, .site-title:visited {
    color: white; }

.article-title-in-header {
  color: white;
  text-transform: capitalize;
  font-family: var(--serif-font-family);
  font-size: 1.5em;
  background-color: rgba(0, 0, 0, 0.55);
  text-shadow: 2px 2px 8px black, -2px -2px 8px black; 
  margin-bottom: 0px;
  width: 100%;
  left: 0px;
  bottom: 0;
  position: absolute;
  text-align: center; }

  /*
.article-title-in-header2 {
  color: white;
  font-size: 1.5em;
  background-color: rgba(0, 0, 0, 0.55);
  margin-bottom: 0px;
  width: 100%;
  left: 0px;
  top: 210px;
  position: absolute;
  text-align: center; }
  */


/* SITE NAVIGATION */
/* Laptop */
@media screen and (min-width: 640px) {
.site-nav {
  float: right;
  line-height: 56px; }
  .site-nav .menu-icon {
    display: none; }
  .site-nav .page-link {
    color: black ;
    line-height: 1.5;
    text-transform: uppercase;
    /* -webkit-text-stroke: 1px white; */
    text-shadow: 2px 2px 8px white, -2px -2px 8px white;
  }

    .site-nav .page-link:not(:first-child) {
      margin-left: 20px; }
}
/* Phone / small screen -- show hamburger menu */
  /* @media screen and (max-width: var(--on-palm)) { */
  @media screen and (max-width: 639.9px) {
    .site-nav {
      z-index:100; /* if not set, NAV was covered by header's sub-title bar */
      position: absolute; top: 9px; right: 30px; /* position of hamburger icon box */
      background-color: var(--bg-color);
      border: 1px solid LightGray;
      border-radius: 5px;
      text-align: right; }
      .site-nav .menu-icon {
        display: block;
        float: right;
        width: 36px;
        height: 26px;
        line-height: 0;
        padding-top: 10px;
        text-align: center; }
        .site-nav .menu-icon > svg {
          /* hamburger menu SVG */
          position: relative; top: -4px; /* tried to center burger vertically */
          width: 18px;
          height: 15px; }
          .site-nav .menu-icon > svg path {
            fill: DarkGray; }
      .site-nav .trigger {
        clear: both;
        display: none; }
      .site-nav:hover .trigger {
        display: block;
        padding-bottom: 5px; }
      .site-nav .page-link {
        display: block;
        padding: 5px 10px; } 
      }

/**
 * Site footer
 */
/* footer except for last line */
.footer-main {
  /* background-color: #ccc; */
  background-color: var(--footer-bg-color);
  padding: 20px 20px 0px 20px; }

.tag-list,
.footer-latest-posts,
.social-media-list {
  list-style: none;
  margin-left: 0; }

.footer-col-wrapper {
  font-size: 15px;
  color: Gray;
  margin-left: calc(-1*var(--spacing-unit)/2); /* unfortunately, this is the only way to negate variable */
  /* margin-left: -15px;  */
}

/* FOOTER normal - 3 columns -  desktop / laptop / wide-view */
.footer-col {
  float: left;
  margin-bottom: 15px;
  padding-left: 15px; }

.footer-col-1 { width: 30%; }
.footer-col-2 { width: 30%; }
.footer-col-3 { width: 40%; }

.footer-last-line {
  font-size: .8em;
  background-color: DarkGray;
  color: Gray;
  text-align: center; }

.footer-last-line a { color: Gray; }

/* Medium view - footers are 2 column */
@media screen and (min-width: 400px) and (max-width: 767.9px)  {
  .footer-col-1,
  .footer-col-2 {
    /* width: -webkit-calc(50% - (30px / 2)); */
    /* width: calc(50% - (30px / 2)); } */
    width: -webkit-calc(50% - (var(--spacing-unit) / 2)); 
    width: calc(50% - (var(--spacing-unit) / 2)); 
}
  .footer-col-3 {
    /* width: -webkit-calc(100% - (30px / 2)); */
    /* width: calc(100% - (30px / 2));  */
    width: -webkit-calc(100% - (var(--spacing-unit) / 2)); 
    width: calc(100% - (var(--spacing-unit) / 2)); 
  } 
}
/* Narrow view - footers are 1 column */
@media screen and (max-width: 399px) {
  .footer-col {
    float: none;
    width: -webkit-calc(100% - (var(--spacing-unit) / 2)); 
    width: calc(100% - (var(--spacing-unit) / 2)); 
  } 
}
/**
 * 
 */
/* content area, main text */

article { font-size: 1em;
}
.article-meta {
  font-size: 14px;
  color: Gray; }

/* NOT USED??? */
/* partially based on http://www.wpbeginner.com/wp-themes/how-to-add-numeric-pagination-in-your-wordpress-theme/  */

.article-list {
  margin-left: 0;
  list-style: none; }
  .article-list > li {
    margin-bottom: 30px; }

.article-link {
  display: block;
  font-size: 24px; }

.pagination a,
.pagination a:hover,
.pagination .active a,
.pagination .disabled {
  color: #fff;
  text-decoration: none; }

.pagination {
  text-align: center; }

.pagination a,
.pagination a:hover,
.pagination .active a,
.pagination .disabled_link {
  cursor: pointer;
  background-color: #6FB7E9;
  border-radius: 3px;
  padding: 4px;
  padding: 0.2rem; }

.pagination .disabled_link {
  background-color: #DDD;
  cursor: auto; }

.pagination a:hover {
  background-color: #3C8DC5; }

a.category {
  padding: 0 .3em;
  font-size: .6em;
  letter-spacing: .05em;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  display: inline-block;
  vertical-align: .3em;
  color: var(--category-text-color);
  background-color: var(--category-bg-color);
  }

a.tag {
  padding: 0 .3em;
  font-size: .6em;
  letter-spacing: .05em;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  display: inline-block;
  vertical-align: .3em;
  color: var(--category-text-color);
  background-color: var(--tag-bg-color);
  }


/* Youtube embed responsive */
	.video-wrapper {
		position: relative;
		padding-bottom: 56.25%; /* 16:9 */
		padding-top: 25px;
		height: 0;
	}
	.video-wrapper iframe {
		position: absolute;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
	}
  

