@import url(typography.css);

body {
  margin-bottom: 60px;
}

header {
  display: block; box-sizing: border-box;
  padding: 10px 20px;

  @media screen {
    background: black;
    color: white;
  }

  h1 {
    font-size: 1em;
  }

  @media screen and (width >= 640px) {
    position: fixed; top: 0; left: 0;
    width: 240px;
    height: 100vh;
    overflow-y: scroll;

    ul {
      padding: 0 20px;
    }
  }

  @media print, screen and (width < 640px) {
    nav {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 10px;
    }

    h1, ul, p {
      margin: 0;
    }

    ul {
      max-width: 400px;
      flex-shrink: 1;
      display: flex;
      flex-wrap: 1;
      padding-left: 0;
    }

    ul li {
      display: inline;
      margin-right: 1.5ch;
    }
  }
}

main::before {
  z-index: -1;

  content: "";
  display: block;

  @media screen and (width >= 640px) {
    position: fixed;
    top: 0;
    left: calc(40px + min(200px, 24vw));
    right: 0;
    height: 100vh;
    min-height: 800px;
    background-size: cover;
  }

  @media screen and (width < 640px) {
    width: 100%;
    aspect-ratio: 16 / 9;
    background-size: cover;
    margin-bottom: 25px;
  }
}

main {
  @media screen and (width >= 640px) {
    position: absolute;
    top: 0; left: 240px; right: 0;
    padding: 20px 20px;

    overflow-y: scroll;
    padding-bottom: 60px;
  }
}

main article section {
  &:not(.raw) {
    text-wrap: pretty;
  }

  @media screen and (width >= 640px) {
    max-width: 600px;
    min-height: 40px;
    margin: 10px auto;
    padding: 0px 20px;
    background: white;
    border-radius: 4px;

    border: 2px solid black;
    box-shadow: 0 4px 18px #0007;

    &:is(:first-child) {
      border: 2px solid black;
      box-shadow: 0 6px 20px #000c;
    }

    &:not(.raw) {
      background:
        linear-gradient(to right,
          white 0%, white calc(100% - 30px),
          #ddd calc(100% - 10px), #ddd 100%);
    }
  }
}

main article aside {
  border-left: 2px solid black;
  padding-left: 10px;

  @media screen and (width >= 640px) {
    border: none;
    padding: 0;

    max-width: 400px;
    margin: 35px auto 55px;
    filter: drop-shadow(4px 4px black);

    p {
      background: white;
      color: black;
    }
  }
}
