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

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

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

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

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

.ns-post-byline {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

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