/**
 * Main.css for Bits and Pieces theme for Pico
 * Authored by Fredrik Danielsson, Lost&Keys (http://lostkeys.se)
 * Licensed under MIT (https://github.com/lostkeys/Bits-and-Pieces-Theme-for-Pico/blob/master/LICENSE)
 *
 * Dev note: This stylesheet is using a mobile first approach
 */



/*
 * Variables, resets and setup
 */

:root {
  --color-white: #ffffff;
  --color-asphalt:#4d5757;
  --color-gray:#ccc;
  --color-concrete: #c1cacc;
  --color-smoke: #e1e7e8;
  --color-cloud: #fafafa;
  --color-ocean: #2980B9;
  --color-grass: #27ae60;

  --color-gruvbox-bg: #32302f;
  --color-gruvbox-fg:#fbf1c7;
  --color-gruvbox-aqua: #689d6a;
  --color-gruvbox-purple: #b16286;
  --color-gruvbox-blue: #458588;
  --color-gruvbox-yellow: #d79921;
  --color-gruvbox-green: #98971a;
  --color-gruvbox-red: #cc241d;

  --background-color: var(--color-white);
  --accent-color: var(--color-grass);
  --border-color: var(--color-smoke);
  --code-bg-color: var(--color-cloud);
  --text-color: var(--color-asphalt);
  --link-color: var(--color-ocean);

  --vertical-padding: 40px;
  --document-horizontal-margin: 40px;
  --main-content-max-width: 800px;
  /*--main-content-margin: 0 auto;*/
  --main-content-margin: 0 0 0 var(--nav-width);
  --nav-width: 180px;
}



/*
 * Font-face
 */

@font-face {
  font-weight: 400;
  font-style: normal;
  font-family: 'source-sans-pro';
  src: url('../font/SourceSansPro-Regular.eot'); /* IE9 Compat Modes */
  src: url('../font/SourceSansPro-Regular.eot@') format('embedded-opentype'), /* IE6-IE8 */
  url('../font/SourceSansPro-Regular.otf.woff') format('woff'), /* Pretty Modern Browsers */
  url('../font/SourceSansPro-Regular.ttf') format('truetype'); /* Safari, Android, iOS */
}

@font-face {
  font-weight: 400;
  font-style: italic;
  font-family: 'source-sans-pro';
  src: url('../font/SourceSansPro-It.eot'); /* IE9 Compat Modes */
  src: url('../font/SourceSansPro-It.eot@') format('embedded-opentype'), /* IE6-IE8 */
  url('../font/SourceSansPro-It.otf.woff') format('woff'), /* Pretty Modern Browsers */
  url('../font/SourceSansPro-It.ttf') format('truetype'); /* Safari, Android, iOS */
}

@font-face {
  font-weight: 700;
  font-style: normal;
  font-family: 'source-sans-pro';
  src: url('../font/SourceSansPro-Semibold.eot'); /* IE9 Compat Modes */
  src: url('../font/SourceSansPro-Semibold.eot@') format('embedded-opentype'), /* IE6-IE8 */
  url('../font/SourceSansPro-Semibold.otf.woff') format('woff'), /* Pretty Modern Browsers */
  url('../font/SourceSansPro-Semibold.ttf') format('truetype'); /* Safari, Android, iOS */
}

@font-face {
  font-weight: 700;
  font-style: italic;
  font-family: 'source-sans-pro';
  src: url('../font/SourceSansPro-SemiboldIt.eot');
  /* IE9 Compat Modes */
  src: url('../font/SourceSansPro-SemiboldIt.eot@') format('embedded-opentype'), /* IE6-IE8 */
  url('../font/SourceSansPro-SemiboldIt.otf.woff') format('woff'), /* Pretty Modern Browsers */
  url('../font/SourceSansPro-SemiboldIt.ttf') format('truetype'); /* Safari, Android, iOS */
}

/*
 * Block styling
 */

html {
  font-size: 16px;
  font-family: "source-sans-pro", "Helvetica Neue", Helvetica, Arial, sans-serif;
  line-height: 1.4;
}

body {
  margin: 0;
  background-color: var(--background-color);
  color: var(--text-color);
}



/*
 * Structure
 */

.main-content {
  margin: var(--main-content-margin);
  max-width: var(--main-content-max-width);
}

.main-content .article {
  margin-top: var(--document-horizontal-margin);
  margin-bottom: var(--document-horizontal-margin);
  margin-left: var(--vertical-padding);
  margin-right: var(--vertical-padding);
}



/*
 * Basic styling
 */

a,
a:link,
a:visited {
  color: var(--link-color);
  text-decoration: none;
  -o-transition:.5s;
  -ms-transition:.5s;
  -moz-transition:.5s;
  -webkit-transition:.5s;
  /* ...and now for the proper property */
  transition:.5s;
}

a:hover {
  text-decoration: none;
  color: var(--accent-color);
}

a:active,
a:focus {
  text-decoration: underline;
}

hr {
  margin: 1rem 0;
  border-width: 1px 0 0 0;
  border-style: solid;
  border-color: #ecf0f1;
}

h1 {
  margin-top: 6rem;
  margin-bottom: 1rem;
  font-weight: normal;
  font-size: 2.5rem;
  letter-spacing: -0.025rem;
}

h2 {
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
  font-weight: bold;
  font-size: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  position: -webkit-sticky;
  top:0;
  background-color: var(--background-color);
}

h3 {
  margin-top: 3rem;
  margin-bottom: 1rem;
  font-size: 1.25rem;
  font-weight: bold;
}

h4,
h5,
h6 {
  font-size: 1rem;
  margin: 1rem 0;
}

h2::before,
h3::before
{
  font-weight: 400;
  font-size: 1.25rem;
  text-align: right;
  width: 1.5rem;
  content: '#';
  padding-right: .5rem;
  margin-left: -1rem;
  color: var(--text-color);
  display: inline-block;
  -webkit-font-smoothing: antialiased;
}

.main-content h1:first-of-type {
  margin-top: 0;
}


h2 + h3 {
  margin-top: 1.5rem;
}


table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

table td,
table th {
  text-align: left;
  padding: .3rem 0;
  border-style: solid;
  border-color: var(--border-color);
  border-width: 1px 0;
}

/* Avoid border-on-border together with bordered H2 */
h2 + table tr:first-child th,
h2 + table tr:first-child td {
  border-top-width: 0;
}

code {
  font-size: .875rem;
  display: inline-block;
  padding: 0 3px;
  border: 1px solid var(--border-color);
  border-radius: 1px;
  background-color: var(--code-bg-color);
  color: var(--text-color);
}

pre code {
  display: block;
  padding: 5px 10px;
}



/*
 * Main navigation
 */

#nav-toggle{
  margin-top:15px;
  margin-bottom:-35px;
  cursor: pointer;
  margin-left:15px;
  display: none;
}

.main-nav {
  box-sizing: border-box;
  position: fixed;
  padding-left: 25px;
  top: 0;
  left: 0;
  /*padding-left: var(--vertical-padding);*/
  padding-top: var(--vertical-padding);
  overflow-x: hidden;
  overflow-y: scroll;
  width: var(--nav-width);
  height: 100vh;
}

.main-nav::-webkit-scrollbar {
  display: none;
}
.main-nav span {
  color: var(--text-color);
  font-size: 0.9rem;
  overflow: hidden;
  padding-top: 5px;
  padding-bottom: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: flex;
}
.main-nav a {
  color: var(--text-color);
  font-size: 0.9rem;
  overflow: hidden;
  padding-top: 5px;
  padding-bottom: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: flex;
}

.main-nav a:hover {
  text-decoration: none;
}

.main-nav a .shortcut {
  align-self: center;
  color: var(--accent-color);
  display: inline-block;
  font-size: .6875rem;
  font-weight: normal;
  margin-left: auto;
  text-align: right;
}

/* Main nav Tree (not implemented...yet */
/*
.main-nav nav li.directory > a::before {
  content: '▸ ';
}

.main-nav nav li.directory a.folder-open::before {
  content: '▾ ';
}

.main-nav nav li.directory > ul {
  margin-top: 0;
  margin-left: 20px;
  display: none;
  margin-bottom: 10px;
}

.main-nav nav li.directory.open > ul {
  display: block;
}
*/

.menu {

}

.menu ul {
  padding-left: 10px;
}
.menu li{
  content: '▸ ';
  list-style-type: none;
}
.has-children span{
  /*#font-weight:bold;*/
}

.foo-item { /* an item named "foo-item" */ }
.foo-item > a { /* the link of a page named "foo-item" */ }
.foo-item > span { /* the name of a directory named "foo-item"  */ }
.foo-item > ul { /* the children of "foo-item" */ }
.foo-item > ul ul { /* the deep children of "foo-item" */ }

.is-page { /* the pages, with links */ }
.is-directory { /* the directories, with simple names */ cursor:pointer; }
.is-current { /* the current page */ }
.is-active { /* the items in the path of the current page */ }
.has-children { /* the items with children */ }

.menu li.is-page:not(.is-active) ul {
    display: none;
}
.is-active ul {
  list-style-type: none;
  display:inherit !important;
}
.is-directory ul {
  list-style-type: none;
  display:none;
}
/* same-page navigation (Not implemented...yet)

.page-nav:not(:empty) {
  padding-top: 5px;
}

.page-nav a {
  padding-top: 0px;
  padding-bottom: 0px;
  font-size: 0.8em;
}

.page-nav a:before {
  content: '# ';
}
*/



/*
 * Mediaqueries
 */

@media only screen and (max-width: 768px) {
  :root {
    --main-content-margin: 0 0 0 0;
    --vertical-padding: 15px;
  }
  .main-nav {
    display: none;
    position: unset;
    margin-top: 35px;
    height: unset;
  }
  #nav-toggle {
    display: inherit; !important
  }
  .menu{
    margin-top:-15px;
  }
}
