/* Books Gallery Component */
.books-gallery-component {
    padding: 80px 0;
    background-color: #ffffff;
    max-width: 1400px;
    margin: 0 auto;
    padding-left: 3rem;
    padding-right: 3rem;
}

@media (max-width: 991px) {
    .books-gallery-component {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-subtitle {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--primary);
    margin-bottom: 8px;
}

.section-title {
    font-family: 'IBM Plex Serif', serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 15px;
}

.section-divider {
    width: 50px;
    height: 3px;
    background-color: var(--tertiary);
    margin: 0 auto;
    border-radius: 2px;
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); /* Reduced size for smaller cards */
    gap: 30px;
    margin-bottom: 50px;
}

.book-card-item {
    max-width: 250px; /* Limit individual card width */
    margin: 0 auto;
    width: 100%;
}

.book-cover-wrapper {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 2/3;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    margin-bottom: 15px;
    background-color: #f8f9fa;
}

.book-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.book-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease;
    backdrop-filter: blur(3px);
}

.view-book-btn {
    padding: 0.6rem 1.2rem;
    border: 2px solid #fff;
    color: #fff;
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 1px;
    text-decoration: none;
    border-radius: 50px;
    transform: translateY(15px);
    transition: all 0.4s ease;
}

.book-card-item:hover .book-cover-img {
    transform: scale(1.08);
}

.book-card-item:hover .book-overlay {
    opacity: 1;
}

.book-card-item:hover .view-book-btn {
    transform: translateY(0);
}

.view-book-btn:hover {
    background: #fff;
    color: #000;
}

.book-info {
    text-align: center;
}

.book-title {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}

.book-author {
    font-size: 0.85rem;
    color: #777;
    margin-bottom: 0;
}

.view-all-container {
    text-align: center;
}

.view-all-link {
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: gap 0.3s ease;
}

.view-all-link:hover {
    gap: 12px;
    text-decoration: underline;
}

@media (max-width: 768px) {
    .section-title {
        font-size: 2rem;
    }
    
    .books-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 20px;
    }
    
    .book-card-item {
        max-width: 180px;
    }
}
