/* === Tipografia === */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--fg);
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(36px, 6vw, 64px);
  line-height: 0.98;
  margin: 0 0 1rem;
}

h2 {
  font-size: clamp(28px, 3.5vw, 36px);
  line-height: 1.15;
  margin: 3rem 0 0.75rem;
  position: relative;
}

h2::before {
  content: "";
  display: block;
  width: 24px;
  height: 3px;
  background: var(--accent);
  margin-bottom: 16px;
}

h3 {
  font-size: 22px;
  line-height: 1.25;
  margin: 2rem 0 0.5rem;
}

/* === Eyebrow (assinatura visual Nextside) === */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.eyebrow::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 8px;
  vertical-align: middle;
  position: relative;
  top: -1px;
}

/* Tag eyebrow vira link pra term page (internal linking p/ crawl).
   Herda a cor muted do eyebrow pra não mudar o visual; só ganha accent no hover. */
.eyebrow-tag-link {
  color: inherit;
  text-decoration: none;
}

.eyebrow-tag-link:hover,
.eyebrow-tag-link:focus-visible {
  color: var(--accent);
}

/* === Corpo do post (prose) === */
.prose {
  max-width: var(--reading-width);
  margin: 0 auto;
  padding: 0 var(--content-padding);
}

.prose p {
  margin: 1.5em 0;
}

.prose a:not(.btn) {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: color 150ms ease;
}

.prose a:not(.btn):hover { color: var(--link-hover); }

/* blockquote (voz do crítico) */
.prose blockquote {
  border-left: 3px solid var(--accent);
  background: linear-gradient(
    to right,
    rgba(221, 46, 3, 0.06),
    transparent 60%
  );
  padding: 18px 24px;
  margin: 2em 0;
  font-style: italic;
  color: var(--fg);
}

.prose blockquote p {
  margin: 0.5em 0;
}

/* dfn — definição de termo técnico (SAO marker) */
.prose dfn {
  font-style: normal;
  font-weight: 600;
  border-bottom: 2px dotted var(--accent);
}

/* code inline + block */
.prose code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--code-bg);
  color: var(--fg);
  padding: 2px 6px;
  border-radius: 3px;
}

.prose pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px;
  overflow-x: auto;
  margin: 2em 0;
  line-height: 1.55;
}

.prose pre code {
  background: transparent;
  padding: 0;
  font-size: 14px;
}

.prose ul, .prose ol {
  margin: 1.5em 0;
  padding-left: 1.5em;
}

.prose li {
  margin: 0.5em 0;
}

.prose hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 3em 0;
}

.prose img {
  max-width: 100%;
  border-radius: 6px;
  margin: 2em 0;
}

/* tabela — wrapper .ns-table-wrap injetado pelo render hook _markup/render-table.html */
.ns-table-wrap {
  margin: 2em 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92em;
  line-height: 1.5;
}

.prose .ns-table-wrap table { margin: 0; }

.prose thead th {
  text-align: left;
  background: var(--bg-surface);
  color: var(--fg);
  font-weight: 600;
  border-bottom: 1px solid var(--border-strong);
}

.prose th,
.prose td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.prose tbody tr:last-child td { border-bottom: none; }

.prose tbody tr:nth-child(even) { background: rgba(127, 127, 127, 0.06); }

/* === Cards === */
.ns-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 28px;
  transition: border-color 200ms ease, box-shadow 200ms ease, transform 200ms ease;
}

.ns-card:hover {
  border-color: var(--border-strong);
  box-shadow: 0 12px 32px -16px var(--shadow);
  transform: translateY(-2px);
}

/* === Ember glow (só em hero/home e CTA — NUNCA no corpo de post) === */
.ember-glow {
  position: relative;
  overflow: hidden;
}

.ember-glow::before,
.ember-glow::after {
  content: "";
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  filter: blur(140px);
  pointer-events: none;
  z-index: 0;
}

.ember-glow::before {
  background: var(--ns-amber);
  top: -260px;
  right: -200px;
  opacity: 0.10;
}

.ember-glow::after {
  background: var(--ns-red-deep);
  bottom: -260px;
  left: -200px;
  opacity: 0.10;
}

:root[data-theme="dark"] .ember-glow::before,
:root[data-theme="dark"] .ember-glow::after {
  opacity: 0.18;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .ember-glow::before,
  :root:not([data-theme]) .ember-glow::after {
    opacity: 0.18;
  }
}

.ember-glow > * { position: relative; z-index: 1; }

/* === Botões === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.04em;
  text-decoration: none;
  border-radius: 6px;
  border: 1px solid transparent;
  transition: all 180ms ease;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: #FFFAEE;
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: #FFFAEE;
}

.btn-ghost {
  border-color: var(--border-strong);
  color: var(--fg);
  background: transparent;
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* === Header (navbar) === */
.ns-header {
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.ns-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.ns-wordmark {
  display: inline-flex;
  align-items: center;
  color: var(--fg);
  transition: color 200ms ease;
}

.ns-wordmark:hover {
  color: var(--accent);
}

.ns-wordmark-svg {
  height: 22px;
  width: auto;
  display: block;
}

@media (max-width: 720px) {
  .ns-wordmark-svg { height: 20px; }
}

.ns-nav {
  display: flex;
  gap: 28px;
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.02em;
}

.ns-nav a {
  color: var(--fg);
  text-decoration: none;
  transition: color 150ms ease;
}

.ns-nav a:hover { color: var(--accent); }

/* CTA da navbar do blog → site institucional (cross-link) */
.ns-nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  padding: 6px 14px;
  border-radius: 999px;
  white-space: nowrap;
  text-decoration: none;
  transition: opacity 150ms ease;
}
.ns-nav-cta:hover { opacity: 0.88; }
@media (max-width: 640px) { .ns-nav-cta { display: none; } }

.ns-header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* === Lang switcher === */
.ns-lang-switcher {
  display: flex;
  gap: 8px;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.ns-lang-current { color: var(--accent); }
.ns-lang { color: var(--fg-muted); text-decoration: none; transition: color 150ms ease; }
.ns-lang:hover { color: var(--fg); }

/* === Search trigger === */
.ns-search-trigger {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--fg-muted);
  border-radius: 6px;
  padding: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 150ms ease;
}

.ns-search-trigger:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* === Mobile === */
@media (max-width: 720px) {
  .ns-nav { display: none; }
  .ns-header-inner { padding: 12px 16px; }
  h2 { margin-top: 2rem; }
  h2::before { width: 20px; margin-bottom: 12px; }
}

/* === Theme toggle === */
.ns-theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-surface);
}

.ns-theme-toggle button {
  background: transparent;
  border: none;
  color: var(--fg-muted);
  padding: 6px;
  cursor: pointer;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 150ms ease;
}

.ns-theme-toggle button:hover {
  color: var(--fg);
  background: var(--bg-elevated);
}

.ns-theme-toggle button.is-active {
  background: var(--accent);
  color: #FFFAEE;
}

.ns-theme-toggle button.is-active:hover {
  background: var(--accent-hover);
}

@media (max-width: 480px) {
  .ns-theme-toggle button[data-theme-set="system"] {
    display: none;
  }
}

/* === Footer === */
.ns-footer {
  border-top: 1px solid var(--border);
  margin-top: 6rem;
  padding: 4rem 24px 2rem;
  background: var(--bg-surface);
}

.ns-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 64px;
}

.ns-footer-logo {
  display: inline-block;
  color: var(--fg);
  margin-bottom: 1.25rem;
}

.ns-footer-logo .ns-wordmark-svg {
  height: 22px;
  width: auto;
  display: block;
}

.ns-footer-brand p {
  max-width: 340px;
  color: var(--fg-muted);
  margin: 0 0 1.5rem;
  font-size: 16px;
  line-height: 1.6;
}

.ns-footer-cta {
  display: inline-block;
  padding: 8px 18px;
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 6px;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background 150ms ease, color 150ms ease;
}

.ns-footer-cta:hover {
  background: var(--accent);
  color: #FFFAEE;
}

.ns-footer-col .eyebrow {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-soft);
  margin: 0;
}

.ns-footer-col ul {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
}

.ns-footer-col li {
  margin-bottom: 10px;
  line-height: 1.5;
}

.ns-footer-col a {
  color: var(--fg);
  text-decoration: none;
  font-family: var(--font-ui);
  font-size: 14px;
  transition: color 150ms ease;
}

.ns-footer-col a:hover {
  color: var(--accent);
}

.ns-footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
  margin-top: 3rem;
  text-align: center;
  color: var(--fg-soft);
  font-size: 13px;
  font-family: var(--font-ui);
}

.ns-footer-bottom a {
  color: var(--fg-muted);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.ns-footer-bottom a:hover {
  color: var(--accent);
}

@media (max-width: 720px) {
  .ns-footer-inner {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .ns-footer {
    padding: 3rem 20px 1.5rem;
  }
}

/* === Post (single) === */
.ns-post-hero {
  padding: 4rem 0 2.5rem;
}

.ns-post-hero .eyebrow {
  margin-bottom: 1.5rem;
}

.ns-post-deck {
  font-family: var(--font-body);
  font-size: 21px;
  line-height: 1.55;
  color: var(--fg-muted);
  margin: 1.25rem 0 2rem;
  max-width: 600px;
  font-style: italic;
}

/* Régua de utilidade no rodapé do hero: byline esquerda + ask-ai direita.
   Border-top vive aqui (não no byline) pra fechar o bloco inteiro.
   line-height: 0 zera o whitespace text-node que .prose (line-height 1.75)
   transforma em flex-item fantasma e estica a row pra ~120px. */
.ns-post-hero-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  line-height: 0;
}

.ns-post-byline {
  display: flex;
  align-items: center;
  gap: 14px;
  line-height: 1; /* neutraliza line-height herdado da .prose (1.75) que esticava o bloco */
  /* margin-top + border-top moveram pro .ns-post-hero-footer (composição) */
}

.ns-byline-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  object-fit: cover;
}

.ns-post-byline a {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--fg);
  font-family: var(--font-ui);
  line-height: 1.3;
}

.ns-byline-name {
  font-weight: 600;
  font-size: 15px;
}

.ns-byline-role {
  font-size: 13px;
  color: var(--fg-muted);
  margin-top: 1px;
}

.ns-post-body { padding: 2rem 0 4rem; }

@media (max-width: 720px) {
  .ns-post-hero { padding: 2.5rem 0 1.5rem; }
  .ns-post-deck { font-size: 19px; margin: 1rem 0 1.5rem; }
}

/* === CTA boxes (mid + bottom) === */
.ns-cta {
  max-width: var(--reading-width);
  margin: 3.5rem auto;
  padding: 32px 32px 28px;
  background:
    radial-gradient(circle at top right, rgba(253, 191, 15, 0.08), transparent 60%),
    radial-gradient(circle at bottom left, rgba(221, 46, 3, 0.10), transparent 60%),
    var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  position: relative;
  overflow: hidden;
}

:root[data-theme="dark"] .ns-cta {
  background:
    radial-gradient(circle at top right, rgba(253, 191, 15, 0.12), transparent 60%),
    radial-gradient(circle at bottom left, rgba(250, 70, 22, 0.18), transparent 60%),
    var(--bg-elevated);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .ns-cta {
    background:
      radial-gradient(circle at top right, rgba(253, 191, 15, 0.12), transparent 60%),
      radial-gradient(circle at bottom left, rgba(250, 70, 22, 0.18), transparent 60%),
      var(--bg-elevated);
  }
}

.ns-cta::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("/textures/grain.png");
  opacity: 0.07;
  mix-blend-mode: soft-light;
  pointer-events: none;
  border-radius: 10px;
}

.ns-cta > * { position: relative; z-index: 1; }

.ns-cta .eyebrow {
  margin-bottom: 0.75rem;
}

.ns-cta-title {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.6vw, 28px);
  line-height: 1.2;
  margin: 0.5rem 0 0.75rem;
  color: var(--fg);
  letter-spacing: -0.01em;
}

.ns-cta-title::before { display: none; }

.ns-cta-meta {
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--fg-muted);
  margin: 0 0 1.5rem;
  line-height: 1.5;
}

.ns-cta-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.ns-cta-mid .ns-cta-title {
  font-size: clamp(20px, 2.4vw, 24px);
}

@media (max-width: 720px) {
  .ns-cta { padding: 24px 20px; margin: 2.5rem auto; }
  .ns-cta-actions { gap: 8px; }
  .ns-cta-actions .btn { flex: 1; justify-content: center; }
}

/* === Home === */
.ns-home-hero {
  padding: 5rem 24px 4rem;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.ns-home-hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 48px;
  align-items: center;
  position: relative;
  z-index: 1;
}

.ns-home-hero-copy .eyebrow {
  margin-bottom: 1rem;
}

.ns-home-title {
  font-size: clamp(48px, 8vw, 104px);
  line-height: 0.94;
  letter-spacing: -0.025em;
  margin: 0.5rem 0 1.5rem;
}

.ns-home-deck {
  font-family: var(--font-body);
  max-width: 520px;
  font-size: 21px;
  line-height: 1.55;
  color: var(--fg-muted);
  margin: 0;
}

.ns-home-symbol {
  width: 100%;
  max-width: 420px;
  opacity: 0.10;
  justify-self: end;
  pointer-events: none;
  filter: saturate(1.1);
}

:root[data-theme="dark"] .ns-home-symbol { opacity: 0.16; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .ns-home-symbol { opacity: 0.16; }
}

.ns-home-posts {
  padding: 4rem 24px;
}

.ns-home-posts-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.ns-home-posts .eyebrow {
  margin-bottom: 2rem;
  display: block;
}

.ns-post-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.ns-post-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ns-post-card-tag {
  margin: 0 0 0.5rem;
}

.ns-post-card h2 {
  font-size: 26px;
  line-height: 1.1;
  margin: 0;
  letter-spacing: -0.015em;
}

.ns-post-card h2::before { display: none; }

.ns-post-card h2 a {
  color: var(--fg);
  text-decoration: none;
  transition: color 150ms ease;
}

.ns-post-card h2 a:hover { color: var(--accent); }

.ns-post-card-meta {
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--fg-soft);
  margin: 4px 0 0;
  letter-spacing: 0.04em;
}

.ns-post-card-desc {
  color: var(--fg-muted);
  margin: 8px 0 12px;
  font-size: 16px;
  line-height: 1.55;
}

.ns-post-card-link {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.02em;
  margin-top: auto;
}

.ns-post-card-link:hover { color: var(--accent-hover); }

@media (max-width: 720px) {
  .ns-home-hero { padding: 3rem 20px 2.5rem; }
  .ns-home-hero-inner { grid-template-columns: 1fr; gap: 24px; }
  .ns-home-symbol { max-width: 200px; opacity: 0.08; justify-self: center; }
  .ns-home-deck { font-size: 18px; }
  .ns-home-posts { padding: 3rem 20px; }
  .ns-post-list { grid-template-columns: 1fr; }
}

/* === List page === */
.ns-list-hero {
  padding: 4rem 24px 2rem;
}

.ns-list-hero-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.ns-list-title {
  font-size: clamp(40px, 6vw, 64px);
  line-height: 1.0;
  letter-spacing: -0.02em;
  margin: 0.75rem 0 1rem;
}

.ns-list-title::before { display: none; }

.ns-list-deck {
  font-family: var(--font-body);
  font-size: 20px;
  color: var(--fg-muted);
  max-width: 640px;
  margin: 0.5rem 0 0;
  font-style: italic;
}

.ns-list-posts {
  padding: 2rem 24px 5rem;
}

.ns-list-posts-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.ns-list-empty {
  color: var(--fg-muted);
  font-style: italic;
  text-align: center;
  padding: 4rem 0;
}

/* === Tag list (taxonomy index) === */
.ns-tag-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ns-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  text-decoration: none;
  color: var(--fg);
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 500;
  transition: all 150ms ease;
}

.ns-tag-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

.ns-tag-count {
  font-size: 12px;
  color: var(--fg-soft);
  background: var(--bg-elevated);
  padding: 2px 8px;
  border-radius: 999px;
}

.ns-tag-chip:hover .ns-tag-count {
  color: var(--accent);
}

@media (max-width: 720px) {
  .ns-list-hero { padding: 2.5rem 20px 1.5rem; }
  .ns-list-deck { font-size: 18px; }
  .ns-list-posts { padding: 1.5rem 20px 3rem; }
}

/* === Related posts === */
.ns-related {
  border-top: 1px solid var(--border);
  margin-top: 4rem;
  padding: 3rem 0 1rem;
  background: var(--bg-surface);
}

.ns-related-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.ns-related .eyebrow {
  margin-bottom: 1.5rem;
  display: block;
}

.ns-related-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.ns-related-list a {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: var(--fg);
  transition: all 200ms ease;
}

.ns-related-list a:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px -16px var(--shadow);
}

.ns-related-list a:hover h3 { color: var(--accent); }

.ns-related-tag {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}

.ns-related-list h3 {
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 1.2;
  margin: 4px 0 4px;
  letter-spacing: -0.01em;
  transition: color 150ms ease;
}

.ns-related-list h3::before { display: none; }

.ns-related-meta {
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--fg-soft);
  letter-spacing: 0.04em;
}

.ns-related-desc {
  color: var(--fg-muted);
  font-size: 14px;
  line-height: 1.55;
  margin: 8px 0 0;
}

@media (max-width: 720px) {
  .ns-related { padding: 2rem 0 0.5rem; margin-top: 3rem; }
  .ns-related-list { grid-template-columns: 1fr; gap: 16px; }
}

/* === Standalone pages (/sobre/, /about/) === */
.ns-page-hero {
  padding: 4rem 0 1.5rem;
}

.ns-page-hero .eyebrow {
  margin-bottom: 1rem;
}

.ns-page-hero h1 {
  font-size: clamp(36px, 5.5vw, 56px);
  line-height: 1.05;
}

.ns-page-deck {
  font-family: var(--font-body);
  font-size: 20px;
  color: var(--fg-muted);
  margin: 1rem 0 0;
  max-width: 580px;
  font-style: italic;
}

.ns-page-body { padding: 2rem 0 4rem; }

@media (max-width: 720px) {
  .ns-page-hero { padding: 2.5rem 0 1rem; }
  .ns-page-deck { font-size: 18px; }
}

/* === Author page === */
.ns-author-hero {
  padding: 4rem 24px 2.5rem;
  border-bottom: 1px solid var(--border);
}

.ns-author-hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  gap: 32px;
  align-items: flex-start;
}

.ns-author-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  object-fit: cover;
  flex-shrink: 0;
}

.ns-author-meta {
  flex: 1;
  min-width: 0;
}

.ns-author-meta .eyebrow {
  margin-bottom: 0.5rem;
}

.ns-author-meta h1 {
  font-size: clamp(36px, 5vw, 52px);
  line-height: 1.05;
  margin: 0.25rem 0 1rem;
}

.ns-author-bio {
  font-family: var(--font-body);
  font-size: 20px;
  line-height: 1.55;
  color: var(--fg-muted);
  margin: 0 0 1.5rem;
  max-width: 580px;
  font-style: italic;
}

.ns-author-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.ns-author-links a {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 2px;
  transition: all 150ms ease;
}

.ns-author-links a:hover {
  color: var(--accent-hover);
  border-color: var(--accent-hover);
}

/* Skills / topics — pílulas leves, sem agressividade visual.
   Reaproveita tokens var(--bg-elevated)/--border pra ficar coerente com cards. */
.ns-author-skills {
  padding: 2rem 24px 0;
}

.ns-author-skills-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.ns-author-skills .eyebrow {
  display: block;
  margin-bottom: 0.75rem;
}

.ns-author-skills-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ns-author-skill {
  font-family: var(--font-ui);
  font-size: 13px;
  line-height: 1;
  color: var(--fg-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 12px;
  transition: border-color 150ms ease, color 150ms ease;
}

.ns-author-skill:hover {
  color: var(--fg);
  border-color: var(--border-strong);
}

.ns-author-about {
  padding: 2rem 24px 1rem;
}

.ns-author-about-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.ns-author-posts {
  padding: 3rem 24px 4rem;
}

.ns-author-posts-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.ns-author-posts .eyebrow {
  display: block;
  margin-bottom: 1.5rem;
}

.ns-author-empty {
  color: var(--fg-muted);
  font-style: italic;
  padding: 1rem 0;
}

.ns-author-back {
  margin: 2.5rem 0 0;
}

@media (max-width: 720px) {
  .ns-author-hero { padding: 2.5rem 20px 1.5rem; }
  .ns-author-hero-inner { flex-direction: column; gap: 20px; }
  .ns-author-avatar { width: 96px; height: 96px; }
  .ns-author-bio { font-size: 18px; }
  .ns-author-skills { padding: 1.5rem 20px 0; }
  .ns-author-about { padding: 1.5rem 20px 0.5rem; }
  .ns-author-posts { padding: 2rem 20px 3rem; }
}

/* === Hextra search — Nextside token overrides === */

/* Wrapper integrado ao header */
.ns-search-wrapper {
  position: relative;
}

/* Oculta a Hextra search em mobile (ícone de busca reservado para fase futura) */
@media (max-width: 720px) {
  .ns-search-wrapper { display: none; }
}

/* Input principal */
.hextra-search-input {
  background: var(--bg-surface) !important;
  color: var(--fg) !important;
  border: 1px solid var(--border) !important;
  border-radius: 8px !important;
  padding: 7px 40px 7px 12px !important;
  font-family: var(--font-ui) !important;
  font-size: 14px !important;
  transition: border-color 150ms ease, box-shadow 150ms ease !important;
  width: 100% !important;
}

.hextra-search-input:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent) !important;
  outline: none !important;
}

.hextra-search-input::placeholder {
  color: var(--fg-muted) !important;
}

/* Kbd hint (Ctrl K / ⌘K) */
.hextra-search-wrapper kbd {
  background: var(--bg-elevated) !important;
  border: 1px solid var(--border) !important;
  color: var(--fg-muted) !important;
  font-family: var(--font-ui) !important;
}

/* Dropdown de resultados */
.hextra-search-results {
  background: var(--bg) !important;
  border: 1px solid var(--border-strong) !important;
  border-radius: 10px !important;
  box-shadow: 0 16px 48px -8px var(--shadow) !important;
  color: var(--fg) !important;
}

.hextra-search-results li a {
  color: var(--fg) !important;
  transition: background 120ms ease !important;
}

.hextra-search-results li a:hover {
  background: var(--bg-elevated) !important;
  color: var(--accent) !important;
}

/* Título do resultado */
.hextra-search-results li .excerpt {
  color: var(--fg-muted) !important;
  font-size: 13px !important;
}

/* === Ask AI button (post hero) ===
   Vive dentro de .ns-post-hero-footer ao lado do byline.
   margin-top removido: o wrapper pai já espaça o bloco inteiro. */
.ns-ask-ai-wrap {
  display: flex;
}

.ns-ask-ai {
  font-size: 13px;
  padding: 10px 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ns-ask-ai svg {
  opacity: 0.7;
}

/* Mobile: empilha byline em cima, ask-ai ocupa linha cheia em baixo.
   Mantém a régua (border-top) mas vira coluna pra dar respiro em 360px. */
@media (max-width: 720px) {
  .ns-post-hero-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }
  .ns-ask-ai-wrap {
    width: 100%;
  }
  .ns-ask-ai {
    font-size: 12px;
    padding: 8px 14px;
    width: 100%;
    justify-content: center;
  }
}

/* === Fix: Hextra prose headings em dark mode ===
 * O Hextra (main.css) define .content :where(hN) { color: var(--hx-color-slate-900) }
 * e só troca pra slate-100 quando <html> tem a classe .dark.
 * Nosso sistema usa data-theme="dark" (não a classe .dark), então os H2-H6
 * do corpo do post ficam quase-pretos sobre fundo escuro — ilegíveis.
 * Este bloco no final do cascade ganha por ordem e corrige todos os níveis.
 * Cobre: data-theme="dark" (toggle manual) e prefers-color-scheme: dark (sistema).
 */
:root[data-theme="dark"] .content h1,
:root[data-theme="dark"] .content h2,
:root[data-theme="dark"] .content h3,
:root[data-theme="dark"] .content h4,
:root[data-theme="dark"] .content h5,
:root[data-theme="dark"] .content h6 {
  color: var(--fg);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .content h1,
  :root:not([data-theme]) .content h2,
  :root:not([data-theme]) .content h3,
  :root:not([data-theme]) .content h4,
  :root:not([data-theme]) .content h5,
  :root:not([data-theme]) .content h6 {
    color: var(--fg);
  }
}

/* === Fix: Hextra TOC sidebar — Nextside overrides
 * Hextra hardcodes hx:bg-white + hx:shadow-[0_-12px_16px_white] no wrapper
 * do scroll-to-top. O dark override do Hextra usa hx:dark:bg-dark (#111) mas
 * o bg do Nextside dark é #10131A — gera leakage do branco nas bordas.
 * Solução: forçar bg e shadow a usar o token --bg do Nextside em modo dark.
 * Os seletores `.dark` funcionam porque Hextra adiciona a classe .dark ao <html>.
 */

/* Links do TOC — usa tokens Nextside em vez dos cinzas hardcoded do Hextra */
.hextra-toc a {
  color: var(--fg-muted);
  transition: color 150ms ease;
}

.hextra-toc a:hover {
  color: var(--fg);
}

/* Wrapper do scroll-to-top: substitui bg-white + shadow white pelo token --bg */
.dark .hextra-toc .hextra-scrollbar > div:last-child {
  background-color: var(--bg) !important;
  box-shadow: 0 -12px 16px var(--bg) !important;
}

/* Fallback via data-theme (Nextside toggle) */
:root[data-theme="dark"] .hextra-toc .hextra-scrollbar > div:last-child {
  background-color: var(--bg) !important;
  box-shadow: 0 -12px 16px var(--bg) !important;
}

/* Fallback via prefers-color-scheme (modo sistema sem data-theme definido) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .hextra-toc .hextra-scrollbar > div:last-child {
    background-color: var(--bg) !important;
    box-shadow: 0 -12px 16px var(--bg) !important;
  }
}

/* === Scroll-to-top override em LIGHT mode (Hextra default branco vs nosso creme) === */
/* O agente anterior cobriu dark; aqui cobre light explicitamente */
:root .hextra-scrollbar [class*="hx:bg-white"],
:root .hextra-scrollbar [class*="hx-bg-white"],
:root [class*="hx:bg-white"]:has(a[href*="#top"]),
:root [class*="hx:bg-white"]:has([aria-label*="topo" i]) {
  background-color: var(--bg) !important;
  box-shadow: 0 -12px 16px var(--bg) !important;
}

/* Caso genérico: qualquer container que tenha "from-white" ou "to-white" do Tailwind */
[class*="from-white"],
[class*="hx:from-white"] {
  --tw-gradient-from: var(--bg) !important;
  --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, transparent) !important;
}

[class*="shadow-[0_-12px_16px_white]"],
[class*="hx:shadow-[0_-12px_16px_white]"] {
  box-shadow: 0 -12px 16px var(--bg) !important;
}

/* Defensivo: cor do texto do blockquote em dark mode (Hextra override) — preserva gradient */
:root[data-theme="dark"] .content blockquote,
:root.dark .content blockquote {
  color: var(--fg) !important;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .content blockquote {
    color: var(--fg) !important;
  }
}

/* === Search input — kbd indicator: Hextra já posiciona absolute dentro do input ===
 * O <kbd> do Hextra usa hx:absolute com hx:bg-white / hx:dark:bg-dark/50.
 * Aqui sobrescrevemos só as cores pra usar tokens Nextside.
 * O posicionamento já é correto no markup do Hextra (absolute right-1.5).
 */
.hextra-search-wrapper kbd,
[class*="hextra-search"] kbd {
  background: var(--bg-elevated) !important;
  color: var(--fg-muted) !important;
  border-color: var(--border) !important;
  font-family: var(--font-ui) !important;
}

/* === Mobile: padding lateral do corpo do post === */
@media (max-width: 720px) {
  .prose,
  .ns-post-hero .prose,
  .ns-post-body {
    padding-left: 8px !important;
    padding-right: 8px !important;
  }
}

/* === Chroma syntax highlight: fundo e borda casam com tokens Nextside ===
 * O tema Chroma (tango/nord) hardcoda background no .chroma.
 * Este bloco garante que o container usa --code-bg do tema ativo,
 * independentemente do que o Hextra ou o Chroma CSS injetou antes.
 * border-radius e overflow ficam aqui pra não depender do tema upstream.
 */
.chroma,
.highlight,
.highlight pre {
  background: var(--code-bg) !important;
  border-radius: 8px;
  overflow-x: auto;
}

/* Texto não-tokenizado dentro do bloco precisa ser legível em ambos os temas.
 * .err no Chroma é "token de erro" (lexer não reconheceu) — em Gherkin isso
 * acontece com keywords em PT. Sobrescrevemos pro fg padrão evitar vermelho #a40000
 * sobre fundo escuro. .x é "token genérico" sem classe específica.
 */
:root[data-theme="dark"] .chroma .err,
:root[data-theme="dark"] .chroma .x {
  color: var(--fg) !important;
  background: transparent !important;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .chroma .err,
  :root:not([data-theme]) .chroma .x {
    color: var(--fg) !important;
    background: transparent !important;
  }
}

/* Seletor de Categorias / ICP */
.ns-filter-wrapper {
  margin: 2rem 0 1.5rem 0;
}

.ns-filter-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border-neutral, rgba(255, 255, 255, 0.08));
  padding-bottom: 1rem;
}

.ns-filter-btn {
  font-family: var(--font-ui, system-ui);
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.15));
  background: transparent;
  color: var(--fg-muted, #888);
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.ns-filter-btn:hover {
  border-color: var(--border-strong, #fff);
  color: var(--fg, #fff);
}

.ns-filter-btn.active {
  background-color: var(--accent, #00ffcc);
  border-color: var(--accent, #00ffcc);
  color: var(--bg, #000);
  font-weight: 600;
  box-shadow: 0 0 12px rgba(var(--accent-rgb, 0, 255, 204), 0.15);
}

/* Suavização de visibilidade dos cards filtrados */
.ns-post-card-container {
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.ns-post-card-container.ns-post-hidden {
  opacity: 0;
  transform: scale(0.96);
  position: absolute;
  width: 0;
  height: 0;
  padding: 0;
  margin: 0;
  overflow: hidden;
  border: none;
  pointer-events: none;
}
