*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 10px;
  font-family: Arial, Helvetica, sans-serif;
}

body > * {
  margin: 1rem;
}

body {
  min-height: 100vh;
  height: 100vh;
  font-size: 1.5rem;
  /* border: 1px solid blue; */
}

h1 {
  font-size: min(3rem, 10vw);
  margin-top: 2rem;
}

main {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, 80px);
  grid-auto-rows: 110px;
  gap: 30px;
  min-height: 110px;
  border-top: 1px solid rgba(0, 0, 0, 0.385);
  border-bottom: 1px solid rgba(0, 0, 0, 0.385);
  padding-top: 20px;
  padding-bottom: 20px;
}

.bookCard {
  border: 2px solid rgb(0, 0, 0);
  border-radius: 3px;
  display: grid;
  place-items: center;

  grid-template-columns: 1fr;
  grid-template-rows: 1fr 25px;
  position: relative;
  text-align: center;
  padding: 10px;
}

.bookContent {
  width: auto;
  text-align: center;
  margin: 5px;

  grid-row: 1 / 2;
  grid-column: 1 / 2;
}

form {
  display: flex;
  flex-direction: column;

  width: 400px;
  /* display: none; */
  /* opacity: 0; */
}

form.open {
  opacity: 1;
  display: flex;
}

button {
  align-self: start;
}

.remove-book-x-btn {
  display: none;
  position: absolute;
  /* top: 3px;
  right: 3px; */
  grid-row: 1 / 2;
  grid-column: 1 / 2;
  align-self: start;
  justify-self: end;
  border: none;
  z-index: 1;
  padding: 3px 5px;
}

.bookCard:hover {
  .remove-book-x-btn {
    display: block;
    cursor: pointer;
  }
}

.remove-book-x-btn:hover {
  background-color: hsl(0, 100%, 50%);
  color: white;
}

.remove-book-x-btn:active {
  background-color: hsl(0, 100%, 37%);
}

@media (width < 500px) {
  main {
    justify-content: center;
  }

  H1 {
    text-align: center;
  }
}

dialog {
  margin: auto;
  padding: 10px;
  border: 1px solid gray;
  border-radius: 10px;
}

.modal-buttons {
  display: flex;
  justify-content: space-between;

  margin-top: 10px;
}

.library-buttons {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
}
