/* =========================================================
 * DuckWow：精选（book）详情页样式
 * Hero 背景 / 四张信息卡 / DUCKWOW 推荐理由
 * 仅在 is_singular('book') 时加载
 * ========================================================= */

/* ---------- Hero ---------- */
.dw-book-hero {
    position: relative;
    overflow: hidden;
    border-radius: var(--theme-border-radius-lg, 12px);
    background: linear-gradient(135deg, #2b3445 0%, #1f2733 100%);
}

.dw-book-hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
}

.dw-book-hero-bg.is-blur {
    filter: blur(30px) brightness(.85);
    transform: scale(1.15);
}

/* 遮罩：保证文字可读 */
.dw-book-hero-mask {
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, rgba(15, 20, 28, .88) 0%, rgba(15, 20, 28, .65) 55%, rgba(15, 20, 28, .45) 100%);
}

.dw-book-hero-inner {
    position: relative;
    z-index: 1;
    padding: 1.75rem 1.75rem 1.5rem;
    color: #fff;
}

/* Hero 内文字反白 */
.dw-book-hero .crumbs,
.dw-book-hero nav[aria-label="breadcrumb"] a,
.dw-book-hero nav[aria-label="breadcrumb"] span {
    color: rgba(255, 255, 255, .75) !important;
}

.dw-book-hero .site-name {
    color: #fff;
}

.dw-book-hero .site-name-box .text-muted,
.dw-book-hero .book-info .text-muted,
.dw-book-hero .views,
.dw-book-hero .io-posts-like {
    color: rgba(255, 255, 255, .75) !important;
}

.dw-book-hero .io-posts-like a,
.dw-book-hero .smooth {
    color: rgba(255, 255, 255, .75) !important;
}

.dw-book-hero .mt-n2 > p {
    color: rgba(255, 255, 255, .92);
    border-left: 3px solid var(--theme-color);
    padding-left: .75rem;
    margin-top: .25rem;
}

/* Hero 内元数据表格反白 */
.dw-book-hero .table-div {
    color: rgba(255, 255, 255, .85);
}

.dw-book-hero .table-div .table-row {
    border-color: rgba(255, 255, 255, .15);
}

.dw-book-hero .table-div a {
    color: #fff;
}

/* Hero 内封面：卡片化 */
.dw-book-hero .book-cover img {
    border-radius: var(--theme-border-radius-md, 8px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, .45);
}

@media screen and (max-width: 767px) {
    .dw-book-hero-inner {
        padding: 1.25rem 1.25rem 1.5rem;
    }

    .dw-book-hero .book-cover img {
        max-width: 150px;
        max-height: 220px;
    }
}

/* ---------- 四张信息卡 ---------- */
.dw-book-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.dw-book-cards.dw-bc-count-3 { grid-template-columns: repeat(3, 1fr); }
.dw-book-cards.dw-bc-count-2 { grid-template-columns: repeat(2, 1fr); }
.dw-book-cards.dw-bc-count-1 { grid-template-columns: minmax(0, 380px); }

/* 与正文同源的卡片背景（card 类：--main-bg-color + 主题阴影） */
.dw-bc-card {
    padding: 16px 16px 12px;
    margin-bottom: 0;
}

/* 头部：图标放入主题色浅底圆角方块 */
.dw-bc-head {
    display: flex;
    align-items: center;
    font-weight: 600;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px dashed rgba(136, 136, 136, .25);
}

.dw-bc-head i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    margin-right: 8px;
    border-radius: 8px;
    color: var(--theme-color);
    background: var(--theme-color-bg);
    font-size: 1rem;
}

.dw-bc-list {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: .85rem;
}

/* 键值对行：行间虚线分隔 */
.dw-bc-list li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    padding: 5px 0;
    line-height: 1.6;
}

.dw-bc-list li + li {
    border-top: 1px dashed rgba(136, 136, 136, .15);
}

.dw-bc-list .dw-bc-k {
    flex-shrink: 0;
    opacity: .55;
    font-size: .82rem;
}

.dw-bc-list .dw-bc-v {
    text-align: right;
    font-weight: 500;
    word-break: break-all;
}

/* 要点列表（优势/人群）：主题色小圆点，无分隔线 */
.dw-bc-list li.dw-bc-dot {
    display: list-item;
    list-style: none;
    position: relative;
    padding-left: 14px;
    font-weight: 400;
}

.dw-bc-list li.dw-bc-dot + li.dw-bc-dot {
    border-top: 0;
}

.dw-bc-list li.dw-bc-dot::before {
    content: "";
    position: absolute;
    left: 0;
    top: .62em;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--theme-color);
}

@media screen and (max-width: 991px) {
    .dw-book-cards,
    .dw-book-cards.dw-bc-count-3,
    .dw-book-cards.dw-bc-count-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 767px) {
    .dw-book-cards,
    .dw-book-cards.dw-bc-count-3,
    .dw-book-cards.dw-bc-count-4,
    .dw-book-cards.dw-bc-count-2 {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .dw-book-cards.dw-bc-count-1 {
        grid-template-columns: 1fr;
    }

    .dw-bc-card {
        padding: 12px 12px 8px;
    }

    .dw-bc-head i {
        width: 26px;
        height: 26px;
    }

    .dw-bc-list {
        font-size: .8rem;
    }
}

/* ---------- DUCKWOW 推荐理由 ---------- */
.dw-book-reason {
    margin-top: 1.5rem;
    border-left: 4px solid var(--theme-color);
    background: linear-gradient(135deg, rgba(var(--theme-color-rgb, 241, 64, 75), .08) 0%, rgba(136, 136, 136, .05) 60%);
}

.dw-reason-head {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.dw-reason-head i {
    color: var(--theme-color);
    font-size: 1.25rem;
    margin-right: 8px;
}

.dw-reason-title {
    font-weight: 700;
    letter-spacing: .02em;
}

.dw-reason-body {
    line-height: 1.9;
}
