/* ============================================
   Editorial — Prosa unificada /c/{id}/{slug}
   Usado por todos os módulos (hedgehog/sloth/flamingo/alpaca/fish).
   Sem full-bleed (grid Josh Comeau removido). Texto justificado.
   ============================================ */

.content-body,
.markdown-content,
.article-body {
    font-size: 1.05rem;
    line-height: 1.75;
    color: var(--q-text-main, #0F172A);
}

/* Headings — sempre alinhados à esquerda (não justificar) */
.content-body h1,
.content-body h2,
.content-body h3,
.content-body h4,
.content-body h5,
.content-body h6,
.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6,
.article-body h1,
.article-body h2,
.article-body h3,
.article-body h4,
.article-body h5,
.article-body h6 {
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    line-height: 1.3;
    text-align: left;
    color: var(--q-text-main, #0F172A);
}

.content-body h1,
.markdown-content h1,
.article-body h1 { font-size: 1.6rem; }

.content-body h2,
.markdown-content h2,
.article-body h2 {
    font-size: 1.35rem;
    border-bottom: 1px solid var(--q-border-subtle, #dee2e6);
    padding-bottom: 0.3rem;
}

.content-body h3,
.markdown-content h3,
.article-body h3 { font-size: 1.15rem; }

/* Parágrafos e listas — justificados */
.content-body p,
.markdown-content p,
.article-body p {
    margin-bottom: 1.1rem;
    text-align: justify;
    text-justify: inter-word;
    hyphens: auto;
    overflow-wrap: break-word;
}

.content-body a,
.markdown-content a,
.article-body a {
    color: var(--q-accent, #0d6efd);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.content-body a:hover,
.markdown-content a:hover,
.article-body a:hover {
    color: var(--q-accent-hover, #0b5ed7);
}

.content-body ul,
.content-body ol,
.markdown-content ul,
.markdown-content ol,
.article-body ul,
.article-body ol {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.content-body li,
.markdown-content li,
.article-body li {
    margin-bottom: 0.35rem;
    text-align: justify;
    hyphens: auto;
    overflow-wrap: break-word;
}

.content-body blockquote,
.markdown-content blockquote,
.article-body blockquote {
    border-left: 4px solid var(--q-accent, #0d6efd);
    padding: 0.75rem 1.25rem;
    margin: 1.5rem 0;
    color: var(--q-text-muted, #495057);
    background: var(--q-bg-surface-alt, #f8f9fa);
    border-radius: 0 var(--q-radius-sm, 0.375rem) var(--q-radius-sm, 0.375rem) 0;
    text-align: justify;
    hyphens: auto;
}

.content-body code,
.markdown-content code,
.article-body code {
    background: var(--q-bg-surface-alt, #f1f3f5);
    border: 1px solid var(--q-border-subtle, #e2e8f0);
    padding: 0.15em 0.4em;
    border-radius: var(--q-radius-sm, 0.25rem);
    font-size: 0.875em;
    color: #d63384;
}

.content-body pre,
.markdown-content pre,
.article-body pre {
    background: var(--q-bg-body, #070B14);
    border: 1px solid var(--q-border-subtle, #1E293B);
    color: var(--q-text-main, #f8f9fa);
    padding: 1rem 1.25rem;
    border-radius: var(--q-radius-md, 0.5rem);
    overflow-x: auto;
    margin-bottom: 1.25rem;
    text-align: left;
}

.content-body pre code,
.markdown-content pre code,
.article-body pre code {
    background: none !important;
    border: none !important;
    color: inherit !important;
    padding: 0 !important;
    font-size: 0.875rem;
}

.content-body table,
.markdown-content table,
.article-body table {
    display: block;
    width: max-content;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-collapse: collapse;
    margin-bottom: 1.25rem;
    font-size: 0.95rem;
    margin-left: auto;
    margin-right: auto;
    color: var(--q-text-main, #0F172A);
}

.content-body th,
.content-body td,
.markdown-content th,
.markdown-content td,
.article-body th,
.article-body td {
    border: 1px solid var(--q-border-subtle, #dee2e6);
    padding: 0.5rem 0.75rem;
    color: inherit;
}

.content-body thead,
.markdown-content thead,
.article-body thead {
    background: var(--q-bg-surface-alt, #f8f9fa);
    color: var(--q-text-main, #0F172A);
    font-weight: 600;
}

.content-body tbody tr:nth-child(even),
.markdown-content tbody tr:nth-child(even),
.article-body tbody tr:nth-child(even) {
    background: var(--q-bg-surface-alt, #f8f9fa);
}

.content-body img,
.markdown-content img,
.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--q-radius-md, 0.5rem);
    margin: 1rem 0;
}

.content-body figure,
.markdown-content figure,
.article-body figure {
    margin: 1rem 0;
}

.content-body figure img,
.markdown-content figure img,
.article-body figure img {
    margin: 0;
}

.content-body figcaption,
.markdown-content figcaption,
.article-body figcaption {
    font-size: 0.875rem;
    color: var(--q-text-muted, #6c757d);
    text-align: center;
    margin-top: 0.35rem;
}

.content-body hr,
.markdown-content hr,
.article-body hr {
    border: 0;
    border-top: 1px solid var(--q-border-subtle, #dee2e6);
    margin: 2rem 0;
}

.content-body div.arithmatex,
.markdown-content div.arithmatex,
.article-body div.arithmatex {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

/* Shortcodes — largura total centrada mas sem full-bleed grid */
.content-body .shortcode-container,
.markdown-content .shortcode-container,
.article-body .shortcode-container {
    width: 100%;
    max-width: 960px;
    margin-inline: auto;
    min-width: 0;
}

.content-body .shortcode-stat-wrapper,
.markdown-content .shortcode-stat-wrapper,
.article-body .shortcode-stat-wrapper {
    margin-inline: auto;
}

/* Shortcode Charts (BCB / RTN / TDData) */
.shortcode-chart {
    margin: 1.5rem 0;
}

.shortcode-chart h6 a {
    color: var(--q-text-main, #212529);
    font-weight: 600;
}

.shortcode-chart h6 a:hover {
    color: var(--bs-primary, #0d6efd);
}

.shortcode-chart-container {
    min-height: 300px;
}

.shortcode-chart canvas {
    max-width: 100%;
}

.shortcode-loading {
    z-index: 1;
}

@media (max-width: 768px) {
    .shortcode-chart h6 {
        font-size: 0.95rem;
    }

    .shortcode-chart .btn-group-sm .btn {
        padding: 0.2rem 0.4rem;
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .shortcode-chart-container {
        min-height: 250px;
    }
}

.shortcode-snapshot,
.shortcode-snapshot .table-responsive,
.shortcode-snapshot table {
    width: 100% !important;
}

.content-body .shortcode-snapshot table,
.markdown-content .shortcode-snapshot table,
.article-body .shortcode-snapshot table {
    display: table !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.content-body .shortcode-snapshot table th,
.content-body .shortcode-snapshot table td,
.markdown-content .shortcode-snapshot table th,
.markdown-content .shortcode-snapshot table td,
.article-body .shortcode-snapshot table th,
.article-body .shortcode-snapshot table td {
    white-space: nowrap;
}

.content-body th[align="left"],
.content-body td[align="left"],
.markdown-content th[align="left"],
.markdown-content td[align="left"],
.article-body th[align="left"],
.article-body td[align="left"] { text-align: left !important; }

.content-body th[align="center"],
.content-body td[align="center"],
.markdown-content th[align="center"],
.markdown-content td[align="center"],
.article-body th[align="center"],
.article-body td[align="center"] { text-align: center !important; }

.content-body th[align="right"],
.content-body td[align="right"],
.markdown-content th[align="right"],
.markdown-content td[align="right"],
.article-body th[align="right"],
.article-body td[align="right"] { text-align: right !important; }

/* Compat: .content-article (Flamingo) — mesma justificação e herança */
.content-article {
    max-width: 760px;
    font-size: 1.05rem;
    line-height: 1.75;
    color: var(--q-text-main, #0F172A);
}

.content-article p,
.content-article li,
.content-article blockquote {
    text-align: justify;
    text-justify: inter-word;
    hyphens: auto;
    overflow-wrap: break-word;
}

.content-article img {
    max-width: 100%;
    height: auto;
}

/* ==========================================================================
   Editorial em Dark Mode — Alto Contraste & WCAG 2.1 AAA
   Garante contraste perfeito e legibilidade dos textos de artigos
   ========================================================================== */

[data-bs-theme="dark"] .content-body,
[data-bs-theme="dark"] .markdown-content,
[data-bs-theme="dark"] .article-body,
[data-bs-theme="dark"] .content-article,
body.dark-mode .content-body,
body.dark-mode .markdown-content,
body.dark-mode .article-body,
body.dark-mode .content-article {
    color: var(--q-text-main, #F8FAFC) !important;
}

[data-bs-theme="dark"] .content-body h1,
[data-bs-theme="dark"] .content-body h2,
[data-bs-theme="dark"] .content-body h3,
[data-bs-theme="dark"] .content-body h4,
[data-bs-theme="dark"] .content-body h5,
[data-bs-theme="dark"] .content-body h6,
[data-bs-theme="dark"] .markdown-content h1,
[data-bs-theme="dark"] .markdown-content h2,
[data-bs-theme="dark"] .markdown-content h3,
[data-bs-theme="dark"] .markdown-content h4,
[data-bs-theme="dark"] .markdown-content h5,
[data-bs-theme="dark"] .markdown-content h6,
[data-bs-theme="dark"] .article-body h1,
[data-bs-theme="dark"] .article-body h2,
[data-bs-theme="dark"] .article-body h3,
[data-bs-theme="dark"] .article-body h4,
[data-bs-theme="dark"] .article-body h5,
[data-bs-theme="dark"] .article-body h6,
body.dark-mode .content-body h1,
body.dark-mode .content-body h2,
body.dark-mode .content-body h3,
body.dark-mode .content-body h4,
body.dark-mode .content-body h5,
body.dark-mode .content-body h6,
body.dark-mode .article-body h1,
body.dark-mode .article-body h2,
body.dark-mode .article-body h3,
body.dark-mode .article-body h4,
body.dark-mode .article-body h5,
body.dark-mode .article-body h6 {
    color: var(--q-text-main, #F8FAFC) !important;
}

[data-bs-theme="dark"] .content-body h2,
[data-bs-theme="dark"] .markdown-content h2,
[data-bs-theme="dark"] .article-body h2,
body.dark-mode .content-body h2,
body.dark-mode .markdown-content h2,
body.dark-mode .article-body h2 {
    border-bottom-color: var(--q-border-subtle, #1E293B) !important;
}

[data-bs-theme="dark"] .content-body blockquote,
[data-bs-theme="dark"] .markdown-content blockquote,
[data-bs-theme="dark"] .article-body blockquote,
[data-bs-theme="dark"] .content-article blockquote,
body.dark-mode .content-body blockquote,
body.dark-mode .markdown-content blockquote,
body.dark-mode .article-body blockquote,
body.dark-mode .content-article blockquote {
    background: var(--q-bg-surface-alt, #131B2E) !important;
    color: var(--q-text-muted, #CBD5E1) !important;
    border-left-color: var(--q-accent, #60A5FA) !important;
}

[data-bs-theme="dark"] .content-body code:not(pre code),
[data-bs-theme="dark"] .markdown-content code:not(pre code),
[data-bs-theme="dark"] .article-body code:not(pre code),
[data-bs-theme="dark"] .content-article code:not(pre code),
body.dark-mode .content-body code:not(pre code),
body.dark-mode .markdown-content code:not(pre code),
body.dark-mode .article-body code:not(pre code),
body.dark-mode .content-article code:not(pre code) {
    background-color: #131B2E !important;
    color: #38BDF8 !important;
    border-color: #2A364F !important;
}

[data-bs-theme="dark"] .content-body thead,
[data-bs-theme="dark"] .markdown-content thead,
[data-bs-theme="dark"] .article-body thead,
body.dark-mode .content-body thead,
body.dark-mode .markdown-content thead,
body.dark-mode .article-body thead {
    background-color: #131B2E !important;
    color: #CBD5E1 !important;
}

[data-bs-theme="dark"] .content-body th,
[data-bs-theme="dark"] .content-body td,
[data-bs-theme="dark"] .markdown-content th,
[data-bs-theme="dark"] .markdown-content td,
[data-bs-theme="dark"] .article-body th,
[data-bs-theme="dark"] .article-body td,
body.dark-mode .content-body th,
body.dark-mode .content-body td,
body.dark-mode .markdown-content th,
body.dark-mode .markdown-content td,
body.dark-mode .article-body th,
body.dark-mode .article-body td {
    border-color: var(--q-border-subtle, #1E293B) !important;
    color: var(--q-text-main, #F8FAFC);
}

[data-bs-theme="dark"] .content-body tbody tr:nth-child(even),
[data-bs-theme="dark"] .markdown-content tbody tr:nth-child(even),
[data-bs-theme="dark"] .article-body tbody tr:nth-child(even),
body.dark-mode .content-body tbody tr:nth-child(even),
body.dark-mode .markdown-content tbody tr:nth-child(even),
body.dark-mode .article-body tbody tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.03) !important;
}

[data-bs-theme="dark"] .content-body hr,
[data-bs-theme="dark"] .markdown-content hr,
[data-bs-theme="dark"] .article-body hr,
body.dark-mode .content-body hr,
body.dark-mode .markdown-content hr,
body.dark-mode .article-body hr {
    border-top-color: var(--q-border-subtle, #1E293B) !important;
}

[data-bs-theme="dark"] .content-body figcaption,
[data-bs-theme="dark"] .markdown-content figcaption,
[data-bs-theme="dark"] .article-body figcaption,
body.dark-mode .content-body figcaption,
body.dark-mode .markdown-content figcaption,
body.dark-mode .article-body figcaption {
    color: var(--q-text-muted, #94A3B8) !important;
}
