/* =========================================================
   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;
    }
}

/* Tags + short link / share actions */
.book-page-tags-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
}

.book-page-tags-bar .tags-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    flex: 1 1 auto;
    min-width: 0;
}

.book-page-share-actions {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    flex: 0 0 auto;
}

.book-action-btn {
    --ba-accent: var(--bp-accent, #008375);
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    margin: 0;
    padding: 0.42rem 0.78rem;
    border-radius: 0.35rem;
    border: 1px solid color-mix(in srgb, var(--ba-accent) 40%, transparent);
    background: linear-gradient(
        135deg,
        color-mix(in srgb, var(--ba-accent) 16%, #fff) 0%,
        color-mix(in srgb, var(--ba-accent) 8%, transparent) 100%
    );
    color: var(--ba-accent);
    font-size: 0.8rem;
    font-weight: 650;
    line-height: 1.2;
    cursor: pointer;
    isolation: isolate;
    transition: transform 0.25s ease, box-shadow 0.25s ease, color 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.book-action-btn::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 20%, rgba(255, 255, 255, 0.45) 45%, transparent 70%);
    transform: translateX(-120%);
    transition: transform 0.55s ease;
    z-index: -1;
}

.book-action-btn:hover,
.book-action-btn:focus-visible {
    color: #fff;
    border-color: var(--ba-accent);
    background: linear-gradient(135deg, var(--ba-accent), color-mix(in srgb, var(--ba-accent) 75%, #00a085));
    box-shadow: 0 8px 18px color-mix(in srgb, var(--ba-accent) 28%, transparent);
    transform: translateY(-2px);
    outline: none;
}

.book-action-btn:hover::before,
.book-action-btn:focus-visible::before {
    transform: translateX(120%);
}

.book-action-btn:active {
    transform: translateY(0);
}

.book-action-btn i {
    font-size: 1rem;
}

.book-share-btn {
    --ba-accent: #2563eb;
}

.book-share-menu {
    min-width: 12.5rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
    padding: 0.35rem;
}

.book-share-menu .dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    border-radius: 0.35rem;
    font-size: 0.86rem;
    padding: 0.5rem 0.65rem;
}

.book-share-menu .dropdown-item i {
    width: 1.1rem;
    text-align: center;
    color: var(--bp-accent, #008375);
}

body.dark-theme .book-action-btn,
html.dark-theme .book-action-btn {
    background: linear-gradient(
        135deg,
        color-mix(in srgb, var(--ba-accent) 22%, transparent) 0%,
        color-mix(in srgb, var(--ba-accent) 10%, transparent) 100%
    );
}

body.dark-theme .book-share-menu,
html.dark-theme .book-share-menu {
    background: var(--bp-surface, #1e222d);
    border-color: rgba(255, 255, 255, 0.08);
}

@media (max-width: 575.98px) {
    .book-page-tags-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .book-page-share-actions {
        width: 100%;
    }

    .book-action-btn {
        flex: 1 1 auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .book-action-btn,
    .book-action-btn::before {
        transition: none !important;
    }
}
/* Bottom-left notifications */
.book-notify-host {
    position: fixed;
    left: 1rem;
    bottom: 1rem;
    z-index: 1080;
    display: flex;
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 0.55rem;
    pointer-events: none;
    max-width: min(20rem, calc(100vw - 2rem));
}

.book-notify {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    width: max-content;
    max-width: 100%;
    padding: 0.7rem 0.9rem;
    border-radius: 0.55rem;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
    color: #0f172a;
    opacity: 0;
    transform: translateY(12px) scale(0.98);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.book-notify.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.book-notify.is-hiding {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
}

.book-notify__icon {
    flex: 0 0 auto;
    font-size: 1.05rem;
    line-height: 1;
}

.book-notify--success .book-notify__icon { color: #008375; }
.book-notify--error .book-notify__icon { color: #dc2626; }
.book-notify--warning .book-notify__icon { color: #d97706; }
.book-notify--info .book-notify__icon { color: #2563eb; }

.book-notify__text {
    font-size: 0.84rem;
    font-weight: 600;
    line-height: 1.4;
}

body.dark-theme .book-notify,
html.dark-theme .book-notify {
    background: #1e222d;
    color: #f1f5f9;
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

@media (prefers-reduced-motion: reduce) {
    .book-notify {
        transition: none !important;
    }
}

/* ---------- Publishing content headings ---------- */
.style-box-book .content-text.publishing h2,
.style-box-book .content-text.publishing h3,
article .publishing h2,
article .publishing h3 {
    font-size: 1.35rem;
    color: var(--first-color, #008375);
    line-height: 1.7;
}

.style-box-book .content-text.publishing h4,
.style-box-book .content-text.publishing h5,
article .publishing h4,
article .publishing h5 {
    font-size: 1.15rem;
    color: var(--first-color, #008375);
    line-height: 1.7;
}

@media (max-width: 991.98px) {
    .style-box-book .content-text.publishing h2,
    .style-box-book .content-text.publishing h3,
    article .publishing h2,
    article .publishing h3 {
        font-size: 1.28rem;
    }

    .style-box-book .content-text.publishing h4,
    .style-box-book .content-text.publishing h5,
    article .publishing h4,
    article .publishing h5 {
        font-size: 1.1rem;
    }
}

@media (max-width: 575.98px) {
    .style-box-book .content-text.publishing h2,
    .style-box-book .content-text.publishing h3,
    article .publishing h2,
    article .publishing h3 {
        font-size: 1.2rem;
    }

    .style-box-book .content-text.publishing h4,
    .style-box-book .content-text.publishing h5,
    article .publishing h4,
    article .publishing h5 {
        font-size: 1.05rem;
    }
}

/* ---------- Publishing / content tables ---------- */
.style-box-book .content-text.publishing .table-responsive,
.content-text.publishing .table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 1rem 0;
}

.style-box-book .content-text.publishing table,
.content-text.publishing table,
article .publishing table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    background: var(--body-box-color, #fff);
    color: var(--title-color, #0f172a);
}

.style-box-book .content-text.publishing th,
.style-box-book .content-text.publishing td,
.content-text.publishing th,
.content-text.publishing td,
article .publishing th,
article .publishing td {
    border: 1px solid rgba(0, 131, 117, 0.28);
    padding: 0.55rem 0.75rem;
    vertical-align: top;
    line-height: 1.7;
}

.style-box-book .content-text.publishing th,
.content-text.publishing th,
article .publishing th {
    background: color-mix(in srgb, var(--first-color, #008375) 12%, transparent);
    color: var(--first-color, #008375);
    font-weight: 700;
    text-align: inherit;
}

body.dark-theme .style-box-book .content-text.publishing th,
body.dark-theme .content-text.publishing th,
html.dark-theme .style-box-book .content-text.publishing th,
html.dark-theme .content-text.publishing th,
body.dark-theme article .publishing th,
html.dark-theme article .publishing th {
    background: rgba(0, 212, 187, 0.12);
    border-color: rgba(0, 212, 187, 0.28);
}

body.dark-theme .style-box-book .content-text.publishing td,
body.dark-theme .content-text.publishing td,
html.dark-theme .style-box-book .content-text.publishing td,
html.dark-theme .content-text.publishing td,
body.dark-theme article .publishing td,
html.dark-theme article .publishing td {
    border-color: rgba(0, 212, 187, 0.22);
}
