/* --- DESKTOP (Default) --- */
.book-card {
  display: flex;
  align-items: stretch;
  height: 180px;
  width: 120px;
  flex-shrink: 0;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.book-card img {
  width: 120px;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
  z-index: 1;
}

.book-info {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.95);
  border-radius: 6px;
  padding: 0.75rem;
  box-sizing: border-box;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
  display: flex;
  flex-direction: column;
  justify-content: center;
  z-index: 2;
  overflow: hidden;
}

.book-info h3 {
  font-size: 0.9rem;
  margin: 0 0 0.25rem 0;
  font-weight: 700;
}

.book-info .author {
  font-size: 0.75rem;
  color: #666;
  margin: 0 0 0.5rem 0;
  font-style: italic;
}

.book-info .summary {
  font-size: 0.75rem;
  line-height: 1.4;
  color: #333;
  margin: 0;
}

@media (hover: hover) {
  .book-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
  }
  .book-card:hover .book-info {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
}

.book-link {
  text-decoration: none;
  color: inherit;
  display: inline-block;
  cursor: pointer;
}

.book-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

/* Search bar container for centering or spacing */
.search-container {
  display: flex;
  justify-content: center;
  margin: 20px 0;
}

/* Style for the input */
#search-bar {
  width: 60%;
  max-width: 600px;
  padding: 15px 20px;
  font-size: 18px;
  border: 2px solid #ccc;
  border-radius: 25px;
  outline: none;
  transition: 0.3s;
}

#search-bar:focus {
  border-color: #007bff;
  box-shadow: 0 0 8px rgba(0, 123, 255, 0.3);
}

/* --- MOBILE (Max-width 600px) --- */
@media (max-width: 600px) {
  .book-row {
    gap: 15px;
    justify-content: center;
  }

  .book-card {
    width: 100%;
    max-width: 160px;
    height: auto;
    flex-direction: column;
    border: 1px solid #eee;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: transform 0.2s ease;
  }

  .book-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px 8px 0 0;
    flex-shrink: 0;
  }

  .book-info {
    position: relative;
    width: 100%;
    height: auto;
    background-color: #fff;
    border-radius: 0 0 8px 8px;
    padding: 1rem;
    opacity: 1;
    visibility: visible;
    transform: none;
    border: none;
    box-shadow: none;
    justify-content: flex-start;
  }

  .book-info h3 {
    font-size: 1rem;
    margin: 0 0 0.3rem 0;
    line-height: 1.2;
  }

  .book-info .author {
    font-size: 0.85rem;
    color: #555;
    margin: 0 0 0.5rem 0;
    font-weight: 600;
  }

  .book-info .summary {
    display: none;
  }

  .book-card:active {
    transform: scale(0.98);
  }
}

.section-hint {
  font-size: 0.9rem;
  color: #000000;
  margin-top: -0.25rem;
  margin-bottom: 1rem;
}