/* Blog João Kepler — modo claro, editorial. IDV do JK: Plus Jakarta Sans + Fraunces, verde esmeralda. */

:root {
  --ink: #0a0a0a;
  --text: #27272a;
  --text-2: #52525b;
  --muted: #71717a;
  --faint: #a1a1aa;
  --line: #ececee;
  --line-2: #e4e4e7;
  --soft: #f7f7f8;
  --paper: #ffffff;
  --green: #16a34a;
  --green-600: #059669;
  --green-500: #10b981;
  --green-400: #34d399;
  --green-50: #ecfdf5;
  --green-100: #d1fae5;
  --gradient: linear-gradient(90deg, var(--green-400), #4ade80);

  --container: 1320px;
  --wide: 1080px;
  --read: 720px;
  --gutter: clamp(16px, 4vw, 48px);
  --header-h: 68px;

  --radius: 14px;
  --radius-lg: 20px;
  --shadow: 0 1px 2px rgb(10 10 10 / 0.04), 0 8px 28px rgb(10 10 10 / 0.06);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Fraunces", Georgia, serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
  -webkit-text-size-adjust: 100%;
  color-scheme: light;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  cursor: pointer;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  color: var(--ink);
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  letter-spacing: -0.01em;
}

h1 em,
h2 em {
  color: var(--green);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.is-hidden {
  display: none !important;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 10px;
  color: #fff;
  background: var(--ink);
}

.skip-link:focus {
  top: 12px;
}

:focus-visible {
  outline: 2px solid var(--green-500);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ------------------------------- Larguras ------------------------------- */

.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container-wide {
  max-width: calc(var(--wide) + var(--gutter) * 2);
}

.container-read {
  max-width: calc(var(--read) + var(--gutter) * 2);
}

/* -------------------------------- Botões -------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: transform 0.15s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.btn svg {
  transition: transform 0.2s ease;
}

.btn:hover svg {
  transform: translateX(3px);
}

.btn-primary {
  color: #fff;
  background: var(--green);
  box-shadow: 0 6px 18px rgb(22 163 74 / 0.22);
}

.btn-primary:hover {
  background: #15803d;
  transform: translateY(-1px);
}

.btn-dark {
  height: 38px;
  padding: 0 16px;
  font-size: 13px;
  color: #fff;
  background: var(--ink);
}

.btn-dark:hover {
  background: #27272a;
}

.btn-ghost {
  color: var(--ink);
  background: var(--soft);
  border: 1px solid var(--line-2);
}

.btn-ghost:hover {
  background: #fff;
}

.link-arrow {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.link-arrow:hover {
  color: var(--green);
}

.eyebrow {
  margin: 0 0 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--green);
}

/* Chips de categoria */
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to right, #000 92%, transparent);
  mask-image: linear-gradient(to right, #000 92%, transparent);
  padding-right: 24px;
}

.chips::-webkit-scrollbar {
  display: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  background: #fff;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.chip:hover {
  color: var(--ink);
  border-color: var(--faint);
}

.chip.is-active {
  color: #fff;
  border-color: var(--ink);
  background: var(--ink);
}

/* -------------------------------- Header -------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgb(255 255 255 / 0.86);
  backdrop-filter: saturate(1.6) blur(16px);
  -webkit-backdrop-filter: saturate(1.6) blur(16px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 32px;
  height: var(--header-h);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.brand img {
  width: auto;
  height: 34px;
}

.brand-divider {
  width: 1px;
  height: 22px;
  background: var(--line-2);
}

.brand-tag {
  font-family: var(--serif);
  font-size: 19px;
  font-style: italic;
  font-weight: 500;
  color: var(--green);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.main-nav a {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  white-space: nowrap;
  transition: color 0.15s ease, background 0.15s ease;
}

.main-nav a:hover {
  color: var(--ink);
  background: var(--soft);
}

.main-nav a.is-current {
  color: var(--ink);
}

.nav-cta-mobile {
  display: none;
}

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

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 10px;
  color: var(--text-2);
  background: transparent;
  transition: color 0.15s ease, background 0.15s ease;
}

.icon-btn:hover {
  color: var(--ink);
  background: var(--soft);
}

.menu-toggle {
  display: none;
}

.reading-progress {
  position: fixed;
  inset: 0 0 auto;
  z-index: 60;
  height: 2px;
  pointer-events: none;
}

.reading-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--green-500);
}

@media (max-width: 960px) {
  .menu-toggle {
    display: inline-flex;
  }

  .btn-cta {
    display: none;
  }

  .header-actions {
    margin-left: auto;
  }

  .main-nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px var(--gutter) 20px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 24px 40px rgb(10 10 10 / 0.06);
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
  }

  .main-nav.is-open {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }

  .main-nav a {
    padding: 14px 4px;
    font-size: 16px;
    border-radius: 0;
    border-bottom: 1px solid var(--line);
  }

  .main-nav a:hover {
    background: transparent;
  }

  .nav-cta-mobile {
    display: block;
    margin-top: 12px;
    padding: 14px !important;
    text-align: center;
    font-weight: 600;
    color: #fff !important;
    background: var(--ink) !important;
    border: 0 !important;
    border-radius: 999px !important;
  }
}

.preview-banner {
  position: sticky;
  top: 0;
  z-index: 70;
  padding: 10px 16px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: #78350f;
  background: #fef3c7;
  border-bottom: 1px solid #fde68a;
}

/* --------------------------------- Intro -------------------------------- */

.intro {
  padding: clamp(48px, 8vw, 96px) 0 clamp(32px, 5vw, 56px);
}

.intro-inner {
  display: grid;
  gap: 32px;
  align-items: end;
}

.intro h1 {
  max-width: 15ch;
  font-size: clamp(38px, 6vw, 68px);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.035em;
}

.intro-lead {
  max-width: 54ch;
  margin: 20px 0 0;
  font-size: clamp(17px, 1.6vw, 19px);
  color: var(--muted);
}

@media (min-width: 1024px) {
  .intro-inner {
    grid-template-columns: 1fr 380px;
    gap: 64px;
  }
}

/* -------------------------------- Seções -------------------------------- */

.section {
  padding: clamp(40px, 6vw, 72px) 0;
}

.section-tight {
  padding-top: 0;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
  margin-bottom: 32px;
}

.section-head h2 {
  font-size: clamp(22px, 2.4vw, 28px);
  font-weight: 700;
}

.section-head .chips {
  min-width: 0;
  max-width: 100%;
}

.result-count {
  margin: 0;
  color: var(--muted);
}

.result-count strong {
  color: var(--ink);
}

.page-hero {
  padding: clamp(40px, 6vw, 72px) 0 clamp(32px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
}

.page-hero h1 {
  font-size: clamp(32px, 4.6vw, 52px);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.page-lead {
  max-width: 60ch;
  margin: 14px 0 0;
  font-size: 18px;
  color: var(--muted);
}

.page-hero--center {
  text-align: center;
  border-bottom: 0;
  padding: clamp(64px, 10vw, 120px) 0;
}

.page-hero--center .page-lead {
  margin-inline: auto;
}

.page-hero--center p:last-child {
  margin-top: 28px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--faint);
}

.breadcrumb a {
  color: var(--muted);
}

.breadcrumb a:hover {
  color: var(--green);
}

.author-hero {
  display: flex;
  gap: 20px;
  align-items: center;
  max-width: 720px;
  margin-top: 24px;
}

.author-hero img {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.author-hero p {
  margin: 0 0 6px;
  color: var(--muted);
}

/* --------------------------------- Cards -------------------------------- */

.post-grid {
  display: grid;
  gap: clamp(36px, 4vw, 56px) clamp(24px, 2.5vw, 36px);
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .post-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .post-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.card {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.card-media {
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--soft);
}

.card-cover,
.featured-cover,
.post-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.card:hover .card-cover,
.featured:hover .featured-cover {
  transform: scale(1.035);
}

.cover-placeholder {
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 25% 20%, var(--green-100), transparent 55%),
    var(--soft);
}

.cover-placeholder img {
  width: 22%;
  max-width: 88px;
  opacity: 0.25;
}

.card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
}

.card-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--green);
}

.kicker-tag {
  padding: 3px 9px;
  border-radius: 999px;
  color: var(--green);
  background: var(--green-50);
}

.card-title {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.015em;
}

.card-title a {
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.3s ease;
}

.card:hover .card-title a {
  background-size: 100% 1px;
}

.card-excerpt {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  font-size: 15px;
  color: var(--muted);
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: auto 0 0;
  padding-top: 4px;
  font-size: 13px;
  color: var(--faint);
}

/* Destaque */
.featured {
  display: grid;
  gap: 28px;
  align-items: center;
}

.featured-media {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--soft);
}

.featured-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.featured-title {
  font-size: clamp(26px, 3.2vw, 42px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.featured-title a:hover {
  color: var(--green);
}

.featured-excerpt {
  margin: 0;
  max-width: 52ch;
  font-size: 17px;
  color: var(--muted);
}

.featured .card-meta {
  margin: 4px 0 0;
}

@media (min-width: 900px) {
  .featured {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: clamp(32px, 5vw, 72px);
  }
}

.empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 72px 16px;
  text-align: center;
  color: var(--muted);
  background: var(--soft);
  border-radius: var(--radius-lg);
}

.empty-state img {
  opacity: 0.25;
}

.empty-state p {
  margin: 0;
}

/* ------------------------------- Paginação ------------------------------- */

.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 64px;
}

.page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
}

a.page:hover {
  color: var(--ink);
  background: var(--soft);
}

.page.is-current {
  color: #fff;
  background: var(--ink);
}

.page.is-gap {
  min-width: 20px;
  color: var(--faint);
}

.page-nav {
  border: 1px solid var(--line-2);
}

/* ---------------------------------- CTA --------------------------------- */

.cta-band,
.post-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-radius: var(--radius-lg);
  background: var(--green-50);
  border: 1px solid var(--green-100);
}

.cta-band {
  padding: clamp(28px, 4vw, 48px);
}

.cta-band h2 {
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 700;
}

.cta-band p,
.post-cta p {
  margin: 10px 0 0;
  max-width: 56ch;
  color: var(--text-2);
}

/* --------------------------------- Artigo -------------------------------- */

.post-header {
  padding-top: clamp(32px, 5vw, 64px);
  padding-bottom: clamp(28px, 4vw, 40px);
}

.post-header h1 {
  font-size: clamp(34px, 4.8vw, 54px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.post-excerpt {
  margin: 20px 0 0;
  font-size: clamp(18px, 1.8vw, 21px);
  line-height: 1.55;
  color: var(--muted);
}

.post-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.post-author {
  display: flex;
  align-items: center;
  gap: 12px;
}

.post-author img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
}

.post-author-name {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.post-author:hover .post-author-name {
  color: var(--green);
}

.post-author-sub {
  display: block;
  font-size: 13px;
  color: var(--muted);
}

.post-figure {
  margin: 0 auto;
}

.post-figure:empty {
  display: none;
}

.post-cover {
  aspect-ratio: 16 / 9;
  height: auto;
  border-radius: var(--radius-lg);
}

.post-layout {
  display: grid;
  grid-template-columns: minmax(0, var(--read));
  justify-content: center;
  gap: 32px;
  padding-top: clamp(36px, 5vw, 56px);
}

.post-aside:empty {
  display: none;
}

@media (min-width: 1280px) {
  .post-layout.has-toc {
    grid-template-columns: minmax(0, 1fr) minmax(0, var(--read)) minmax(0, 1fr);
    gap: 0;
  }

  .post-layout.has-toc .post-aside {
    position: sticky;
    top: calc(var(--header-h) + 40px);
    align-self: start;
    justify-self: end;
    width: 220px;
    margin-right: 56px;
  }
}

/* Sumário */
.toc {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  font-size: 14px;
}

.toc-title {
  padding: 14px 18px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}

.toc-title::-webkit-details-marker {
  display: none;
}

.toc-title::after {
  content: "+";
  float: right;
  font-weight: 500;
  color: var(--muted);
}

.toc[open] .toc-title::after {
  content: "–";
}

.toc ol {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0 10px 14px;
  list-style: none;
}

.toc a {
  display: block;
  padding: 5px 8px;
  border-radius: 6px;
  line-height: 1.4;
  color: var(--muted);
  border-left: 2px solid transparent;
}

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

.toc a.is-active {
  color: var(--green);
  font-weight: 600;
}

.toc-l3 a {
  padding-left: 20px;
  font-size: 13px;
}

@media (min-width: 1280px) {
  .toc {
    border: 0;
  }

  .toc-title {
    padding: 0 0 12px 8px;
    cursor: default;
  }

  .toc-title::after {
    display: none;
  }

  .toc ol {
    padding: 0;
    border-left: 1px solid var(--line);
  }

  .toc a {
    margin-left: -1px;
    border-radius: 0;
    padding-left: 14px;
  }

  .toc a.is-active {
    border-left-color: var(--green);
  }

  .toc-l3 a {
    padding-left: 26px;
  }
}

/* Corpo do texto */
.prose {
  font-size: 19px;
  line-height: 1.78;
  color: var(--text);
  overflow-wrap: break-word;
}

.prose > * + * {
  margin-top: 1.3em;
}

.prose p {
  margin: 0;
}

.prose h2 {
  margin-top: 2.2em;
  font-size: clamp(26px, 2.6vw, 30px);
  font-weight: 700;
  line-height: 1.25;
}

.prose h3 {
  margin-top: 1.9em;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
}

.prose h4 {
  margin-top: 1.6em;
  font-size: 19px;
  font-weight: 700;
}

.prose h2 + *,
.prose h3 + *,
.prose h4 + * {
  margin-top: 0.7em;
}

.prose a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--green-400);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

.prose a:hover {
  color: var(--green);
}

.prose strong {
  font-weight: 700;
  color: var(--ink);
}

.prose ul,
.prose ol {
  padding-left: 1.3em;
}

.prose li + li {
  margin-top: 0.5em;
}

.prose li::marker {
  color: var(--green-500);
}

.prose blockquote {
  margin: 2em 0;
  padding: 0 0 0 24px;
  border-left: 3px solid var(--green-500);
  font-family: var(--serif);
  font-size: clamp(22px, 2.4vw, 26px);
  font-style: italic;
  line-height: 1.45;
  color: var(--ink);
}

.prose img {
  height: auto;
  margin: 2em auto;
  border-radius: var(--radius);
}

.prose figcaption {
  margin-top: -1.2em;
  font-size: 14px;
  text-align: center;
  color: var(--muted);
}

.prose hr {
  height: 1px;
  margin: 3em auto;
  border: 0;
  background: var(--line-2);
}

.prose pre {
  overflow-x: auto;
  padding: 18px 20px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.6;
  color: #e4e4e7;
  background: #18181b;
}

.prose code {
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.88em;
  background: var(--soft);
}

.prose pre code {
  padding: 0;
  background: none;
}

.prose .ql-align-center {
  text-align: center;
}

.prose .ql-align-right {
  text-align: right;
}

.prose .ql-align-justify {
  text-align: justify;
}

.prose .embed {
  position: relative;
  aspect-ratio: 16 / 9;
  margin: 2em 0;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--soft);
}

.prose .embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

@media (max-width: 640px) {
  .prose {
    font-size: 18px;
    line-height: 1.72;
  }
}

/* Rodapé do artigo */
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 48px;
}

.post-tags .chip {
  height: 32px;
  padding: 0 14px;
  background: var(--soft);
  border-color: transparent;
}

.post-tags .chip:hover {
  background: #fff;
  border-color: var(--line-2);
}

.share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 40px;
  padding: 20px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.share-list {
  display: flex;
  gap: 8px;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  color: var(--text-2);
  background: #fff;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.share-btn:hover {
  color: var(--green);
  border-color: var(--green-400);
  background: var(--green-50);
}

.share-btn--ghost {
  border-color: transparent;
}

.author-box {
  display: flex;
  gap: 20px;
  margin-top: 40px;
}

.author-box img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.author-label {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.author-name {
  display: inline-block;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}

.author-name:hover {
  color: var(--green);
}

.author-role {
  margin: 2px 0 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--green);
}

.author-bio {
  margin: 10px 0 0;
  font-size: 15px;
  color: var(--muted);
}

.post-cta {
  margin-top: 40px;
  padding: 28px 32px;
}

.post-cta-title {
  margin: 0 !important;
  font-size: 19px;
  font-weight: 700;
  color: var(--ink) !important;
}

.section-related {
  margin-top: clamp(48px, 6vw, 80px);
  background: var(--soft);
}

/* -------------------------------- Rodapé -------------------------------- */

.site-footer {
  border-top: 1px solid var(--line);
}

.footer-grid {
  display: grid;
  gap: 36px;
  padding-top: 56px;
  padding-bottom: 40px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.footer-brand {
  grid-column: 1 / -1;
}

.footer-brand img {
  width: auto;
  height: 28px;
}

.footer-brand p {
  margin: 14px 0 0;
  font-size: 14px;
  color: var(--muted);
}

.footer-brand strong {
  font-weight: 600;
  color: var(--ink);
}

.footer-title {
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--ink);
}

.footer-col ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-col a {
  font-size: 14px;
  color: var(--muted);
}

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

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding-top: 20px;
  padding-bottom: 28px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--faint);
}

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

@media (min-width: 900px) {
  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr 1fr;
  }

  .footer-brand {
    grid-column: auto;
  }
}

/* --------------------------------- Toast --------------------------------- */

.toast-region {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 200;
  display: grid;
  gap: 8px;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100vw - 32px);
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  background: var(--ink);
  box-shadow: 0 12px 32px rgb(10 10 10 / 0.2);
  animation: toast-in 0.25s ease;
}

.toast-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--green-400);
}

.toast.is-leaving {
  animation: toast-out 0.2s ease forwards;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(8px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* ------------------------- Fundo sutil (linhas) -------------------------
 * Grade fina que some em degradê nas aberturas, para o topo não ficar
 * inteiramente branco. Não passa por trás do texto do artigo.
 */
.intro,
.page-hero,
.post-header {
  position: relative;
  isolation: isolate;
}

.intro::before,
.page-hero::before,
.post-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgb(10 10 10 / 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgb(10 10 10 / 0.045) 1px, transparent 1px);
  background-size: 64px 64px;
  background-position: center top;
  -webkit-mask-image: radial-gradient(ellipse 70% 90% at 50% 0%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 90% at 50% 0%, #000 30%, transparent 75%);
}

.intro::after,
.page-hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: -120px;
  right: 8%;
  width: min(520px, 70vw);
  aspect-ratio: 1;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgb(16 185 129 / 0.1), transparent 65%);
  filter: blur(10px);
}

/* No artigo a grade fica mais discreta e não desce até o texto */
.post-header::before {
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  -webkit-mask-image: radial-gradient(ellipse 60% 100% at 50% 0%, #000 10%, transparent 70%);
  mask-image: radial-gradient(ellipse 60% 100% at 50% 0%, #000 10%, transparent 70%);
}

/* ---------------------------- Busca no header ----------------------------
 * O campo nasce da lupa: começa com a largura do ícone e cresce para a esquerda,
 * enquanto o menu some em fade. Fechar faz o caminho inverso.
 */
.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.header-search {
  position: absolute;
  top: 50%;
  right: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 40px;
  height: 38px;
  padding: 0 4px 0 11px;
  overflow: hidden;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%);
  transition:
    width 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.2s ease,
    background 0.25s ease,
    border-color 0.25s ease;
}

.header-search > svg {
  flex-shrink: 0;
}

.header-search input,
.header-search .search-close,
.header-search .search-spinner {
  opacity: 0;
  transition: opacity 0.15s ease;
}

.site-header.is-search-open .header-search {
  width: min(380px, calc(100vw - var(--gutter) * 2 - 56px));
  opacity: 1;
  pointer-events: auto;
  border-color: var(--line-2);
  background: var(--soft);
}

.site-header.is-search-open .header-search input,
.site-header.is-search-open .header-search .search-close {
  opacity: 1;
  transition-delay: 0.12s;
}

.header-search:focus-within {
  border-color: var(--faint) !important;
  background: #fff !important;
}

.header-search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
}

.header-search input::placeholder {
  color: var(--faint);
}

.header-search input::-webkit-search-cancel-button {
  display: none;
}

.search-close {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: transparent;
}

.search-close:hover {
  color: var(--ink);
  background: var(--line);
}

.search-spinner {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--line-2);
  border-top-color: var(--green-500);
  animation: spin 0.7s linear infinite;
}

.site-header.is-search-open .header-search.is-loading .search-spinner {
  opacity: 1;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* O menu e a lupa saem de cena enquanto o campo cresce */
.main-nav,
.search-toggle,
.brand {
  transition: opacity 0.2s ease, transform 0.25s ease;
}

.site-header.is-search-open .search-toggle {
  opacity: 0;
}

@media (min-width: 961px) {
  .site-header.is-search-open .main-nav {
    opacity: 0;
    transform: translateX(-10px);
    pointer-events: none;
  }
}

@media (max-width: 960px) {
  .site-header.is-search-open .brand {
    opacity: 0;
    pointer-events: none;
  }
}

/* Resultados rápidos (páginas sem grade, como o artigo) */
.search-panel {
  position: absolute;
  top: calc(100% + 18px);
  right: 0;
  width: min(420px, calc(100vw - var(--gutter) * 2));
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 24px 60px rgb(10 10 10 / 0.12);
  animation: panel-in 0.2s ease;
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
}

.search-panel a {
  display: block;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
}

.search-panel a:last-child {
  border-bottom: 0;
}

.search-panel a:hover,
.search-panel a.is-active {
  background: var(--soft);
}

.search-panel strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.search-panel small {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}

.search-panel .search-empty {
  padding: 16px 18px;
  font-size: 14px;
  color: var(--muted);
}

.search-panel .search-all {
  font-size: 13px;
  font-weight: 600;
  color: var(--green);
  background: var(--soft);
}

/* Filtrando: some o que não é resultado */
body.is-search-active [data-hide-on-search],
body.is-live-search [data-live-hide] {
  display: none !important;
}

.post-grid.is-updating {
  opacity: 0.45;
  transition: opacity 0.15s ease;
}

mark.hl {
  padding: 0 2px;
  border-radius: 3px;
  color: inherit;
  background: var(--green-100);
}

/* A grade do artigo usa 100vw: corta o excesso sem criar rolagem lateral */
main {
  overflow-x: clip;
}
