/* Single book page (/book/<slug>/) — builds on library.css (colors, buttons,
   price, badges and preview page styles). */

/* The theme's content wrapper may be a multi-column grid or flex row (e.g.
   Woodmart's 12-column .wd-grid-g) — always take the full row, or the page
   gets squeezed into the first column. */
.satsigne-book-main {
    grid-column: 1 / -1;
    flex: 1 1 100%;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.satsigne-book-page {
    font-family: 'Inter', sans-serif;
    color: hsl(var(--foreground));
    max-width: 1120px;
    margin: 0 auto;
    padding: 32px 20px 64px;
    box-sizing: border-box;
    text-align: left;
}

.satsigne-book-page *, .satsigne-book-page *::before, .satsigne-book-page *::after {
    box-sizing: border-box;
}

.satsigne-book-page a { text-decoration: none; }

.satsigne-book-page i[data-lucide], .satsigne-book-page svg.lucide {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Breadcrumb */
.sbp-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
    margin-bottom: 32px;
}

.sbp-breadcrumb a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: hsl(var(--muted-foreground));
    transition: color 0.2s;
}

.sbp-breadcrumb a:hover { color: hsl(var(--foreground)); }
.sbp-sep { opacity: 0.5; }

/* Hero: cover + info */
.sbp-hero {
    display: grid;
    grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
    gap: 56px;
    align-items: start;
}

.sbp-cover {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    background: hsl(var(--muted));
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 24px 48px -16px rgba(15, 23, 42, 0.25);
}

.sbp-cover img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 2 / 3;
    object-fit: cover;
}

.sbp-info {
    display: flex;
    flex-direction: column;
    padding-top: 8px;
}

.sbp-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.sbp-chip {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 999px;
    background: hsl(var(--muted));
    color: hsl(var(--muted-foreground)) !important;
    transition: background 0.2s, color 0.2s;
}

.sbp-chip:hover {
    background: hsl(var(--border));
    color: hsl(var(--foreground)) !important;
}

.sbp-title {
    font-size: 2.5rem;
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: hsl(var(--foreground));
    margin: 0 0 10px;
}

.sbp-author {
    font-size: 1.125rem;
    color: hsl(var(--muted-foreground));
    margin: 0 0 20px;
}

.sbp-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
    margin-bottom: 28px;
}

.sbp-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Buy box */
.sbp-buy-box {
    border: 1px solid hsl(var(--border));
    border-radius: 12px;
    padding: 24px;
    max-width: 440px;
    background: hsl(var(--background));
}

.book-price.sbp-price {
    font-size: 1.75rem;
    margin: 0 0 18px;
    line-height: 1.2;
}

.book-price.sbp-price del { font-size: 1.125rem; }

.sbp-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sbp-actions .scn-btn-primary,
.sbp-actions .scn-btn-outline {
    height: 48px;
    font-size: 0.9375rem;
}

.sbp-actions svg.lucide, .sbp-actions i[data-lucide] { width: 18px; height: 18px; }

.sbp-unavailable {
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
}

.sbp-owned { margin-bottom: 18px; }

.sbp-owned-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #059669;
    margin-bottom: 14px;
}

.sbp-progress-text {
    font-size: 0.8125rem;
    color: hsl(var(--muted-foreground));
    margin-bottom: 6px;
}

.sbp-share {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 14px;
    padding: 8px;
    border: none;
    background: none;
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 500;
    color: hsl(var(--muted-foreground));
    cursor: pointer;
    transition: color 0.2s;
}

.sbp-share:hover { color: hsl(var(--foreground)); }

/* Sections */
.sbp-section {
    margin-top: 64px;
    padding-top: 40px;
    border-top: 1px solid hsl(var(--border));
}

.sbp-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
}

.sbp-section-title {
    font-size: 1.375rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: hsl(var(--foreground));
    margin: 0 0 20px;
}

.sbp-section-head .sbp-section-title { margin-bottom: 4px; }

.sbp-section-sub {
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
    margin: 0 0 20px;
}

.sbp-section-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    color: hsl(var(--foreground)) !important;
    white-space: nowrap;
}

.sbp-section-link:hover { opacity: 0.7; }

.sbp-description {
    max-width: 720px;
    font-size: 1rem;
    line-height: 1.75;
    color: hsl(var(--foreground) / 0.85);
}

.sbp-description p { margin: 0 0 1em; }
.sbp-description p:last-child { margin-bottom: 0; }

/* Preview strip: pages side by side, scrolls horizontally */
.sbp-preview {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding: 24px;
    border-radius: 12px;
    background: hsl(var(--muted));
    scroll-snap-type: x proximity;
}

.sbp-preview .preview-page-wrapper {
    flex: 0 0 auto;
    width: 260px;
    scroll-snap-align: start;
}

.sbp-preview .preview-img { width: 100%; }

.sbp-preview .preview-placeholder,
.sbp-preview .preview-error {
    width: 100%;
    text-align: center;
}

/* Related books */
.sbp-related {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
}

.sbp-related-card {
    display: block;
    color: inherit !important;
}

.sbp-related-cover {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: hsl(var(--muted));
    margin-bottom: 12px;
    box-shadow: 0 8px 20px -10px rgba(15, 23, 42, 0.25);
    transition: transform 0.2s, box-shadow 0.2s;
}

.sbp-related-card:hover .sbp-related-cover {
    transform: translateY(-4px);
    box-shadow: 0 16px 28px -12px rgba(15, 23, 42, 0.3);
}

.sbp-related-cover img {
    display: block;
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
}

.sbp-related-title {
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.35;
    color: hsl(var(--foreground));
}

.sbp-related-author {
    font-size: 0.8125rem;
    color: hsl(var(--muted-foreground));
    margin-top: 2px;
}

.sbp-related-card .book-price {
    font-size: 0.875rem;
    margin-top: 4px;
}

/* Responsive */
@media (max-width: 900px) {
    .sbp-hero { grid-template-columns: minmax(0, 260px) minmax(0, 1fr); gap: 36px; }
    .sbp-title { font-size: 2rem; }
    .sbp-related { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
    .satsigne-book-page { padding: 20px 16px 48px; }
    .sbp-breadcrumb { margin-bottom: 20px; }
    .sbp-hero { grid-template-columns: 1fr; gap: 28px; }
    .sbp-cover { max-width: 240px; margin: 0 auto; }
    .sbp-info { padding-top: 0; }
    .sbp-title { font-size: 1.75rem; }
    .sbp-buy-box { max-width: none; padding: 20px; }
    .sbp-section { margin-top: 44px; padding-top: 32px; }
    .sbp-section-title { font-size: 1.1875rem; }
    .sbp-section-head { flex-wrap: wrap; row-gap: 0; }
    .sbp-section-head .sbp-section-link { order: 3; width: 100%; margin-bottom: 4px; }
    .sbp-preview { padding: 16px; gap: 14px; }
    .sbp-preview .preview-page-wrapper { width: 200px; }
    .sbp-related { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
}
