/* Content Engine styles (SPEC-SAAS-CONTENT) — public blog/article + admin CRUD.
   Own file (Wave-3 anti-collision: never touch app.css). Reuses app.css design tokens (--surface,
   --text, --accent, --border, spacing, radius) so light/dark themes track automatically. */

/* ── Public content shell ─────────────────────────────────────────── */
.content-wrap { max-width: 900px; margin: 0 auto; padding: 40px 32px 72px; }
.content-wrap.article { max-width: 760px; }

.crumbs { font-size: 12.5px; color: var(--text-3); margin-bottom: 20px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.crumbs a { color: var(--text-3); }
.crumbs a:hover { color: var(--accent); }
.crumbs .sep { color: var(--muted); }
.crumbs .cur { color: var(--text-2); }

.blog-head { margin-bottom: 28px; }
.blog-head h1 { font-size: 34px; letter-spacing: -0.025em; margin: 0 0 10px; }
.blog-head .lead { color: var(--text-2); font-size: 16px; max-width: 60ch; margin: 0 0 18px; line-height: 1.55; }
.blog-search { display: flex; gap: 8px; max-width: 420px; }
.blog-search input { flex: 1; height: 36px; padding: 0 12px; border: 1px solid var(--border-2); border-radius: var(--r);
  background: var(--surface); color: var(--text); font-family: var(--font); font-size: 13.5px; }
.blog-search input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.cat-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.chip { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border-2); background: var(--surface);
  color: var(--text-2); font-size: 12.5px; font-weight: 500; }
.chip:hover { color: var(--text); border-color: var(--border-strong); text-decoration: none; }
.chip.on { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent-line); }

/* Tag picker (admin post editor): a chip that carries a checkbox; the checked state lights the chip. */
.tag-picker { margin-bottom: 0; }
.chip-check { cursor: pointer; user-select: none; }
.chip-check input { accent-color: var(--accent, #2563eb); margin: 0; }
.chip-check:has(input:checked) { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent-line); }
/* Tag chips on the public article. */
.article-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 28px 0 4px; }

.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.post-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  overflow: hidden; box-shadow: var(--sh-sm); transition: box-shadow .15s, transform .15s; display: flex; flex-direction: column; }
.post-card:hover { box-shadow: var(--sh-md); transform: translateY(-2px); }
.post-card .thumb { display: block; aspect-ratio: 16/9; overflow: hidden; background: var(--surface-3); }
.post-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.pc-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; }
.pc-cat { font-family: var(--font-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--accent); }
.post-card h3 { font-size: 17px; line-height: 1.25; margin: 0; letter-spacing: -0.01em; }
.post-card h3 a { color: var(--text); }
.post-card h3 a:hover { color: var(--accent); text-decoration: none; }
.pc-excerpt { color: var(--text-2); font-size: 13.5px; line-height: 1.5; margin: 0; }
.pc-meta { display: flex; gap: 10px; font-size: 12px; color: var(--text-3); margin-top: auto; padding-top: 4px; }

.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 32px; }

.empty-state { text-align: center; padding: 56px 24px; color: var(--text-2); }
.empty-state.big { padding: 80px 24px; }
.empty-state p { max-width: 48ch; margin: 0 auto 20px; line-height: 1.55; }
.code-404 { font-family: var(--font-mono); font-size: 64px; color: var(--muted); letter-spacing: -.03em; }

/* ── Article ──────────────────────────────────────────────────────── */
.article-head { margin-bottom: 30px; }
.article-head h1 { font-size: 38px; line-height: 1.1; letter-spacing: -0.03em; margin: 8px 0 14px; }
.article-head .lead { font-size: 18px; color: var(--text-2); line-height: 1.55; margin: 0 0 18px; }
.byline { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-3); }
.byline .avatar.sm { width: 30px; height: 30px; font-size: 12px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.byline .who { display: flex; flex-direction: column; line-height: 1.2; }
.byline .who .role { font-size: 11.5px; color: var(--muted); }
.byline time { margin-left: auto; }

.prose { font-size: 16.5px; line-height: 1.72; color: var(--text); }
.prose > * + * { margin-top: 1.05em; }
.prose h2 { font-size: 26px; letter-spacing: -0.02em; margin-top: 1.8em; }
.prose h3 { font-size: 20px; margin-top: 1.5em; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.prose code { font-family: var(--font-mono); font-size: .88em; background: var(--surface-3); padding: 2px 5px; border-radius: var(--r-sm); }
.prose pre { background: var(--term-bg); color: var(--term-fg); padding: 16px 18px; border-radius: var(--r);
  overflow-x: auto; font-family: var(--font-mono); font-size: 13px; line-height: 1.55; }
.prose pre code { background: none; padding: 0; color: inherit; }
.prose blockquote { border-left: 3px solid var(--accent-line); padding-left: 16px; color: var(--text-2); }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: .35em; }
.prose img { max-width: 100%; height: auto; border-radius: var(--r); }
.prose table { width: 100%; border-collapse: collapse; font-size: 14px; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--border-2); padding: 8px 10px; text-align: left; }
.prose th { background: var(--surface-2); font-weight: 600; }
.article-foot { display: flex; justify-content: space-between; gap: 12px; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--border); }

/* ── Admin content CRUD ───────────────────────────────────────────── */
.admin-subnav { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 22px; border-bottom: 1px solid var(--border); }
.admin-subnav a { padding: 8px 12px; font-size: 13px; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.admin-subnav a:hover { color: var(--text); text-decoration: none; }
.admin-subnav a.on { color: var(--accent); border-bottom-color: var(--accent); }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat-tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 16px 18px; }
.stat-tile .n { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; }
.stat-tile .k { font-size: 12px; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; }

.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
/* No phone, tabela admin larga ROLA no próprio container em vez de cortar as colunas da direita
   (o body tem overflow-x:clip ≤960px). Escopado ao mobile — desktop mantém o table-layout normal. */
@media (max-width: 640px) { .tbl { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; } }
.tbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3);
  padding: 10px 12px; border-bottom: 1px solid var(--border); }
.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--border); }
.tbl tr:hover td { background: var(--surface-2); }
.tbl .st { font-family: var(--font-mono); font-size: 11px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border-2); }
.tbl .st.published { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.tbl .st.draft { color: var(--warn); border-color: var(--warn-line); background: var(--warn-soft); }
.tbl .st.archived, .tbl .st.unpublished { color: var(--muted); }

.editor-grid { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start; }
@media (max-width: 860px) { .editor-grid { grid-template-columns: 1fr; } }
.editor-grid textarea { width: 100%; min-height: 420px; font-family: var(--font-mono); font-size: 13px; line-height: 1.55;
  padding: 12px; border: 1px solid var(--border-2); border-radius: var(--r); background: var(--surface); color: var(--text); resize: vertical; }
.editor-grid input, .editor-grid select { width: 100%; height: 36px; padding: 0 10px; border: 1px solid var(--border-2);
  border-radius: var(--r); background: var(--surface); color: var(--text); font-family: var(--font); font-size: 13.5px; }
.editor-side .field { margin-bottom: 14px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

/* Helpers CSP-safe (a CSP estrita bloqueia `style=` inline — estas classes substituem-nos). */
.editor-grid.cols-2 { grid-template-columns: 1fr 1fr; }
.editor-grid.cols-3 { grid-template-columns: 1fr 1fr 120px; }
@media (max-width: 860px) { .editor-grid.cols-2, .editor-grid.cols-3 { grid-template-columns: 1fr; } }
.notice { margin-bottom: 16px; }
.notice-ok { border-color: var(--accent-line); background: var(--accent-soft); }
.notice-err { border-color: var(--danger-line); background: var(--danger-soft); }
.tax-row { padding: 6px 0; border-bottom: 1px solid var(--border); }
.status-line { margin: 12px 0 4px; }
.m-0 { margin: 0; }
.mt-12 { margin-top: 12px; }
.mt-14 { margin-top: 14px; }
.mt-16 { margin-top: 16px; }
.mb-18 { margin-bottom: 18px; }

/* ── Onboarding checklist ─────────────────────────────────────────── */
.onb-steps { display: flex; flex-direction: column; gap: 12px; margin: 24px 0; }
.onb-step { display: flex; gap: 14px; align-items: flex-start; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 16px 18px; }
.onb-step .marker { width: 26px; height: 26px; flex: 0 0 26px; border-radius: 50%; border: 2px solid var(--border-strong);
  display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; color: var(--text-3); }
.onb-step.done .marker { background: var(--accent); border-color: var(--accent); color: #fff; }
.onb-step.done h3 { color: var(--text-3); text-decoration: line-through; }
.onb-step .b { flex: 1; }
.onb-step h3 { font-size: 15px; margin: 0 0 4px; }
.onb-step p { font-size: 13.5px; color: var(--text-2); margin: 0 0 8px; line-height: 1.5; }
.free-entry { border: 1px dashed var(--accent-line); background: var(--accent-soft); border-radius: var(--r); padding: 18px 20px; margin-top: 8px; }
.free-entry h3 { margin: 0 0 6px; font-size: 15px; }
.free-entry ol { margin: 8px 0 0; padding-left: 18px; font-size: 13.5px; color: var(--text-2); line-height: 1.6; }
.disclaimer { font-size: 12px; color: var(--text-3); margin-top: 10px; line-height: 1.5; }

/* Páginas legais/segurança/pricing públicas (legal_public.py) */
.legal { max-width: 820px; }
.legal-note { border: 1px dashed var(--accent-line); background: var(--accent-soft); border-radius: var(--r);
  padding: 12px 16px; margin: 4px 0 26px; font-size: 13px; color: var(--text-2); line-height: 1.55; }
.legal-body h2 { font-size: 21px; margin-top: 1.9em; }
.legal-body h3 { font-size: 17px; }
.legal-body ul { padding-left: 20px; }
.legal-body ul li { margin-top: .5em; }
