@import "variables.scss";
@import "poole.scss";
@import "logo.scss";

html {
  font: 16px/1.5 sans-serif;
  font-size: unquote("min(max(calc(.5rem + 1vw), 16px), 22px)"); // min=16, max=22, fluid between
}

body {
  background-color: #000;
  color: hsl(var(--hue-blue), 10%, 70%);
}

h1, h2, h3, h4, h5, h6, .copyright {
  font-family: 'Raleway', sans-serif;
}

h1 { color: hsl(var(--hue-blue), 10%, 80%); border-bottom: 1px solid hsl(var(--hue-blue), 10%, 65%); font-weight: 200; }
h2 { color: hsl(var(--hue-blue), 10%, 70%); font-size: 1.75rem; font-weight: 200; }
h3 { color: hsl(var(--hue-blue), 10%, 60%); font-size: 1.5rem; margin-top: 2rem;}
h4 { color: hsl(var(--hue-blue), 10%, 50%); font-size: 1.2rem; margin-bottom: .75rem}

strong {
  color: inherit;
}

ul {
  list-style-image: none;
}

li > ul {
  margin-bottom: 0;
}

a {
  color: var(--link-color);
  text-decoration: none;

  &:hover {
    color: hsl(var(--hue-blue), 92%, 80%);
  }
}

code {
  color: hsl(var(--hue-blue), 10%, 90%);
}

code,
pre {
  background-color: hsl(var(--hue-blue), 10%, 12%);
}

tbody tr:nth-child(odd) td, tbody tr:nth-child(odd) th {
  background-color: hsl(var(--hue-blue), 10%, 12%);
}

hr { border-color: #777; }

.copyright {
  color: #777;
  text-align: center;
}

.copyright a {
  color: #777;
  text-decoration: underline;
}

/*
 * Container
 */
.content {
  padding-top: 0.5rem;
  padding-bottom: 4rem;
}

@media (min-width: 60rem) {
  .content {
    padding-top: 6rem;
    max-width: 80rem;
    margin-left: 20rem;
    margin-right: 0;
  }
}

/*
 * Sidebar
 */
@media (min-width: 60rem) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    padding-top: 3rem;
    width: 20rem;
    overflow-y: scroll;

    nav {
      display: block;
      margin: 1.5rem;
      padding: 0;
    }
  }

  #btn-nav {
    display: none;
  }
}

/*
 * Navigation
 */
#btn-nav {
  max-width: 40rem;
  padding: 0 1rem;
  margin: 0 auto;
  fill: var(--btn-bg-color);
  cursor: pointer;
}

#btn-nav.active {
  fill: var(--btn-active-bg-color);
}

#btn-nav .icon {
  width: 48px;
  height: 48px;
  display: block;
  float: right;
  position: relative;
  top: 1.75rem;
}

nav {
  display: none;
  max-width: 40rem;
  margin: 3.5rem auto 1rem auto;
  padding: 0 4rem 0 1rem;
}

nav.active {
  display: block;
}

nav a.active,
nav li.active {
  background-color: var(--info-bg-color);
}
nav li.active ul {
  background-color: black;
}

.nav-item {
  display: block;
  line-height: 1.75;
}
a.nav-item:hover,
a.nav-item:focus {
  text-decoration: underline;
}
.nav-item.active {
  font-weight: bold;
}

#doc-toc {
  margin-bottom: 0;
}

.github {
  margin-top: 0.5rem;
  padding: 0;
  text-align: center;
  list-style-type: none;
}

.github li span {
  padding: 0 0.15rem;
}

/*
 * Asides
 */
aside {
  display: flex;
  margin-bottom: 1rem;
  padding: 5px 10px;
}

aside .icon {
  width: 32px;
  height: 32px;
  min-width: 32px;
}

aside p {
  margin-left: 10px;
  margin-top: 5px;
  margin-bottom: 0;
}

aside.info {
  background-color: var(--info-bg-color);
  border: 3px solid hsl(var(--hue-blue), 50%, 20%);

  .icon { fill: var(--info-color); }
}

aside.warn {
  background-color: var(--warn-bg-color);
  border: 3px solid hsl(var(--warn-color), 50%, 20%);

  .icon { fill: var(--warn-color); }
}

/*
 * Icons
 */
.icon {
  width: 1em;
  height: 1em;
}

.icon.external { fill: var(--info-color); }

/*
 * Screenshots
 */
ul.screenshots {
  display: grid; 
  grid-template-columns: repeat(4, 1fr); 
  grid-template-rows: repeat(2, 1fr); 
  list-style: none;
  margin-bottom: .5rem;
  padding: 0;

  li:last-child {
    grid-column: 1 / -1;
  }

  img {
    height: 20vw;
    width: 100%;
    object-fit: cover;
    vertical-align: bottom;
    margin: 0;
    padding: .5rem;
  }
}

.row {
  display: flex;
  justify-content: space-around;

  img {
    max-height: 50vh;
    margin: 0 auto;
  }
}

figure {
  figcaption {
    font-family: 'Raleway', sans-serif;
    color: hsl(var(--hue-blue), 20%, 50%);
    text-align: center;
    margin-top: .5rem;
  }
}

/*
 * :target image overlay
 */
.overlay {
  position: fixed;
  z-index: 99;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.9);
  display: flex;
  align-items: center;
  text-align: center;
  visibility: hidden;
  opacity: 0;
  transition: opacity .167s;
}

.overlay img {
  max-width: 90vw !important;
  max-height: 90vh !important;
  margin: auto !important;
  width: auto !important;;
  height: auto !important;
  object-fit: contain;
}

@media (min-width: 60rem) {
  ul.screenshots {
    margin-left: 5vw;
    margin-right: 5vw;

    img {
      object-fit: contain;
    }
  }

  .overlay img {
    max-width: 66vw !important;
    max-height: 66vh !important;
  }
}

.overlay:target {
  visibility: visible;
  outline: none;
  opacity: 1;
}
