/* ============================================================
   Finanças Descomplicada / Finance Made Simple — Design System
   Blog de finanças para iniciantes (PT-BR + EN)
   HTML estático + CSS puro, tema claro/escuro
   ============================================================ */

:root {
  /* Paleta — claro */
  --bg:            #f7f9f8;
  --bg-soft:       #ffffff;
  --bg-elevated:   #ffffff;
  --surface:       #ffffff;
  --border:        #e3e8e6;
  --border-strong: #cfd6d3;

  --text:          #0f1a17;
  --text-soft:     #45524d;
  --text-muted:    #6b7772;

  --brand:         #0f9d76;   /* verde teal — crescimento/confiança */
  --brand-strong:  #0b7d5e;
  --brand-soft:    #e6f5ef;
  --accent:        #f0a500;   /* âmbar — destaques */
  --accent-soft:   #fdf3dc;
  --danger:        #d64545;
  --up:            #0f9d76;
  --down:          #d64545;

  --shadow-sm: 0 1px 2px rgba(15,26,23,.06), 0 1px 3px rgba(15,26,23,.04);
  --shadow-md: 0 4px 12px rgba(15,26,23,.08), 0 2px 4px rgba(15,26,23,.04);
  --shadow-lg: 0 18px 40px rgba(15,26,23,.14);

  --radius:    14px;
  --radius-sm: 10px;
  --radius-lg: 22px;

  --maxw: 1120px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
}

[data-theme="dark"] {
  --bg:            #0b0f0e;
  --bg-soft:       #101614;
  --bg-elevated:   #141c19;
  --surface:       #141c19;
  --border:        #232d29;
  --border-strong: #33403a;

  --text:          #eef3f1;
  --text-soft:     #b7c2bd;
  --text-muted:    #7f8b86;

  --brand:         #23c393;
  --brand-strong:  #37d5a4;
  --brand-soft:    #10241d;
  --accent:        #f5b426;
  --accent-soft:   #241d0f;
  --danger:        #f26d6d;
  --up:            #23c393;
  --down:          #f26d6d;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow-md: 0 6px 18px rgba(0,0,0,.5);
  --shadow-lg: 0 20px 44px rgba(0,0,0,.6);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background .25s ease, color .25s ease;
}

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

a { color: var(--brand-strong); text-decoration: none; transition: color .15s; }
a:hover { color: var(--brand); }

img { max-width: 100%; display: block; }

h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -.02em; color: var(--text); }

/* ---------- Barra de progresso de leitura ---------- */
#progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  z-index: 200; transition: width .1s linear;
}

/* ---------- Header ---------- */
header.site {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 66px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.15rem; letter-spacing: -.03em; color: var(--text); }
.brand:hover { color: var(--text); }
.brand .mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  display: grid; place-items: center; color: #fff; box-shadow: var(--shadow-sm);
}
.brand .mark svg { width: 20px; height: 20px; }

.nav-links { display: flex; align-items: center; gap: 8px; }
.nav-links a { color: var(--text-soft); font-size: .93rem; font-weight: 500; padding: 8px 12px; border-radius: 9px; }
.nav-links a:hover { color: var(--text); background: var(--bg-soft); }

.nav-tools { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-soft); cursor: pointer;
  display: grid; place-items: center; transition: all .15s;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }
.icon-btn svg { width: 18px; height: 18px; }
.lang-switch {
  border: 1px solid var(--border); background: var(--surface); border-radius: 10px;
  height: 40px; padding: 0 12px; font-weight: 600; font-size: .85rem; color: var(--text-soft);
  cursor: pointer; transition: all .15s; display: inline-flex; align-items: center; gap: 6px;
}
.lang-switch:hover { color: var(--text); border-color: var(--border-strong); }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  padding: 12px 20px; border-radius: 11px; font-weight: 600; font-size: .95rem;
  cursor: pointer; border: 1px solid transparent; transition: all .15s; white-space: nowrap;
}
.btn-primary { background: var(--brand); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--brand-strong); color: #fff; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand-strong); }

/* ---------- Hero ---------- */
.hero { padding: 80px 0 56px; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; top: -180px; right: -120px; width: 460px; height: 460px;
  background: radial-gradient(circle, var(--brand-soft), transparent 70%); z-index: 0; opacity: .9;
}
.hero .wrap { position: relative; z-index: 1; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-size: .8rem; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase; color: var(--brand-strong);
  background: var(--brand-soft); padding: 6px 13px; border-radius: 999px; margin-bottom: 20px;
}
.hero h1 { font-size: clamp(2.1rem, 5vw, 3.5rem); font-weight: 800; max-width: 15ch; margin-bottom: 20px; }
.hero h1 .hl { color: var(--brand); }
.hero p.lead { font-size: clamp(1.05rem, 2vw, 1.28rem); color: var(--text-soft); max-width: 56ch; margin-bottom: 30px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 32px; margin-top: 46px; flex-wrap: wrap; }
.hero-stats .stat .num { font-size: 1.7rem; font-weight: 800; color: var(--text); letter-spacing: -.03em; }
.hero-stats .stat .lbl { font-size: .85rem; color: var(--text-muted); }

/* ---------- Seções ---------- */
section.block { padding: 56px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 34px; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); font-weight: 800; }
.section-head p { color: var(--text-muted); margin-top: 6px; max-width: 52ch; }
.section-head .link { font-weight: 600; font-size: .92rem; display: inline-flex; align-items: center; gap: 5px; }

/* ---------- Cards de notícias ---------- */
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.news-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; display: flex; flex-direction: column; gap: 10px; transition: all .18s;
  box-shadow: var(--shadow-sm);
}
.news-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.news-card .src { display: flex; align-items: center; gap: 8px; font-size: .78rem; color: var(--text-muted); font-weight: 600; }
.news-card .src .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); }
.news-card h3 { font-size: 1.08rem; font-weight: 700; line-height: 1.35; }
.news-card h3 a { color: var(--text); }
.news-card h3 a:hover { color: var(--brand-strong); }
.news-card .desc { font-size: .92rem; color: var(--text-soft); flex: 1; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.news-card .meta { font-size: .8rem; color: var(--text-muted); margin-top: 4px; }
.news-loading, .news-error { grid-column: 1 / -1; padding: 40px; text-align: center; color: var(--text-muted); border: 1px dashed var(--border-strong); border-radius: var(--radius); }
.skeleton { background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius); height: 180px; position: relative; overflow: hidden; }
.skeleton::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--border) 60%, transparent), transparent); animation: shimmer 1.4s infinite; }
@keyframes shimmer { 100% { transform: translateX(100%); } }

/* ---------- Cards de guias ---------- */
.guide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.guide-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; transition: all .18s; position: relative; overflow: hidden; box-shadow: var(--shadow-sm);
}
.guide-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--brand); }
.guide-card .gicon { width: 46px; height: 46px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-strong); display: grid; place-items: center; margin-bottom: 16px; }
.guide-card .gicon svg { width: 24px; height: 24px; }
.guide-card .tag { font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--accent); }
.guide-card h3 { font-size: 1.2rem; font-weight: 700; margin: 8px 0 8px; }
.guide-card h3 a { color: var(--text); }
.guide-card p { font-size: .93rem; color: var(--text-soft); }
.guide-card .read { margin-top: 16px; font-weight: 600; font-size: .88rem; color: var(--brand-strong); display: inline-flex; align-items: center; gap: 5px; }
.guide-card:hover .read { gap: 9px; }

/* ---------- CTA / Newsletter ---------- */
.cta {
  background: linear-gradient(135deg, var(--brand-strong), var(--brand));
  border-radius: var(--radius-lg); padding: 52px 44px; color: #fff; text-align: center;
  position: relative; overflow: hidden;
}
.cta::before { content: ""; position: absolute; top: -80px; right: -60px; width: 300px; height: 300px; background: rgba(255,255,255,.12); border-radius: 50%; }
.cta h2 { color: #fff; font-size: clamp(1.6rem, 3vw, 2.2rem); position: relative; }
.cta p { color: rgba(255,255,255,.9); max-width: 48ch; margin: 12px auto 26px; position: relative; }
.cta form { display: flex; gap: 10px; max-width: 460px; margin: 0 auto; position: relative; flex-wrap: wrap; }
.cta input { flex: 1; min-width: 200px; padding: 13px 16px; border-radius: 11px; border: none; font-size: .95rem; font-family: inherit; }
.cta .btn-primary { background: #fff; color: var(--brand-strong); }
.cta .btn-primary:hover { background: #f0f0f0; color: var(--brand-strong); }
.cta small { display: block; margin-top: 14px; color: rgba(255,255,255,.75); position: relative; font-size: .8rem; }

/* ---------- Footer ---------- */
footer.site { border-top: 1px solid var(--border); background: var(--bg-soft); padding: 48px 0 30px; margin-top: 40px; }
.foot-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 34px; }
.foot-brand p { color: var(--text-muted); font-size: .9rem; margin-top: 12px; max-width: 34ch; }
.foot-col h4 { font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-bottom: 14px; }
.foot-col a { display: block; color: var(--text-soft); font-size: .92rem; padding: 5px 0; }
.foot-col a:hover { color: var(--brand-strong); }
.foot-bottom { margin-top: 38px; padding-top: 22px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--text-muted); font-size: .85rem; }
.disclaimer { background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); border-radius: var(--radius-sm); padding: 14px 18px; font-size: .84rem; color: var(--text-soft); margin-top: 24px; }

/* ============================================================
   ARTIGOS (posts)
   ============================================================ */
.article { padding: 48px 0 20px; }
.article .wrap { max-width: 760px; }
.breadcrumb { font-size: .85rem; color: var(--text-muted); margin-bottom: 20px; }
.breadcrumb a { color: var(--text-muted); } .breadcrumb a:hover { color: var(--brand-strong); }
.article .tag { font-size: .75rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--accent); }
.article h1 { font-size: clamp(2rem, 4.5vw, 2.9rem); font-weight: 800; margin: 12px 0 18px; }
.article .post-meta { display: flex; align-items: center; gap: 14px; color: var(--text-muted); font-size: .9rem; margin-bottom: 28px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.article .avatar { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--brand-strong)); }

.prose { font-size: 1.09rem; }
.prose > * + * { margin-top: 1.25em; }
.prose p { color: var(--text-soft); }
.prose h2 { font-size: 1.7rem; font-weight: 800; margin-top: 2em; }
.prose h3 { font-size: 1.3rem; font-weight: 700; margin-top: 1.6em; }
.prose ul, .prose ol { padding-left: 1.4em; color: var(--text-soft); }
.prose li + li { margin-top: .5em; }
.prose strong { color: var(--text); font-weight: 700; }
.prose a { text-decoration: underline; text-underline-offset: 3px; }

.callout { border-radius: var(--radius-sm); padding: 18px 22px; border-left: 4px solid var(--brand); background: var(--brand-soft); }
.callout .ct-title { font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.callout p { color: var(--text-soft); margin: 0; }
.callout.warn { border-left-color: var(--accent); background: var(--accent-soft); }

.analogy { border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); padding: 20px 22px; background: var(--bg-soft); }
.analogy .ct-title { font-weight: 700; color: var(--brand-strong); margin-bottom: 6px; font-size: .95rem; }

.key-points { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 26px; box-shadow: var(--shadow-sm); }
.key-points h4 { font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; color: var(--brand-strong); margin-bottom: 12px; }
.key-points ul { list-style: none; padding: 0; }
.key-points li { padding-left: 28px; position: relative; margin-top: 10px; color: var(--text-soft); }
.key-points li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--brand); font-weight: 800; }

.prose blockquote { border-left: 4px solid var(--border-strong); padding: 4px 0 4px 22px; font-family: var(--serif); font-size: 1.25rem; font-style: italic; color: var(--text); }

.post-nav { display: flex; justify-content: space-between; gap: 16px; margin: 48px 0; flex-wrap: wrap; }
.post-nav a { flex: 1; min-width: 220px; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; background: var(--surface); transition: all .15s; }
.post-nav a:hover { border-color: var(--brand); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.post-nav .dir { font-size: .78rem; color: var(--text-muted); font-weight: 600; }
.post-nav .ttl { font-weight: 700; color: var(--text); margin-top: 4px; }
.post-nav a.next { text-align: right; }

/* ---------- Responsivo ---------- */
@media (max-width: 860px) {
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .nav-links { display: none; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .hero { padding: 54px 0 40px; }
  .hero-stats { gap: 22px; }
  .foot-grid { grid-template-columns: 1fr; }
  .cta { padding: 40px 24px; }
}

/* ---------- Frases de economistas ---------- */
.quotes { background: var(--bg-soft); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.quote-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.quote-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px 26px 22px; position: relative; box-shadow: var(--shadow-sm); transition: all .18s;
  display: flex; flex-direction: column;
}
.quote-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.quote-card::before {
  content: "\201C"; font-family: var(--serif); font-size: 4.2rem; line-height: 1;
  color: var(--brand); opacity: .25; position: absolute; top: 8px; left: 18px;
}
.quote-card blockquote {
  font-family: var(--serif); font-style: italic; font-size: 1.16rem; line-height: 1.5;
  color: var(--text); margin: 18px 0 0; padding: 0; border: none; position: relative; z-index: 1; flex: 1;
}
.quote-card .author { display: flex; align-items: center; gap: 12px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.quote-card .author .ini {
  width: 42px; height: 42px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, var(--brand), var(--brand-strong)); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: .95rem;
}
.quote-card .author .who .name { font-weight: 700; color: var(--text); font-size: .96rem; }
.quote-card .author .who .role { font-size: .8rem; color: var(--text-muted); }

/* animação de entrada */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .5s ease, transform .5s ease; }
.reveal.in { opacity: 1; transform: none; }
