
@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

main#body {
  max-width: 80ch;
}

nav {
  .mobile_menu {
    display: none;
  }

  .desktop_menu {
    display: flex;
    flex-direction: column;
    padding: 5px;
  }
}

.book {
  transition: all 400ms;
  border-radius: 5px;
  background-color: transparent;
  height: 280px;
  background-color: var(--bg-0);

  img {
    border-radius: 5px;
    margin: 0;
    width: 180px;
    height: 280px;
    object-fit: cover;
  }


  div {
    display: none;
    padding: 10px;
    margin: 0;
    transition: all 200ms;

    progress, p {
      display: none;
    }
  }

  &:hover {
    scale: 1.2;
    z-index: 100;
    height: calc(280px + 4em);
    width: 180px;
    margin-bottom: -4em !important;
    user-select: none;

    img {
      border-end-start-radius: 0;
      border-end-end-radius: 0;
    }

    div {
      display: flex;
      flex-wrap: wrap;
      flex-direction: column;
      flex-grow: 1;
      width: 100%;
      align-content: center;

      .book_review, .close_button, .info_cover {
        display: none;
      }

      .book_progress {
        animation: fade-in 1s;
      }

      progress, p {
        display: block;
      }

      progress {
        width: 180px;
      }
    }
  }

  &:not(:has(.book_review:target)):hover {
    div {
      justify-self: center;

      progress, p {
        width: 80%;
      }
    }
  }

  &:has(.book_review:target) {
    &:hover, &:hover div {
      scale: 1.0;
      width: fit-content;
      height: fit-content;
      margin-bottom: 0px !important;

      .close_button, .book_progress {
        width: 180px;
        justify-self: center;
        animation: none;
      }

      .info img {
        border-end-start-radius: 5px;
        border-end-end-radius: 5px;
      }
    }

    z-index: 200;
    width: fit-content;
    height: fit-content;
    display: grid;
    animation: fade-in 1s;
    place-items: center;

    div {
      display: grid;
      grid-template-areas: "top-left right"
                           "middle-left right"
                           "bottom-left right";
      grid-template-columns: 1fr 3fr;
      grid-template-rows: 2fr .5fr .5fr;
      gap: 0px;
    }

    .book_progress, progress, p {
      display: block;
      place-items: anchor-center;
      grid-area: middle-left
    }

    .book_progress, .close_button {
      width: 180px;
      justify-self: center;
    }

    .close_button {
      display: block;
      border-radius: 5px;
      grid-area: bottom-left;
      box-shadow: none !important;

      .button {
        background-color: rgb(var(--ac-0));
        color: var(--bg-1);
        text-align: center;
      }
    }

    a:has(img) {
      display: none;
    }

    .info_cover {
      display: block;
      grid-area: top-left;
      margin: 15px;
    }

    .book_review {
      display: block;
      grid-area: right;
      padding: 15px;
      text-align: justify;
    }
  }
}


#game_library img {
  position: relative;
  &:hover {
    scale: 1.2;
    z-index: 100;
  }
  &:target {
    position: fixed;
    top: calc(50% - (180px/2));
    scale: 3;
    z-index: 1000;
    left: calc(50% - (180px/2));
  }  
}
