/* ═══════════════════════════════════════════
   BLOG — depende de styles.css (tokens + nav + footer)
   ═══════════════════════════════════════════ */

/* ── PROGRESSO DE LEITURA ── */
#read-progress{
  position:fixed;top:0;left:0;height:2px;width:0%;z-index:200;
  background:var(--grad);transition:width 0.1s linear;
  box-shadow:0 0 8px rgba(192,132,252,0.6);
}

/* ── HERO DO BLOG ── */
.blog-hero{
  padding:11rem 2rem 4rem;text-align:center;
  position:relative;z-index:1;
  content-visibility:visible;  /* neutraliza o content-visibility:auto de section */
}
.article-cta{content-visibility:visible}
.blog-hero .kicker{
  font-family:'IBM Plex Mono',monospace;font-size:0.72rem;
  color:var(--purple);letter-spacing:0.18em;text-transform:uppercase;
  margin-bottom:1.1rem;
}
.blog-hero h1{
  font-family:'Syne',sans-serif;font-weight:800;
  font-size:clamp(2.4rem,6vw,4rem);letter-spacing:-0.035em;
  line-height:1.05;margin-bottom:1.2rem;
}
.blog-hero h1 .dim{color:var(--hero-role-color)}
.blog-hero p{
  color:var(--muted);font-size:1.05rem;line-height:1.8;
  max-width:620px;margin:0 auto;
}

/* ── FILTRO POR TAG ── */
.tag-filter{
  display:flex;flex-wrap:wrap;gap:0.5rem;justify-content:center;
  max-width:1100px;margin:0 auto 3.5rem;padding:0 2rem;
}
.tag-filter button{
  background:none;border:1px solid var(--border);color:var(--muted);
  font-family:'IBM Plex Mono',monospace;font-size:0.72rem;
  padding:0.4rem 0.9rem;border-radius:999px;cursor:pointer;
  transition:border-color 0.2s,color 0.2s,background 0.2s;
  touch-action:manipulation;
}
.tag-filter button:hover{color:var(--white);border-color:var(--stroke-base)}
.tag-filter button[aria-pressed="true"]{
  border-color:var(--purple);color:var(--purple);
  background:rgba(124,106,247,0.1);
}

/* ── LISTA DE POSTS ── */
.post-list{
  max-width:1100px;margin:0 auto;padding:0 2rem 7rem;
  display:flex;flex-direction:column;gap:0;
}
.post-card{
  display:grid;grid-template-columns:180px 1fr;gap:2.5rem;
  padding:2.6rem 0;border-bottom:1px solid var(--border);
  text-decoration:none;color:inherit;
  transition:opacity 0.25s;
}
.post-card:last-child{border-bottom:none}
.post-card[hidden]{display:none}
.post-card-meta{
  display:flex;flex-direction:column;gap:0.55rem;
  padding-top:0.35rem;
}
.post-date{
  font-family:'IBM Plex Mono',monospace;font-size:0.74rem;
  color:var(--purple);
}
.post-read{
  font-family:'IBM Plex Mono',monospace;font-size:0.72rem;
  color:var(--muted);
}
.post-tags{display:flex;flex-wrap:wrap;gap:0.35rem;margin-top:0.15rem}
.post-tag{
  font-family:'IBM Plex Mono',monospace;font-size:0.62rem;
  letter-spacing:0.06em;text-transform:uppercase;
  color:var(--muted);border:1px solid var(--border);
  padding:0.18rem 0.5rem;border-radius:4px;
}
.post-card h2{
  font-family:'Syne',sans-serif;font-weight:700;
  font-size:clamp(1.35rem,3vw,1.75rem);letter-spacing:-0.025em;
  line-height:1.25;margin-bottom:0.85rem;
  transition:color 0.2s;
}
.post-card:hover h2{color:var(--purple)}
.post-card p{
  color:var(--muted);font-size:0.95rem;line-height:1.8;
  margin-bottom:1rem;
}
.post-more{
  font-family:'IBM Plex Mono',monospace;font-size:0.75rem;
  color:var(--purple);display:inline-flex;align-items:center;gap:0.4rem;
}
.post-card:hover .post-more{gap:0.7rem}
.post-more span{transition:transform 0.2s}

.list-empty{
  text-align:center;color:var(--muted);
  font-family:'IBM Plex Mono',monospace;font-size:0.85rem;
  padding:4rem 0;
}

/* ═══════════════════════════════════════════
   PÁGINA DE ARTIGO
   ═══════════════════════════════════════════ */

.article{
  position:relative;z-index:1;
  max-width:720px;margin:0 auto;padding:9.5rem 2rem 4rem;
}
.article-back{
  font-family:'IBM Plex Mono',monospace;font-size:0.75rem;
  color:var(--muted);text-decoration:none;
  display:inline-flex;align-items:center;gap:0.45rem;
  margin-bottom:2.5rem;transition:color 0.2s,gap 0.2s;
}
.article-back:hover{color:var(--purple);gap:0.65rem}

.article-header{margin-bottom:3rem}
.article-header .post-tags{margin-bottom:1.1rem}
.article-header h1{
  font-family:'Syne',sans-serif;font-weight:800;
  font-size:clamp(2rem,5.5vw,3.1rem);letter-spacing:-0.035em;
  line-height:1.1;margin-bottom:1.2rem;
}
.article-lead{
  font-size:1.15rem;line-height:1.85;color:var(--muted);
  margin-bottom:1.8rem;
}
.article-meta{
  display:flex;flex-wrap:wrap;align-items:center;gap:0.75rem;
  font-family:'IBM Plex Mono',monospace;font-size:0.74rem;
  color:var(--muted);padding-top:1.5rem;
  border-top:1px solid var(--border);
}
.article-meta .sep{opacity:0.4}
.article-meta strong{color:var(--white);font-weight:500}

/* ── PROSA ── */
.prose{font-size:1.02rem;line-height:1.9;color:rgba(245,244,255,0.78)}
body.light .prose{color:rgba(15,23,42,0.82)}
.prose > * + *{margin-top:1.5rem}
.prose p{overflow-wrap:break-word}
.prose strong{color:var(--white);font-weight:600}
.prose em{color:var(--white);font-style:italic;opacity:0.9}
.prose a{
  color:var(--purple);text-decoration:none;
  border-bottom:1px solid rgba(124,106,247,0.35);
  transition:border-color 0.2s;
}
.prose a:hover{border-bottom-color:var(--purple)}

.prose h2{
  font-family:'Syne',sans-serif;font-weight:700;color:var(--white);
  font-size:clamp(1.45rem,3.6vw,1.9rem);letter-spacing:-0.025em;
  line-height:1.25;margin-top:3.5rem;margin-bottom:0.4rem;
  scroll-margin-top:6rem;
}
.prose h3{
  font-family:'Syne',sans-serif;font-weight:700;color:var(--white);
  font-size:clamp(1.12rem,2.6vw,1.3rem);letter-spacing:-0.02em;
  line-height:1.35;margin-top:2.6rem;margin-bottom:0.3rem;
  scroll-margin-top:6rem;
}
.prose h2 + p,.prose h3 + p{margin-top:0.9rem}

.prose ul,.prose ol{padding-left:1.3rem;display:flex;flex-direction:column;gap:0.7rem}
.prose ul{list-style:none;padding-left:0}
.prose ul li{display:flex;gap:0.7rem;align-items:baseline}
.prose ul li::before{
  content:'▸';color:var(--purple);font-size:0.75rem;
  flex-shrink:0;position:relative;top:-0.05em;
}
.prose ol li{padding-left:0.3rem}
.prose ol li::marker{color:var(--purple);font-family:'IBM Plex Mono',monospace;font-size:0.85rem}
.prose li > ul,.prose li > ol{margin-top:0.7rem}

/* ── CÓDIGO ── */
.prose code{
  font-family:'IBM Plex Mono',monospace;font-size:0.86em;
  background:var(--surface);border:1px solid var(--border);
  padding:0.12em 0.4em;border-radius:4px;color:var(--lilac);
  overflow-wrap:break-word;
}
.prose pre{
  background:rgba(0,0,0,0.35);border:1px solid var(--border);
  border-radius:10px;padding:1.25rem 1.35rem;
  overflow-x:auto;-webkit-overflow-scrolling:touch;
  font-size:0.84rem;line-height:1.75;
  tab-size:2;
}
body.light .prose pre{background:rgba(0,0,0,0.045)}
.prose pre code{
  background:none;border:none;padding:0;color:rgba(245,244,255,0.88);
  font-size:inherit;white-space:pre;
}
body.light .prose pre code{color:rgba(15,23,42,0.88)}
.prose pre .c{color:var(--muted);font-style:italic}      /* comentário */
.prose pre .k{color:var(--purple)}                        /* keyword    */
.prose pre .s{color:#7DD3A0}                              /* string     */
.prose pre .f{color:var(--lilac)}                         /* função     */
.prose pre .n{color:#F0ABFC}                              /* número     */
body.light .prose pre .s{color:#0F766E}
body.light .prose pre .n{color:#C026D3}

.code-label{
  font-family:'IBM Plex Mono',monospace;font-size:0.68rem;
  color:var(--muted);letter-spacing:0.08em;text-transform:uppercase;
  margin-bottom:-0.9rem;display:block;
}

/* ── CITAÇÃO ── */
.prose blockquote{
  border-left:2px solid var(--purple);
  padding:0.3rem 0 0.3rem 1.4rem;
  font-size:1.08rem;line-height:1.8;color:var(--white);
  font-style:italic;
}
.prose blockquote p{margin:0}
.prose blockquote + blockquote{margin-top:1rem}

/* ── CALLOUT ── */
.callout{
  background:var(--surface);border:1px solid var(--border);
  border-left:2px solid var(--purple);
  border-radius:0 10px 10px 0;padding:1.25rem 1.4rem;
  font-size:0.95rem;line-height:1.8;
}
.callout .callout-title{
  font-family:'IBM Plex Mono',monospace;font-size:0.7rem;
  letter-spacing:0.1em;text-transform:uppercase;color:var(--purple);
  display:block;margin-bottom:0.5rem;
}
.callout p{margin:0}
.callout p + p{margin-top:0.8rem}

/* ── TABELA ── */
.table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch}
.prose table{
  width:100%;border-collapse:collapse;font-size:0.88rem;
  min-width:420px;
}
.prose th,.prose td{
  text-align:left;padding:0.75rem 1rem;
  border-bottom:1px solid var(--border);
}
.prose th{
  font-family:'IBM Plex Mono',monospace;font-size:0.7rem;
  letter-spacing:0.08em;text-transform:uppercase;
  color:var(--purple);font-weight:500;
}
.prose tbody tr:last-child td{border-bottom:none}

/* ── SEPARADOR ── */
.prose hr{
  border:none;height:1px;background:var(--border);
  margin-top:3rem;margin-bottom:3rem;
}

/* ── FIGURA ── */
.prose figure{margin-top:2.2rem}
.prose figure img{width:100%;height:auto;border-radius:10px;border:1px solid var(--border)}
.prose figcaption{
  font-family:'IBM Plex Mono',monospace;font-size:0.72rem;
  color:var(--muted);margin-top:0.7rem;text-align:center;
}

/* ── RODAPÉ DO ARTIGO ── */
.article-footer{max-width:720px;margin:0 auto;padding:0 2rem 6rem;position:relative;z-index:1}

.author-box{
  display:flex;gap:1.35rem;align-items:flex-start;
  border-top:1px solid var(--border);
  padding-top:2.5rem;margin-top:4rem;
}
.author-box img{
  width:64px;height:64px;border-radius:50%;object-fit:cover;
  border:1px solid var(--border);flex-shrink:0;
}
.author-box .author-name{
  font-family:'Syne',sans-serif;font-weight:700;font-size:1.05rem;
  letter-spacing:-0.02em;margin-bottom:0.35rem;
}
.author-box .author-bio{font-size:0.88rem;color:var(--muted);line-height:1.75}
.author-box .author-links{display:flex;gap:1.1rem;margin-top:0.7rem;flex-wrap:wrap}
.author-box .author-links a{
  font-family:'IBM Plex Mono',monospace;font-size:0.74rem;
  color:var(--purple);text-decoration:none;
}
.author-box .author-links a:hover{text-decoration:underline}

/* ── PRÓXIMO / ANTERIOR ── */
.post-nav{
  display:grid;grid-template-columns:1fr 1fr;gap:1rem;
  margin-top:3rem;
}
.post-nav a{
  border:1px solid var(--border);border-radius:10px;
  padding:1.25rem 1.35rem;text-decoration:none;color:inherit;
  transition:border-color 0.2s;display:block;
}
.post-nav a:hover{border-color:rgba(124,106,247,0.45)}
.post-nav .dir{
  font-family:'IBM Plex Mono',monospace;font-size:0.68rem;
  color:var(--purple);letter-spacing:0.1em;text-transform:uppercase;
  display:block;margin-bottom:0.6rem;
}
.post-nav .t{display:block;font-size:0.92rem;line-height:1.5;font-weight:500}
.post-nav a.next{text-align:right;grid-column:2}
.post-nav a.prev{grid-column:1}

/* ── CTA FINAL ── */
.article-cta{
  border:1px solid var(--border);border-radius:12px;
  background:var(--surface);
  padding:2rem;margin-top:3rem;text-align:center;
}
.article-cta h2{
  font-family:'Syne',sans-serif;font-weight:700;font-size:1.3rem;
  letter-spacing:-0.02em;margin-bottom:0.7rem;
}
.article-cta p{color:var(--muted);font-size:0.92rem;line-height:1.8;margin-bottom:1.5rem}

/* ── RESPONSIVO ── */
@media(max-width:900px){
  .blog-hero{padding:8rem 1.5rem 3rem}
  .tag-filter{padding:0 1.5rem;margin-bottom:2.5rem}
  .post-list{padding:0 1.5rem 5rem}
  .post-card{grid-template-columns:1fr;gap:1rem;padding:2.2rem 0}
  .post-card-meta{flex-direction:row;flex-wrap:wrap;align-items:center;gap:0.75rem;padding-top:0}
  .post-tags{margin-top:0}
  .article{padding:7.5rem 1.5rem 3rem}
  .article-footer{padding:0 1.5rem 4rem}
}

@media(max-width:600px){
  .blog-hero{padding:7rem 1.25rem 2.5rem}
  .post-list{padding:0 1.25rem 4rem}
  .tag-filter{padding:0 1.25rem}
  .article{padding:7rem 1.25rem 2.5rem}
  .article-footer{padding:0 1.25rem 3.5rem}
  .prose{font-size:1rem;line-height:1.85}
  .prose pre{padding:1rem;font-size:0.78rem;border-radius:8px}
  .article-lead{font-size:1.05rem}
  .author-box{flex-direction:column;gap:1rem}
  .post-nav{grid-template-columns:1fr}
  .post-nav a.next{text-align:left}
  .article-cta{padding:1.6rem 1.25rem}
}

@media(prefers-reduced-motion:reduce){
  #read-progress{transition:none}
  .post-more span,.post-card,.article-back{transition:none}
}
