.documentation-page {
  height: 100vh;
  display: grid;
  grid-template-rows: var(--header-height) 1fr auto;
  grid-template-columns: 100%;
  overflow: hidden;

  > .header {
    grid-area: 1/1/2/2;
    width: 100%;
    top: 0;
    z-index: 2;
  }

  > .center {
    grid-area: 2/1/3/2;
    display: grid;
    width: 100%;
    max-width: 1200px;
    grid-template-columns: 0 100vw;
    margin: 0 auto;
    overflow: scroll;
    overflow-x: hidden;
    transition: grid-template-columns 0.3s ease;

    &.show-menu {
      grid-template-columns: var(--menu-width) 100vw;
    }
  }

  .page-content {
    grid-area: 1/2/2/3;
    overflow: scroll;
    padding: 2rem 1rem 1rem;
  }

  > .footer {
    grid-area: 3/1/4/2;
  }

  code {
    word-break: break-all;
  }
}

@media screen and (min-width: 1024px) {
  .documentation-page {
    > .center {
      grid-template-columns: var(--menu-width) 1fr;

      &.show-menu {
        grid-template-columns: var(--menu-width) 1fr;
      }
    }
  }
}
.header {
  background-color: var(--jonquil);
  display: flex;
  height: var(--header-height);
  align-items: center;
  justify-content: center;
  box-shadow: 0 0.25rem 0.5rem -0.25rem rgba(0, 0, 0, 0.5);
  border-radius: 0 0 1rem 1rem;

  .logo {
    --logo-width: 10rem;

    width: var(--logo-width);
    filter: drop-shadow(0 0 0.125rem var(--black-30));
  }
}

@media screen and (min-width: 1024px) {
  .header {
    .logo {
      --logo-width: 12rem;
    }
  }
}
.menu {
  position: sticky;
  padding: 2rem 1rem;
  width: var(--menu-width);
  justify-self: end;
  cursor: pointer;
  overflow: scroll;

  ul {
    list-style: none;
    padding: 0;
    margin: 0;
  }

  li.main {
    background-color: var(--accent-color);
    position: relative;
    border-radius: 0.5rem 0.5rem 0 0;
    padding: 0.25rem 1rem 0.875rem;
    font-weight: 300;
    font-size: 1.25rem;
    font-family: var(--font-heading);
    background-image: url("/reasonus/images/logo-only.svg");
    background-repeat: no-repeat;
    background-position: -1rem -1rem;
    background-size: 5rem auto;
    text-shadow: 0 0 0.25rem var(--white-60);
    overflow: hidden;

    ~ .main {
      margin-top: 0.5rem;
    }

    a {
      display: block;
    }

    + ul {
      border-radius: 0 0 0.5rem 0.5rem;
      background-color: white;
    }

    &:not(.active) + ul {
      display: none;
    }

    &::after {
      background-color: var(--background);
      position: absolute;
      content: "";
      bottom: 0;
      left: -0.125rem;
      display: block;
      height: 0.5rem;
      border-radius: inherit;
      z-index: 1;
      width: calc(100% + 0.25rem);
      box-shadow: 0 -0.125rem 0.5rem -0.125rem rgba(0, 0, 0, 0.5);
    }

    &.active::after {
      background-color: white;
    }
  }

  li {
    --accent-color: var(--sky-blue);

    & + li {
      margin-top: 0.25rem;
    }

    a {
      color: var(--black);
      text-decoration: none;
      width: 100%;
    }

    &.blue {
      --accent-color: var(--sky-blue);
    }
    &.red {
      --accent-color: var(--tomato);
    }
    &.green {
      --accent-color: var(--olive);
    }
    &.grey,
    &.gray {
      --accent-color: var(--battleship-gray);
    }
  }

  li.sub {
    height: 2.5rem;
    padding: 0 1rem;
    border-bottom: 0.125rem solid var(--accent-color);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    border-style: solid;
    border-width: 0 0 0.125rem 0;
  }
}

.menu-button {
  display: grid;
  width: 2.25rem;
  height: 1.75rem;
  box-sizing: border-box;
  background-color: transparent;
  border: none;
  padding: 0.25rem;
  grid-template-rows: 1fr 1fr 1fr;
  gap: 0.4rem;
  position: fixed;
  top: 1.25rem;
  right: 1rem;
  z-index: 2;

  div {
    background-color: var(--black);
    border-radius: 1rem;
  }
}

@media screen and (min-width: 1024px) {
  .menu-button {
    display: none;
  }
}
.documentation-block {
  container-type: inline-size;
  width: 100%;

  > article {
    --accent-color: var(--jonquil);

    display: grid;
    height: 100%;
    grid-template-rows: 3.5rem auto 0.25rem;
    border-radius: 1rem;
    background: var(--accent-color);
    position: relative;
    background-image: url("/reasonus/images/logo-only.svg");
    background-repeat: no-repeat;
    background-position: -1rem -4rem;
    background-size: 17.5rem auto;

    &.yellow {
      --accent-color: var(--jonquil);
    }
    &.green {
      --accent-color: var(--olive);
    }
    &.blue {
      --accent-color: var(--sky-blue);
    }
    &.red {
      --accent-color: var(--tomato);
    }
    &.gray {
      --accent-color: var(--battleship-gray);
    }
  }

  header {
    grid-area: 1/1/2/2;
    overflow: hidden;
    align-content: center;
    justify-content: center;
    position: sticky;
    top: -2rem;
    z-index: 0;

    h2 {
      grid-area: 1/1/2/2;
      padding: 0.5rem 2rem;
      display: flex;
      align-items: center;
      z-index: 1;
      font-family: var(--font-heading);
      letter-spacing: -4%;
      font-weight: 300;
      font-size: 1.5rem;
    }
  }

  > .content {
    z-index: 4;
    grid-area: 2/1/4/2;
    background-color: var(--white);
    border-width: 0 0 0.25rem 0;
    position: relative;
    padding: 0;
  }

  blockquote {
    border-radius: 1rem;
    background-color: var(--background);
    padding: 0.75rem 1rem;
    font-style: italic;
    font-size: 0.75em;
    margin: 1rem 0;
  }
}

.documentation-block + .documentation-block {
  margin-top: 2rem;
}

@media (min-width: 786px) {
  .documentation-block {
    max-width: 90rem;

    > article {
      grid-template-rows: 4.5rem auto 0.25rem;
    }

    header h2 {
      font-size: 2rem;
    }
  }
}
.image-content {
  padding: 1rem;
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
  grid-template-rows: repeat(3, auto);
  grid-template-areas: "image" "content" "extras";
  border-radius: 1rem;
  background-color: white;
  z-index: 1;
  box-shadow: 0 -0.5rem 0.5rem -0.5rem rgba(0, 0, 0, 0.5);

  .img-container {
    grid-area: image;
    text-align: center;

    img {
      justify-self: center;
      border-radius: 0.75rem;
      position: sticky;
      max-width: 100%;
      max-height: 22rem;
      top: 0;
      bottom: 1rem;
      cursor: pointer;

      &.general-controlls,
      &.mix-management {
        max-width: 10rem;
        max-height: auto;
      }
    }
  }

  .content {
    grid-area: content;
  }

  .extras {
    grid-area: extras;
  }
}

@media (min-width: 786px) {
  .image-content {
    grid-template-columns: 20rem 1fr;
    grid-template-rows: auto auto;
    grid-template-areas: "image content" "extras extras";
  }
}

@media (min-width: 1024px) {
  .image-content {
    .img-container img {
      max-height: initial;
    }
  }
}
.image-popout {
  position: fixed;
  width: 100%;
  height: 100%;
  display: flex;
  top: 0;
  left: 0;
  background-color: hsla(0deg, 0%, 0%, 0.6);
  backdrop-filter: blur(4px);
  z-index: 10;
  align-items: center;
  justify-content: center;

  img {
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
    background-color: white;
    border-radius: 0.5rem;
    border: 2px solid white;
  }
}
.explanation-macro {
  border-radius: 1rem;
  border: 2px solid var(--accent-color);
  background-color: var(--background);
  padding: 1rem;
  margin-top: 1rem;
  background-image: url("/reasonus/images/logo-only-dark.svg");
  background-repeat: no-repeat;
  background-position: -2rem -2rem;

  header {
    position: relative;
    top: unset;
    bottom: unset;
  }

  h4 {
    font-family: var(--font-heading);
    font-weight: 300;
    font-size: 1.25rem;
    display: inline-block;
    padding-bottom: 0.25rem;
    margin-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent-color);
  }

  img {
    position: relative;
    height: 5rem;
    margin: 0.5rem 0 0.75rem;
    cursor: pointer;
  }
}
.footer {
  background-color: var(--jonquil);
  padding: 1rem;
  position: relative;

  &::after {
    content: "";
    background-color: var(--background);
    display: block;
    width: 100%;
    top: 0;
    left: 0;
    height: 1rem;
    position: absolute;
    border-radius: 0 0 1rem 1rem;
    box-shadow: 0 0.25rem 0.5rem -0.25rem rgba(0, 0, 0, 0.5);
  }

  .footer-content {
    max-width: 1124px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    list-style: none;
    padding: 1rem 1rem 0;
    height: 100%;
  }

  .link-list {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    list-style: none;
    padding: 0;
    gap: 1rem;

    li {
      margin: 0;
    }

    a {
      display: flex;
      align-items: center;
      text-decoration: none;
      color: var(--black);
      font-weight: 400;
    }

    img {
      height: 2rem;
      width: 2rem;
      margin-right: 0.5rem;
    }

    span {
      display: none;
    }
  }

  .coffee-link {
    display: block;
    height: 7.25rem;
    width: 7.25rem;
  }
}

@media screen and (min-width: 768px) {
  .footer {
    .link-list {
      span {
        display: initial;
      }
    }
  }
}
