/*
Theme Name: Fluxo de Caixa Blog
Theme URI: https://fluxodecaixa.app/blog/
Author: Zer062
Author URI: https://zero62.com
Description: Tema do blog do Fluxo de Caixa, com os tokens do design system do produto (azul #2563EB, Plus Jakarta Sans).
Version: 1.0.0
Requires at least: 6.5
Requires PHP: 8.2
Text Domain: fluxodecaixa-blog
*/

/* ---------------------------------------------------------------- Fontes (auto-hospedadas, só latin) */
@font-face {
    font-family: "Plus Jakarta Sans";
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url("assets/fonts/plus-jakarta-sans-normal-latin.woff2") format("woff2");
}
@font-face {
    font-family: "Plus Jakarta Sans";
    font-style: italic;
    font-weight: 400 800;
    font-display: swap;
    src: url("assets/fonts/plus-jakarta-sans-italic-latin.woff2") format("woff2");
}

/* ---------------------------------------------------------------- Tokens (espelham resources/css/app.css) */
:root {
    color-scheme: light;
    --bg: #f7f9fc;
    --fg: #111827;
    --card: #ffffff;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-soft: #f1f5ff;
    --primary-line: #dce8ff;
    --primary-softer: #dbe7fe;
    --muted: #f8fafc;
    --muted-fg: #6b7280;
    --subtle: #9aa3af;
    --border: #edf1f6;
    --border-strong: #dfe5ec;
    --success: #15803d;
    --success-bg: #f0fdf4;
    --warning: #b45309;
    --warning-bg: #fffbeb;
    --radius: 10px;
    --radius-card: 14px;
    --shadow: 0 1px 1px rgba(17, 24, 39, 0.02), 0 6px 20px -12px rgba(17, 24, 39, 0.1);
    --shadow-md: 0 1px 2px rgba(17, 24, 39, 0.06), 0 16px 40px -12px rgba(17, 24, 39, 0.22);
    --font: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    --nav-h: 64px;
    --wrap: 1180px;
    --measure: 720px;
}

/* ---------------------------------------------------------------- Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + 16px); }
body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
img, video { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -0.02em; font-weight: 700; text-wrap: balance; }
p { margin: 0; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }
.skip-link:focus { position: fixed; top: 8px; left: 8px; z-index: 100; width: auto; height: auto; clip: auto; padding: 8px 14px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-md); }
.wrap { max-width: var(--wrap); margin: 0 auto; padding-inline: 24px; }
@media (max-width: 480px) { .wrap { padding-inline: 16px; } }

/* ---------------------------------------------------------------- Botões */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 40px; padding: 0 16px; border-radius: var(--radius);
    font: 600 14px/1 var(--font); white-space: nowrap; cursor: pointer;
    border: 1px solid transparent; transition: background-color .15s, color .15s, border-color .15s;
}
.btn-sm { height: 36px; padding: 0 14px; font-size: 13.5px; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 15px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); color: #fff; }
.btn-ghost { background: transparent; color: var(--fg); }
.btn-ghost:hover { background: var(--muted); color: var(--fg); }
.btn-outline { background: var(--card); color: var(--fg); border-color: var(--border-strong); }
.btn-outline:hover { border-color: var(--primary-line); color: var(--primary); }

/* ---------------------------------------------------------------- Navbar (igual à landing) */
.site-nav {
    position: sticky; top: 0; z-index: 50; height: var(--nav-h);
    background: rgba(247, 249, 252, 0.85); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
    border-bottom: 1px solid var(--border);
}
.site-nav .wrap { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--fg); }
.brand:hover { color: var(--fg); }
.brand-word { font-weight: 700; font-size: 18px; letter-spacing: -0.04em; }
.brand-word b { font-weight: 700; color: var(--primary); }
.brand-tag { font-size: 12px; font-weight: 600; color: var(--muted-fg); padding: 2px 8px; border: 1px solid var(--border-strong); border-radius: 999px; margin-left: 4px; }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a { font-size: 13.5px; font-weight: 500; color: var(--muted-fg); }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--fg); }
.nav-actions { display: flex; align-items: center; gap: 6px; }
@media (max-width: 960px) { .nav-links { display: none; } }
@media (max-width: 480px) { .nav-actions .btn-ghost, .brand-tag { display: none; } }

/* ---------------------------------------------------------------- Cabeçalho do blog */
.blog-hero { padding-block: 56px 32px; display: grid; gap: 14px; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--primary); }
.blog-hero h1 { font-size: clamp(30px, 4.2vw, 44px); font-weight: 800; letter-spacing: -0.03em; max-width: 18ch; }
.blog-hero p { font-size: 17px; color: var(--muted-fg); max-width: 60ch; }
.cat-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip { display: inline-flex; align-items: center; height: 32px; padding: 0 13px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted-fg); background: var(--card); border: 1px solid var(--border-strong); }
.chip:hover { color: var(--primary); border-color: var(--primary-line); }
.chip.is-active { background: var(--primary-soft); color: var(--primary); border-color: var(--primary-line); }

/* ---------------------------------------------------------------- Listagem */
.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; padding-bottom: 56px; }
@media (max-width: 960px) { .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .post-grid { grid-template-columns: 1fr; } }
.card {
    display: grid; grid-template-rows: auto 1fr; background: var(--card);
    border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow); overflow: hidden;
    transition: border-color .15s, box-shadow .15s, transform .15s;
}
.card:hover { border-color: var(--primary-line); box-shadow: var(--shadow-md); }
@media (prefers-reduced-motion: no-preference) { .card:hover { transform: translateY(-2px); } }
.card-media { aspect-ratio: 16 / 9; background: var(--primary-soft); display: block; overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-media.is-empty { display: grid; place-items: center; }
.card-body { padding: 18px 20px 20px; display: grid; gap: 10px; align-content: start; }
.card-cat { font-size: 12px; font-weight: 700; color: var(--primary); }
.card-title { font-size: 18px; line-height: 1.3; }
.card-title a { color: var(--fg); }
.card-title a:hover { color: var(--primary); }
.card-excerpt { font-size: 14.5px; color: var(--muted-fg); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 13px; color: var(--subtle); font-variant-numeric: tabular-nums; }
.meta span + span::before { content: "·"; margin-right: 12px; color: var(--border-strong); }

.card-featured { grid-column: 1 / -1; grid-template-columns: 1.15fr 1fr; grid-template-rows: none; }
.card-featured .card-media { aspect-ratio: auto; min-height: 280px; }
.card-featured .card-body { padding: 32px; align-content: center; gap: 14px; }
.card-featured .card-title { font-size: clamp(22px, 2.6vw, 30px); letter-spacing: -0.025em; }
.card-featured .card-excerpt { font-size: 16px; -webkit-line-clamp: 4; }
@media (max-width: 760px) {
    .card-featured { grid-template-columns: 1fr; }
    .card-featured .card-media { aspect-ratio: 16 / 9; min-height: 0; }
    .card-featured .card-body { padding: 20px; }
}

.pagination { display: flex; justify-content: center; gap: 6px; padding-bottom: 64px; }
.pagination .page-numbers { min-width: 40px; height: 40px; padding: 0 12px; display: inline-grid; place-items: center; border-radius: var(--radius); border: 1px solid var(--border-strong); background: var(--card); color: var(--fg); font-weight: 600; font-size: 14px; }
.pagination .page-numbers.current { background: var(--primary); border-color: var(--primary); color: #fff; }

.empty { background: var(--card); border: 1px dashed var(--border-strong); border-radius: var(--radius-card); padding: 40px 24px; text-align: center; display: grid; gap: 10px; justify-items: center; margin-bottom: 64px; }
.empty p { color: var(--muted-fg); max-width: 48ch; }

/* ---------------------------------------------------------------- Artigo */
.article-head { padding-block: 40px 28px; display: grid; gap: 16px; max-width: 860px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--subtle); }
.crumbs a { color: var(--muted-fg); }
.crumbs a:hover { color: var(--primary); }
.article-head h1 { font-size: clamp(30px, 4.4vw, 46px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.12; }
.article-head .lede { font-size: 18.5px; color: var(--muted-fg); max-width: 62ch; }
.byline { display: flex; align-items: center; gap: 10px; }
.byline .avatar { width: 36px; height: 36px; border-radius: 999px; background: var(--primary-soft); display: grid; place-items: center; }
.byline strong { display: block; font-size: 14px; }
.article-cover { border-radius: var(--radius-card); overflow: hidden; border: 1px solid var(--border); margin-bottom: 36px; }
.article-cover img { width: 100%; }

.article-layout { display: grid; grid-template-columns: minmax(0, var(--measure)) 300px; gap: 56px; justify-content: space-between; padding-bottom: 56px; }
@media (max-width: 1060px) { .article-layout { grid-template-columns: minmax(0, 1fr); } .article-aside { display: none; } }
.article-aside { position: relative; }
.aside-sticky { position: sticky; top: calc(var(--nav-h) + 24px); display: grid; gap: 16px; }
.toc { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 18px 20px; }
.toc-title { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--subtle); margin-bottom: 10px; }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.toc a { font-size: 13.5px; color: var(--muted-fg); line-height: 1.4; display: block; }
.toc a:hover { color: var(--primary); }

/* ---------------------------------------------------------------- CTA do produto */
.cta-card { background: var(--card); border: 1px solid var(--primary-line); border-radius: var(--radius-card); padding: 22px; display: grid; gap: 12px; box-shadow: var(--shadow); }
.cta-card h2, .cta-card h3 { font-size: 18px; letter-spacing: -0.02em; }
.cta-card p { font-size: 14px; color: var(--muted-fg); }
.cta-card ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 13.5px; }
.cta-card li { display: flex; gap: 8px; align-items: flex-start; }
.cta-card li::before { content: ""; flex: none; width: 16px; height: 16px; margin-top: 2px; border-radius: 999px; background: var(--primary-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 8.2l2.2 2.2 4.8-4.8' fill='none' stroke='%232563EB' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 16px no-repeat; }
.cta-card .fine { font-size: 12.5px; color: var(--subtle); }

.cta-band { background: var(--primary); color: #fff; border-radius: var(--radius-card); padding: 32px; display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center; margin-block: 40px 8px; position: relative; overflow: hidden; }
.cta-band::after { content: ""; position: absolute; right: -40px; bottom: -60px; width: 260px; height: 260px; opacity: .14; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' fill='none' stroke='white' stroke-width='11' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 76 L38 52 L52 64 L80 30'/%3E%3Cpath d='M62 26 L82 26 L82 46'/%3E%3C/svg%3E") center / contain no-repeat; pointer-events: none; }
.cta-band h2 { font-size: 22px; color: #fff; }
.cta-band p { color: rgba(255, 255, 255, 0.85); font-size: 15px; margin-top: 6px; max-width: 52ch; }
.cta-band .btn { background: #fff; color: var(--primary); position: relative; z-index: 1; }
.cta-band .btn:hover { background: var(--primary-soft); color: var(--primary-hover); }
@media (max-width: 640px) { .cta-band { grid-template-columns: 1fr; padding: 24px; } }

/* ---------------------------------------------------------------- Conteúdo (também usado no editor) */
.entry-content { font-size: 17.5px; line-height: 1.75; color: #1f2937; }
.entry-content > * + * { margin-top: 1.15em; }
.entry-content h2 { font-size: 27px; margin-top: 1.9em; letter-spacing: -0.025em; color: var(--fg); }
.entry-content h3 { font-size: 21px; margin-top: 1.6em; color: var(--fg); }
.entry-content h4 { font-size: 18px; margin-top: 1.4em; color: var(--fg); }
.entry-content h2 + *, .entry-content h3 + * { margin-top: .6em; }
.entry-content a { text-decoration: underline; text-decoration-color: var(--primary-line); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.entry-content a:hover { text-decoration-color: var(--primary); }
.entry-content strong { color: var(--fg); font-weight: 700; }
.entry-content ul, .entry-content ol { padding-left: 1.3em; }
.entry-content li + li { margin-top: .4em; }
.entry-content li::marker { color: var(--primary); }
.entry-content blockquote { margin-inline: 0; padding: 16px 20px; background: var(--primary-soft); border-radius: var(--radius); font-size: 17px; color: var(--fg); }
.entry-content blockquote p { margin: 0; }
.entry-content blockquote cite { display: block; margin-top: 8px; font-size: 13px; font-style: normal; color: var(--muted-fg); }
.entry-content figure { margin-inline: 0; }
.entry-content figure img { border-radius: var(--radius); border: 1px solid var(--border); }
.entry-content figcaption, .entry-content .wp-element-caption { font-size: 13px; color: var(--subtle); margin-top: 8px; text-align: center; }
.entry-content code { font-family: var(--mono); font-size: .88em; background: var(--muted); border: 1px solid var(--border); padding: .1em .35em; border-radius: 6px; }
.entry-content pre { font-family: var(--mono); font-size: 14px; background: #0f172a; color: #e2e8f0; padding: 16px 18px; border-radius: var(--radius); overflow-x: auto; }
.entry-content pre code { background: none; border: 0; padding: 0; color: inherit; }
.entry-content hr { border: 0; border-top: 1px solid var(--border-strong); margin-block: 2em; }
.entry-content .wp-block-table, .entry-content .table-scroll { overflow-x: auto; }
.entry-content table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.5; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); font-variant-numeric: tabular-nums; }
.entry-content th, .entry-content td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.entry-content thead th { font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted-fg); background: var(--muted); }
.entry-content tbody tr:last-child td { border-bottom: 0; }
.entry-content .wp-block-button__link { display: inline-flex; align-items: center; height: 44px; padding: 0 20px; border-radius: var(--radius); background: var(--primary); color: #fff; font-weight: 600; font-size: 15px; text-decoration: none; }
.entry-content .wp-block-button__link:hover { background: var(--primary-hover); color: #fff; }
.entry-content .has-text-align-center { text-align: center; }
.entry-content .alignwide { margin-inline: -60px; }
@media (max-width: 860px) { .entry-content .alignwide { margin-inline: 0; } }

/* Caixa de destaque: use o bloco "Grupo" com a classe "destaque" */
.entry-content .destaque { background: var(--card); border: 1px solid var(--primary-line); border-left: 4px solid var(--primary); border-radius: var(--radius); padding: 16px 20px; }
.entry-content .alerta { background: var(--warning-bg); border: 1px solid #fde7b0; border-radius: var(--radius); padding: 16px 20px; }

.article-foot { display: grid; gap: 20px; margin-top: 40px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }

.related { border-top: 1px solid var(--border); padding-block: 48px 64px; }
.related h2 { font-size: 22px; margin-bottom: 20px; }
.related .post-grid { padding-bottom: 0; }

/* ---------------------------------------------------------------- Formulário de lead (isca) */
.lead-box { background: var(--card); border: 1px solid var(--primary-line); border-radius: var(--radius-card); padding: 24px; display: grid; gap: 14px; box-shadow: var(--shadow); margin-block: 28px; font-size: 15px; line-height: 1.5; }
.entry-content .lead-box > * + * { margin-top: 0; }
.lead-box p { margin: 0; }
.lead-title { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; color: var(--fg); }
.lead-sub, .lead-fine { color: var(--muted-fg); font-size: 14px; }
.lead-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 760px) { .lead-grid { grid-template-columns: 1fr; } }
.lead-grid label { display: grid; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--fg); }
.lead-grid label em { font-style: normal; font-weight: 400; color: var(--subtle); }
.lead-grid input { height: 44px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--radius); font: 400 15px var(--font); color: var(--fg); background: #fff; width: 100%; }
.lead-grid input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-line); }
.lead-consent { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--muted-fg); }
.lead-consent input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--primary); flex: none; }
.lead-btn, .entry-content a.lead-btn { justify-self: start; display: inline-flex; align-items: center; height: 46px; padding: 0 22px; border: 0; border-radius: var(--radius); background: var(--primary); color: #fff; font: 700 15px var(--font); cursor: pointer; text-decoration: none; }
.lead-btn:hover, .entry-content a.lead-btn:hover { background: var(--primary-hover); color: #fff; }
.lead-error { background: #fef2f2; color: #b91c1c; border-radius: var(--radius); padding: 10px 12px; font-size: 14px; }
.lead-ok { border-color: #bbf7d0; background: var(--success-bg); }
.lead-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------------------------------------------------------------- Página simples / 404 */
.page-simple { max-width: var(--measure); padding-block: 48px 72px; display: grid; gap: 20px; }
.page-simple h1 { font-size: clamp(28px, 4vw, 40px); font-weight: 800; letter-spacing: -0.03em; }
.notfound { padding-block: 96px; display: grid; gap: 16px; justify-items: start; max-width: 560px; }
.notfound .code { font-size: 14px; font-weight: 700; color: var(--primary); font-variant-numeric: tabular-nums; }
.notfound h1 { font-size: 36px; font-weight: 800; letter-spacing: -0.03em; }
.notfound p { color: var(--muted-fg); }
.search-form { display: flex; gap: 8px; width: 100%; max-width: 440px; }
.search-form input[type="search"] { flex: 1; height: 40px; padding: 0 14px; border-radius: var(--radius); border: 1px solid var(--border-strong); background: var(--card); font: 400 14px var(--font); color: var(--fg); }
.search-form input[type="search"]:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-line); }

/* ---------------------------------------------------------------- Rodapé (igual à landing) */
.site-footer { background: var(--card); border-top: 1px solid var(--border); }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 32px; padding-block: 48px; }
.footer-grid p { font-size: 13.5px; color: var(--muted-fg); margin-top: 12px; max-width: 34ch; }
.footer-col { display: flex; flex-direction: column; gap: 12px; }
.footer-label { font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--subtle); }
.footer-col a { font-size: 13.5px; color: var(--muted-fg); }
.footer-col a:hover { color: var(--fg); }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding-bottom: 32px; font-size: 12.5px; color: var(--subtle); }
.footer-bottom a { color: var(--muted-fg); font-weight: 500; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } }
