@import "vars.css";

/* global */
body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell,
    Noto Sans, sans-serif, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial,
    sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  margin: 0;
  scroll-behavior: smooth;
  color: #1c1e21;
}

h1 {
  font-size: 2rem;
  line-height: normal;
}

a {
  color: var(--orange-3);
  /*  text-decoration: none; */
}
a:hover {
  text-decoration-thickness: 0.15rem;
}

a.button {
  margin: 1rem;
  padding: 1rem;
  color: var(--indigo-9);
  text-align: center;
  font-weight: 400;
  background-color: var(--indigo-0);
  text-decoration: none;
}

a.button:hover {
  background-color: var(--indigo-2);
}

.header {
  grid-area: header;
  display: flex;
  align-items: center;
  height: 3.8rem;
  background-color: white;
  position: sticky;
  top: 0;
}

.header img {
  height: 2.4rem;
  margin-left: 0.7rem;
  margin-right: 0.2rem;
}
.header a {
  padding: 0.4rem;
  color: var(--green-1);
  text-decoration: none;
}
.header a.logo {
  color: black;
  font-weight: 600;
}
.header ul li {
  display: inline;
  padding-right: 0.8rem;
}
.header ul {
  padding: 1.6rem;
}
.header a:hover {
  text-decoration: underline;
}
.header a.active {
  color: var(--orange-9);
  background-color: var(--green-2);
  padding: 0.1rem 0.4rem;
  border-radius: 0.2rem;
  transition: color 0.5s;
}
.header a.active:hover {
  text-decoration: none;
}

.content {
  grid-area: content;
  margin-left: 2rem;
  margin-right: 3rem;
  line-height: 1.5rem;
  z-index: -5;
}

.content .grey-clouded {
  color: var(--grey-9);
  border: 1px solid var(--blue-8);
  border-radius: 1rem;
  padding: 0.5rem 0.5rem 0 0.5rem;
  background-color: var(--blue-9);
}

.content h2 {
  padding-top: 1rem;
  color: var(--green-3);
}

/* handle anchor jumps with fixed header size */
.content [id]::before {
  content: "";
  display: block;
  height: 3.8rem;
  margin-top: -3.8rem;
  visibility: hidden;
}

.nav {
  grid-area: nav;
  margin-left: -2rem;
}
.nav ul li {
  list-style-type: none;
  padding: 0.5rem;
}
.nav .subnav {
  font-size: 0.8rem;
  margin-bottom: -0.5rem;
}
.nav li.subnav.active {
  background-color: var(--green-9);
  border-radius: 0 0 0.6rem 0;
}
.nav a {
  color: var(--green-2);
  text-decoration: none;
}

.nav a:hover {
  color: var(--green-4);
  transition: color 0.5s;
  text-decoration: underline;
}
.nav li.active {
  background-color: var(--green-8);
  border-left: 0.1rem solid var(--green-2);
  border-radius: 0 0.6rem 0 0;
}
.nav li.active a {
  color: var(--green-1);
  text-decoration: none;
}

.sidebar {
  grid-area: sidebar;
  z-index: -1;
}

/* keep sidebar in view even as screen scrolls */
.sidebar nav {
  border-left: 2px solid #f0f0f0;
  list-style-type: none;
  position: sticky;
  top: 4.8rem;
}

.sidebar ol {
  list-style-type: none;
}
.sidebar li {
  margin-top: 1rem;
}
.sidebar nav a {
  font-size: 0.8rem;
  color: var(--blue-3);
}
.sidebar nav a:hover,
.sidebar nav a.active,
.sidebar nav a.current {
  color: var(--blue-1);
  transition: color 0.5s;
}

/* footer */
.footer {
  grid-area: footer;
  color: black;
  border-top: 1px solid #f0f0f0;
  height: 4rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer span {
  padding: 1rem;
}

/*
@media (-webkit-min-device-pixel-ratio: 1.5) and (orientation: portrait), @media (min-resolution: 1.5dppx) and (orientation: portrait){
  html {
    font-size: 2rem;
  }
}
*/

/*
@media (-webkit-min-device-pixel-ratio: 2.5) and (orientation: portrait), @media (min-resolution: 2.5dppx) and (orientation: portrait){
  html {
    font-size: 3rem;
  }
}
*/

.wrapper {
  display: grid;
  grid-template-areas:
    "header"
    "burger"
    "nav"
    /* "sidebar" */
    "content"
    "footer";
  width: 100%;
  height: 99.9vh;
  align-items: start;
  /*overflow: clip;*/
  /* not certain why wrapper places itself above sidebar, but this helps... */
  position: absolute;
  z-index: -10;
}

hr {
  display: none;
}

/* default to showing hamburger navigation and hiding sidebar */
#hamburger_header_navigation {
  display: block;
  padding-top: 1rem;
}
#inline_header_navigation {
  display: none;
}
aside.sidebar {
  display: none;
}

@media (min-width: 950px) and (min-device-width: 950px) {
  .wrapper {
    grid-template-columns: 1fr 6fr 1fr;
    grid-template-areas:
      "header header  header"
      "nav    content sidebar"
      "footer footer  footer";
    grid-template-rows: 3.8rem 1fr 4rem;
  }
  #wide.wrapper {
    grid-template-columns: 1fr;
    grid-template-areas:
      "header"
      "content"
      "footer";
  }

  nav ul {
    flex-direction: column;
  }

  /* with more width show inline navigation */
  #hamburger_header_navigation {
    display: none;
  }
  #inline_header_navigation {
    display: block;
  }
  aside.sidebar {
    display: inline;
  }
}

/* general usage */
.row {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  flex-basis: 100%;
}

.column {
  display: flex;
  flex-direction: column;
  flex-basis: 100%;
  flex: 1;
}
