/*
 * 虛擬書架統一書籍卡片樣式
 * 對應 includes/book-card.php 與 assets/js/book-card.js 產生的 HTML 結構
 *
 * 需求：前後端、grid／list 兩種模式必須完全一致
 */

/* ==================== Grid Mode ==================== */
.vb-bc.vb-bc-grid {
    height: 220px;
    overflow: hidden;
    background: #fff;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid rgba(0, 0, 0, 0.1);
}
.vb-bc.vb-bc-grid:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}
.vb-bc-row {
    height: 100%;
    margin: 0;
}

/* 封面欄：純白底，圖片置中、不裁切 */
.vb-bc-cover {
    overflow: hidden;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.vb-bc-cover .vb-bc-cover-link,
.vb-bc-cover img {
    display: block;
    width: 100%;
    height: 100%;
    max-height: 100%;
    object-fit: contain;
}
.vb-bc-cover .vb-bc-cover-link {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}
.vb-bc-cover-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: #fff;
    color: #adb5bd;
    font-size: 3rem;
    opacity: 0.35;
}

/* 文字資訊欄 */
.vb-bc-body {
    overflow: hidden;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.vb-bc-title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.15rem;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.vb-bc-title .vb-bc-title-link {
    color: #212529;
    text-decoration: none;
}
.vb-bc-title .vb-bc-title-link:hover {
    color: #0d6efd;
    text-decoration: underline;
}
.vb-bc-title .vb-bc-source {
    font-size: 0.7rem;
    vertical-align: middle;
}
.vb-bc-title-en {
    font-size: 0.78rem;
    color: #6c757d;
    font-style: italic;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.vb-bc-meta-line {
    font-size: 0.78rem;
    color: #6c757d;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.vb-bc-idbadges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem;
    margin-top: 0.15rem;
}
.vb-bc-idbadge {
    font-size: 0.7rem;
    font-weight: normal;
}
.vb-bc-desc {
    font-size: 0.78rem;
    color: #6c757d;
    line-height: 1.3;
    margin-top: 0.2rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.vb-bc-actions {
    margin-top: auto;
    padding-top: 0.3rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}
.vb-bc-actions .btn {
    font-size: 0.78rem;
    padding: 0.2rem 0.5rem;
}

/* ==================== List Mode ==================== */
.vb-bc-list-row td {
    vertical-align: middle;
    padding: 0.6rem 0.5rem;
}
.vb-bc-list-cover-cell {
    width: 60px;
    text-align: center;
}
.vb-bc-list-cover-cell img,
.vb-bc-list-cover-cell .vb-bc-list-cover-placeholder {
    width: 44px;
    height: 60px;
    object-fit: contain;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.05);
}
.vb-bc-list-cover-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #adb5bd;
    font-size: 1.5rem;
    opacity: 0.4;
}
.vb-bc-list-cover-link {
    display: inline-block;
    line-height: 0;
}
.vb-bc-list-titlecell {
    min-width: 200px;
}
.vb-bc-list-title {
    color: #212529;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.92rem;
}
.vb-bc-list-title:hover {
    color: #0d6efd;
    text-decoration: underline;
}
.vb-bc-list-title-en {
    color: #6c757d;
    font-style: italic;
    font-size: 0.8rem;
    margin-top: 0.15rem;
}
.vb-bc-list-idbadges {
    margin-top: 0.25rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem;
}
.vb-bc-list-idbadges .badge {
    font-size: 0.7rem;
    font-weight: normal;
}
.vb-bc-list-author,
.vb-bc-list-publisher,
.vb-bc-list-pubdate {
    font-size: 0.85rem;
    color: #6c757d;
}
.vb-bc-list-source .badge {
    font-size: 0.78rem;
}
.vb-bc-list-actions .btn {
    font-size: 0.78rem;
    padding: 0.25rem 0.6rem;
}

/* RWD：手機畫面隱藏部分欄位避免擠壓 */
@media (max-width: 767.98px) {
    .vb-bc-list-publisher,
    .vb-bc-list-pubdate {
        display: none;
    }
}
