/* ──────────────────────────────────────────────────────────────
   blog.css — listagem e artigos
   Depende de site.css (tokens, nav, footer, botões).
   ────────────────────────────────────────────────────────────── */

:root {
  --ink:       #C9C7D8;   /* corpo de texto do artigo (mais suave que --white) */
  --read-w:    720px;     /* largura de leitura confortável */
}

/* ═══════════ CABEÇALHO DE PÁGINA ═══════════ */
.page-head {
  position: relative;
  padding: 172px 0 64px;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.page-head::after {
  content: '';
  position: absolute;
  width: 620px; height: 620px; border-radius: 50%;
  background: #00c853; filter: blur(110px); opacity: 0.10;
  top: -320px; right: -180px; pointer-events: none;
}
.page-head .container { position: relative; z-index: 2; }
.page-head .section-sub { max-width: 620px; }

/* ═══════════ BREADCRUMB ═══════════ */
.breadcrumb {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  font-size: 13px; color: var(--gray);
  margin-bottom: 26px;
}
.breadcrumb a { color: var(--gray); text-decoration: none; transition: color .2s; }
.breadcrumb a:hover { color: var(--lime); }
.breadcrumb span.sep { opacity: 0.45; }
.breadcrumb .current { color: var(--gray-l); }

/* ═══════════ TAGS / CATEGORIAS ═══════════ */
.tag {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--lime-dim);
  border: 1px solid var(--lime-border);
  color: var(--lime);
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  padding: 5px 13px; border-radius: 100px;
  text-decoration: none;
  transition: background .2s, border-color .2s;
}
a.tag:hover { background: rgba(0,200,83,0.14); border-color: rgba(0,200,83,0.35); }

.cat-filters {
  display: flex; gap: 10px; flex-wrap: wrap;
  margin-top: 34px;
}
.cat-filters .tag.is-off {
  background: transparent; border-color: var(--border); color: var(--gray-l);
}
.cat-filters .tag.is-off:hover { border-color: rgba(255,255,255,0.22); color: var(--white); }

/* ═══════════ META (data · leitura) ═══════════ */
.post-meta {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 13px; color: var(--gray);
}
.post-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--gray); opacity: .7; }

/* <picture> é inline por defeito — precisa de ser bloco para as
   dimensões dos contentores de capa se propagarem ao <img> */
.featured-thumb picture, .card-thumb picture { display: block; width: 100%; height: 100%; }
.post-cover picture { display: block; }

/* ═══════════ LISTAGEM ═══════════ */
.blog-list { padding: 72px 0 104px; }

.list-label {
  display: flex; align-items: center; gap: 16px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--gray);
  margin-bottom: 30px;
}
.list-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* — Card destaque — */
.featured-card {
  display: grid; grid-template-columns: 1.05fr 1fr;
  gap: 0; margin-bottom: 84px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 20px; overflow: hidden;
  text-decoration: none; color: inherit;
  transition: border-color .25s, transform .25s, box-shadow .25s;
}
.featured-card:hover {
  border-color: var(--lime-border);
  transform: translateY(-3px);
  box-shadow: 0 22px 60px rgba(0,0,0,0.45);
}
.featured-thumb { position: relative; min-height: 340px; background: var(--bg-2); overflow: hidden; }
.featured-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s cubic-bezier(.215,.61,.355,1); }
.featured-card:hover .featured-thumb img { transform: scale(1.04); }
.featured-body { padding: 44px 44px 40px; display: flex; flex-direction: column; justify-content: center; }
.featured-body h2 {
  font-size: clamp(26px, 2.6vw, 34px); font-weight: 800;
  letter-spacing: -0.03em; line-height: 1.18;
  margin: 20px 0 16px; color: var(--white);
  transition: color .2s;
}
.featured-card:hover .featured-body h2 { color: var(--lime); }
.featured-body p { font-size: 16px; color: var(--gray-l); font-weight: 300; line-height: 1.75; margin-bottom: 26px; }

/* — Grelha de cards — */
.post-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px;
}
.post-card {
  display: flex; flex-direction: column;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  text-decoration: none; color: inherit;
  transition: border-color .25s, transform .25s, box-shadow .25s;
}
.post-card:hover {
  border-color: var(--lime-border);
  transform: translateY(-4px);
  box-shadow: 0 18px 44px rgba(0,0,0,0.4);
}
.card-thumb { aspect-ratio: 16/9; background: var(--bg-2); overflow: hidden; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s cubic-bezier(.215,.61,.355,1); }
.post-card:hover .card-thumb img { transform: scale(1.05); }
.card-body { padding: 26px 26px 24px; display: flex; flex-direction: column; flex: 1; }
.card-body h3 {
  font-size: 19px; font-weight: 700; letter-spacing: -0.02em;
  line-height: 1.32; margin: 16px 0 12px; color: var(--white);
  transition: color .2s;
}
.post-card:hover .card-body h3 { color: var(--lime); }
.card-body p {
  font-size: 14.5px; color: var(--gray-l); font-weight: 300;
  line-height: 1.7; margin-bottom: 22px; flex: 1;
}
.card-body .post-meta { margin-top: auto; padding-top: 18px; border-top: 1px solid var(--border); }

/* ═══════════ ARTIGO ═══════════ */
.post-head { padding: 152px 0 0; }
.post-head .container { max-width: 900px; }
.post-title {
  font-size: clamp(34px, 5vw, 58px); font-weight: 800;
  letter-spacing: -0.035em; line-height: 1.08;
  margin: 22px 0 24px; color: var(--white);
}
.post-lead {
  font-size: clamp(17px, 2vw, 20px); color: var(--gray-l);
  font-weight: 300; line-height: 1.72; max-width: 720px;
}
.post-head .post-meta { margin-top: 32px; padding-top: 26px; border-top: 1px solid var(--border); }
.post-head .post-meta strong { color: var(--gray-l); font-weight: 600; }

.post-cover { max-width: 1000px; margin: 52px auto 0; padding: 0 32px; }
.post-cover img {
  width: 100%; height: auto;   /* height:auto anula o atributo height do <img> */
  aspect-ratio: 1200 / 630; object-fit: cover;
  border-radius: 20px; display: block;
  border: 1px solid var(--border);
}

/* — Layout com índice lateral — */
.post-layout {
  max-width: var(--max-w); margin: 0 auto; padding: 72px 32px 110px;
  display: grid; grid-template-columns: minmax(0, 1fr) 244px; gap: 72px;
  align-items: start;
}

.post-toc { position: sticky; top: 112px; }
.post-toc .toc-title {
  font-size: 11px; font-weight: 700; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--gray);
  margin-bottom: 18px; padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.post-toc ol { list-style: none; display: flex; flex-direction: column; gap: 13px; counter-reset: toc; }
.post-toc a {
  display: block; font-size: 13.5px; line-height: 1.5;
  color: var(--gray-l); text-decoration: none;
  border-left: 2px solid transparent; padding-left: 14px;
  transition: color .2s, border-color .2s;
}
.post-toc a:hover { color: var(--white); }
.post-toc a.is-active { color: var(--lime); border-left-color: var(--lime); }

/* ═══════════ CORPO DO ARTIGO ═══════════ */
.post-body { max-width: var(--read-w); font-size: 17.5px; line-height: 1.82; color: var(--ink); font-weight: 300; }

.post-body > * + * { margin-top: 26px; }

.post-body h2 {
  font-size: clamp(25px, 2.8vw, 31px); font-weight: 800;
  letter-spacing: -0.025em; line-height: 1.22;
  color: var(--white); margin-top: 62px; scroll-margin-top: 108px;
}
.post-body h2::before {
  content: ''; display: block;
  width: 30px; height: 2px; background: var(--lime);
  margin-bottom: 20px; border-radius: 2px;
}
.post-body h3 {
  font-size: 20px; font-weight: 700; letter-spacing: -0.015em;
  color: var(--white); margin-top: 44px; scroll-margin-top: 108px;
}
.post-body h2 + p, .post-body h3 + p { margin-top: 18px; }

.post-body strong { color: var(--white); font-weight: 600; }
.post-body em { font-style: italic; }

.post-body a {
  color: var(--lime); text-decoration: none;
  border-bottom: 1px solid var(--lime-border);
  transition: border-color .2s;
}
.post-body a:hover { border-bottom-color: var(--lime); }

/* botões dentro do artigo não são links de texto */
.post-body a.btn-primary, .post-body a.btn-primary:hover { color: #000; border-bottom: none; }
.post-body a.btn-secondary, .post-body a.btn-secondary:hover { color: var(--white); border-bottom: 1px solid var(--border); }

.post-body ul, .post-body ol { padding-left: 4px; list-style: none; display: flex; flex-direction: column; gap: 13px; }
.post-body ul li, .post-body ol li { position: relative; padding-left: 28px; }
.post-body ul li::before {
  content: ''; position: absolute; left: 4px; top: 12px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--lime); opacity: .85;
}
.post-body ol { counter-reset: li; }
.post-body ol li::before {
  counter-increment: li; content: counter(li) '.';
  position: absolute; left: 0; top: 0;
  color: var(--lime); font-weight: 700; font-size: 15px;
}
.post-body li > ul, .post-body li > ol { margin-top: 13px; }

.post-body blockquote {
  border-left: 2px solid var(--lime);
  background: var(--lime-dim);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 24px 28px;
  color: var(--white); font-weight: 400;
}
.post-body blockquote p + p { margin-top: 14px; }

.post-body hr { border: none; height: 1px; background: var(--border); margin: 52px 0; }

.post-body img { max-width: 100%; border-radius: var(--radius); border: 1px solid var(--border); display: block; }
.post-body figure { margin: 40px 0; }
.post-body figcaption { font-size: 13px; color: var(--gray); text-align: center; margin-top: 14px; }

/* Tabelas — com scroll horizontal próprio */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.post-body table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 460px; }
.post-body thead th {
  background: var(--bg-3); color: var(--white);
  font-weight: 600; font-size: 12.5px; letter-spacing: 0.06em;
  text-transform: uppercase; text-align: left;
  padding: 15px 18px; white-space: nowrap;
}
.post-body tbody td { padding: 14px 18px; border-top: 1px solid var(--border); color: var(--ink); }
.post-body tbody tr:hover td { background: rgba(255,255,255,0.015); }

/* Código */
.post-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88em; background: var(--bg-3);
  border: 1px solid var(--border); border-radius: 6px;
  padding: 2px 7px; color: var(--lime);
}
.post-body pre {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px 24px; overflow-x: auto;
}
.post-body pre code { background: none; border: none; padding: 0; color: var(--ink); font-size: 14px; line-height: 1.7; }

/* Caixa de destaque */
.callout {
  display: flex; gap: 16px;
  background: var(--bg-3); border: 1px solid var(--lime-border);
  border-radius: var(--radius); padding: 24px 26px;
}
.callout .callout-icon {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 8px;
  background: var(--lime-dim); border: 1px solid var(--lime-border);
  display: flex; align-items: center; justify-content: center;
  color: var(--lime); font-size: 14px; font-weight: 700;
}
.callout p { margin: 0; font-size: 15.5px; }
.callout p + p { margin-top: 12px; }

/* ═══════════ RODAPÉ DO ARTIGO ═══════════ */
.post-foot { max-width: var(--read-w); margin-top: 72px; }

.post-author {
  display: flex; align-items: center; gap: 18px;
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px 26px;
}
.author-avatar {
  flex-shrink: 0; width: 52px; height: 52px; border-radius: 50%;
  background: var(--lime-dim); border: 1px solid var(--lime-border);
  display: flex; align-items: center; justify-content: center;
  color: var(--lime); font-weight: 800; font-size: 17px; letter-spacing: -0.02em;
}
.author-name { font-size: 15px; font-weight: 700; color: var(--white); }
.author-bio { font-size: 13.5px; color: var(--gray); line-height: 1.6; margin-top: 4px; }

.post-cta {
  position: relative; overflow: hidden;
  margin-top: 30px; padding: 42px 40px;
  background: var(--bg-3); border: 1px solid var(--lime-border);
  border-radius: 20px;
}
.post-cta::after {
  content: ''; position: absolute;
  width: 340px; height: 340px; border-radius: 50%;
  background: #00c853; filter: blur(90px); opacity: 0.11;
  top: -170px; right: -120px; pointer-events: none;
}
.post-cta > * { position: relative; z-index: 2; }
.post-cta h3 { font-size: 24px; font-weight: 800; letter-spacing: -0.025em; line-height: 1.24; color: var(--white); margin-bottom: 14px; }
.post-cta p { font-size: 15.5px; color: var(--gray-l); font-weight: 300; line-height: 1.72; margin-bottom: 26px; max-width: 460px; }

.post-related { border-top: 1px solid var(--border); padding: 72px 0 0; margin-top: 72px; }
.post-related .post-grid { grid-template-columns: repeat(2, 1fr); }

/* ═══════════ RESPONSIVE ═══════════ */
@media (max-width: 1024px) {
  .post-layout { grid-template-columns: 1fr; gap: 0; padding: 56px 32px 88px; }
  .post-toc { display: none; }
  .post-body, .post-foot { max-width: 100%; }
  .post-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .page-head { padding: 140px 0 52px; }
  .post-head { padding: 128px 0 0; }
  .featured-card { grid-template-columns: 1fr; }
  .featured-thumb { min-height: 0; aspect-ratio: 16/9; }
  .featured-body { padding: 32px 28px 30px; }
  .post-cover { padding: 0 20px; margin-top: 36px; }
  .post-layout { padding: 48px 20px 72px; }
  .blog-list { padding: 56px 0 80px; }
}

@media (max-width: 640px) {
  .post-grid, .post-related .post-grid { grid-template-columns: 1fr; }
  .post-body { font-size: 16.5px; }
  .post-cta { padding: 32px 26px; }
  .post-author { flex-direction: column; align-items: flex-start; gap: 14px; }
}
