/* ==========================================================================
   Blog: hub de conteúdos e página de artigo. Usa os tokens de styles.css.
   Leitura: texto escuro sobre marfim (14:1), linhas de 60 a 70 caracteres.
   ========================================================================== */

:root {
  --prose-text: #2A2A2E;         /* 13.9:1 sobre marfim */
  --prose-width: 70ch;
}

/* Cards de artigo (hub e relacionados) ---------------------------------- */

.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  font-size: .8125rem;
  color: var(--muted-on-light);
}
.post-tag {
  padding: 2px 8px;
  background: var(--bg-dark);
  color: var(--yellow);
  font-size: .6875rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* O card inteiro é clicável pelo link do título (um único link por card). */
.card-link { text-decoration: none; }
.card-link::after { content: ""; position: absolute; inset: 0; }
.card-link:focus-visible { outline: none; }

.post-grid { display: grid; gap: var(--gap); }
.post-card {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  height: 100%;
  background: var(--bg-light);
  border: 1px solid var(--border-light);
  transition: border-color var(--duration) var(--ease), transform var(--duration) var(--ease);
}
.post-card:hover { border-color: var(--border-light-accent); transform: translateY(-3px); }
.post-card:has(.card-link:focus-visible) { outline: 2px solid var(--text-on-light); outline-offset: 4px; }
.post-card img { width: 100%; aspect-ratio: 1.6; object-fit: cover; }
.post-body { display: grid; gap: 10px; align-content: start; padding: 22px 24px 28px; }
.post-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: .01em;
  text-wrap: balance;
}
.post-card:hover .post-title a { text-decoration: underline; text-decoration-color: var(--red); text-decoration-thickness: 2px; text-underline-offset: .15em; }
.post-excerpt { color: var(--muted-on-light); font-size: .9375rem; }

@media (min-width: 768px) { .post-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .post-grid { grid-template-columns: repeat(3, 1fr); } }

/* Hub ------------------------------------------------------------------- */

.blog-hero { padding-block: 40px 56px; }
.blog-hero-inner { display: grid; gap: 20px; justify-items: start; }
.blog-hero-title {
  font-family: var(--font-heading);
  font-size: clamp(3rem, 2rem + 4vw, 5rem);
  font-weight: 800;
  line-height: .95;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.blog-hero-lead { max-width: 620px; font-size: 1.125rem; color: var(--muted-on-dark); }

.topic-nav { margin-top: 12px; width: 100%; }
.topic-nav ul { display: flex; flex-wrap: wrap; gap: 10px; }
.topic-nav a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid var(--border-accent-strong);
  font-size: .875rem;
  font-weight: 500;
  text-decoration: none;
  transition: background-color var(--duration) var(--ease), color var(--duration) var(--ease);
}
.topic-nav a .icon { color: var(--yellow); transition: color var(--duration) var(--ease); }
.topic-nav a:hover { background: var(--yellow); color: var(--on-yellow); }
.topic-nav a:hover .icon { color: var(--on-yellow); }

.featured-section { padding-bottom: 0; }
.featured-post {
  position: relative;
  display: grid;
  background: var(--bg-dark);
  color: var(--text-on-dark);
}
.featured-post:has(.card-link:focus-visible) { outline: 2px solid var(--text-on-light); outline-offset: 4px; }
.featured-post img { width: 100%; height: 100%; aspect-ratio: 1.48; object-fit: cover; }
.featured-body { display: grid; gap: 16px; align-content: center; padding: 32px 28px; }
.featured-body .post-meta { color: var(--muted-on-dark); }
.featured-body .post-tag { background: var(--yellow); color: var(--on-yellow); }
.featured-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 1.5rem + 1.8vw, 2.75rem);
  font-weight: 700;
  line-height: 1.05;
  text-wrap: balance;
}
.featured-excerpt { color: var(--muted-on-dark); font-size: 1.0625rem; }
.read-more { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-heading); font-size: 1.0625rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--yellow); }
.featured-post:hover .read-more .icon { transform: translateX(4px); }
.read-more .icon { transition: transform var(--duration) var(--ease); }

@media (min-width: 1024px) {
  .blog-hero { padding-block: 56px 72px; }
  .featured-post { grid-template-columns: 1.1fr 1fr; }
  .featured-body { padding: 48px; }
}

.topic-section { scroll-margin-top: 0; }
.topic-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 16px 40px;
  margin-bottom: 40px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-light);
}
.topic-heading > div { display: grid; gap: 14px; }
.topic-desc { max-width: 440px; color: var(--muted-on-light); }

.blog-cta { padding-block: 56px; }
.blog-cta-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 28px; }
.blog-cta-inner > div { display: grid; gap: 14px; }
.blog-cta-text { color: var(--muted-on-dark); }

/* Artigo: barra de progresso (CSS puro, sem JS) ------------------------- */

.read-progress { display: none; }
@supports (animation-timeline: scroll()) {
  .read-progress {
    display: block;
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 60;
    height: 4px;
    background: var(--yellow);
    transform-origin: 0 50%;
    transform: scaleX(0);
    animation: read-progress linear both;
    animation-timeline: scroll(root);
  }
  @keyframes read-progress { to { transform: scaleX(1); } }
}

/* Artigo: topo ---------------------------------------------------------- */

.post-hero { padding-block: 32px 48px; }
.post-hero-inner { display: grid; gap: 18px; justify-items: start; }
.post-hero-inner > * { max-width: 800px; }
.post-hero-tag a {
  display: inline-block;
  padding: 4px 10px;
  background: var(--yellow);
  color: var(--on-yellow);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-decoration: none;
}
.post-title-main {
  font-family: var(--font-heading);
  font-size: clamp(2.25rem, 1.5rem + 3vw, 3.75rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: .01em;
  text-wrap: balance;
}
.post-dek { max-width: 680px; font-size: 1.1875rem; line-height: 1.6; color: var(--muted-on-dark); }
.post-byline { display: flex; align-items: center; gap: 14px; margin-top: 8px; }
.byline-avatar img { width: 48px; height: 48px; border-radius: 50%; background: var(--bg-panel); }
.byline-text { display: grid; font-size: .875rem; line-height: 1.5; }
.byline-author a { color: var(--text-on-dark); font-weight: 700; }
.byline-meta { color: var(--muted-on-dark); }

/* No desktop o topo alinha com a coluna do texto (sumário de 260px + espaço). */
@media (min-width: 1024px) {
  .post-hero { padding-block: 48px 64px; }
  .post-hero-inner { max-width: 1064px; padding-left: calc(260px + var(--gap-lg)); }
}

/* Artigo: grade com sumário lateral ------------------------------------- */

.post-layout { display: grid; gap: 32px; padding-block: 40px 64px; }
.post-content { min-width: 0; }

.toc { padding: 22px 24px; background: #FFFFFF; border: 1px solid var(--border-light); border-top: 4px solid var(--bg-dark); }
.toc-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.toc ol { display: grid; gap: 2px; counter-reset: toc; }
.toc li { counter-increment: toc; }
.toc a {
  display: flex;
  gap: 10px;
  padding: 7px 0 7px 12px;
  border-left: 2px solid var(--border-light);
  font-size: .9375rem;
  line-height: 1.4;
  color: var(--muted-on-light);
  text-decoration: none;
}
.toc a::before { content: counter(toc, decimal-leading-zero); font-variant-numeric: tabular-nums; font-weight: 700; color: var(--muted-on-light); }
.toc a:hover { color: var(--text-on-light); border-left-color: var(--text-on-light); }
.toc a[aria-current] { color: var(--text-on-light); font-weight: 500; border-left-color: var(--red); }

.aside-cta { display: none; }

@media (min-width: 1024px) {
  .post-layout { grid-template-columns: 260px minmax(0, 740px); justify-content: center; gap: var(--gap-lg); padding-block: 56px 80px; }
  .post-aside { position: sticky; top: 24px; align-self: start; display: grid; gap: 20px; }
  .aside-cta { display: grid; gap: 8px; padding: 22px 24px; background: var(--bg-dark); color: var(--text-on-dark); }
  .aside-cta-title { font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--yellow); }
  .aside-cta-date { font-family: var(--font-heading); font-size: 1.75rem; font-weight: 700; line-height: 1.1; margin-bottom: 8px; }
}

/* Artigo: capa e resumo ------------------------------------------------- */

.post-cover { margin-bottom: 32px; }
.post-cover img { width: 100%; aspect-ratio: 1.6; object-fit: cover; }
.post-cover figcaption { margin-top: 10px; font-size: .8125rem; color: var(--muted-on-light); }

.key-points {
  margin-bottom: 40px;
  padding: 28px;
  background: var(--bg-dark);
  color: var(--text-on-dark);
  border-left: 6px solid var(--yellow);
}
.key-points-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.key-points-title .icon { color: var(--yellow); }
.key-points ul { display: grid; gap: 12px; }
.key-points li { position: relative; padding-left: 22px; color: var(--muted-on-dark); line-height: 1.6; }
.key-points li::before { content: ""; position: absolute; left: 0; top: .6em; width: 8px; height: 8px; background: var(--yellow); }
.key-points strong { color: var(--text-on-dark); }

/* Artigo: tipografia de leitura ----------------------------------------- */

.prose {
  max-width: var(--prose-width);
  color: var(--prose-text);
  font-size: 1.125rem;
  line-height: 1.8;
  hyphens: auto;
}
.prose > * + * { margin-top: 1.25em; }
.prose p { text-wrap: pretty; }
.prose .lead-paragraph { font-size: 1.3125rem; line-height: 1.65; color: var(--text-on-light); }
.prose h2 {
  margin-top: 2.2em;
  font-family: var(--font-heading);
  font-size: clamp(1.875rem, 1.6rem + 1vw, 2.375rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: .005em;
  color: var(--text-on-light);
  text-wrap: balance;
  scroll-margin-top: 24px;
}
.prose h2::before { content: ""; display: block; width: 48px; height: 4px; margin-bottom: 16px; background: var(--red); }
.prose h3 {
  margin-top: 1.8em;
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-on-light);
}
.prose h2 + *, .prose h3 + * { margin-top: .75em; }
.prose strong { color: var(--text-on-light); }
.prose a {
  color: var(--text-on-light);
  font-weight: 500;
  text-decoration-line: underline;
  text-decoration-color: var(--red);
  text-decoration-thickness: 2px;
  text-underline-offset: .2em;
}
.prose a:hover { background: rgba(255, 204, 42, .35); }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: .45em; }
.prose ul li::marker { color: var(--red); }
.prose ol li::marker { color: var(--text-on-light); font-weight: 700; }

.check-steps { list-style: none; padding-left: 0 !important; }
.check-steps li { position: relative; padding-left: 38px; }
.check-steps li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .3em;
  width: 24px;
  height: 24px;
  background: var(--bg-dark) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FFCC2A' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 16px no-repeat;
}

/* Destaques dentro do texto */
.callout {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 20px 22px;
  font-size: 1rem;
  line-height: 1.65;
}
.callout > .icon { width: 26px; height: 26px; margin-top: 1px; }
.callout--info { background: #FFF6D6; border-left: 4px solid var(--border-light-accent); }
.callout--info > .icon { color: var(--text-on-light); }
.callout--warning { background: #FDECEC; border-left: 4px solid var(--red); }
.callout--warning > .icon { color: #B3141A; }

.timeline { list-style: none; padding-left: 0 !important; counter-reset: passo; }
.timeline li { position: relative; counter-increment: passo; padding: 0 0 28px 64px; margin: 0 !important; }
.timeline li::before {
  content: counter(passo);
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  background: var(--yellow);
  color: var(--on-yellow);
  font-family: var(--font-heading);
  font-size: 1.375rem;
  font-weight: 700;
}
.timeline li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 21px;
  top: 52px;
  bottom: 8px;
  width: 2px;
  background: var(--border-light);
}
.timeline h3 { margin-top: 0 !important; padding-top: 6px; font-size: 1.375rem; }
.timeline p { margin-top: .4em; }

.inline-cta {
  display: grid;
  gap: 20px;
  align-items: center;
  margin-block: 2.5em !important;
  padding: 28px;
  background: var(--bg-dark);
  color: var(--text-on-dark);
  border-top: 6px solid var(--yellow);
  font-size: 1rem;
  line-height: 1.6;
}
.inline-cta > div { display: grid; gap: 8px; }
.inline-cta p { color: var(--muted-on-dark); }
.inline-cta-eyebrow { font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--yellow) !important; }
.inline-cta-title { font-family: var(--font-heading); font-size: 1.875rem; font-weight: 700; line-height: 1.1; color: var(--text-on-dark); }
.inline-cta-title::before { display: none; }
.inline-cta .button { justify-self: start; }
@media (min-width: 768px) { .inline-cta { grid-template-columns: 1fr auto; padding: 32px; } }

.table-scroll { overflow-x: auto; border: 1px solid var(--border-light); }
.prose-table { width: 100%; min-width: 440px; border-collapse: collapse; font-size: 1rem; line-height: 1.5; }
.prose-table caption { padding: 12px 16px; text-align: left; font-size: .875rem; color: var(--muted-on-light); caption-side: bottom; border-top: 1px solid var(--border-light); }
.prose-table th, .prose-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border-light); }
.prose-table thead th { background: var(--bg-dark); color: var(--text-on-dark); font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.prose-table tbody th { font-weight: 500; color: var(--text-on-light); }
.prose-table td:last-child, .prose-table thead th:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.prose-table tbody tr:nth-child(even) { background: #F7F5EA; }

.pull-quote { margin-block: 2em !important; padding: 8px 0 8px 28px; border-left: 6px solid var(--yellow); }
.pull-quote blockquote p {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 1.3rem + .8vw, 1.875rem);
  font-weight: 600;
  line-height: 1.25;
  color: var(--text-on-light);
}
.pull-quote figcaption { margin-top: 10px; font-size: .875rem; color: var(--muted-on-light); }

/* Artigo: perguntas, fontes, autor e compartilhamento ------------------- */

.post-section-title {
  margin-bottom: 20px;
  font-family: var(--font-heading);
  font-size: clamp(1.875rem, 1.6rem + 1vw, 2.375rem);
  font-weight: 700;
  line-height: 1.1;
  scroll-margin-top: 24px;
}
.post-faq, .post-sources { max-width: var(--prose-width); margin-top: 56px; scroll-margin-top: 24px; }
.post-faq .faq-item { background: #FFFFFF; }
.post-faq .faq-item summary { font-size: 1.1875rem; text-transform: none; letter-spacing: .01em; }
.post-sources ol { padding-left: 1.3em; display: grid; gap: 8px; color: var(--prose-text); }
.post-sources a { color: var(--text-on-light); text-decoration-color: var(--red); text-underline-offset: .2em; }
.post-updated { margin-top: 16px; font-size: .875rem; color: var(--muted-on-light); }

.post-footer { max-width: var(--prose-width); margin-top: 56px; display: grid; gap: 28px; }
.author-box {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 20px;
  align-items: center;
  padding: 24px;
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  scroll-margin-top: 24px;
}
.author-box img { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; }
.author-label { font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-on-light); }
.author-name { font-family: var(--font-heading); font-size: 1.625rem; font-weight: 700; line-height: 1.15; }
.author-bio { margin-top: 6px; color: var(--muted-on-light); font-size: .9375rem; }

.share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  padding-top: 24px;
  border-top: 1px solid var(--border-light);
}
.share-label { font-weight: 700; }
.share ul { display: flex; flex-wrap: wrap; gap: 8px; }
.share ul a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  background: var(--bg-dark);
  color: var(--text-on-dark);
  font-size: .875rem;
  font-weight: 500;
  text-decoration: none;
}
.share ul a .icon { color: var(--yellow); }
.share ul a:hover { background: #2A2A2E; }
.back-top { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; font-size: .875rem; font-weight: 500; color: var(--text-on-light); text-decoration-color: var(--red); text-underline-offset: .2em; }

/* Artigo anterior / próximo -------------------------------------------- */

.post-pagination { background: var(--bg-dark); color: var(--text-on-dark); }
.post-pagination-inner { display: grid; }
.pager {
  display: grid;
  gap: 6px;
  padding: 28px 0;
  text-decoration: none;
  border-bottom: 1px solid var(--divider-dark);
}
.pager-label { display: inline-flex; align-items: center; gap: 8px; font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--yellow); }
.pager-title { font-family: var(--font-heading); font-size: 1.5rem; font-weight: 700; line-height: 1.15; }
.pager:hover .pager-title { text-decoration: underline; text-decoration-color: var(--yellow); text-underline-offset: .15em; }
.pager--next { text-align: right; justify-items: end; border-bottom: 0; }

@media (min-width: 768px) {
  .post-pagination-inner { grid-template-columns: 1fr 1fr; }
  .pager { padding: 40px 32px 40px 0; border-bottom: 0; }
  .pager--next { padding: 40px 0 40px 32px; border-left: 1px solid var(--divider-dark); }
}

/* A chamada no meio do texto não herda o estilo dos títulos e links da leitura. */
.prose .inline-cta-title { margin-top: 0; font-size: 1.875rem; color: var(--text-on-dark); }
.prose .inline-cta-title::before { display: none; }
.prose .inline-cta .button { color: var(--on-yellow); font-weight: 700; text-decoration: none; }
.prose .inline-cta .button:hover { background: var(--yellow-hover); }
.prose .inline-cta time { color: var(--text-on-dark); }

.aside-cta-note { display: flex; gap: 10px; align-items: flex-start; margin-top: 6px; font-size: .875rem; line-height: 1.45; color: var(--muted-on-dark); }
.aside-cta-note .icon { color: var(--yellow); margin-top: 1px; }

/* Tabela de texto no artigo: colunas alinhadas à esquerda */
.prose-table.prose-table--texto td:last-child, .prose-table.prose-table--texto thead th:last-child { text-align: left; font-variant-numeric: normal; }
