.book-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: 20px; } .book-item { color: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3); overflow: hidden; transition: transform 0.3s ease-in-out; display: flex; flex-direction: column; justify-content: space-between; height: auto; background-color: var(--surface-card); border-radius: 8px; position: relative; /* Positioning container for the buttons and overlay */ } .book-cover { width: 100%; height: 225px; /* Adjust this as per the image height */ object-fit: cover; background-color: #444; transition: background-color 0.3s ease, filter 0.3s ease; /* Add transition for blur effect */ position: relative; /* Make this the reference point for the overlay and buttons */ } /* Blur and overlay effect */ .book-item:hover .book-cover { filter: blur(2px); /* Apply blur effect to the image */ } .book-item:hover .book-cover::after { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.5); /* Semi-transparent black overlay */ z-index: 0; /* Put overlay behind the buttons */ } .book-info { padding: 10px; text-align: center; display: flex; flex-direction: column; justify-content: flex-start; flex-grow: 1; z-index: 1; /* Ensure the text stays above the overlay */ } h4 { font-size: 1rem; color: var(--text-color); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; text-align: center; margin-bottom: 5px; } p { color: var(--text-color-secondary); font-size: 0.8rem; line-height: 1.4; margin-top: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; margin-bottom: auto; } .authors { font-weight: bold; } .no-authors { color: #888; font-style: italic; } /* PrimeNG button styling */ .view-btn, .read-btn { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -20%); /* Center buttons within the book-cover */ display: none; /* Hide by default */ margin: -60px 0; /* Add spacing between the buttons */ } .book-item:hover .view-btn { display: block; /* Show the View button when the card is hovered */ } .book-item:hover .read-btn { display: block; /* Show the Read button when the card is hovered */ top: 75%; /* Slightly adjust the position to be below the View button */ } .infinite-scroll { margin-top: 20px; }