/* Blog — páginas geradas pelo Editorial. Este arquivo é escrito à mão; os HTML de blog/ não. */

:root {
  --bg: #faf9f6;
  --surface: #f1efe9;
  --surface-2: #e9e6de;
  --ink: #1b1c19;
  --muted: #6b6c62;
  --accent: #2f6f5e;
  --accent-warm: #b97a3d;
  --accent-ink: #f4f8f6;
  --line: #ddd9cf;
  --font-display: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --measure: 68ch;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14161a;
    --surface: #1b1e22;
    --surface-2: #24272c;
    --ink: #f1efe9;
    --muted: #9a9d95;
    --accent: #59b39a;
    --accent-warm: #e0a868;
    --accent-ink: #0d1613;
    --line: #2b2e32;
  }
}

:root[data-theme="dark"] {
  --bg: #14161a;
  --surface: #1b1e22;
  --surface-2: #24272c;
  --ink: #f1efe9;
  --muted: #9a9d95;
  --accent: #59b39a;
  --accent-warm: #e0a868;
  --accent-ink: #0d1613;
  --line: #2b2e32;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

h1, h2, h3 {
  font-family: var(--font-display);
  letter-spacing: -0.01em;
  text-wrap: balance;
}

/* ---------- Cabeçalho e rodapé ---------- */

.blog-header {
  max-width: 1080px;
  margin: 0 auto;
  padding: 1.25rem clamp(1.25rem, 5vw, 2.5rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
}

.blog-brand {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.05rem;
  text-decoration: none;
}

.blog-nav { display: flex; gap: 1.5rem; }

.blog-nav a {
  font-size: 0.86rem;
  color: var(--muted);
  text-decoration: none;
}

.blog-nav a:hover { color: var(--ink); }

.blog-footer {
  max-width: var(--measure);
  margin: 4rem auto 3rem;
  padding: 1.5rem clamp(1.25rem, 5vw, 0px) 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

/* Fonte menor só nos filhos: 68ch é medido na fonte do próprio rodapé. */
.blog-footer a { color: var(--muted); font-size: 0.86rem; }

/* ---------- Artigo ---------- */

.article {
  max-width: var(--measure);
  margin: 0 auto;
  padding: clamp(2.5rem, 7vw, 4.5rem) clamp(1.25rem, 5vw, 0px) 0;
}

.article-pillar {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0;
}

.article-title {
  font-weight: 300;
  font-size: clamp(2rem, 5vw, 2.9rem);
  line-height: 1.15;
  margin: 0.75rem 0 1rem;
}

.article-meta {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0 0 2.5rem;
}

.article-body h2 {
  font-weight: 400;
  font-size: 1.55rem;
  line-height: 1.3;
  margin: 2.75rem 0 0.75rem;
}

.article-body h3 {
  font-weight: 500;
  font-size: 1.2rem;
  margin: 2rem 0 0.5rem;
}

.article-body p, .article-body li { color: var(--ink); }

.article-body p { margin: 0 0 1.25rem; }

.article-body ul, .article-body ol { padding-left: 1.4rem; margin: 0 0 1.25rem; }

.article-body li { margin-bottom: 0.4rem; }

.article-body a { color: var(--accent); text-underline-offset: 3px; }

.article-body blockquote {
  margin: 1.75rem 0;
  padding: 0.25rem 0 0.25rem 1.25rem;
  border-left: 2px solid var(--accent-warm);
  color: var(--muted);
  font-style: italic;
}

/* Citação de impacto: uma frase do próprio argumento, em destaque. */
.article-body blockquote.pull {
  margin: 2.25rem 0;
  padding: 0.25rem 0 0.25rem 1.25rem;
  border-left: 4px solid var(--accent);
  color: var(--ink);
  font-family: var(--font-display);
  font-style: normal;
  font-weight: 700;
  font-size: 1.3rem;
  line-height: 1.4;
}

.article-body blockquote.pull p { margin: 0; }

/* Bloco de destaque: um dado ou alerta que o leitor não pode perder. */
.article-body aside.callout {
  margin: 1.75rem 0;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border-left: 4px solid var(--accent-warm);
  border-radius: 8px;
}

.article-body aside.callout p { margin: 0 0 0.5rem; }
.article-body aside.callout p:last-child { margin-bottom: 0; }

.article-body figure.illustration { margin: 2.25rem 0; }

.article-body figure.illustration img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
}

.article-body figure.illustration figcaption {
  margin-top: 0.6rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.article-body code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--surface);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

.article-body pre {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.55;
}

.article-body pre code { background: none; padding: 0; }

.article-body hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }

.cite { font-size: 0.7em; line-height: 0; }

.cite a {
  font-family: var(--font-mono);
  color: var(--accent);
  text-decoration: none;
  padding: 0 0.1em;
}

.cite a:hover { text-decoration: underline; }

.sources {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.sources h2 {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1rem;
}

.sources ol { padding-left: 1.6rem; margin: 0; font-size: 0.9rem; }

.sources li { color: var(--muted); margin-bottom: 0.4rem; scroll-margin-top: 1.5rem; }

.sources li:target { color: var(--ink); }

.sources a { color: inherit; text-underline-offset: 3px; word-break: break-word; }

.article-cta {
  margin-top: 3rem;
  padding: 1.5rem 1.75rem;
  background: var(--surface);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.article-cta p {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--ink);
}

.article-cta a {
  background: var(--accent);
  color: var(--accent-ink);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
}

/* ---------- Índice ---------- */

.blog-index {
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(2.5rem, 7vw, 4.5rem) clamp(1.25rem, 5vw, 2.5rem) 0;
}

.blog-index h1 { font-weight: 300; font-size: clamp(2rem, 5vw, 2.9rem); margin: 0 0 2rem; }

.blog-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.blog-card a {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.blog-card a:hover { border-color: var(--accent); transform: translateY(-2px); }

.blog-card img { aspect-ratio: 1200 / 630; object-fit: cover; width: 100%; }

.blog-card .article-pillar { margin: 1.1rem 1.25rem 0; }

.blog-card h2 { font-weight: 400; font-size: 1.2rem; line-height: 1.3; margin: 0.5rem 1.25rem 0.5rem; }

.blog-card p { color: var(--muted); font-size: 0.92rem; line-height: 1.55; margin: 0 1.25rem 1rem; }

.blog-card time {
  margin: auto 1.25rem 1.1rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
}

.blog-empty { color: var(--muted); font-size: 1.05rem; }

@media (min-width: 1080px) {
  .blog-index + .blog-footer { max-width: 1000px; padding-left: 0; padding-right: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .blog-card a { transition: none; }
  .blog-card a:hover { transform: none; }
}
