/* Página de artigo / case gerada pelo build (build/templates/*.mjs). Usa só tokens do nexaas-theme.css.
   Cabeçalho escuro (como o hero do blog) + corpo de leitura claro (como a biblioteca de artigos). */

.artigo {
  display: flow-root; /* contém a margem inferior do CTA: sem isso ela vaza e cola o CTA no footer */
  background: var(--paper-2);
  color: var(--fg-ink);
}

/* ---- cabeçalho ---- */
.artigo-cabecalho {
  position: relative;
  padding-top: 148px; /* Nav fixo (76px) + respiro */
  padding-bottom: 260px; /* espaço para a capa "flutuar" sobre a dobra */
  margin-bottom: -220px;
  color: var(--fg);
  max-width: none;
  background: radial-gradient(
    120% 100% at 50% -20%,
    #103a52 0%,
    #172034 48%,
    #0f1a2e 100%
  );
}
.artigo-cabecalho-inner {
  max-width: 800px;
  margin: 0 auto;
}
.artigo-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}
.artigo-cat {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: max-content;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--violet-300);
  background: rgba(0, 158, 219, 0.14);
  border: 1px solid rgba(0, 158, 219, 0.35);
  border-radius: var(--r-sm);
  padding: 6px 12px;
  transition: border-color 0.2s var(--ease);
}
.artigo-cat:hover {
  border-color: var(--violet-400);
}
.artigo-cabecalho h1 {
  font-size: clamp(30px, 4vw, 48px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 18px;
}
.artigo-resumo {
  font-size: 18px;
  line-height: 1.6;
  color: var(--fg-muted);
  margin-bottom: 22px;
}
.artigo-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--fg-muted);
}
.case-identidade {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}
.case-logo {
  max-height: 44px;
  width: auto;
}
.case-marca {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.case-tag {
  padding-left: 14px;
  border-left: 1px solid var(--hairline-strong);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--violet-300);
}

/* ---- capa ---- */
.artigo-capa {
  position: relative;
  z-index: 1;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  width: min(960px, calc(100% - 2 * var(--pad)));
  height: auto;
  margin: 0 auto;
  border-radius: 20px;
  box-shadow: var(--shadow-card);
  background: var(--ink-700);
}
.artigo--case .artigo-cabecalho:has(+ .artigo-corpo) {
  padding-bottom: 72px;
  margin-bottom: 0;
} /* case sem capa */

/* ---- corpo (rich text sanitizado) ---- */
.artigo-corpo {
  max-width: 720px;
  margin: 0 auto;
  padding: 56px var(--pad) 72px;
  font-size: 17.5px;
  line-height: 1.75;
  color: var(--fg-ink);
}
.artigo-corpo > * + * {
  margin-top: 1.25em;
}
.artigo-corpo h2,
.artigo-corpo h3,
.artigo-corpo h4 {
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--fg-ink);
  scroll-margin-top: 96px;
}
.artigo-corpo h2 {
  font-size: clamp(24px, 2.6vw, 30px);
  margin-top: 2em;
}
.artigo-corpo h3 {
  font-size: clamp(20px, 2vw, 23px);
  margin-top: 1.7em;
}
.artigo-corpo h4 {
  font-size: 18px;
  margin-top: 1.5em;
}
.artigo-corpo a {
  color: var(--indigo-600);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--violet-300);
}
.artigo-corpo a:hover {
  text-decoration-color: var(--indigo-600);
}
.artigo-corpo strong,
.artigo-corpo b {
  font-weight: 700;
}
.artigo-corpo ul,
.artigo-corpo ol {
  padding-left: 1.4em;
}
.artigo-corpo li + li {
  margin-top: 0.5em;
}
.artigo-corpo blockquote {
  margin-left: 0;
  padding: 4px 0 4px 22px;
  border-left: 3px solid var(--violet-500);
  font-size: 1.08em;
  font-weight: 500;
  color: var(--fg-ink-muted);
}
.artigo-corpo img {
  width: 100%;
  height: auto;
  border-radius: var(--r-md);
}
.artigo-corpo figure {
  margin: 0;
}
.artigo-corpo figcaption {
  margin-top: 0.6em;
  font-size: 14px;
  color: var(--fg-ink-muted);
  text-align: center;
}
.artigo-corpo iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  border: 0;
  border-radius: var(--r-md);
  background: var(--ink-800);
}
.artigo-corpo pre {
  overflow-x: auto;
  padding: 16px 18px;
  border-radius: var(--r-md);
  background: var(--ink-800);
  color: var(--fg);
  font-size: 14px;
  line-height: 1.6;
}
.artigo-corpo code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.92em;
}
.artigo-corpo :not(pre) > code {
  background: #fff;
  border: 1px solid var(--line-light);
  border-radius: 6px;
  padding: 0.1em 0.4em;
}
.artigo-corpo table {
  display: block;
  overflow-x: auto;
  border-collapse: collapse;
  width: 100%;
  font-size: 15.5px;
}
.artigo-corpo th,
.artigo-corpo td {
  border: 1px solid var(--line-light);
  padding: 10px 14px;
  text-align: left;
  vertical-align: top;
}
.artigo-corpo th {
  background: #fff;
  font-weight: 700;
}
.artigo-corpo hr {
  border: 0;
  border-top: 1px solid var(--line-light);
  margin: 2.5em 0;
}

/* ---- páginas legais (sem capa: cabeçalho não reserva espaço para a imagem flutuar) ---- */
.artigo--legal .artigo-cabecalho {
  padding-bottom: 56px;
  margin-bottom: 0;
}

/* ---- CTA ---- */
.artigo-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
  width: calc(100% - 2 * var(--pad)); /* margem lateral abaixo de 960px + gutter */
  max-width: 960px;
  margin: 0 auto 64px;
  padding: 44px 48px;
  color: var(--fg);
  border: 1px solid var(--hairline);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-card);
  background: radial-gradient(
    130% 160% at 85% -20%,
    #0e86bd 0%,
    #172034 55%,
    #0f1a2e 100%
  );
}
.artigo-cta h2 {
  font-size: clamp(22px, 2.4vw, 28px);
  font-weight: 300;
  letter-spacing: -0.02em;
  max-width: 520px;
}

/* ---- responsivo ---- */
@media (max-width: 720px) {
  .artigo-cabecalho {
    padding-top: 116px;
    padding-bottom: 200px;
    margin-bottom: -170px;
  }
  .artigo-corpo {
    padding-top: 40px;
    font-size: 16.5px;
  }
  .artigo-cta {
    padding: 32px 24px;
    margin-bottom: 40px;
  }
  .case-identidade {
    flex-wrap: wrap;
    gap: 12px;
  }
}
