/* Canal de publicações — mesmo idioma visual do index.html (caderno: papel, traço de caneta, letra à mão),
   em versão leve: o artigo fica numa folha lisa, confortável para leitura longa.
   Arquivo estático: editado à mão, não é gerado. */
/* Tokens do "caderno" (iguais aos do index.html): papel quadriculado no claro, lousa de grafite no escuro. */
:root {
  --bg: #fbf8f1;
  --paper: #fbf8f1;
  --paper-2: #fffdf8;
  --bg-raised: #fffdf8;
  --grid: rgba(66, 112, 160, 0.11);
  --margin-line: rgba(214, 72, 66, 0.38);
  --line: #d9d3c4;
  --pencil: #33383d;
  --pencil-soft: rgba(51, 56, 61, 0.42);
  --ink: #1e2124;
  --ink-dim: #4d5257;    /* 7,4:1 sobre o papel */
  --accent: #1d9371;
  --accent-dim: #d6f0e6;
  --hl: rgba(29, 147, 113, 0.22);
  --tape: rgba(236, 214, 128, 0.8);
  --link: #0f6b50;       /* 6,1:1 sobre o papel (o verde da marca tem só 3,7:1) */
  --focus: #0f5c44;
  --quote-bg: rgba(29, 147, 113, 0.08);
  --shadow-paper: 0 1px 1px rgba(60, 45, 20, 0.06), 0 16px 30px -20px rgba(60, 45, 20, 0.5);
  --measure: 66ch;       /* ~65–75 caracteres por linha */
  --hand: 'Caveat', 'Segoe Print', 'Bradley Hand', cursive;
  --label: 'Architects Daughter', 'Segoe Print', 'Comic Sans MS', cursive;
  --wobbly: 255px 16px 225px 16px / 16px 225px 16px 255px;
  --wobbly-2: 16px 225px 16px 255px / 255px 16px 225px 16px;
}
html[data-theme="dark"] {
  --bg: #1c201f;
  --paper: #1c201f;
  --paper-2: #252a29;
  --bg-raised: #252a29;
  --grid: rgba(255, 255, 255, 0.045);
  --margin-line: rgba(240, 120, 110, 0.32);
  --line: #3a403e;
  --pencil: #d8dad3;
  --pencil-soft: rgba(216, 218, 211, 0.4);
  --ink: #ecebe4;
  --ink-dim: #b4b8b2;    /* 8,1:1 sobre a lousa */
  --accent: #3cc29b;
  --accent-dim: #173a30;
  --hl: rgba(60, 194, 155, 0.22);
  --tape: rgba(214, 200, 140, 0.5);
  --link: #5fd6b1;       /* 9,1:1 sobre a lousa */
  --focus: #7fe3c2;
  --quote-bg: rgba(60, 194, 155, 0.08);
  --shadow-paper: 0 16px 32px -20px rgba(0, 0, 0, 0.85);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Barlow', system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
  transition: background 0.35s ease, color 0.35s ease;
}
h1, h2, h3, h4 { font-family: 'Barlow', system-ui, sans-serif; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; }
a { color: var(--link); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 3px; }
img { max-width: 100%; height: auto; }

.wrap { max-width: 1280px; margin: 0 auto; padding-left: 72px; padding-right: 72px; }
.mono { font-family: 'Barlow', ui-monospace, monospace; letter-spacing: 0.02em; }
.eyebrow {
  font-family: 'Barlow', system-ui, sans-serif; font-weight: 600; font-size: 0.8125rem;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-dim);
}
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Pular para o conteúdo */
.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 100;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 4px;
  font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 16px; }

/* Cabeçalho (igual ao nav do index.html) */
.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding-top: 28px; padding-bottom: 28px; border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; min-width: 0; }
.brand img { height: 30px; width: auto; display: block; opacity: 0.85; }
.brand .logo-light { display: none; }
html[data-theme="light"] .brand .logo-dark { display: none; }
html[data-theme="light"] .brand .logo-light { display: block; }
.brand span { font-size: 12px; color: var(--ink-dim); white-space: nowrap; }
.site-nav ul { display: flex; align-items: center; gap: 32px; list-style: none; margin: 0; padding: 0; }
.site-nav a { font-size: 14px; color: var(--ink-dim); text-decoration: none; padding: 6px 0; }
.site-nav a:hover, .site-nav a[aria-current] { color: var(--ink); }
.site-nav a[aria-current] { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 8px; }
.header-actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 999px; border: 1px solid var(--line);
  background: transparent; color: var(--ink); cursor: pointer; padding: 0;
  font-family: 'Barlow', system-ui, sans-serif; font-weight: 600; font-size: 12px; text-decoration: none;
  transition: border-color 0.2s ease;
}
.icon-btn:hover { border-color: var(--accent); }
.icon-btn svg { stroke: var(--ink); display: block; }

/* Conteúdo */
main { padding-top: 56px; padding-bottom: 96px; }
.back-link { display: inline-flex; gap: 6px; font-size: 15px; color: var(--ink-dim); text-decoration: none; margin-bottom: 28px; }
.back-link:hover { color: var(--ink); text-decoration: underline; }

/* Índice */
.index-head { max-width: var(--measure); margin-bottom: 48px; }
.index-head h1 { font-size: clamp(2rem, 4.5vw, 2.75rem); margin: 0 0 14px; }
.index-head p { color: var(--ink-dim); font-size: 1.125rem; margin: 0 0 12px; }
.pub-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; max-width: 860px; }
.pub-item {
  position: relative; padding: 28px 32px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg-raised); transition: border-color 0.2s ease;
}
.pub-item:hover, .pub-item:focus-within { border-color: var(--accent); }
.pub-item h2 { font-size: clamp(1.25rem, 2.4vw, 1.5rem); margin: 8px 0 10px; }
.pub-item h2 a { color: var(--ink); text-decoration: none; }
.pub-item h2 a::after { content: ""; position: absolute; inset: 0; border-radius: 8px; } /* cartão inteiro clicável */
.pub-item h2 a:hover { text-decoration: underline; }
.pub-item p { margin: 0; color: var(--ink-dim); }
.pub-meta { font-size: 0.9375rem; color: var(--ink-dim); }
.pub-alt { position: relative; z-index: 1; margin-top: 14px !important; font-size: 0.9375rem; }
.pub-alt a { font-weight: 500; }
.subhead { font-size: 1.25rem; margin: 56px 0 20px; }
.feed-link { display: inline-flex; align-items: center; gap: 8px; font-size: 0.9375rem; }

/* Artigo */
.post { max-width: var(--measure); margin: 0 auto; }
.post-header h1 { font-size: clamp(2rem, 5vw, 2.875rem); margin: 0 0 18px; }
.post-meta { color: var(--ink-dim); font-size: 1rem; margin: 0; }
.post-translations { margin: 14px 0 0; font-size: 1rem; color: var(--ink-dim); }
.post-translations a { font-weight: 600; }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 0; padding: 0; }
.tags li {
  font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-dim);
  padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line);
}
.post-header { padding-bottom: 32px; margin-bottom: 40px; border-bottom: 1px solid var(--line); }

.prose { font-size: 1.1875rem; line-height: 1.75; }
.prose > * { margin: 0 0 1.4em; }
.prose h2 { font-size: 1.5rem; margin: 2.2em 0 0.7em; }
.prose h3 { font-size: 1.25rem; margin: 1.9em 0 0.6em; }
.prose h4 { font-size: 1.0625rem; margin: 1.6em 0 0.5em; }
.prose a { text-decoration: underline; text-decoration-thickness: 1px; }
.prose a:hover { text-decoration-thickness: 2px; }
.prose strong { font-weight: 600; }
.prose blockquote {
  margin-left: 0; margin-right: 0; padding: 14px 22px; border-left: 4px solid var(--accent);
  background: var(--quote-bg); border-radius: 0 6px 6px 0;
}
.prose blockquote > :last-child { margin-bottom: 0; }
.prose blockquote p { margin: 0 0 0.8em; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin-bottom: 0.4em; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.5em 0; }
.prose figure { margin: 2em 0; }
.prose figure img { display: block; margin: 0 auto; border-radius: 6px; }
.prose figcaption { margin-top: 10px; font-size: 0.9375rem; color: var(--ink-dim); text-align: center; line-height: 1.5; }
.prose pre { overflow-x: auto; padding: 16px; border: 1px solid var(--line); border-radius: 6px; font-size: 0.9375rem; }
.prose code { font-size: 0.9em; }
.prose .video-link a {
  display: inline-flex; gap: 10px; align-items: baseline; padding: 12px 18px;
  border: 1px solid var(--line); border-radius: 8px; text-decoration: none; color: var(--ink);
}
.prose .video-link a:hover { border-color: var(--accent); }

.post-origin {
  margin-top: 56px; padding: 22px 26px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg-raised); color: var(--ink-dim);
}
.post-origin p { margin: 0; }
.post-origin p + p { margin-top: 6px; }
.post-origin + .post-origin { margin-top: 16px; }
.related { margin-top: 56px; }
.related h2 { font-size: 1.25rem; margin: 0 0 16px; }
.related ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.related a { font-weight: 500; }
.related .pub-meta { display: block; }

/* Rodapé (igual ao index.html) */
.site-footer {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px;
  padding-top: 32px; padding-bottom: 32px; border-top: 1px solid var(--line);
  font-size: 13px; color: var(--ink-dim);
}
.site-footer a { color: var(--ink-dim); }
.site-footer a:hover { color: var(--ink); }

@media (max-width: 960px) {
  .wrap { padding-left: 24px; padding-right: 24px; }
}
@media (max-width: 680px) {
  .site-nav { display: none; }
  .brand span { display: none; }
  main { padding-top: 36px; }
  .pub-item { padding: 22px 20px; }
  .prose { font-size: 1.125rem; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
/* "Pausar animações" do painel de acessibilidade: ver assets/acessibilidade.css */
html.a11y-sem-animacao .pub-item:hover, html.a11y-sem-animacao .pub-item:focus-within { transform: none; }
@media print {
  .site-header, .site-footer, .skip-link, .related { display: none; }
  body { background: #fff; color: #000; }
}

/* =====================================================================
   Caderno (mesmo idioma visual do index.html, em versão leve)
   ===================================================================== */
body {
  position: relative;
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
  background-position: -1px -1px;
}
body::before { /* margem vermelha do caderno */
  content: ""; position: absolute; top: 0; bottom: 0;
  left: max(14px, calc(50% - 640px + 34px)); width: 2px;
  background: var(--margin-line); pointer-events: none;
}
h1, h2, h3 { font-family: var(--hand); font-weight: 700; letter-spacing: 0; line-height: 1.08; }
.mono { font-family: var(--label); }
.site-header { border-bottom: 0; position: relative; }
.site-header::after, .site-footer::before {
  content: ""; position: absolute; left: 72px; right: 72px; height: 7px; background: var(--pencil); opacity: 0.55;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='7' viewBox='0 0 600 7'%3E%3Cpath d='M0 3.6C60 2.4 120 4.6 190 3.4S320 2.2 400 3.8 520 4.4 600 3.2' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") 0 0 / 600px 7px repeat-x;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='7' viewBox='0 0 600 7'%3E%3Cpath d='M0 3.6C60 2.4 120 4.6 190 3.4S320 2.2 400 3.8 520 4.4 600 3.2' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") 0 0 / 600px 7px repeat-x;
}
.site-header::after { bottom: -4px; }
.site-footer { border-top: 0; position: relative; }
.site-footer::before { top: -4px; }
.site-nav a { font-family: var(--label); font-size: 15px; }
.site-nav a[aria-current] { text-decoration: underline wavy var(--accent); text-decoration-thickness: 1.5px; text-underline-offset: 7px; }
.icon-btn {
  border: 1.8px solid var(--pencil); background: var(--paper);
  border-radius: 58% 42% 55% 45% / 48% 56% 44% 52%;
  font-family: var(--label); font-size: 13px;
}
.icon-btn:hover { background: var(--hl); border-color: var(--pencil); }
.eyebrow { font-family: var(--label); font-weight: 400; color: var(--ink-dim); }

/* índice: cada artigo é um cartão de papel preso com fita */
.index-head h1 { font-size: clamp(2.75rem, 6vw, 3.75rem); }
.pub-list { gap: 34px; }
.pub-item {
  background: var(--paper-2);
  border: 1.6px solid var(--pencil);
  border-radius: 4px 14px 6px 18px / 16px 5px 14px 7px;
  box-shadow: var(--shadow-paper);
  transition: transform 0.25s ease, border-color 0.2s ease;
}
.pub-item::before { /* fita adesiva */
  content: ""; position: absolute; top: -12px; left: 40px; width: 88px; height: 24px;
  background: var(--tape); transform: rotate(-4deg);
  clip-path: polygon(0 8%, 4% 0, 9% 10%, 14% 2%, 20% 6%, 100% 0, 97% 18%, 100% 34%, 96% 52%, 100% 70%, 97% 86%, 100% 100%, 0 100%, 3% 84%, 0 66%, 4% 48%, 0 30%);
  pointer-events: none;
}
.pub-item:nth-child(even)::before { left: auto; right: 48px; transform: rotate(3deg); }
.pub-item:hover, .pub-item:focus-within { border-color: var(--pencil); transform: translateY(-3px); }
.pub-item h2 { font-size: clamp(1.75rem, 3.4vw, 2.1rem); }
.pub-item h2 a::after { border-radius: 0; }
.subhead { font-size: 2rem; }
.tags li {
  font-family: 'Barlow', system-ui, sans-serif; font-weight: 500;
  border: 1.4px solid var(--pencil-soft); border-radius: var(--wobbly-2);
}

/* artigo: folha lisa (sem quadriculado atrás do texto) para leitura longa */
.post {
  position: relative;
  max-width: calc(var(--measure) + 120px);
  padding: 56px 60px 64px;
  background: var(--paper-2);
  box-shadow: var(--shadow-paper);
  border: 1px solid var(--line);
}
.post::before { /* fita segurando a folha */
  content: ""; position: absolute; top: -13px; left: 50%; width: 110px; height: 26px;
  background: var(--tape); transform: translateX(-50%) rotate(-2deg);
  clip-path: polygon(0 8%, 4% 0, 9% 10%, 14% 2%, 20% 6%, 100% 0, 97% 18%, 100% 34%, 96% 52%, 100% 70%, 97% 86%, 100% 100%, 0 100%, 3% 84%, 0 66%, 4% 48%, 0 30%);
}
.post-header h1 { font-size: clamp(2.6rem, 6vw, 3.6rem); }
.post-header { border-bottom: 1.5px dashed var(--pencil-soft); }
.prose h2 { font-size: 2.15rem; }
.prose h3 { font-size: 1.75rem; }
.prose h4 { font-family: 'Barlow', system-ui, sans-serif; font-weight: 600; font-size: 1.0625rem; }
.prose blockquote { border-left: 0; background: var(--quote-bg); border-radius: 2px; position: relative; }
.prose blockquote::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px; background: var(--accent); border-radius: 3px; }
.prose figure img { border-radius: 0; background: #fff; padding: 8px; box-shadow: 0 10px 20px -12px rgba(30, 22, 8, 0.55); }
.prose hr { border-top: 1.5px dashed var(--pencil-soft); }
.post-origin { background: var(--paper); border: 1.5px dashed var(--pencil-soft); border-radius: 4px; }
.related h2 { font-size: 1.9rem; }

@media (max-width: 960px) {
  .site-header::after, .site-footer::before { left: 24px; right: 24px; }
}
@media (max-width: 680px) {
  .post { padding: 36px 18px 40px; margin-left: -6px; margin-right: -6px; }
  .pub-item::before { left: 24px; }
}
