* {
  box-sizing: border-box;
}

:root {
    --bg-color: #fbf6f0;
    --main-section-color: #e8e8e8;
    --nav-head-color: #fe7171;
    --nav-list-color: #e8e8e8;
    --nav-list-hover-color: #ffb0b0;
    --emphasis-color: #7ea04d;
    --emphasis-border: #335d2d;
    --inline-code-color: rgb(255, 233, 144);
    --brick-red-color: #C04055;
    --subsecton-color: #a3d8f4;
    --tab-color: #800080;
    --tab-label-hover-color: lightgray;
    --tab-label-select-color: #800080;
}

body {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-color);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  overflow-x: hidden;
} 

.noselect {
  user-select: none;
}

code {
  white-space: pre-wrap;
}

a {
  text-decoration: none;
  color: black;
}

ul {
  list-style-type: none;
}

/*  Navbar  */
#navbar {
  position: sticky;
  top: 0%;
  z-index: 99;
  width: 100%;
}

#toggle {
  display: none;
}

#navbar header{
  background-color: var(--nav-head-color);
  text-align: center;
  font-size: 1.4em;
  font-weight: bold;
  padding: 8px 0;
  cursor: pointer;
}

#navbar-list {
  padding-left: 0;
  width: 100%;
  margin-left: 50vw ;
  margin-top: 0;
  position: absolute;
  right: 100%;
  transition: 0.6s right  ease;
}

.nav-link {
  font-size: 1.1em;
}

#navbar-list li {
  border-bottom: 1px solid black;
  text-align: center;
  height: auto;
  padding: 5px;
  background-color: var(--nav-list-color);
  transition: 1s background-color ease;
}

#navbar input:checked ~ul {
  right: 0;
}

#navbar-list li:hover{
  background-color: var(--nav-list-hover-color);
}

/*  Main Document */
#main-doc {
  display: flex;
  flex-flow: column;
  padding: 5px 20px;
}

/*  Main Document's children */
.main-section {
  background-color: var(--main-section-color);
  border-radius: 10px;
  margin: 10px;
  padding: 10px 20px;
  box-shadow: 1px 1px 2px rgb(145, 145, 145);
  border: 1px solid darkmagenta;
}

.main-section header {
  font-size: 1.3em;
  font-weight: bold;
}

.main-section article p {
  text-align: justify;
}

.emphasis {
  margin: 5px 0;
  padding-left: 5px;
}

.emphasis li {
  text-align: justify;
  padding: 5px;
  margin: 10px 5px;
  border-left: 5px solid var(--emphasis-border);
  background-color: var(--emphasis-color);
  border-radius: 3px;
}

.inline-code {
  display: inline-block;
  background-color: var(--inline-code-color);
  line-height: 0.7em;
  padding: 2px;
  border-radius: 5px;
}

.sub-section {
  padding: 10px;
  margin: 30px 20px;
  border: 1px solid darkmagenta;
  box-shadow: 0 0 2px gray;
  border-radius: 10px;
}

.sub-section > h1 {
  margin-top: 0;
  padding-left: 0;
  font-size: 1em;
  text-align: center;
}

.image {
  margin-left: 50%;
  transform: translateX(-50%);
}

/* Tabs */
.tabs {
  display: flex;
  flex-wrap: wrap;
  width: 100%;
  /* background-color: var(--emphasis-color); */
}

.tab-input {
  position: absolute;
  opacity: 0;
}

.tab-label {
  width: 25%;
  height: 50px;
  line-height: 20px;
  padding: 12px 0;
  text-align: center;
  font-weight: bold;
  cursor: pointer;
  transition: .5s background-color ease;
  border-bottom: 2px solid black;
}

.tab-label:hover {
  background-color: lightgray;
}

.tab-input:checked + .tab-label {
  background-color: var(--tab-label-select-color);
  color: white;
  border-bottom: 5px solid var(--brick-red-color);
}

.tab-content {
  order: 99;
  display: none;
  padding: 10px;
  width: 100%;
  height: auto;
}

.tab-content > p {
  text-decoration: underline;
}

.tab-input:checked + .tab-label + .tab-content {
  display: block;
}

/* Code */
.code-snippet {
  background-color: #093145;
  color: white;
  font-size: 1.1em;
  padding: 10px 0 10px 20px;
  border-radius: 15px;
}

/* Reference */
#reference a {
  text-decoration: underline;
}

#reference a:hover {
  color: blue;
}

/* Footer */
footer {
  margin-top: 30px;
  background-color: #fe7171;
  color: black;
  text-align: center;
}

footer a {
  color: black;
}

footer a:hover{
  text-decoration: underline;
}

@media screen and (min-width: 760px) {
  body {
    flex-direction: row;
    justify-content: center;
  }
  
  /*  Navbar  */
  #navbar{
    flex-basis: 300px;
    margin-top: 30px;
    max-width: 500px;
    height: max-content;
    position: sticky;
    top: 50px;
  }

  #navbar-list {
    right: 0;
    background-color: transparent;
    border-radius: 0 0 20px 20px;
    background-color: var(--main-section-color);
  }

  #navbar-list li {
    background-color: transparent;
    height: auto;
    line-height: 50px;
    padding: 0;
  }
  
  #navbar-list li:last-child {
    border-bottom: none;
  }

  #main-doc {
    flex-basis: 500px;
    max-width: 800px;
    flex-grow: 1;
  }
}

@media screen and (max-width: 560px) {
  .image {
    width: 60vw !important;
  }
}