/**
 * Estilização e Destaque Tipográfico para Conteúdo de Publicações (Notícias e Blog)
 * Garante que tags <h1> até <h6>, parágrafos, listas, citações e tabelas tenham
 * destaque visual nítido contra o reset do Tailwind CSS Preflight.
 */

/* ========================================================
   APLICAÇÃO DA TIPOGRAFIA INSTITUCIONAL DO TEMA
   ======================================================== */

.post-content,
.prose,
.editor-content,
#preview-content-body {
    font-family: var(--font-secondary, 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif) !important;
}

.prose p,
.post-content p,
.editor-content p,
#preview-content-body p,
.prose span,
.post-content span,
.editor-content span,
#preview-content-body span,
.prose li,
.post-content li,
.editor-content li,
#preview-content-body li,
.prose blockquote,
.post-content blockquote,
.editor-content blockquote,
#preview-content-body blockquote,
.prose table,
.post-content table,
.editor-content table,
#preview-content-body table {
    font-family: var(--font-secondary, 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif) !important;
}

/* ========================================================
   1. TAGS DE CABEÇALHO / TÍTULO (H1 até H6)
   ======================================================== */

.prose h1, .post-content h1, .editor-content h1, #preview-content-body h1,
.prose h2, .post-content h2, .editor-content h2, #preview-content-body h2,
.prose h3, .post-content h3, .editor-content h3, #preview-content-body h3,
.prose h4, .post-content h4, .editor-content h4, #preview-content-body h4,
.prose h5, .post-content h5, .editor-content h5, #preview-content-body h5,
.prose h6, .post-content h6, .editor-content h6, #preview-content-body h6 {
    font-family: var(--font-primary, 'MuseoModerno', cursive, sans-serif) !important;
}

.prose h1,
.post-content h1,
.editor-content h1,
#preview-content-body h1 {
    display: block !important;
    font-size: 2rem !important; /* ~32px */
    font-weight: 700 !important;
    line-height: 1.25 !important;
    color: #0f172a !important;
    margin-top: 1.75rem !important;
    margin-bottom: 0.75rem !important;
    letter-spacing: -0.02em !important;
}

.prose h2,
.post-content h2,
.editor-content h2,
#preview-content-body h2 {
    display: block !important;
    font-size: 1.5rem !important; /* ~24px */
    font-weight: 700 !important;
    line-height: 1.3 !important;
    color: #0f172a !important;
    margin-top: 1.5rem !important;
    margin-bottom: 0.6rem !important;
    letter-spacing: -0.015em !important;
}

.prose h3,
.post-content h3,
.editor-content h3,
#preview-content-body h3 {
    display: block !important;
    font-size: 1.35rem !important; /* ~22px */
    font-weight: 600 !important;
    line-height: 1.35 !important;
    color: #1e293b !important;
    margin-top: 1.5rem !important;
    margin-bottom: 0.5rem !important;
}

.prose h4,
.post-content h4,
.editor-content h4,
#preview-content-body h4 {
    display: block !important;
    font-size: 1.15rem !important; /* ~18px */
    font-weight: 600 !important;
    line-height: 1.4 !important;
    color: #334155 !important;
    margin-top: 1.25rem !important;
    margin-bottom: 0.4rem !important;
}

.prose h5,
.post-content h5,
.editor-content h5,
#preview-content-body h5 {
    display: block !important;
    font-size: 1.05rem !important; /* ~17px */
    font-weight: 600 !important;
    line-height: 1.45 !important;
    color: #475569 !important;
    margin-top: 1rem !important;
    margin-bottom: 0.35rem !important;
}

.prose h6,
.post-content h6,
.editor-content h6,
#preview-content-body h6 {
    display: block !important;
    font-size: 0.925rem !important; /* ~15px */
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    color: #64748b !important;
    margin-top: 1rem !important;
    margin-bottom: 0.35rem !important;
}

/* ========================================================
   2. ELEMENTOS DE TEXTO, LISTAS E CITAÇÕES
   ======================================================== */

.prose p,
.post-content p,
.editor-content p,
#preview-content-body p {
    font-size: 1.025rem !important;
    line-height: 1.8 !important;
    color: #334155 !important;
    margin-bottom: 1.25rem !important;
}

.prose ul,
.post-content ul,
.editor-content ul,
#preview-content-body ul {
    list-style-type: disc !important;
    padding-left: 1.75rem !important;
    margin-top: 0.5rem !important;
    margin-bottom: 1.25rem !important;
}

.prose ol,
.post-content ol,
.editor-content ol,
#preview-content-body ol {
    list-style-type: decimal !important;
    padding-left: 1.75rem !important;
    margin-top: 0.5rem !important;
    margin-bottom: 1.25rem !important;
}

.prose li,
.post-content li,
.editor-content li,
#preview-content-body li {
    margin-bottom: 0.4rem !important;
    line-height: 1.7 !important;
    color: #334155 !important;
}

.prose blockquote,
.post-content blockquote,
.editor-content blockquote,
#preview-content-body blockquote {
    border-left: 4px solid var(--color-taruma-eco) !important;
    background: var(--color-taruma-bg) !important;
    padding: 0.85rem 1.25rem !important;
    margin: 1.5rem 0 !important;
    font-style: italic !important;
    color: var(--color-taruma-slate) !important;
    border-radius: 0 0.5rem 0.5rem 0 !important;
}

.prose a:not(.taruma-cta-btn),
.post-content a:not(.taruma-cta-btn),
.editor-content a:not(.taruma-cta-btn),
#preview-content-body a:not(.taruma-cta-btn) {
    color: var(--color-taruma-river) !important;
    text-decoration: underline !important;
    font-weight: 500 !important;
}

.prose a:not(.taruma-cta-btn):hover,
.post-content a:not(.taruma-cta-btn):hover,
.editor-content a:not(.taruma-cta-btn):hover,
#preview-content-body a:not(.taruma-cta-btn):hover {
    color: var(--color-taruma-eco) !important;
}

.prose strong,
.post-content strong,
.editor-content strong,
#preview-content-body strong,
.prose b,
.post-content b,
.editor-content b,
#preview-content-body b {
    font-weight: 700 !important;
    color: #0f172a !important;
}

.prose table,
.post-content table,
.editor-content table,
#preview-content-body table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin: 1.5rem 0 !important;
    font-size: 0.95rem !important;
}

.prose th,
.post-content th,
.editor-content th,
#preview-content-body th {
    background-color: #f1f5f9 !important;
    color: #0f172a !important;
    font-weight: 700 !important;
    border: 1px solid #cbd5e1 !important;
    padding: 0.65rem 0.85rem !important;
    text-align: left !important;
}

.prose td,
.post-content td,
.editor-content td,
#preview-content-body td {
    border: 1px solid #e2e8f0 !important;
    padding: 0.65rem 0.85rem !important;
    color: #334155 !important;
}

.prose img,
.post-content img,
.editor-content img,
#preview-content-body img {
    max-width: 100%;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.prose figure,
.post-content figure,
.editor-content figure,
#preview-content-body figure {
    max-width: 100%;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

.prose hr,
.post-content hr,
.editor-content hr,
#preview-content-body hr {
    border: 0 !important;
    border-top: 1px solid #cbd5e1 !important;
    margin: 2rem 0 !important;
}

.prose pre,
.post-content pre,
.editor-content pre,
#preview-content-body pre {
    background: #0f172a !important;
    color: #e2e8f0 !important;
    padding: 1rem 1.25rem !important;
    border-radius: 0.5rem !important;
    overflow-x: auto !important;
    margin: 1.5rem 0 !important;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
}

/* ========================================================
   3. ADAPTAÇÃO PARA MODO ESCURO (A11Y DARK MODE)
   ======================================================== */

html.a11y-dark-mode .prose,
html.a11y-dark-mode .post-content,
html.a11y-dark-mode .editor-content,
html.a11y-dark-mode #preview-content-body,
html.a11y-dark-mode .taruma-column,
html.a11y-dark-mode .taruma-editor-column {
    color: #f8fafc !important;
}

html.a11y-dark-mode .prose h1,
html.a11y-dark-mode .post-content h1,
html.a11y-dark-mode .editor-content h1,
html.a11y-dark-mode #preview-content-body h1,
html.a11y-dark-mode .taruma-column h1,
html.a11y-dark-mode .taruma-editor-column h1 {
    color: #ffffff !important;
}

html.a11y-dark-mode .prose h2,
html.a11y-dark-mode .post-content h2,
html.a11y-dark-mode .editor-content h2,
html.a11y-dark-mode #preview-content-body h2,
html.a11y-dark-mode .taruma-column h2,
html.a11y-dark-mode .taruma-editor-column h2 {
    color: #ffffff !important;
}

html.a11y-dark-mode .prose h3,
html.a11y-dark-mode .post-content h3,
html.a11y-dark-mode .editor-content h3,
html.a11y-dark-mode #preview-content-body h3,
html.a11y-dark-mode .taruma-column h3,
html.a11y-dark-mode .taruma-editor-column h3 {
    color: #ffffff !important;
}

html.a11y-dark-mode .prose h4,
html.a11y-dark-mode .post-content h4,
html.a11y-dark-mode .editor-content h4,
html.a11y-dark-mode #preview-content-body h4,
html.a11y-dark-mode .taruma-column h4,
html.a11y-dark-mode .taruma-editor-column h4 {
    color: #f8fafc !important;
}

html.a11y-dark-mode .prose h5,
html.a11y-dark-mode .post-content h5,
html.a11y-dark-mode .editor-content h5,
html.a11y-dark-mode #preview-content-body h5,
html.a11y-dark-mode .taruma-column h5,
html.a11y-dark-mode .taruma-editor-column h5 {
    color: #f8fafc !important;
}

html.a11y-dark-mode .prose h6,
html.a11y-dark-mode .post-content h6,
html.a11y-dark-mode .editor-content h6,
html.a11y-dark-mode #preview-content-body h6,
html.a11y-dark-mode .taruma-column h6,
html.a11y-dark-mode .taruma-editor-column h6 {
    color: var(--color-taruma-water, #60aebf) !important;
}

html.a11y-dark-mode .prose p,
html.a11y-dark-mode .post-content p,
html.a11y-dark-mode .editor-content p,
html.a11y-dark-mode .editor-content .block-editable,
html.a11y-dark-mode .taruma-column p,
html.a11y-dark-mode .taruma-editor-column p,
html.a11y-dark-mode #preview-content-body p,
html.a11y-dark-mode .prose span,
html.a11y-dark-mode .post-content span,
html.a11y-dark-mode .editor-content span,
html.a11y-dark-mode .taruma-column span,
html.a11y-dark-mode .taruma-editor-column span,
html.a11y-dark-mode #preview-content-body span,
html.a11y-dark-mode .prose font,
html.a11y-dark-mode .post-content font,
html.a11y-dark-mode .taruma-column font,
html.a11y-dark-mode #preview-content-body font,
html.a11y-dark-mode .prose li,
html.a11y-dark-mode .post-content li,
html.a11y-dark-mode .editor-content li,
html.a11y-dark-mode .taruma-column li,
html.a11y-dark-mode .taruma-editor-column li,
html.a11y-dark-mode #preview-content-body li,
html.a11y-dark-mode .prose em,
html.a11y-dark-mode .post-content em,
html.a11y-dark-mode .taruma-column em,
html.a11y-dark-mode #preview-content-body em,
html.a11y-dark-mode .prose i,
html.a11y-dark-mode .post-content i,
html.a11y-dark-mode .taruma-column i,
html.a11y-dark-mode #preview-content-body i,
html.a11y-dark-mode .post-content div:not(.col-image-actions):not(.col-image-container),
html.a11y-dark-mode .taruma-column div:not(.col-image-actions):not(.col-image-container),
html.a11y-dark-mode #preview-content-body div:not(.col-image-actions):not(.col-image-container),
html.a11y-dark-mode .post-content *[style*="color"],
html.a11y-dark-mode .taruma-column *[style*="color"],
html.a11y-dark-mode #preview-content-body *[style*="color"] {
    color: #f8fafc !important;
}

html.a11y-dark-mode .prose strong,
html.a11y-dark-mode .post-content strong,
html.a11y-dark-mode .editor-content strong,
html.a11y-dark-mode .taruma-column strong,
html.a11y-dark-mode .taruma-editor-column strong,
html.a11y-dark-mode #preview-content-body strong,
html.a11y-dark-mode .prose b,
html.a11y-dark-mode .post-content b,
html.a11y-dark-mode .editor-content b,
html.a11y-dark-mode .taruma-column b,
html.a11y-dark-mode .taruma-editor-column b,
html.a11y-dark-mode #preview-content-body b {
    color: #ffffff !important;
}

html.a11y-dark-mode .prose blockquote,
html.a11y-dark-mode .post-content blockquote,
html.a11y-dark-mode .editor-content blockquote,
html.a11y-dark-mode .taruma-column blockquote,
html.a11y-dark-mode #preview-content-body blockquote {
    background: rgba(61, 137, 167, 0.18) !important;
    color: var(--color-taruma-water, #60aebf) !important;
    border-left-color: var(--color-taruma-river, #3d89a7) !important;
}

html.a11y-dark-mode .prose th,
html.a11y-dark-mode .post-content th,
html.a11y-dark-mode .editor-content th,
html.a11y-dark-mode #preview-content-body th {
    background-color: #1e293b !important;
    color: #f8fafc !important;
    border-color: #334155 !important;
}

html.a11y-dark-mode .prose td,
html.a11y-dark-mode .post-content td,
html.a11y-dark-mode .editor-content td,
html.a11y-dark-mode #preview-content-body td {
    background-color: #1a2035 !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}

/* ========================================================
   4. BLOCOS MODULARES (CONTAINERS, COLUNAS E ELEMENTOS TIPO GUTENBERG)
   ======================================================== */

.taruma-block-container {
    display: grid !important;
    gap: 1.5rem !important;
    margin: 1.75rem 0 !important;
    width: 100% !important;
}

.taruma-cols-1 { grid-template-columns: 1fr !important; }
.taruma-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
.taruma-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
.taruma-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
.taruma-cols-1-2 { grid-template-columns: 1fr 2fr !important; }
.taruma-cols-2-1 { grid-template-columns: 2fr 1fr !important; }

.taruma-column {
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
}

.taruma-column img,
.taruma-editor-column img,
.taruma-column figure img,
.taruma-editor-column figure img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    display: block !important;
    object-fit: cover !important;
    border-radius: 0.375rem !important;
}

.taruma-column figure,
.taruma-editor-column figure,
.taruma-column .col-image-container,
.taruma-editor-column .col-image-container {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0.5rem auto !important;
    display: block !important;
}

@media (max-width: 768px) {
    .taruma-block-container {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
}

/* Caixas de Destaque / Alerta (Callouts) */
.taruma-callout {
    padding: 1.25rem 1.5rem !important;
    border-radius: 0.75rem !important;
    margin: 1.5rem 0 !important;
    border-left: 4px solid var(--color-taruma-river, #3d89a7) !important;
    background: rgba(96, 174, 191, 0.12) !important;
    color: var(--color-taruma-slate, #354c5a) !important;
}

.taruma-callout.callout-eco {
    border-left-color: var(--color-taruma-eco, #63b22f) !important;
    background: rgba(99, 178, 47, 0.12) !important;
}

.taruma-callout.callout-amber {
    border-left-color: #d97706 !important;
    background: #fffbeb !important;
    color: #92400e !important;
}

/* Botões de Ação (CTA) Padronizados com a Identidade do Site */
.taruma-cta-btn,
a.taruma-cta-btn,
.prose a.taruma-cta-btn,
.post-content a.taruma-cta-btn,
.editor-content a.taruma-cta-btn,
#preview-content-body a.taruma-cta-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    padding: 0.75rem 1.75rem !important;
    font-family: var(--font-secondary, 'Poppins', sans-serif) !important;
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.01em !important;
    border-radius: 0.5rem !important;
    text-decoration: none !important;
    line-height: 1.4 !important;
    background-color: var(--color-taruma-eco, #63b22f) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    cursor: pointer !important;
    text-align: center !important;
}

.taruma-cta-btn:hover,
a.taruma-cta-btn:hover,
.prose a.taruma-cta-btn:hover,
.post-content a.taruma-cta-btn:hover,
.editor-content a.taruma-cta-btn:hover,
#preview-content-body a.taruma-cta-btn:hover {
    background-color: var(--color-taruma-eco-hover, #529924) !important;
    color: #ffffff !important;
    text-decoration: none !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.12), 0 4px 6px -4px rgba(0, 0, 0, 0.1) !important;
}

.taruma-cta-btn.btn-river,
a.taruma-cta-btn.btn-river,
.editor-content a.taruma-cta-btn.btn-river,
.post-content a.taruma-cta-btn.btn-river,
.prose a.taruma-cta-btn.btn-river,
#preview-content-body a.taruma-cta-btn.btn-river {
    background-color: var(--color-taruma-river, #3d89a7) !important;
    color: #ffffff !important;
}

.taruma-cta-btn.btn-river:hover,
a.taruma-cta-btn.btn-river:hover,
.editor-content a.taruma-cta-btn.btn-river:hover,
.post-content a.taruma-cta-btn.btn-river:hover,
.prose a.taruma-cta-btn.btn-river:hover,
#preview-content-body a.taruma-cta-btn.btn-river:hover {
    background-color: var(--color-taruma-river-hover, #32728c) !important;
    color: #ffffff !important;
}

/* Modo Noturno para Blocos Modulares */
html.a11y-dark-mode .taruma-callout {
    background: rgba(53, 76, 90, 0.3) !important;
    color: var(--color-taruma-bg, #f4fafe) !important;
}

html.a11y-dark-mode .taruma-callout.callout-amber {
    background: rgba(120, 53, 15, 0.4) !important;
    color: #fde68a !important;
}
