/* guigo — tema só texto para Ghost. Coluna única de 680px, serifa de leitura. */

:root {
  --bg: #ffffff;
  --fg: #1c1c1a;
  --muted: #6e6c66;
  --rule: #e6e4df;
  --code-bg: #f4f3f0;
  --accent: #2a5c7a;
  --serif: "Literata", Georgia, "Times New Roman", serif;
  /* Settings > Design do Admin injeta --gh-font-*; sem escolha, fica na serifa. */
  --font-body: var(--gh-font-body, var(--serif));
  --font-heading: var(--gh-font-heading, var(--serif));
  --sans: "IBM Plex Sans", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --measure: 680px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161615;
    --fg: #e6e3dd;
    --muted: #98958d;
    --rule: #2c2b28;
    --code-bg: #1f1f1d;
    --accent: #7fb0cc;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 19px;
  line-height: 1.6;
  padding-inline: 16px;
  padding-block: 0 64px;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: var(--measure); margin: 0 auto; }
img, video, iframe { max-width: 100%; height: auto; }

a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Cabeçalho e rodapé do site */
.site-header {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding-block: 28px 20px;
  border-bottom: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 14px;
}
.site-header .brand { font-weight: 500; letter-spacing: 0.01em; }
.site-header nav { display: flex; gap: 20px; flex-wrap: wrap; justify-content: flex-end; color: var(--muted); }
.site-header nav a:hover { color: var(--fg); }

.site-footer {
  margin-top: 64px;
  font-family: var(--sans); font-size: 13px; color: var(--muted);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.site-footer a:hover { color: var(--fg); }

/* Meta: data e tempo de leitura */
.meta {
  font-family: var(--sans);
  font-size: 13px; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.meta span + span::before { content: "·"; margin-inline: 8px; }

/* Home: lista de posts */
.list-header { padding-block: 40px 8px; }
.list-header h1 { margin: 0 0 8px; font-family: var(--font-heading); font-size: 28px; font-weight: 600; line-height: 1.2; }
.list-header .meta { font-size: 15px; }

.post-list { list-style: none; margin: 0; padding: 0; }
.post-list li { border-bottom: 1px solid var(--rule); }
.post-list a {
  display: flex; flex-direction: column; gap: 6px;
  padding-block: 26px;
}
.post-list h2 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 24px; font-weight: 600; line-height: 1.25;
  text-wrap: balance;
}
.post-list a:hover h2 { color: var(--accent); }

.pagination {
  display: flex; justify-content: space-between; gap: 16px;
  padding-block: 28px;
  font-family: var(--sans); font-size: 14px; color: var(--muted);
}
.pagination a:hover { color: var(--fg); }

/* Post */
.post-header { padding-block: 56px 32px; }
.post-header h1 {
  margin: 0 0 14px;
  font-family: var(--font-heading);
  font-size: 38px; font-weight: 600; line-height: 1.15;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.post-feature-image { margin: 0 0 40px; }
.post-feature-image img { display: block; width: 100%; }

.post-footer {
  margin-top: 56px; padding-top: 20px;
  border-top: 1px solid var(--rule);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-family: var(--sans); font-size: 14px; color: var(--muted);
}
.post-footer a:hover { color: var(--fg); }
.post-footer .tags { display: flex; gap: 12px; flex-wrap: wrap; }
.post-footer .tags a::before { content: "#"; }

/* Conteúdo do post (saída do editor) */
/* Espaçamento vertical só por vizinhança; regras abaixo com seletor
   mais específico (h2, h2 + *) sobrescrevem de propósito. */
.post-body > * { margin-block: 0; }
.post-body > * + * { margin-top: 1.4em; }
.post-body h2, .post-body h3, .post-body h4 {
  margin: 2em 0 0; font-family: var(--font-heading); font-weight: 600; line-height: 1.25;
}
.post-body h2 { font-size: 26px; }
.post-body h3 { font-size: 22px; }
.post-body h4 { font-size: 19px; }
.post-body h2 + *, .post-body h3 + *, .post-body h4 + * { margin-top: 0.6em; }
.post-body a {
  color: var(--accent);
  text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px;
}
.post-body ul, .post-body ol { padding-left: 1.4em; }
.post-body li + li { margin-top: 0.4em; }
.post-body blockquote {
  margin-inline: 0; padding-left: 20px;
  border-left: 3px solid var(--rule);
  font-style: italic; color: var(--muted);
}
.post-body blockquote.kg-blockquote-alt {
  border: 0; padding: 0; text-align: center; font-size: 1.2em;
}
.post-body hr { border: 0; border-top: 1px solid var(--rule); margin-block: 2.5em; }
.post-body code {
  font-family: var(--mono); font-size: 0.82em;
  background: var(--code-bg); padding: 0.1em 0.35em; border-radius: 3px;
}
.post-body pre {
  padding: 16px 20px;
  background: var(--code-bg); border-radius: 4px;
  overflow-x: auto;
  font-family: var(--mono); font-size: 14px; line-height: 1.55;
}
.post-body pre code { background: none; padding: 0; font-size: inherit; }
.post-body table {
  width: 100%; border-collapse: collapse;
  font-family: var(--sans); font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.post-body th, .post-body td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--rule); }
.post-body th { font-weight: 500; color: var(--muted); }
.post-body figure { margin-inline: 0; }
.post-body figure img { display: block; width: 100%; }
.post-body figcaption {
  margin-top: 8px; text-align: center;
  font-family: var(--sans); font-size: 13px; color: var(--muted);
}
.post-body figcaption a { color: inherit; }

/* Cards do editor: largura wide e full escapam da coluna */
.kg-width-wide {
  width: min(1040px, 100vw - 32px);
  margin-left: calc(50% - min(520px, 50vw - 16px));
}
.kg-width-full {
  width: 100vw;
  margin-left: calc(50% - 50vw);
}
.kg-width-full img { width: 100%; }

.kg-embed-card { display: flex; justify-content: center; }
.kg-embed-card iframe { width: 100%; }
.kg-gallery-container { display: flex; flex-direction: column; gap: 8px; }
.kg-gallery-row { display: flex; gap: 8px; }
.kg-gallery-image { flex: 1 1 0; }
.kg-gallery-image img { display: block; width: 100%; height: 100%; object-fit: cover; }
.kg-bookmark-card, .kg-callout-card, .kg-toggle-card { font-family: var(--sans); }

@media (max-width: 480px) {
  body { font-size: 18px; }
  .post-header { padding-block: 36px 24px; }
  .post-header h1 { font-size: 30px; }
  .post-list h2 { font-size: 21px; }
}

@media (prefers-reduced-motion: no-preference) {
  .post-list a:hover h2, .site-header nav a, .pagination a { transition: color 120ms ease; }
}
