/* ==========================================================================
   Blog — listagem e artigos (usa os tokens e componentes de style.css)
   ========================================================================== */

/* ---------- Topo da listagem ---------- */
.blog-hero {
  padding: 32px 0 clamp(48px, 4vw, 72px);
  background:
    radial-gradient(1200px 500px at 85% 0%, rgba(239, 124, 26, .08), transparent 60%),
    linear-gradient(180deg, var(--card-bg) 0%, var(--white) 100%);
}
.blog-hero__head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 460px); gap: 32px; align-items: end; margin-top: clamp(28px, 3vw, 48px); }
.blog-hero__head .text { margin: 0; }

.blog-filtros { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 36px; }
.blog-filtros button {
  height: 42px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: var(--navy);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease);
}
.blog-filtros button:hover { border-color: var(--orange); color: var(--orange); }
.blog-filtros button[aria-pressed="true"] { border-color: var(--navy); background: var(--navy); color: var(--white); }

/* ---------- Artigo em destaque ---------- */
.blog-destaque { padding-top: 0; }
.destaque {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--white);
  transition: translate .45s var(--ease), box-shadow .45s var(--ease), border-color .45s var(--ease);
}
.destaque:hover { translate: 0 -4px; border-color: transparent; box-shadow: 0 40px 70px -40px rgba(18, 50, 110, .45); }
.destaque__img { min-height: 360px; overflow: hidden; background: var(--card-bg); }
.destaque__img img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.1s var(--ease); }
.destaque:hover .destaque__img img { transform: scale(1.05); }
.destaque__body { display: flex; flex-direction: column; justify-content: center; padding: clamp(28px, 3.5vw, 56px); }
.destaque__tag { font-family: var(--font-label); font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--orange); }
.destaque__body h2 { margin-top: 14px; font-size: clamp(26px, 1.2rem + 1.2vw, 38px); font-weight: 900; line-height: 1.1; letter-spacing: -0.02em; color: var(--navy); }
.destaque__body p { margin-top: 16px; font-family: var(--font-body); font-size: 17px; line-height: 1.6; color: var(--muted); }
.destaque__meta, .post__meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 20px; font-family: var(--font-body); font-size: 13px; color: var(--muted); }
.destaque .post__more { margin-top: 26px; }

/* ---------- Grade de artigos ---------- */
.blog-lista { padding-top: clamp(48px, 4vw, 72px); }
.blog-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(24px, 2.4vw, 40px) var(--gutter); }
.blog-grid .post[hidden] { display: none; }
.post__resumo { margin-top: 10px; font-family: var(--font-body); font-size: 15px; line-height: 1.6; color: var(--muted); }
.blog-vazio { margin-top: 24px; font-family: var(--font-body); color: var(--muted); }

/* ---------- Topo do artigo ---------- */
.artigo-hero {
  padding: 32px 0 0;
  background:
    radial-gradient(1200px 500px at 85% 0%, rgba(239, 124, 26, .08), transparent 60%),
    linear-gradient(180deg, var(--card-bg) 0%, var(--white) 70%);
}
.artigo-hero__head { max-width: 920px; margin-top: clamp(28px, 3vw, 48px); }
.artigo-hero__title {
  margin-top: 6px;
  font-size: clamp(36px, 1.6rem + 2.6vw, 64px);
  font-weight: 900;
  line-height: 1.04;
  letter-spacing: -0.03em;
  color: var(--navy);
}
.artigo-hero__lead { max-width: 760px; margin-top: 22px; font-size: clamp(18px, 1rem + .35vw, 21px); line-height: 1.55; color: #2c4670; }
.artigo-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin-top: 26px; font-family: var(--font-body); font-size: 14px; color: var(--muted); }
.artigo-meta strong { color: var(--navy); }
.artigo-meta span + span::before { content: "·"; margin-right: 18px; color: var(--border); }
.artigo-capa { margin-top: clamp(36px, 3.5vw, 56px); overflow: hidden; border-radius: 28px; background: var(--card-bg); aspect-ratio: 16 / 7.5; }
.artigo-capa img { width: 100%; height: 100%; object-fit: cover; }

.lang-note { display: none; margin-top: 18px; padding: 10px 16px; border-radius: 12px; background: rgba(239, 124, 26, .1); color: var(--navy); font-family: var(--font-body); font-size: 14px; }
html[data-lang="en"] .lang-note,
html[data-lang="es"] .lang-note,
html[data-lang="zh"] .lang-note { display: inline-block; }

/* ---------- Corpo do artigo ---------- */
.artigo { padding-top: clamp(48px, 4.5vw, 80px); }
.artigo__grid { display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); gap: clamp(32px, 5vw, 96px); align-items: start; }

.prose { max-width: 760px; font-family: var(--font-body); font-size: 18px; line-height: 1.75; color: #2c4670; }
.prose > * + * { margin-top: 22px; }
.prose h2 { margin-top: 56px; scroll-margin-top: calc(var(--header-h) + 24px); font-family: var(--font-display); font-size: clamp(26px, 1.1rem + 1vw, 34px); font-weight: 900; line-height: 1.15; letter-spacing: -0.02em; color: var(--navy); }
.prose h3 { margin-top: 36px; font-family: var(--font-display); font-size: 22px; font-weight: 800; color: var(--navy); }
.prose strong { color: var(--navy); }
.prose a { color: var(--navy); font-weight: 700; text-decoration: underline; text-decoration-color: var(--orange); text-decoration-thickness: 2px; text-underline-offset: 3px; transition: color .3s var(--ease); }
.prose a:hover { color: var(--orange); }
.prose ul, .prose ol { padding-left: 0; list-style: none; }
.prose li { position: relative; padding-left: 30px; }
.prose li + li { margin-top: 10px; }
.prose ul li::before { content: ""; position: absolute; left: 6px; top: .72em; width: 8px; height: 8px; border-radius: 50%; background: var(--orange); }
.prose ol { counter-reset: passo; }
.prose ol li { counter-increment: passo; }
.prose ol li::before { content: counter(passo); position: absolute; left: 0; top: .2em; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--navy); color: var(--white); font-family: var(--font-display); font-size: 12px; font-weight: 800; line-height: 1; }
.prose .callout { padding: 22px 26px; border-left: 4px solid var(--orange); border-radius: 0 16px 16px 0; background: var(--card-bg); color: var(--navy); }
.prose .table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; }
.prose table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 15px; line-height: 1.45; }
.prose th { padding: 14px 16px; background: var(--navy); color: var(--white); font-family: var(--font-display); font-weight: 700; text-align: left; white-space: nowrap; }
.prose td { padding: 13px 16px; border-top: 1px solid var(--line); }
.prose tbody tr:nth-child(even) td { background: #fafbfd; }

/* Perguntas frequentes e fontes */
.artigo-faq { margin-top: 64px; }
.artigo-faq h2, .artigo-fontes h2 { margin-top: 0; }
.faq__item { border-bottom: 1px solid var(--line); }
.faq__item summary {
  position: relative;
  padding: 22px 48px 22px 0;
  list-style: none;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--navy);
  cursor: pointer;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after {
  content: "+";
  position: absolute;
  right: 4px;
  top: 50%;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-top: -16px;
  border-radius: 50%;
  background: var(--card-bg);
  color: var(--orange);
  font-size: 22px;
  font-weight: 700;
  transition: transform .35s var(--ease), background-color .35s var(--ease);
}
.faq__item[open] summary::after { transform: rotate(45deg); background: rgba(239, 124, 26, .14); }
.faq__item p { margin: 0 0 22px; padding-right: 48px; }
.artigo-fontes { margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--line); font-size: 15px; }
.artigo-fontes h2 { font-size: 18px; }
.artigo-fontes ul { margin-top: 14px; }
.artigo-fontes a { font-weight: 500; }

/* Lateral: índice e chamada */
.artigo-aside { position: sticky; top: calc(var(--header-h) + 24px); display: grid; gap: 24px; }
.toc { padding: 26px 26px 22px; border: 1px solid var(--line); border-radius: 24px; background: var(--white); }
.toc__title { font-family: var(--font-label); font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--orange); }
.toc ol { margin: 14px 0 0; padding: 0; list-style: none; counter-reset: toc; }
.toc li { counter-increment: toc; }
.toc a {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 4px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.4;
  color: var(--blue);
  transition: color .3s var(--ease);
}
.toc li:first-child a { border-top: 0; }
.toc a::before { content: counter(toc, decimal-leading-zero); font-weight: 700; color: var(--border); }
.toc a:hover, .toc a.is-active { color: var(--orange); }
.toc a.is-active::before { color: var(--orange); }

/* ---------- Máquinas citadas ---------- */
.artigo-maquinas .m-others__track { grid-auto-columns: calc((100% - 3 * var(--gutter)) / 4); }

/* ---------- Responsivo ---------- */
@media (max-width: 1240px) {
  .blog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .artigo-maquinas .m-others__track { grid-auto-columns: calc((100% - 2 * var(--gutter)) / 3); }
}
@media (max-width: 1024px) {
  .artigo__grid { grid-template-columns: minmax(0, 1fr); }
  .artigo-aside { position: static; grid-template-columns: 1fr 1fr; }
  .destaque { grid-template-columns: minmax(0, 1fr); }
  .destaque__img { min-height: 0; aspect-ratio: 16 / 9; }
  .blog-hero__head { grid-template-columns: minmax(0, 1fr); }
  .artigo-maquinas .m-others__track { grid-auto-columns: calc((100% - var(--gutter)) / 2.3); }
}
@media (max-width: 700px) {
  .blog-grid { grid-template-columns: minmax(0, 1fr); }
  .artigo-aside { grid-template-columns: minmax(0, 1fr); }
  .artigo-capa { aspect-ratio: 4 / 3; border-radius: 20px; }
  .prose { font-size: 17px; }
  .prose .callout { padding: 18px 20px; }
  .faq__item summary { font-size: 17px; }
  .artigo-maquinas .m-others__track { grid-auto-columns: 82%; }
}
