/* === 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;
}

/* No corpo do post o H2 é texto puro (mock) — sem a barrinha de acento. */
.prose h2::before { display: none; }

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-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  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: var(--accent);
  text-decoration: none;
}

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

/* Trecho do título em gradiente de marca (hero da home) */
.ns-grad-text {
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

/* === 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(--accent-text);
  font-family: var(--font-mono);
  font-size: 0.82em;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  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(--card-bg);
  border: 1px solid var(--border-hair);
  border-radius: 14px;
  padding: 28px;
  transition: border-color 220ms ease, box-shadow 220ms ease, transform 220ms ease, background 220ms ease;
}

.ns-card:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  box-shadow: 0 18px 48px -24px var(--shadow);
  transform: translateY(-3px);
}

/* === 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-aperol);
  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: 999px;
  border: 1px solid transparent;
  transition: all 180ms ease;
  cursor: pointer;
}

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

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

.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: var(--accent-contrast);
}

.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-text);
  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: var(--accent-contrast);
}

.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;
}

/* Linha de meta do post (categoria · data · tempo). Classe dedicada em vez de
   .eyebrow pra controlar a quebra no mobile sem o dot do ::before atrapalhar. */
.ns-post-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 1.5rem;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.ns-post-meta-cat {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-text);
  text-decoration: none;
}

.ns-post-meta-cat::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
}

.ns-post-meta-cat:hover,
.ns-post-meta-cat:focus-visible { color: var(--accent-hover); }

.ns-post-meta-sep { color: var(--fg-soft); }
.ns-post-meta-info { color: var(--fg-muted); }

/* Mobile: categoria na 1ª linha, data · tempo quebram pra 2ª */
@media (max-width: 720px) {
  .ns-post-meta-sep { display: none; }
  .ns-post-meta-info { flex-basis: 100%; }
}

.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 var(--content-padding) 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: 40px 36px;
  background: var(--grad-cta);
  border: none;
  border-radius: 18px;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

/* "N" de marca em marca d'água no canto inferior direito */
.ns-cta::before {
  content: "";
  position: absolute;
  right: -36px;
  bottom: -56px;
  width: 240px;
  height: 240px;
  background: url("/brand/symbol.svg") no-repeat center / contain;
  opacity: 0.14;
  filter: brightness(0) invert(1);
  pointer-events: none;
  z-index: 0;
}

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

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

.ns-cta .eyebrow {
  margin-bottom: 0.75rem;
  color: rgba(255, 250, 238, 0.85);
}

.ns-cta .eyebrow::before {
  background: var(--ns-vanilla);
}

.ns-cta-title {
  font-family: var(--font-display);
  font-size: clamp(24px, 2.8vw, 30px);
  line-height: 1.15;
  margin: 0.5rem 0 0.75rem;
  color: #fff;
  letter-spacing: -0.01em;
}

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

.ns-cta-meta {
  font-family: var(--font-ui);
  font-size: 14px;
  color: rgba(255, 250, 238, 0.92);
  margin: 0 0 1.5rem;
  line-height: 1.5;
}

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

/* Botões sobre o gradiente Aperol: primário vira vanilla, ghost vira branco */
.ns-cta .btn-primary {
  background: var(--ns-vanilla);
  color: var(--accent);
}

.ns-cta .btn-primary:hover {
  background: #fff;
  color: var(--accent);
  transform: translateY(-1px);
}

.ns-cta .btn-ghost {
  border-color: rgba(255, 250, 238, 0.55);
  color: #fff;
}

.ns-cta .btn-ghost:hover {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

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

@media (max-width: 720px) {
  .ns-cta { padding: 24px 16px; 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(38px, 5.2vw, 64px);
  line-height: 1.04;
  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;
}

/* Marca d'água "N" do hero: discreta e quase monocromática (mock). */
.ns-home-symbol {
  width: 100%;
  max-width: 360px;
  opacity: 0.07;
  justify-self: end;
  pointer-events: none;
  filter: grayscale(0.5);
}

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

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

.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-mono);
  font-size: 11px;
  color: var(--fg-soft);
  margin: 4px 0 0;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.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: 180px; opacity: 0.06; 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;
}

/* "Leia também" como headline centralizado (mock) */
.ns-related-title {
  font-family: var(--font-display);
  font-size: clamp(26px, 3vw, 36px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-align: center;
  margin: 0 0 2rem;
}

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

.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-mono);
  font-size: 11px;
  color: var(--fg-soft);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.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; }
}

/* 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);
  padding-bottom: 1rem;
}

/* No mobile as pills ficam centralizadas */
@media (max-width: 720px) {
  .ns-filter-container { justify-content: center; }
}

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

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

.ns-filter-btn.active {
  background-color: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
  font-weight: 600;
  box-shadow: 0 8px 20px -10px color-mix(in srgb, var(--accent) 70%, transparent);
}

/* 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;
}

/* ===========================================================================
   Redesign "Nextside Performance" — adições (featured bento + CTA da home)
   NEX-176. Componentes novos do mock; o resto herda via tokens.
   =========================================================================== */

/* --- Card em destaque (1º post da home) --- */
.ns-featured {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 0;
  padding: 0;
  overflow: hidden;
  margin-bottom: 24px;
}

.ns-featured-media {
  position: relative;
  display: block;
  min-height: 320px;
  background:
    radial-gradient(120% 120% at 78% 18%, rgba(222, 46, 3, 0.42), transparent 55%),
    radial-gradient(120% 120% at 20% 92%, rgba(253, 191, 15, 0.20), transparent 55%),
    #191817;
  overflow: hidden;
}

.ns-featured-media::after {
  content: "";
  position: absolute;
  right: -8%;
  top: 50%;
  transform: translateY(-50%);
  width: 72%;
  height: 128%;
  background: url("/brand/symbol-color.svg") no-repeat center / contain;
  opacity: 0.20;
  pointer-events: none;
}

.ns-featured-chip {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: var(--accent);
  color: var(--accent-contrast);
  padding: 5px 11px;
  border-radius: 5px;
}

.ns-featured-body {
  padding: 34px 32px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ns-featured-body h2 {
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 6px 0 0;
}

.ns-featured-body h2::before { display: none; }

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

.ns-featured-body h2 a:hover { color: var(--accent); }

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

.ns-featured .ns-post-card-link { margin-top: auto; }

@media (max-width: 860px) {
  .ns-featured { grid-template-columns: 1fr; }
  .ns-featured-media { min-height: 168px; }
  .ns-featured-body { padding: 26px 22px; }
}

/* --- CTA gradiente da home (full-width) --- */
.ns-home-cta-wrap {
  padding: 0 24px 5rem;
}

.ns-home-cta {
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: var(--grad-cta);
  border-radius: 22px;
  padding: 56px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}

.ns-home-cta::before {
  content: "";
  position: absolute;
  right: 5%;
  top: 50%;
  transform: translateY(-50%);
  width: 210px;
  height: 210px;
  background: url("/brand/symbol.svg") no-repeat center / contain;
  filter: brightness(0) invert(1);
  opacity: 0.16;
  z-index: 0;
  pointer-events: none;
}

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

.ns-home-cta-copy {
  position: relative;
  z-index: 1;
  max-width: 640px;
}

.ns-home-cta-title {
  font-family: var(--font-display);
  color: #fff;
  font-size: clamp(26px, 3.2vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
}

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

.ns-home-cta-text {
  color: rgba(255, 250, 238, 0.92);
  font-size: 16px;
  line-height: 1.55;
  margin: 0 0 24px;
  max-width: 520px;
}

.ns-home-cta .btn-primary {
  background: var(--ns-vanilla);
  color: var(--accent);
}

.ns-home-cta .btn-primary:hover {
  background: #fff;
  color: var(--accent);
  transform: translateY(-1px);
}

@media (max-width: 720px) {
  .ns-home-cta {
    padding: 36px 24px;
    border-radius: 18px;
  }
  .ns-home-cta::before { opacity: 0.10; right: -6%; }
  .ns-home-cta-wrap { padding: 0 20px 3rem; }
}

/* --- CTA mid: variante sutil (evita 2 slabs Aperol idênticos no post) --- */
.ns-cta-mid {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--accent);
  padding: 30px 30px 26px;
}

.ns-cta-mid::before,
.ns-cta-mid::after { display: none; }

.ns-cta-mid .eyebrow { color: var(--fg-muted); }
.ns-cta-mid .eyebrow::before { background: var(--accent); }
.ns-cta-mid .ns-cta-title { color: var(--fg); font-size: clamp(20px, 2.4vw, 24px); }
.ns-cta-mid .ns-cta-meta { color: var(--fg-muted); }
.ns-cta-mid .btn-primary { background: var(--accent); color: var(--accent-contrast); }
.ns-cta-mid .btn-primary:hover { background: var(--accent-hover); color: var(--accent-contrast); }
.ns-cta-mid .btn-ghost { border-color: var(--border-strong); color: var(--fg); }
.ns-cta-mid .btn-ghost:hover { border-color: var(--accent); color: var(--accent); background: transparent; }

/* --- Card de autor no fim do post (E-E-A-T + espelha o mock) --- */
.ns-post-author-wrap {
  max-width: var(--reading-width);
  margin: 3.5rem auto 0;
  padding: 0 var(--content-padding);
}

.ns-post-author {
  display: flex;
  gap: 22px;
  align-items: flex-start;
  background: var(--bg-surface);
  border: 1px solid var(--border-hair);
  border-radius: 14px;
  padding: 26px 28px;
}

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

.ns-post-author-info { min-width: 0; }
.ns-post-author-info .eyebrow { margin-bottom: 6px; }

.ns-post-author-name {
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 2px 0 8px;
}

.ns-post-author-name::before { display: none; }

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

.ns-post-author-name a:hover { color: var(--accent); }

.ns-post-author-bio {
  color: var(--fg-muted);
  font-size: 15px;
  line-height: 1.55;
  margin: 0 0 12px;
}

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

.ns-post-author-links a {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
}

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

@media (max-width: 720px) {
  .ns-post-author { flex-direction: column; gap: 16px; padding: 22px; }
  .ns-post-author-avatar { width: 64px; height: 64px; }
}

/* === Menu mobile (hambúrguer) — navegação acessível no celular (NEX-176) === */
.ns-menu-toggle { display: none; }
.ns-mobile-menu { display: none; }

@media (max-width: 720px) {
  /* declutter do header: lang vai pro drawer (busca e CTA já escondem antes) */
  .ns-header-actions .ns-lang-switcher { display: none; }

  .ns-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    background: transparent;
    color: var(--fg);
    cursor: pointer;
  }
  .ns-menu-icon {
    position: relative;
    display: block;
    width: 18px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    transition: background 0.2s ease;
  }
  .ns-menu-icon::before,
  .ns-menu-icon::after {
    content: "";
    position: absolute;
    left: 0;
    width: 18px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    transition: transform 0.2s ease;
  }
  .ns-menu-icon::before { top: -6px; }
  .ns-menu-icon::after { top: 6px; }
  .ns-header.is-menu-open .ns-menu-icon { background: transparent; }
  .ns-header.is-menu-open .ns-menu-icon::before { transform: translateY(6px) rotate(45deg); }
  .ns-header.is-menu-open .ns-menu-icon::after { transform: translateY(-6px) rotate(-45deg); }

  .ns-header.is-menu-open .ns-mobile-menu { display: block; }
  .ns-mobile-menu {
    border-top: 1px solid var(--border);
    background: var(--bg);
    padding: 8px 16px 20px;
  }
  .ns-mobile-nav { display: flex; flex-direction: column; }
  .ns-mobile-nav a {
    font-family: var(--font-ui);
    font-size: 16px;
    color: var(--fg);
    text-decoration: none;
    padding: 14px 4px;
    border-bottom: 1px solid var(--border);
  }
  .ns-mobile-nav a:last-child { border-bottom: none; }
  .ns-mobile-cta { color: var(--accent-text) !important; font-weight: 600; }
  .ns-mobile-menu .ns-lang-switcher {
    display: flex;
    gap: 18px;
    padding: 16px 4px 4px;
    font-size: 14px;
  }
  .ns-mobile-menu .ns-lang { padding: 6px 2px; }
}

/* === Acessibilidade: foco visível + Aperol legível em texto pequeno === */
:where(a, button, .btn, .ns-filter-btn, .ns-lang, .ns-menu-toggle,
       .ns-theme-toggle button, .ns-post-card-link):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Aperol em texto PEQUENO usa --accent-text (mais claro em dark → ≥4.5:1 sobre charcoal) */
.eyebrow-tag-link,
.ns-post-card-link,
.ns-related-tag,
.ns-post-author-links a { color: var(--accent-text); }

/* Touch targets ≥40px no mobile */
@media (max-width: 720px) {
  .ns-filter-btn { min-height: 40px; }
  .ns-theme-toggle button { min-width: 40px; min-height: 40px; }
}
