/*
 * 虛擬書架統一書籍卡片樣式
 * 對應 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;
}
/* 2026-05-28 業主要求：缺封面時套用美觀的預設樣式（取代原本灰底 fa-book icon）
   - 深藍漸層背景（與書架前台主題 sd-navy 一致）
   - 金色書本 icon + 金色裝飾線
   - 底部「無封面」文字 */
.vb-bc-cover-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1e3a5f 0%, #2c4f7c 50%, #1a3355 100%);
    color: #c49b4a;
    position: relative;
    overflow: hidden;
    padding: 1rem;
}
.vb-bc-cover-placeholder::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Cpath d='M0 20h40M20 0v40' stroke='%23ffffff' stroke-width='0.4' opacity='0.06'/%3E%3C/svg%3E");
    pointer-events: none;
}
.vb-bc-cover-placeholder i {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
    position: relative;
    z-index: 1;
}
.vb-bc-cover-placeholder::after {
    content: '無封面';
    color: rgba(255,255,255,0.7);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    border-top: 1px solid #c49b4a;
    padding-top: 0.4rem;
    margin-top: 0.2rem;
    position: relative;
    z-index: 1;
}

/* 文字資訊欄 */
.vb-bc-body {
    overflow: hidden;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
/* 2026-05-28 source / 館藏 badge 列：永遠在書名上方，不受書名長度影響 */
.vb-bc-topbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 0.25rem;
    align-items: center;
}
.vb-bc-topbar .badge {
    font-size: 0.7rem;
    font-weight: 500;
}
.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;
    }
}
