/* Book Affiliate Plugin — Public Styles */
/* These are baseline styles. Override in your theme CSS. */

/* ── Layout ─────────────────────────────────────────────────────────────── */
.bap-main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 16px 48px;
}

/* ── Breadcrumb ─────────────────────────────────────────────────────────── */
.bap-breadcrumb {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 20px;
}
.bap-breadcrumb a { color: #3b82f6; text-decoration: none; }
.bap-breadcrumb a:hover { text-decoration: underline; }
.bap-sep { margin: 0 6px; }

/* ── Genre Tags ─────────────────────────────────────────────────────────── */
.bap-genre-tags { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.bap-genre-tag {
    padding: 3px 10px;
    background: #f1f5f9;
    border-radius: 9999px;
    font-size: 12px;
    color: #475569;
    text-decoration: none;
}
.bap-genre-tag:hover { background: #e2e8f0; }

/* ── Section Title ──────────────────────────────────────────────────────── */
.bap-section-title {
    font-size: 22px;
    font-weight: 700;
    margin: 32px 0 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e2e8f0;
}
.bap-count {
    font-size: 15px;
    font-weight: 400;
    color: #94a3b8;
    margin-left: 8px;
}

/* ── Author Hero ────────────────────────────────────────────────────────── */
.bap-author-hero {
    display: flex;
    gap: 32px;
    margin-bottom: 32px;
    align-items: flex-start;
}
.bap-author-photo img {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #e2e8f0;
}
.bap-author-title { font-size: 28px; font-weight: 800; margin: 0 0 8px; }

/* ── Book Grid ──────────────────────────────────────────────────────────── */
.bap-book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
}

/* ── Book Card ──────────────────────────────────────────────────────────── */
.bap-book-card {
    display: flex;
    flex-direction: column;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
}
.bap-book-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.10);
    transform: translateY(-2px);
}
.bap-cover-link { display: block; }
.bap-book-card img {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    display: block;
}
.bap-card-body {
    padding: 10px 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.bap-book-title {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    margin: 0;
}
.bap-book-title a { color: #1e293b; text-decoration: none; }
.bap-book-title a:hover { color: #3b82f6; }
.bap-book-year { font-size: 12px; color: #94a3b8; margin: 0; }

/* ── Buy Button ─────────────────────────────────────────────────────────── */
.bap-buy-btn {
    display: inline-block;
    padding: 7px 14px;
    background: #f59e0b;
    color: #1a1a1a;
    font-size: 12px;
    font-weight: 700;
    border-radius: 4px;
    text-decoration: none;
    text-align: center;
    margin-top: auto;
}
.bap-buy-btn:hover { background: #d97706; color: #fff; }
.bap-buy-btn--lg {
    padding: 12px 24px;
    font-size: 15px;
    border-radius: 6px;
    margin-top: 16px;
}

/* ── Cover Placeholder ──────────────────────────────────────────────────── */
.bap-cover-placeholder {
    width: 100%;
    aspect-ratio: 2/3;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
}
.bap-cover-placeholder span {
    font-size: 12px;
    color: #fff;
    text-align: center;
    font-weight: 600;
    line-height: 1.4;
}
.bap-cover-placeholder--lg { aspect-ratio: 2/3; width: 200px; border-radius: 8px; }

/* ── Series Hero ────────────────────────────────────────────────────────── */
.bap-series-hero { margin-bottom: 24px; }
.bap-series-title { font-size: 30px; font-weight: 800; margin: 8px 0; }
.bap-series-author { font-size: 16px; color: #64748b; margin: 4px 0; }
.bap-series-count { font-size: 14px; color: #94a3b8; margin: 0; }
.bap-series-desc { margin-bottom: 32px; line-height: 1.7; color: #374151; }

/* ── Reading Order List ─────────────────────────────────────────────────── */
.bap-order-list { list-style: none; margin: 0; padding: 0; }
.bap-order-item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 16px 0;
    border-bottom: 1px solid #f1f5f9;
}
.bap-order-item:last-child { border-bottom: none; }
.bap-order-number {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    background: #3b82f6;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    margin-top: 4px;
}
.bap-order-cover { flex-shrink: 0; width: 80px; }
.bap-order-cover img { width: 80px; border-radius: 4px; }
.bap-order-body { flex: 1; }
.bap-order-title { font-size: 17px; font-weight: 700; margin: 0 0 4px; }
.bap-order-title a { color: #1e293b; text-decoration: none; }
.bap-order-title a:hover { color: #3b82f6; }
.bap-order-year { font-size: 13px; color: #94a3b8; margin: 0 0 6px; }
.bap-order-excerpt { font-size: 14px; color: #475569; margin: 0 0 10px; line-height: 1.5; }

/* ── Book Hero ──────────────────────────────────────────────────────────── */
.bap-book-hero {
    display: flex;
    gap: 32px;
    margin-bottom: 32px;
    align-items: flex-start;
}
.bap-book-cover-wrap { flex-shrink: 0; }
.bap-book-cover { width: 200px; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.15); }
.bap-book-title { font-size: 28px; font-weight: 800; margin: 0 0 6px; }
.bap-book-subtitle { font-size: 17px; color: #64748b; margin: 0 0 10px; }
.bap-book-author { font-size: 16px; margin: 0 0 16px; }
.bap-book-author a { color: #3b82f6; text-decoration: none; }

/* Meta table */
.bap-meta-table { border-collapse: collapse; font-size: 14px; }
.bap-meta-table th { text-align: left; color: #64748b; font-weight: 500; padding: 4px 16px 4px 0; white-space: nowrap; }
.bap-meta-table td { color: #1e293b; padding: 4px 0; }
.bap-meta-table a { color: #3b82f6; text-decoration: none; }

.bap-affiliate-notice { margin-top: 6px; color: #94a3b8; }

/* Book content */
.bap-book-summary { max-width: 740px; }
.bap-book-summary h2 { font-size: 20px; margin-bottom: 12px; }
.bap-book-content { line-height: 1.8; color: #374151; }

/* Series nav */
.bap-series-nav {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    padding: 20px 0;
    border-top: 1px solid #e2e8f0;
    margin-top: 32px;
    font-size: 14px;
}
.bap-series-nav a { color: #3b82f6; text-decoration: none; }
.bap-series-nav a:hover { text-decoration: underline; }
.bap-nav-series { text-align: center; }

/* ── List Page (mostrecommendedbooks style) ──────────────────────────────── */

/* Hero */
.bap-list-hero { padding-bottom: 24px; border-bottom: 1px solid #e2e8f0; margin-bottom: 20px; }
.bap-list-title { font-size: 32px; font-weight: 800; margin: 0 0 16px; line-height: 1.2; }
.bap-list-intro-wrap { display: flex; flex-direction: column; gap: 12px; max-width: 680px; }
.bap-list-goal, .bap-list-method {
    background: #f8fafc;
    border-left: 3px solid #3b82f6;
    padding: 10px 16px;
    border-radius: 0 6px 6px 0;
    font-size: 14px;
    color: #374151;
    line-height: 1.6;
}
.bap-list-goal strong, .bap-list-method strong { color: #1e293b; }
.bap-method-steps {
    margin: 6px 0 0 16px;
    padding: 0;
    font-size: 14px;
    color: #374151;
    line-height: 1.8;
}

/* Description */
.bap-list-desc { margin-bottom: 20px; line-height: 1.7; color: #374151; max-width: 740px; }

/* Disclosure */
.bap-disclosure {
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 24px;
    padding: 8px 12px;
    background: #f8fafc;
    border-radius: 4px;
}

/* ── Ranked list ─────────────────────────────────────────────────────────── */
.bap-ranked-list { display: flex; flex-direction: column; gap: 0; }

.bap-ranked-item {
    display: flex;
    gap: 0;
    padding: 28px 0;
    border-bottom: 1px solid #f1f5f9;
    align-items: flex-start;
    position: relative;
}
.bap-ranked-item:last-child { border-bottom: none; }

/* Rank badge */
.bap-rank-badge {
    flex-shrink: 0;
    width: 48px;
    display: flex;
    align-items: flex-start;
    padding-top: 4px;
}
.bap-rank-num {
    width: 36px;
    height: 36px;
    background: #3b82f6;
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.bap-ranked-item:nth-child(1) .bap-rank-num { background: #f59e0b; }
.bap-ranked-item:nth-child(2) .bap-rank-num { background: #94a3b8; }
.bap-ranked-item:nth-child(3) .bap-rank-num { background: #b45309; }

/* Inner grid: cover | body */
.bap-ranked-inner {
    flex: 1;
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 24px;
}

/* Cover column */
.bap-ranked-cover-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.bap-ranked-cover {
    width: 160px !important;
    height: 240px !important;
    object-fit: cover !important;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    display: block;
}
.bap-cover-placeholder.bap-ranked-cover {
    width: 160px;
    height: 240px;
    aspect-ratio: unset;
}

/* Amazon button */
.bap-amazon-btn {
    display: block;
    width: 100%;
    text-align: center;
    padding: 8px 12px;
    background: #f59e0b;
    color: #111;
    font-size: 13px;
    font-weight: 700;
    border-radius: 4px;
    text-decoration: none;
    transition: background 0.15s;
}
.bap-amazon-btn:hover { background: #d97706; color: #fff; }

/* Body column */
.bap-ranked-body { padding-top: 4px; }
.bap-ranked-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 4px;
    line-height: 1.3;
}
.bap-ranked-title a { color: #1e293b; text-decoration: none; }
.bap-ranked-title a:hover { color: #3b82f6; }
.bap-ranked-author { font-size: 14px; color: #64748b; margin: 0 0 10px; }
.bap-ranked-author a { color: #3b82f6; text-decoration: none; }
.bap-ranked-excerpt { font-size: 14px; color: #475569; line-height: 1.6; margin: 8px 0; }
.bap-ranked-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #94a3b8;
    margin-top: 8px;
    flex-wrap: wrap;
}

/* AI Score + Reason */
.bap-ai-score-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 8px 0;
    flex-wrap: wrap;
}
.bap-ai-score-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 10px;
    border-radius: 9999px;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}
.bap-ai-reason {
    font-size: 13px;
    color: #64748b;
    font-style: italic;
}

/* Mention count */
.bap-mention-count {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #64748b;
    margin: 6px 0;
}
.bap-mention-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: #ec4899;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Sources */
.bap-sources { margin-top: 12px; }
.bap-sources-label {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    margin: 0 0 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.bap-sources-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.bap-sources-list li { display: flex; align-items: baseline; gap: 6px; font-size: 12px; color: #64748b; }
.bap-sources-list a { color: #3b82f6; text-decoration: none; }
.bap-sources-list a:hover { text-decoration: underline; }
.bap-source-num {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    background: #ec4899;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ── Related lists ───────────────────────────────────────────────────────── */
.bap-related-lists {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 2px solid #e2e8f0;
}
.bap-related-title {
    font-size: 24px;
    font-weight: 800;
    text-align: center;
    margin-bottom: 24px;
}
.bap-related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.bap-related-card {
    display: block;
    text-decoration: none;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px;
    text-align: center;
    transition: box-shadow 0.2s, transform 0.2s;
}
.bap-related-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.10);
    transform: translateY(-2px);
}
.bap-related-covers {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
    min-height: 104px;
    align-items: flex-end;
}
.bap-related-covers img {
    width: 76px;
    height: 104px;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
.bap-related-placeholder {
    width: 228px;
    height: 104px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 4px;
}
.bap-related-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
    line-height: 1.4;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .bap-ranked-inner { grid-template-columns: 120px 1fr; gap: 16px; }
    .bap-ranked-cover { width: 120px !important; height: 180px !important; }
    .bap-cover-placeholder.bap-ranked-cover { width: 120px; height: 180px; }
    .bap-related-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .bap-ranked-inner { grid-template-columns: 1fr; }
    .bap-rank-badge { display: none; }
    .bap-related-grid { grid-template-columns: 1fr; }
    .bap-related-covers img { width: 60px; height: 84px; }
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .bap-author-hero { flex-direction: column; }
    .bap-book-hero   { flex-direction: column; }
    .bap-book-cover  { width: 140px; }
    .bap-book-grid   { grid-template-columns: repeat(2, 1fr); }
    .bap-order-cover { width: 60px; }
    .bap-order-cover img { width: 60px; }
}
