/* =========================================================
   Book detail page — modern shell
   Scoped under .bp-page
   ========================================================= */

.bp-page {
    --bp-accent: var(--first-color, #008375);
    --bp-accent-2: #00a085;
    --bp-text: var(--title-color, #0f172a);
    --bp-muted: var(--text-color, #64748b);
    --bp-surface: var(--body-box-color, #fff);
    --bp-border: rgba(15, 23, 42, 0.08);
    --bp-radius: 1.15rem;
    --bp-soft: color-mix(in srgb, var(--bp-accent) 9%, transparent);
}

body.dark-theme .bp-page {
    --bp-border: rgba(255, 255, 255, 0.08);
}

.bp-shell {
    padding: 1.15rem 1.15rem 1.5rem;
    border-radius: var(--bp-radius);
    background: var(--bp-surface);
    border: 1px solid var(--bp-border);
    box-shadow: 0 10px 32px rgba(15, 23, 42, 0.07);
}

body.dark-theme .bp-shell {
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.28);
}

.bp-hero {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    margin-bottom: 1.35rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--bp-border);
}

@media (min-width: 768px) {
    .bp-hero {
        grid-template-columns: minmax(0, 280px) minmax(0, 1fr);
        align-items: start;
        gap: 1.5rem;
    }
}

.bp-cover {
    position: relative;
    border-radius: 1rem;
    overflow: hidden;
    background: var(--bp-soft);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
}

.bp-cover img,
.bp-cover .book-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 1rem;
    object-fit: cover;
}

.bp-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.78rem;
    color: var(--bp-muted);
}

.bp-crumb {
    display: block;
    margin-bottom: 0.55rem;
    font-size: 0.8rem;
    color: var(--bp-muted);
    line-height: 1.7;
}

.bp-crumb a {
    color: var(--bp-accent);
    text-decoration: none;
}

.bp-divider {
    margin: 0 0 0.75rem;
    border: 0;
    border-top: 1px solid var(--bp-border);
    opacity: 1;
}

.bp-kicker {
    margin: 0 0 0.85rem;
    font-size: clamp(1.05rem, 2vw, 1.25rem);
    font-weight: 750;
    color: var(--bp-accent);
    line-height: 1.65;
}

.bp-title {
    margin: 0 0 0.85rem;
    font-size: clamp(1.35rem, 2.6vw, 1.7rem);
    font-weight: 800;
    color: var(--bp-text);
    line-height: 1.45;
    letter-spacing: -0.02em;
}

.bp-author {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.85rem;
    font-size: 0.95rem;
    color: var(--bp-muted);
}

.bp-author a {
    color: var(--bp-accent);
    font-weight: 700;
    text-decoration: none;
}

.bp-author a:hover {
    text-decoration: underline;
}

.bp-summary {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.9;
    color: var(--bp-muted);
    text-align: justify;
}

.bp-body {
    font-size: 0.98rem;
    line-height: 2;
    color: var(--bp-text);
}

.bp-body h1,
.bp-body h2,
.bp-body h3,
.bp-body h4,
.bp-body h5,
.bp-body h6 {
    color: var(--bp-accent);
    margin-top: 1.4rem;
}

/* ---------- Related books sidebar ---------- */
.bp-related {
    padding: 1rem;
    border-radius: var(--bp-radius);
    background: var(--bp-surface);
    border: 1px solid var(--bp-border);
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.06);
}

body.dark-theme .bp-related {
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
}

.bp-related__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.9rem;
    padding-bottom: 0.7rem;
    border-bottom: 1px solid var(--bp-border);
}

.bp-related__head h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 750;
    color: var(--bp-accent);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.bp-related__count {
    font-size: 0.72rem;
    font-weight: 650;
    color: var(--bp-accent);
    background: var(--bp-soft);
    border-radius: 999px;
    padding: 0.2rem 0.55rem;
}

.bp-related__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.bp-related__card {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 0.7rem;
    align-items: center;
    padding: 0.55rem;
    border-radius: 0.9rem;
    text-decoration: none;
    color: inherit;
    background: var(--bp-soft);
    border: 1px solid transparent;
    transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease;
}

.bp-related__card:hover,
.bp-related__card:focus-visible {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--bp-accent) 35%, var(--bp-border));
    background: color-mix(in srgb, var(--bp-accent) 14%, transparent);
    outline: none;
    color: inherit;
}

.bp-related__thumb {
    width: 64px;
    height: 88px;
    border-radius: 0.55rem;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
    flex-shrink: 0;
}

.bp-related__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.bp-related__card:hover .bp-related__thumb img {
    transform: scale(1.05);
}

.bp-related__meta {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.bp-related__meta strong {
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--bp-text);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bp-related__cta {
    font-size: 0.74rem;
    font-weight: 650;
    color: var(--bp-accent);
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.bp-related__more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    width: 100%;
    margin-top: 0.9rem;
    padding: 0.55rem 0.75rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 650;
    text-decoration: none;
    color: #fff;
    background: linear-gradient(135deg, var(--bp-accent), var(--bp-accent-2));
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.bp-related__more:hover {
    opacity: 0.93;
    transform: translateY(-1px);
    color: #fff;
}

@media (max-width: 991.98px) {
    .bp-related {
        margin-top: 1rem;
        position: static !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bp-related__card,
    .bp-related__thumb img {
        transition: none !important;
    }
}
