html {
    color: #222;
    font-size: 1em;
    line-height: 1.4;
}

/*
 * Remove text-shadow in selection highlight:
 * https://twitter.com/miketaylr/status/12228805301
 *
 * Vendor-prefixed and regular ::selection selectors cannot be combined:
 * https://stackoverflow.com/a/16982510/7133471
 *
 * Customize the background color to match your design.
 */

::selection {
    background: #b3d4fc;
    text-shadow: none;
}

hr {
    display: block;
    height: 1px;
    border: 0;
    border-top: 1px solid #ccc;
    margin: 1em 0;
    padding: 0;
}

/*
 * Remove the gap between audio, canvas, iframes,
 * images, videos and the bottom of their containers:
 * https://github.com/h5bp/html5-boilerplate/issues/440
 */

audio,
canvas,
iframe,
img,
svg,
video {
    vertical-align: middle;
}

fieldset {
    border: 0;
    margin: 0;
    padding: 0;
}

/*
 * Allow only vertical resizing of textareas.
 */

textarea {
    resize: vertical;
}

/* ==========================================================================
   Browser Upgrade Prompt
   ========================================================================== */

.browserupgrade {
    margin: 0.2em 0;
    background: #ccc;
    color: #000;
    padding: 0.2em 0;
}

 /* ==========================================================================
   Helper classes
   ========================================================================== */

/*
 * Hide visually and from screen readers
 */

 .hidden {
  display: none !important;
}

/*
* Hide only visually, but have it available for screen readers:
* https://snook.ca/archives/html_and_css/hiding-content-for-accessibility
*/

.visuallyhidden {
  border: 0;
  clip: rect(0 0 0 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  white-space: nowrap; /* 1 */
}

/*
* Extends the .visuallyhidden class to allow the element
* to be focusable when navigated to via the keyboard:
* https://www.drupal.org/node/897638
*/

.visuallyhidden.focusable:active,
.visuallyhidden.focusable:focus {
  clip: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  position: static;
  width: auto;
  white-space: inherit;
}

/*
* Hide visually and from screen readers, but maintain layout
*/

.invisible {
  visibility: hidden;
}

.clearfix:before,
.clearfix:after {
  content: " ";
  display: table;
}

.clearfix:after {
  clear: both;
}

/* ==========================================================================
   Text
   ========================================================================== */

  a{
    color:#007bba;
  }
    
  h2,h3,h4{
    line-height: 1.2;
    margin:.8em 0 0;
  }
  
  h3{
      font-weight:bold;
  }
  
  .categoryTitle{
      display:none;
  }

  section > h2, hgroup, footer{
    text-align: center;
  }

  section > h2{
    color:#fff;
    padding:6px;
    letter-spacing: 1px;
  }

  nav#sections ul{
    list-style-type: none;
    padding:0;
  }

  nav#sections ul li{
    margin-bottom:6px;
  }

  nav#sections ul li a{
    display: block;
    padding:5px 6px;
    text-align: center;
  }

  .bg1,.bg2,.bg3,.bg4,.bg5,.bg6{color:#fff;}

  .bg1{background-color: #b03440;}
  .bg2{background-color: #6e3667;}
  .bg3{background-color: #ff8b00;}
  .bg4{background-color: #7bba00;}
  .bg5{background-color: #F5B935;}
  .bg6{background-color: #999999;}
  .bg7{background-color: #BAA560;}
  .bg8{background-color: #297A4B;}
  .bg9{background-color: #654321;}

  div[aria-labelledby="title2"] ul li{color: #b03440;}
  div[aria-labelledby="title3"] ul li{color: #6e3667;}
  div[aria-labelledby="title4"] ul li{color: #ff8b00;}
  div[aria-labelledby="title5"] ul li{color: #7bba00;}
  div[aria-labelledby="title6"] ul li{color: #F5B935;}
  div[aria-labelledby="title7"] ul li{color: #999999;}
  div[aria-labelledby="title8"] ul li{color: #BAA560;}
  div[aria-labelledby="title9"] ul li{color: #297A4B;}
  div[aria-labelledby="title10"] ul li{color: #654321;}

  #intro aside ul, footer #credits ul{
    list-style-type: none;
    margin:0;
    padding:0;
  }
  
  section:not(#intro) div[role="main"] ul, aside.right ul{
    padding-left:1.4em;
    margin-bottom:0;
  }

  section:not(#intro) ul li {
    line-height: 1.3;
    margin-bottom: .3vw;
  }

  section:not(#intro) ul li ul li {
    line-height: 1.3;
    margin: .2vw;
  }

  aside h2, aside h3{
    display: block;
    font-size: 1em;
    color:#fff;
    background:#007bba;
    padding:5px 6px;
  }

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

  body{
    max-width: 1300px;
    margin:0 auto;
  }


    #TOC{
      display:flex;
      flex-wrap: wrap;
      justify-content: space-between;
    }
	
	
  #toolbar{
    display: block;
    padding:.8em;
  }

  #toolbar a{
    padding:1px 0 8px;
  }

  #toolbar nav a{
    display:inline;
    float:left;
    text-decoration: none;
    margin-right:1vw;
  }

  #toolbar #tools{
	float:right;
	position: relative;
	top:0px;
	left: 1px;

  }

  #toolbar #tools > *{
    margin-left:1vw;
  }

  header{
    display:block;
  }
  
  img.crop{
    object-fit:cover;
    object-position:center;
  }

  section{
    display:flex;
    flex-flow: row wrap;
    padding:0 .8em;
  }

  section > *{
    flex: 1 100%;
  }
  
  div[role="main"]{
      padding:0 10px;
  }

  main > section > div{
    padding:0 20px;
  }

  section div[role="main"] section{
    break-inside: avoid;
  }

  aside nav a{
    display: block;
  }

  footer{
    padding: 20px;
  }
  
  footer nav{
      margin:8px;
  }

  .ad{
    margin-top:.8em;
    background:#1b8dcc;
    padding:10px;
    display:inline-block;
  }

/* ==========================================================================
   Phone
   ========================================================================== */

  @media only screen and (max-width: 599px) {
    
    aside{
        padding:0 20px;
    }
    
    #header img.crop{
      height:110px;
    }
    
    #intro aside.right ul li:last-child{
        margin-bottom:.8em;
    }
    
    #TOC > div{
      width:100%;
    }
  
  }

/* ==========================================================================
   Tablet
   ========================================================================== */

  @media only screen and (min-width: 600px) {
      
    .small-only, .closeLink{
        display:none;
    }
      
    #header img.crop{
        height:130px
    }
    
    #TOC > div{
        width:50%;
    }
    
    section.category > h2{
        display:none;
    }
      
    #intro aside.left ul li a{
      display:block;
      background-color:#007bba;
      color:#fff;
      text-align:center;
      padding:14px 4px;
      margin:20px 0;
    }
    
    #intro aside.right ul li a{
        display:block;
        margin:1.1em 0;
    }
  
    section div[role="main"]{
      flex: 2 0px;
      order:2;
    }

    section:not(#intro) div[role="main"]{
      flex-grow:2;
      columns:2;
      max-width:calc(100% - 380px);
    }

    aside{
      flex:1 auto;
    }

    aside.left{
      order:1;
      max-width:140px;
    }

    aside.right{
      order:3;
      max-width:180px;
    }

    footer #credits ul{
      display: flex;
      justify-content: center;
    }

    footer #credits ul li, footer nav a{
      margin:1vw;
    }
  }
  
  @media only screen and (min-width: 1000px) {
      
    #header img.crop{
        height:177px;
    }
    
    section:not(#intro) div[role="main"]{
      columns:3;
    }

    nav#sections ul{
      columns:2;
    }

    aside.right{
      order:3;
      max-width:200px;
    }
  }
 
/* ==========================================================================
   Desktop
   ========================================================================== */

  @media only screen and (min-width: 1200px) {
    section:not(#intro) div[role="main"]{
      columns:4;
    }

    aside.right{
        padding:0;
        max-width: 230px;
    }
    
    #main{
        margin:0;
    }

    nav#sections ul{
      columns:3;
    }

    section{
      padding:0;
    }
    
    #TOC > div{
        width: 33%;
      }
  }
 
/* ==========================================================================
   Print styles.
   Inlined to avoid the additional HTTP request:
   https://www.phpied.com/delay-loading-your-print-css/
   ========================================================================== */

   @media print {
    *,
    *:before,
    *:after {
        background: transparent !important;
        color: #000 !important; /* Black prints faster */
        -webkit-box-shadow: none !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    a,
    a:visited {
        text-decoration: underline;
    }

    a[href]:after {
        content: " (" attr(href) ")";
    }

    abbr[title]:after {
        content: " (" attr(title) ")";
    }

    /*
     * Don't show links that are fragment identifiers,
     * or use the `javascript:` pseudo protocol
     */

    a[href^="#"]:after,
    a[href^="javascript:"]:after {
        content: "";
    }

    pre {
        white-space: pre-wrap !important;
    }
    pre,
    blockquote {
        border: 1px solid #999;
        page-break-inside: avoid;
    }

    /*
     * Printing Tables:
     * http://css-discuss.incutio.com/wiki/Printing_Tables
     */

    thead {
        display: table-header-group;
    }

    tr,
    img {
        page-break-inside: avoid;
    }

    p,
    h2,
    h3 {
        orphans: 3;
        widows: 3;
    }

    h2,
    h3 {
        page-break-after: avoid;
    }
}

/********** Sticky Bar **********/
.popup{
  display:block;
  width:100vw;
  background:#000;
  color:#fff;
  left:0;
  bottom:0;
  position:fixed;
  text-align:center;
  -webkit-transition: all 1s linear;
  -moz-transition: all 1s linear;
  -o-transition: all 1s linear;
  transition: all 1s linear;
  z-index:999;
}

.popup a{
  color:#F5B935;
}

.popup a.close{
  display:inline-block;
  margin:auto 11px;
  font-size: 11px;
  width:16px;
  height: 16px;
  border:2px solid #F5B935;
  border-radius: 50%;
  cursor: pointer;
}
