/* Grid */
.goodreads-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 16px;
}

.goodreads-book {
  position: relative;
  display: inline-block;
}

.goodreads-book img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
}

/* Popup container */
.goodreads-popup {
  position: absolute;
  top: 0;
  left: 110%;
  width: 260px;
  background: #fff;
  border: 1px solid #ddd;
  padding: 12px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
  z-index: 1000;
  font-size: 0.9rem;
  line-height: 1.4;
}

/* Flip to left if needed */
.goodreads-popup.left {
  left: auto;
  right: 110%;
}

/* Remove ALL underlines in popup */
.goodreads-popup,
.goodreads-popup a {
  text-decoration: none !important;
  color: inherit;
}

/* Typography */
.goodreads-popup h3 {
  margin: 0 0 4px 0;
  font-size: 1rem;
  font-weight: 600;
}

.goodreads-popup .author {
  font-style: italic;
  margin-bottom: 6px;
}

.goodreads-popup .meta {
  font-size: 0.8rem;
  margin-bottom: 6px;
  color: #555;
}

.goodreads-popup .review {
  margin-top: 6px;
}

/* Limit popup height + allow scrolling */
.goodreads-popup {
  max-height: 320px;
  overflow-y: auto;
}

/* Optional: nicer scrolling on modern browsers */
.goodreads-popup::-webkit-scrollbar {
  width: 6px;
}

.goodreads-popup::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

.goodreads-popup::-webkit-scrollbar-track {
  background: transparent;
}

