.bookshelf {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  justify-content: center;
  padding: 16px;
  align-items: center;
  place-items: center;
}

button.card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-width: 300px;
  background-color: #f0f0f0;
  padding: 12px;
  text-align: center;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease-in-out;
  border-radius: 10px;
}

.card:hover {
  transform: scale(1.03);
  box-shadow: 0 10px 15px rgba(0, 0, 0, 0.3);
}

.card:focus {
  transform: scale(1.03);
  box-shadow: 0 10px 15px rgba(0, 0, 0, 0.3);
}

.card-header {
  width: 100%;
  overflow: hidden;
  background-color: #d9d9d9;
  border-radius: 10px;
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 1 / 1;
}

.card-body {
  padding-top: 1rem;
}

.card-title {
  font-family: 'Georgia', serif;
  font-size: 1rem;
  color: #333;
  text-align: center;
}

.card-description {
  font-family: 'Times New Roman', serif;
  color: #666;
  text-align: center;
  font-size: 1rem;
}




.visual-bookshelf {
  width: 80%;
  height: 20px;
  background-color: rgba(139, 69, 19, 0.7);
  /* Brown color for the bookshelf */
  background-image: url('../images/bookimages/wood.jpg');
  /* Add wood texture */
  background-size: cover;
  box-shadow: 0px 5px 5px rgba(0, 0, 0, 0.2);
  border-radius: 3px;
  margin: 10px auto;
  /* Centers the bookshelf horizontally */
  position: relative;
}

.visual-bookshelf::before,
.visual-bookshelf::after {
  content: "";
  width: 30px;
  /* Width of the shelf holders */
  height: 40px;
  /* Height of the shelf holders */
  background-image: url('../images/bookimages/wood.jpg');
  /* Same wood texture as the shelf */
  background-size: cover;
  background-color: rgba(139, 69, 19, 0.7);
  position: absolute;
  top: 100%;
  border-radius: 0 0 5px 5px;
  box-shadow: 0px 5px 5px rgba(0, 0, 0, 0.2);
}

/* make bookshelf responsive to screen size */
/* tablets */
@media (max-width: 768px) {
  .bookshelf {
    grid-template-columns: repeat(auto-fit, minmax(auto-fit, 2fr));
    justify-content: center;
  }
}
/* mobile */
@media (max-width: 480px) {
  .bookshelf {
    grid-template-columns: 1fr;
    justify-content: center;
  }
}
