/**
 * BPC Auto Blogger — Frontend Styles
 * TOC (table of contents), Prism.js overrides, code blocks, justified text.
 * Divi, Elementor & Avada compatible.
 */

/* ──────────────────────────────────────────
 * Justified text for generated articles
 * ────────────────────────────────────────── */
.entry-content p,
.et_pb_post_content p,
.post-content p,
.elementor-widget-theme-post-content p,
.elementor-text-editor p,
.fusion-post-content p,
.avada-post-content p {
    text-align: justify;
}

/* ──────────────────────────────────────────
 * TABLE DES MATIÈRES — grey box like WordPress.com
 * ────────────────────────────────────────── */
.bpcab-toc {
    background: #f0f0f0;
    border-left: 4px solid #3858e9;
    border-radius: 8px;
    padding: 24px 28px 20px;
    margin: 0 0 32px 0;
    font-size: 15px;
    line-height: 1.7;
}

.bpcab-toc-title {
    font-size: 18px;
    font-weight: 700;
    color: #1d2327;
    margin: 0 0 12px 0 !important;
    padding: 0;
    text-align: left !important;
}

.bpcab-toc ol {
    margin: 0;
    padding: 0 0 0 20px;
    list-style-type: decimal;
}

.bpcab-toc ol li {
    margin: 4px 0;
    padding: 2px 0;
    color: #50575e;
}

.bpcab-toc ol li a {
    color: #3858e9;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s ease;
}

.bpcab-toc ol li a:hover {
    color: #1d35b4;
    text-decoration: underline;
}

/* ──────────────────────────────────────────
 * Code block wrapper — position relative for copy button
 * ────────────────────────────────────────── */
.bpcab-code-wrapper {
    position: relative;
    margin: 24px 0;
}

/* Copy button — icon only, top-right corner */
.bpcab-copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.45);
    padding: 6px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 2;
    line-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.bpcab-copy-btn svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.bpcab-copy-btn:hover {
    color: rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.08);
}
.bpcab-copy-btn.bpcab-copied {
    color: #27ae60;
}

/* ──────────────────────────────────────────
 * CODE BLOCKS — Prism.js overrides for our dark theme
 * Prism "Tomorrow" is the base; we refine background + radius.
 * ────────────────────────────────────────── */
.entry-content pre[class*="language-"],
.et_pb_post_content pre[class*="language-"],
.post-content pre[class*="language-"],
.elementor-widget-theme-post-content pre[class*="language-"],
.elementor-text-editor pre[class*="language-"],
.fusion-post-content pre[class*="language-"],
.avada-post-content pre[class*="language-"],
.entry-content pre,
.et_pb_post_content pre,
.post-content pre,
.elementor-widget-theme-post-content pre,
.elementor-text-editor pre,
.fusion-post-content pre,
.avada-post-content pre {
    background: #1a1a2e !important;
    border: none;
    border-radius: 8px;
    padding: 24px 28px;
    overflow-x: auto;
    font-family: 'Fira Code', 'Source Code Pro', 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    line-height: 1.65;
    margin: 0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    -webkit-font-smoothing: antialiased;
    tab-size: 4;
}

/* Code inside pre — inherit from Prism */
.entry-content pre code,
.et_pb_post_content pre code,
.post-content pre code,
.elementor-widget-theme-post-content pre code,
.elementor-text-editor pre code,
.fusion-post-content pre code,
.avada-post-content pre code {
    background: transparent !important;
    padding: 0;
    border: none;
    font-size: inherit;
    line-height: inherit;
    white-space: pre;
    word-break: normal;
    word-wrap: normal;
}

/* Inline code (not inside pre) */
.entry-content > code,
.entry-content p code,
.entry-content li code,
.entry-content td code,
.et_pb_post_content > code,
.et_pb_post_content p code,
.et_pb_post_content li code,
.post-content p code,
.post-content li code,
.elementor-widget-theme-post-content p code,
.elementor-text-editor p code,
.fusion-post-content p code,
.avada-post-content p code {
    background: #f0f0f5 !important;
    color: #d63384 !important;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Fira Code', 'Source Code Pro', 'Consolas', monospace;
    font-size: 0.88em;
    box-shadow: none;
}

/* Prism token color enhancements on our dark background */
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
    color: #676e95 !important;
    font-style: italic;
}

.token.keyword,
.token.tag,
.token.boolean,
.token.constant {
    color: #c792ea !important;
}

.token.function {
    color: #82aaff !important;
}

.token.string,
.token.attr-value {
    color: #c3e88d !important;
}

.token.number {
    color: #f78c6c !important;
}

.token.variable {
    color: #f07178 !important;
}

.token.operator,
.token.punctuation {
    color: #89ddff !important;
}

.token.property,
.token.class-name {
    color: #ffcb6b !important;
}

.token.attr-name {
    color: #ffcb6b !important;
}

.token.selector {
    color: #c792ea !important;
}

/* Line numbers (Prism plugin) */
.line-numbers .line-numbers-rows {
    border-right-color: rgba(255, 255, 255, 0.08) !important;
}

.line-numbers .line-numbers-rows > span::before {
    color: rgba(255, 255, 255, 0.2) !important;
}

/* ──────────────────────────────────────────
 * Scrollbar styling for code blocks
 * ────────────────────────────────────────── */
.entry-content pre::-webkit-scrollbar,
.et_pb_post_content pre::-webkit-scrollbar,
.elementor-widget-theme-post-content pre::-webkit-scrollbar,
.fusion-post-content pre::-webkit-scrollbar {
    height: 6px;
}

.entry-content pre::-webkit-scrollbar-track,
.et_pb_post_content pre::-webkit-scrollbar-track,
.elementor-widget-theme-post-content pre::-webkit-scrollbar-track,
.fusion-post-content pre::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.entry-content pre::-webkit-scrollbar-thumb,
.et_pb_post_content pre::-webkit-scrollbar-thumb,
.elementor-widget-theme-post-content pre::-webkit-scrollbar-thumb,
.fusion-post-content pre::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

.entry-content pre::-webkit-scrollbar-thumb:hover,
.et_pb_post_content pre::-webkit-scrollbar-thumb:hover,
.elementor-widget-theme-post-content pre::-webkit-scrollbar-thumb:hover,
.fusion-post-content pre::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* ──────────────────────────────────────────────
 * Hide categories / tags widgets below articles
 * ────────────────────────────────────────────── */
.widget_categories,
.cat-links,
.post-categories,
.et_post_meta_wrapper .et-post-categories,
.entry-categories,
.single-post-categories,
.post-footer-categories,
.tag-links,
.entry-footer {
    display: none !important;
}
