/* Enhanced Book Cards - Consistent Style Across Platform */
.book-card {
    border: none;
    border-radius: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    background: white;
    font-family: 'EB Garamond', 'Garamond', Georgia, serif;
}

/* Tighter spacing for book details - applied globally */
.book-card .card-body .mt-auto {
    margin-top: auto !important;
}

.book-card .card-body .mt-auto .mb-2 {
    margin-bottom: 0.25rem !important;
}

.book-card .card-body .mt-auto small {
    display: block;
    margin-top: 0.25rem;
}

.book-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

/* Universal A5 Image Ratio for All Book Images */
.book-image,
.card-img-top,
.book-thumbnail,
.book-cover,
img.book-image,
.book-img {
    position: relative;
    aspect-ratio: 5 / 7 !important; /* A5 ratio (148mm × 210mm) - forced on all pages */
    overflow: hidden;
    width: 100%;
    object-fit: cover;
}

.book-image {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.book-image img,
.card-img-top,
.book-thumbnail img,
.book-cover img,
.book-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    aspect-ratio: 5 / 7 !important;
}

.book-card:hover .book-image img {
    transform: scale(1.05);
}

/* Clickable card styles */
a.book-card-link {
    text-decoration: none !important;
    color: inherit;
    display: block;
}

a.book-card-link:hover {
    text-decoration: none !important;
    color: inherit;
}

a.book-card-link .book-card {
    cursor: pointer;
}

/* Remove text decoration from all book card elements */
.book-card a,
.book-card a:hover,
.book-card a:focus,
.book-card a:active,
.book-card .card-title,
.book-card .card-text,
.book-card .card-text a,
.book-card h5,
.book-card p {
    text-decoration: none !important;
}

/* Ensure book titles and author names have no underline */
.book-card .card-title a,
.book-card .card-text a {
    text-decoration: none !important;
    color: inherit;
}

.book-card .card-title a:hover,
.book-card .card-text a:hover {
    text-decoration: none !important;
    color: inherit;
}

.no-image {
    width: 100%;
    aspect-ratio: 5 / 7; /* A5 ratio to match book covers */
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.price {
    color: var(--success-color);
    font-weight: 600;
    font-size: 1.3rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: 'EB Garamond', 'Garamond', Georgia, serif;
    letter-spacing: 0.5px;
    text-decoration: none !important;
}

.price a,
.price a:hover {
    text-decoration: none !important;
    color: inherit;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    font-family: 'EB Garamond', 'Garamond', Georgia, serif;
    letter-spacing: 0.3px;
    line-height: 1.3;
    text-decoration: none !important;
}

.card-text {
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
    font-family: 'EB Garamond', 'Garamond', Georgia, serif;
    line-height: 1.4;
    text-decoration: none !important;
}

/* Remove underline from author names and all text in book cards */
.card-text a,
.card-text a:hover,
.card-text a:focus {
    text-decoration: none !important;
    color: inherit;
}

.card-title a,
.card-title a:hover,
.card-title a:focus {
    text-decoration: none !important;
    color: inherit;
}

.card-body {
    padding: 1rem;
}

.card-body small {
    margin-bottom: 0 !important;
    margin-top: 0.25rem !important;
    line-height: 1.2;
    display: block;
    text-decoration: none !important;
}

.card-body small a,
.card-body small a:hover {
    text-decoration: none !important;
    color: inherit;
}

.price {
    margin-bottom: 0.25rem !important;
}

/* Override Bootstrap default margins for tighter spacing */
.book-card .card-body p {
    margin-bottom: 0.25rem !important;
}

.book-card .card-body h5 {
    margin-bottom: 0.25rem !important;
}

/* Ensure price section has tight spacing */
.book-card .w-100.mb-2 {
    margin-bottom: 0.25rem !important;
}

/* Responsive A5 Images - All Screen Sizes */
@media (max-width: 768px) {
    .book-image,
    .card-img-top,
    .book-thumbnail,
    .book-cover,
    img.book-image,
    .book-img {
        aspect-ratio: 5 / 7 !important;
        object-fit: cover;
    }
    
    .book-image img,
    .card-img-top,
    .book-thumbnail img,
    .book-cover img,
    .book-img {
        aspect-ratio: 5 / 7 !important;
        object-fit: cover;
    }
    
    .card-body {
        padding: 0.875rem;
    }
    
    .card-title {
        margin-bottom: 0.2rem;
        line-height: 1.25;
    }
    
    .card-text {
        margin-bottom: 0.2rem;
        line-height: 1.3;
    }
}

@media (max-width: 576px) {
    .book-image,
    .card-img-top,
    .book-thumbnail,
    .book-cover,
    img.book-image,
    .book-img {
        aspect-ratio: 5 / 7 !important;
        object-fit: cover;
    }
    
    .card-body {
        padding: 0.625rem;
    }
    
    .card-title {
        margin-bottom: 0.15rem;
        line-height: 1.2;
        font-size: 0.9rem;
    }
    
    .card-text {
        margin-bottom: 0.15rem;
        line-height: 1.25;
        font-size: 0.8rem;
    }
    
    .card-body small {
        margin-top: 0.15rem !important;
        font-size: 0.75rem;
    }
    
    .price {
        font-size: 1.1rem;
        margin-bottom: 0.15rem !important;
    }
}
