/* ============================================================
   Blog Vida Leve Fit — páginas estáticas (SEO/SXO/GEO)
   Tokens espelham DESIGN_SYSTEM.md v2.0 (Golden Master).
   Direção: revista médica editorial — calma, calorosa, precisa.
   Mantido junto de scripts/blog-generate.mjs
   ============================================================ */

@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/fonts/PlusJakartaSans-Variable-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/fonts/PlusJakartaSans-Variable-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- Tokens: LIGHT (DESIGN_SYSTEM.md v2.0) ---------- */
:root {
  color-scheme: light;

  --primary: 160 85% 25%;
  --primary-foreground: 0 0% 100%;
  --primary-light: 160 70% 45%;
  --primary-dark: 160 90% 18%;

  --background: 40 33% 98%;
  --foreground: 158 22% 16%;
  --card: 0 0% 100%;
  --muted: 40 20% 94%;
  --muted-foreground: 150 8% 36%;
  --secondary: 152 38% 93%;
  --border: 40 14% 88%;

  --surface-1: 0 0% 100%;
  --surface-2: 40 25% 96%;
  --surface-3: 40 18% 92.5%;

  --warning: 38 92% 40%;
  --info: 205 72% 38%;

  /* Elevação neutra quente (superfícies) */
  --shadow-1: 0 1px 2px hsl(156 30% 12% / 0.05), 0 1px 3px hsl(156 30% 12% / 0.06);
  --shadow-2: 0 2px 8px -2px hsl(156 30% 12% / 0.08), 0 4px 16px -4px hsl(156 30% 12% / 0.06);
  --shadow-3: 0 8px 28px -8px hsl(156 30% 12% / 0.14);
  /* Sombra de marca — exclusiva de CTAs */
  --shadow-brand: 0 8px 24px -8px hsl(160 70% 25% / 0.45);

  --gradient-primary: linear-gradient(135deg, hsl(160 70% 45%), hsl(155 75% 55%));
  --gradient-soft: linear-gradient(180deg, hsl(40 33% 98%), hsl(160 45% 98%));

  --radius: 0.75rem;
  --measure: 43rem;
  --wide: 70rem;
}

/* ---------- Tokens: DARK ---------- */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;

    --primary: 160 65% 55%;
    --primary-foreground: 160 20% 10%;
    --primary-light: 160 60% 65%;
    --primary-dark: 160 70% 45%;

    --background: 160 22% 7%;
    --foreground: 160 10% 95%;
    --card: 158 16% 11%;
    --muted: 160 15% 15%;
    --muted-foreground: 152 8% 72%;
    --secondary: 160 20% 18%;
    --border: 157 12% 20%;

    --surface-1: 158 16% 11%;
    --surface-2: 158 14% 14%;
    --surface-3: 157 12% 17%;

    --shadow-1: 0 1px 2px hsl(0 0% 0% / 0.4);
    --shadow-2: 0 2px 10px -2px hsl(0 0% 0% / 0.5);
    --shadow-3: 0 10px 32px -10px hsl(0 0% 0% / 0.65);
    --shadow-brand: 0 8px 24px -10px hsl(160 65% 45% / 0.5);

    --gradient-soft: linear-gradient(180deg, hsl(160 22% 7%), hsl(160 20% 9%));
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

body {
  margin: 0;
  font-family: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.75;
  color: hsl(var(--foreground));
  background: hsl(var(--background));
  /* Gradiente sutil só no topo. Evitamos `background-attachment: fixed`:
     em páginas longas ele força repintura de viewport inteira a cada scroll
     (custo alto de INP, sobretudo no mobile). */
  background-image: var(--gradient-soft);
  background-repeat: no-repeat;
  background-size: 100% 60rem;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-variant-numeric: proportional-nums;
}

::selection { background: hsl(var(--primary) / 0.22); color: hsl(var(--foreground)); }

a { color: hsl(var(--primary)); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible {
  outline: 2px solid hsl(var(--primary));
  outline-offset: 3px;
  border-radius: 4px;
}
img { max-width: 100%; height: auto; }
time, .num { font-variant-numeric: tabular-nums; }

/* ---------- Barra de progresso de leitura (progressive enhancement) ---------- */
.progress {
  position: fixed; inset: 0 auto auto 0;
  height: 3px; width: 0;
  background: var(--gradient-primary);
  z-index: 60;
  transition: width .12s linear;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid hsl(var(--border));
  background: hsl(var(--background) / 0.82);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
}
.site-header .wrap {
  max-width: var(--wide); margin: 0 auto;
  padding: .75rem 1.25rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}

/* Logo beija-flor — tratamento de ícone do app (anel de marca + halo) */
.brandmark { display: inline-flex; align-items: center; gap: .625rem; color: hsl(var(--foreground)); }
.brandmark:hover { text-decoration: none; }
.brandmark .mark {
  position: relative;
  width: 2.5rem; height: 2.5rem;
  border-radius: .7rem;
  padding: 2px;
  background: var(--gradient-primary);
  box-shadow: var(--shadow-1);
  flex: 0 0 auto;
  overflow: hidden;
}
/* O arquivo do logo traz o wordmark embutido; ampliamos e reposicionamos
   para enquadrar apenas o beija-flor — o nome já aparece ao lado em texto. */
.brandmark .mark img {
  width: 100%; height: 100%;
  border-radius: .55rem;
  object-fit: cover;
  background: #fff;
  display: block;
  transform: scale(1.42);
  transform-origin: 50% 33%;
}
.brandmark .word { font-weight: 800; letter-spacing: -.022em; font-size: 1.0625rem; line-height: 1.1; white-space: nowrap; }
.brandmark .word b { color: hsl(var(--primary)); font-weight: 800; }
.brandmark .word span { display: block; font-size: .6875rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: hsl(var(--muted-foreground)); }

.header-cta {
  font-size: .875rem; font-weight: 700;
  padding: .6rem 1.05rem;
  border-radius: 999px;
  background: var(--gradient-primary);
  color: hsl(var(--primary-foreground));
  box-shadow: var(--shadow-brand);
  white-space: nowrap;
  transition: transform .18s cubic-bezier(.2,.8,.3,1), filter .18s;
}
.header-cta:hover { text-decoration: none; transform: translateY(-1px); filter: brightness(1.04); }
.header-cta:active { transform: translateY(0); }

/* ---------- Layout ---------- */
main { max-width: var(--measure); margin: 0 auto; padding: 1.5rem 1.25rem 5rem; }
.wide { max-width: var(--wide); margin: 0 auto; padding: 0 1.25rem; }

.breadcrumb { font-size: .8125rem; color: hsl(var(--muted-foreground)); margin: 1.5rem 0 .5rem; letter-spacing: .01em; }
.breadcrumb a { color: hsl(var(--muted-foreground)); }
.breadcrumb a:hover { color: hsl(var(--primary)); }

/* Entrada escalonada */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.article-head > * { animation: rise .5s cubic-bezier(.2,.8,.3,1) backwards; }
.article-head > *:nth-child(1) { animation-delay: .02s; }
.article-head > *:nth-child(2) { animation-delay: .07s; }
.article-head > *:nth-child(3) { animation-delay: .12s; }
.article-head > *:nth-child(4) { animation-delay: .17s; }

/* ---------- Cabeçalho do artigo ---------- */
.category-badge {
  display: inline-block;
  font-size: .6875rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .11em;
  color: hsl(var(--primary));
  background: hsl(var(--secondary));
  border: 1px solid hsl(var(--primary) / 0.22);
  padding: .35rem .7rem; border-radius: 999px;
}
h1 {
  font-size: clamp(2rem, 1.35rem + 2.9vw, 3.15rem);
  line-height: 1.08;
  letter-spacing: -.033em;
  font-weight: 800;
  margin: 1rem 0 .75rem;
  text-wrap: balance;
}
.lede {
  font-size: clamp(1.125rem, 1.02rem + .45vw, 1.3125rem);
  line-height: 1.6;
  color: hsl(var(--muted-foreground));
  margin: 0 0 1.5rem;
  text-wrap: pretty;
}
.article-meta {
  display: flex; flex-wrap: wrap; gap: .5rem 1.15rem;
  font-size: .8125rem; color: hsl(var(--muted-foreground));
  padding: .9rem 0;
  border-top: 1px solid hsl(var(--border));
  border-bottom: 1px solid hsl(var(--border));
  font-variant-numeric: tabular-nums;
}
.article-meta strong { color: hsl(var(--foreground)); font-weight: 700; }
.article-meta .reviewed {
  color: hsl(var(--primary)); font-weight: 700;
  display: inline-flex; align-items: center; gap: .3rem;
}

/* ---------- Prosa ---------- */
.prose h2 {
  font-size: clamp(1.4rem, 1.2rem + .85vw, 1.85rem);
  line-height: 1.22; letter-spacing: -.02em; font-weight: 800;
  margin: 3rem 0 .85rem; scroll-margin-top: 6rem;
  text-wrap: balance;
}
.prose h2::after {
  content: ""; display: block;
  width: 2.25rem; height: 3px; margin-top: .7rem;
  border-radius: 2px; background: var(--gradient-primary);
}
.prose h3 {
  font-size: 1.1875rem; font-weight: 700; letter-spacing: -.012em;
  margin: 2rem 0 .5rem; scroll-margin-top: 6rem;
}
.prose p { margin: 0 0 1.15rem; text-wrap: pretty; }
.prose > p:first-of-type { font-size: 1.09375rem; }
.prose ul, .prose ol { margin: 0 0 1.15rem; padding-left: 1.35em; }
.prose li { margin: .45rem 0; }
.prose li::marker { color: hsl(var(--primary)); font-weight: 700; }
.prose strong { font-weight: 700; color: hsl(var(--foreground)); }
.prose a { text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
.prose blockquote {
  margin: 1.75rem 0; padding: 1.15rem 1.35rem;
  border-left: 3px solid hsl(var(--primary));
  background: hsl(var(--secondary) / .55);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 1.0625rem;
}
.prose blockquote p { margin: 0; }
.prose hr { border: 0; border-top: 1px solid hsl(var(--border)); margin: 2.5rem 0; }

/* ---------- Cartões ---------- */
.card {
  background: hsl(var(--surface-1));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 1.35rem 1.5rem;
  box-shadow: var(--shadow-1);
}

/* ---------- Figuras / diagramas SVG ---------- */
.fig {
  margin: 2rem 0; padding: 1.25rem;
  background: hsl(var(--surface-1));
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) + .25rem);
  box-shadow: var(--shadow-1);
}
.fig figcaption {
  margin-top: .9rem; font-size: .8125rem; line-height: 1.55;
  color: hsl(var(--muted-foreground));
  border-top: 1px solid hsl(var(--border)); padding-top: .75rem;
}
.fig-svg { display: block; width: 100%; height: auto; }
.fig-svg--sm { max-width: 20rem; margin: 0 auto; }

/* Traços e eixos */
.fig-axis { stroke: hsl(var(--border)); stroke-width: 1.5; }
.fig-line { fill: none; stroke-width: 3; stroke-linecap: round; }
.fig-line--brand { stroke: hsl(var(--primary)); }
.fig-line--alt { stroke: hsl(var(--warning)); }
.fig-dot--brand { fill: hsl(var(--primary)); }
.fig-dot--alt { fill: hsl(var(--warning)); }
.fig-label { font-size: 11px; fill: hsl(var(--muted-foreground)); font-family: inherit; }
.fig-out { font-size: 12px; font-weight: 700; fill: hsl(var(--muted-foreground)); font-family: inherit; }
.fig-out--brand { fill: hsl(var(--primary)); }

/* Prato */
.fig-plate { fill: hsl(var(--surface-2)); stroke: hsl(var(--border)); stroke-width: 2; }
.fig-slice--veg { fill: hsl(var(--primary) / .28); }
.fig-slice--pro { fill: hsl(var(--primary) / .55); }
.fig-slice--carb { fill: hsl(var(--warning) / .35); }
.fig-plate-line { stroke: hsl(var(--surface-1)); stroke-width: 3; }
.fig-slice-label { font-size: 14px; font-weight: 700; fill: hsl(var(--foreground)); font-family: inherit; }
.fig-slice-sub { font-size: 11px; fill: hsl(var(--muted-foreground)); font-family: inherit; }

/* Mitocôndria / UCP1 */
.fig-membrane { fill: hsl(var(--surface-3)); stroke: hsl(var(--border)); stroke-width: 1.5; }
.fig-proton circle { fill: hsl(var(--info)); opacity: .8; }
.fig-arrow { fill: none; stroke: hsl(var(--muted-foreground)); stroke-width: 2; }
.fig-arrow--brand { stroke: hsl(var(--primary)); stroke-width: 2.5; }
.fig-arrowhead { fill: hsl(var(--muted-foreground)); }
.fig-arrowhead--brand { fill: hsl(var(--primary)); }
.fig-port { stroke-width: 2; }
.fig-port--atp { fill: hsl(var(--surface-1)); stroke: hsl(var(--muted-foreground) / .5); }
.fig-port--ucp { fill: hsl(var(--primary) / .18); stroke: hsl(var(--primary)); }
.fig-port-label { font-size: 11px; font-weight: 700; fill: hsl(var(--foreground)); font-family: inherit; }

/* Barras */
.fig-bar--brand { fill: hsl(var(--primary)); }
.fig-bar--alt { fill: hsl(var(--warning)); }
.fig-bar--muted { fill: hsl(var(--muted-foreground) / .35); }

/* ---------- Resposta rápida (bloco mais citável por IAs) ---------- */
.quickanswer {
  margin: 1.75rem 0 .25rem;
  padding: 1.15rem 1.35rem;
  border-radius: calc(var(--radius) + .25rem);
  background: hsl(var(--secondary) / .6);
  border: 1px solid hsl(var(--primary) / .25);
  border-left: 4px solid hsl(var(--primary));
}
.quickanswer h2 {
  font-size: .75rem; text-transform: uppercase; letter-spacing: .12em;
  color: hsl(var(--primary)); margin: 0 0 .5rem; font-weight: 800;
}
.quickanswer h2::after { display: none; }
.quickanswer p {
  margin: 0; font-size: 1.0625rem; line-height: 1.65;
  color: hsl(var(--foreground));
}

/* ---------- Leitor de áudio (Web Speech API) ---------- */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.audioplayer {
  display: flex; align-items: center; gap: 1rem;
  margin: 1.75rem 0 .25rem; padding: .9rem 1.1rem;
  border: 1px solid hsl(var(--primary) / .22);
  border-radius: calc(var(--radius) + .35rem);
  background:
    radial-gradient(120% 140% at 0% 0%, hsl(var(--primary) / .09), transparent 60%),
    hsl(var(--surface-1));
  box-shadow: var(--shadow-1);
  transition: border-color .3s, box-shadow .3s;
}
.audioplayer.is-playing {
  border-color: hsl(var(--primary) / .45);
  box-shadow: var(--shadow-2), 0 0 0 4px hsl(var(--primary) / .07);
}

/* Botão circular */
.ap-play {
  position: relative; flex: 0 0 auto;
  width: 3rem; height: 3rem; padding: 0;
  display: grid; place-items: center;
  border: 0; border-radius: 999px; cursor: pointer;
  color: hsl(var(--primary-foreground));
  background: var(--gradient-primary);
  box-shadow: var(--shadow-brand);
  transition: transform .2s cubic-bezier(.2,.8,.3,1), filter .2s;
}
.ap-play:hover { transform: scale(1.06); filter: brightness(1.05); }
.ap-play:active { transform: scale(.97); }
/* Halo pulsante enquanto toca (transform/opacity apenas) */
.audioplayer.is-playing .ap-play::after {
  content: ""; position: absolute; inset: 0; border-radius: 999px;
  border: 2px solid hsl(var(--primary) / .5);
  animation: apHalo 2s ease-out infinite;
}
@keyframes apHalo {
  0% { transform: scale(1); opacity: .7; }
  100% { transform: scale(1.5); opacity: 0; }
}
/* Ícone play → pause, em CSS puro */
.ap-icon {
  width: 0; height: 0;
  border-style: solid;
  border-width: .45rem 0 .45rem .75rem;
  border-color: transparent transparent transparent currentColor;
  margin-left: .18rem;
  transition: border-width .2s, width .2s, height .2s, margin .2s;
}
.audioplayer.is-playing .ap-icon {
  width: .7rem; height: .85rem; margin-left: 0;
  border-width: 0 0 0 .7rem;
  border-left-style: double;
}

.ap-body { flex: 1 1 auto; min-width: 0; }
.ap-top { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.ap-title { font-weight: 700; font-size: .9375rem; color: hsl(var(--foreground)); letter-spacing: -.01em; }
.ap-status { display: block; font-size: .75rem; color: hsl(var(--muted-foreground)); margin-top: .3rem; font-variant-numeric: tabular-nums; }

/* Equalizador — CSS puro, anima só transform (compositor).
   Fica PAUSADO quando não está tocando: custo de CPU zero em repouso. */
.ap-eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 1.1rem; flex: 0 0 auto; }
.ap-eq i {
  display: block; width: 3px; height: 100%;
  border-radius: 2px; background: hsl(var(--primary));
  transform: scaleY(.22); transform-origin: bottom;
  opacity: .55;
  animation: apEq .9s ease-in-out infinite alternate;
  animation-play-state: paused;
}
.audioplayer.is-playing .ap-eq i { animation-play-state: running; opacity: 1; }
.ap-eq i:nth-child(1) { animation-duration: .72s; animation-delay: -.10s; }
.ap-eq i:nth-child(2) { animation-duration: .94s; animation-delay: -.32s; }
.ap-eq i:nth-child(3) { animation-duration: .64s; animation-delay: -.05s; }
.ap-eq i:nth-child(4) { animation-duration: 1.06s; animation-delay: -.48s; }
.ap-eq i:nth-child(5) { animation-duration: .82s; animation-delay: -.22s; }
.ap-eq i:nth-child(6) { animation-duration: .70s; animation-delay: -.40s; }
.ap-eq i:nth-child(7) { animation-duration: .98s; animation-delay: -.15s; }
@keyframes apEq { from { transform: scaleY(.18); } to { transform: scaleY(1); } }
/* Modo sincronizado: as barras passam a ser pilotadas por JS a cada palavra
   falada (evento onboundary). Só transform + transition → compositor. */
.audioplayer.eq-live .ap-eq i {
  animation: none;
  opacity: 1;
  transition: transform .13s cubic-bezier(.2,.8,.3,1);
}
@media (prefers-reduced-motion: reduce) {
  .ap-eq i { animation: none !important; transform: scaleY(.45); }
  .audioplayer.is-playing .ap-play::after { animation: none; }
}

.ap-bar {
  display: block; height: 4px; margin-top: .5rem; border-radius: 999px;
  background: hsl(var(--border)); overflow: hidden;
}
.ap-bar i { display: block; height: 100%; width: 0; background: var(--gradient-primary); transition: width .25s linear; }
.ap-rate select {
  font: inherit; font-size: .8125rem; font-variant-numeric: tabular-nums;
  color: hsl(var(--foreground)); background: hsl(var(--surface-2));
  border: 1px solid hsl(var(--border)); border-radius: 999px;
  padding: .4rem .65rem; cursor: pointer; flex: 0 0 auto;
}
@media (max-width: 30rem) {
  .audioplayer { gap: .75rem; padding: .8rem .85rem; }
  .ap-play { width: 2.75rem; height: 2.75rem; }
  .ap-eq { height: .9rem; }
  .ap-title { font-size: .875rem; }
}
/* Trecho sendo lido */
.ap-reading {
  background: hsl(var(--primary) / .12);
  box-shadow: 0 0 0 .35rem hsl(var(--primary) / .12);
  border-radius: 4px;
  transition: background .2s;
}

/* Principais pontos — marcador beija-flor (asa estilizada) */
.takeaways { margin: 1.75rem 0 .5rem; border-radius: calc(var(--radius) + .25rem); }
.takeaways h2 {
  font-size: .75rem; text-transform: uppercase; letter-spacing: .12em;
  color: hsl(var(--primary)); margin: 0 0 .85rem; font-weight: 700;
}
.takeaways h2::after { display: none; }
.takeaways ul { margin: 0; padding: 0; list-style: none; }
.takeaways li { position: relative; padding-left: 1.75rem; margin: .65rem 0; }
.takeaways li::before {
  content: ""; position: absolute; left: 0; top: .6em;
  width: .7rem; height: .7rem;
  background: var(--gradient-primary);
  border-radius: 60% 10% 60% 10%;
  transform: rotate(-8deg);
}

/* Índice */
.toc { margin: 1.5rem 0; font-size: .9375rem; }
.toc summary {
  cursor: pointer; font-weight: 700; color: hsl(var(--primary));
  padding: .5rem 0; list-style: none;
}
.toc summary::-webkit-details-marker { display: none; }
.toc summary::before { content: "☰ "; opacity: .7; }
.toc ol { margin: .5rem 0 0; padding-left: 1.25em; color: hsl(var(--muted-foreground)); }
.toc li { margin: .3rem 0; }
.toc a { color: hsl(var(--muted-foreground)); }
.toc a:hover { color: hsl(var(--primary)); }

/* ---------- CTA ---------- */
.cta-inline {
  margin: 2.5rem 0; padding: 1.5rem 1.6rem;
  border-radius: calc(var(--radius) + .25rem);
  background: var(--gradient-primary);
  color: hsl(var(--primary-foreground));
  box-shadow: var(--shadow-brand);
  position: relative; overflow: hidden;
}
.cta-inline::after {
  content: ""; position: absolute; right: -3rem; top: -3rem;
  width: 12rem; height: 12rem; border-radius: 50%;
  background: hsl(0 0% 100% / .1);
}
.cta-inline p { margin: 0 0 1rem; font-size: 1.0625rem; position: relative; }
.btn {
  display: inline-block; font-weight: 800; font-size: 1rem;
  padding: .8rem 1.5rem; border-radius: 999px;
  background: hsl(var(--card)); color: hsl(var(--primary-dark));
  position: relative;
  transition: transform .18s cubic-bezier(.2,.8,.3,1), box-shadow .18s;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-2); }
.btn-solid { background: var(--gradient-primary); color: hsl(var(--primary-foreground)); box-shadow: var(--shadow-brand); }

.cta-final { margin: 3.5rem 0 .5rem; text-align: center; }
.cta-final h2 { margin: 0 0 .5rem; }
.cta-final h2::after { margin-left: auto; margin-right: auto; }
.cta-final p { color: hsl(var(--muted-foreground)); margin: 0 0 1.25rem; }

/* ---------- Autor ---------- */
.author-box { display: flex; gap: 1rem; align-items: flex-start; margin: 3rem 0 .5rem; }
.author-box .avatar {
  width: 4rem; height: 4rem; border-radius: 999px;
  object-fit: cover; object-position: 50% 12%;
  border: 2px solid hsl(var(--primary) / .3);
  flex: 0 0 auto; background: hsl(var(--secondary));
}
.author-box .name { font-weight: 800; margin: 0; letter-spacing: -.015em; }
.author-box .role { color: hsl(var(--primary)); font-weight: 600; font-size: .875rem; margin: .15rem 0 .25rem; }
.author-box .credentials { color: hsl(var(--muted-foreground)); font-size: .8125rem; line-height: 1.5; margin: 0 0 .5rem; }
.author-box .bio { color: hsl(var(--muted-foreground)); font-size: .9375rem; margin: 0; }

/* ---------- Página de autor ---------- */
.authorpage-head { display: flex; gap: 1.5rem; align-items: flex-start; flex-wrap: wrap; }
.authorpage-head h1 { margin-top: 0; font-size: clamp(1.75rem, 1.3rem + 2vw, 2.5rem); }
.ab-photo {
  width: 7.5rem; height: 7.5rem; border-radius: 999px; object-fit: cover;
  object-position: 50% 12%; flex: 0 0 auto;
  border: 3px solid hsl(var(--primary) / .35);
  box-shadow: var(--shadow-2); background: hsl(var(--secondary));
}
.ab-role { color: hsl(var(--primary)); font-weight: 700; font-size: 1rem; margin: 0 0 .75rem; }
.ab-crm {
  display: inline-block; margin-left: .4rem; padding: .15rem .55rem;
  font-size: .75rem; font-weight: 700; letter-spacing: .02em;
  border-radius: 999px; background: hsl(var(--secondary));
  color: hsl(var(--primary)); border: 1px solid hsl(var(--primary) / .25);
  vertical-align: middle;
}
.ab-links { display: flex; gap: .6rem; flex-wrap: wrap; margin: .25rem 0 0; }
.ab-link {
  font-size: .8125rem; font-weight: 700; padding: .4rem .85rem;
  border-radius: 999px; border: 1px solid hsl(var(--border));
  background: hsl(var(--surface-1)); color: hsl(var(--foreground));
  transition: border-color .2s, color .2s;
}
.ab-link:hover { text-decoration: none; border-color: hsl(var(--primary) / .45); color: hsl(var(--primary)); }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1.15rem; }
.chip {
  font-size: .8125rem; font-weight: 600;
  padding: .4rem .8rem; border-radius: 999px;
  background: hsl(var(--secondary)); color: hsl(var(--primary));
  border: 1px solid hsl(var(--primary) / .2);
}
.author-box .name a { color: inherit; }
.author-box .name a:hover { color: hsl(var(--primary)); text-decoration: none; }
@media (max-width: 34rem) {
  .authorpage-head { gap: 1.1rem; }
  .ab-photo { width: 5.5rem; height: 5.5rem; }
}

/* ---------- FAQ ---------- */
.faq h2 { margin-top: 3rem; }
.faq details {
  border: 1px solid hsl(var(--border)); border-radius: var(--radius);
  background: hsl(var(--surface-1)); padding: 0 1.15rem; margin: .6rem 0;
  transition: box-shadow .2s, border-color .2s;
}
.faq details[open] { box-shadow: var(--shadow-1); border-color: hsl(var(--primary) / .3); }
.faq summary {
  cursor: pointer; font-weight: 700; padding: .95rem 0;
  list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; color: hsl(var(--primary)); font-weight: 800; font-size: 1.25rem;
  transition: transform .2s; flex: 0 0 auto;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0 0 .95rem; color: hsl(var(--muted-foreground)); }

/* ---------- Fontes / Referências (AMA) ---------- */
/* Legado — mantido para artigos ainda em `sources`. */
.sources { margin: 3rem 0 0; }
.sources h2 { font-size: 1.125rem; }
.sources ol { padding-left: 1.25em; color: hsl(var(--muted-foreground)); font-size: .875rem; }
.sources li { margin: .5rem 0; }
.sources .pub { opacity: .85; }

/* Padrão AMA/Vancouver — bibliografia numerada com back-refs. */
.refs { margin: 3rem 0 0; scroll-margin-top: 6rem; }
.refs h2 { font-size: 1.125rem; }
.ref-list {
  padding-left: 1.4em;
  color: hsl(var(--muted-foreground));
  font-size: .875rem;
  line-height: 1.55;
  counter-reset: none; /* usamos <ol> nativo */
}
.ref-list li {
  margin: .7rem 0;
  padding-left: .25em;
  scroll-margin-top: 6rem;
}
.ref-list li:target {
  background: hsl(var(--primary) / .08);
  border-left: 3px solid hsl(var(--primary));
  padding: .5rem .6rem .5rem .75rem;
  border-radius: 0 .35rem .35rem 0;
  transition: background .4s;
}
.ref-list cite { font-style: normal; font-weight: 600; color: hsl(var(--foreground)); }
.ref-list em { font-style: italic; }
.ref-list a { color: hsl(var(--primary)); text-decoration: none; }
.ref-list a:hover { text-decoration: underline; text-underline-offset: 2px; }
.ref-back {
  display: inline-block; margin-left: .35em;
  color: hsl(var(--muted-foreground));
  text-decoration: none; font-weight: 700;
  opacity: .55;
}
.ref-back:hover { opacity: 1; color: hsl(var(--primary)); }

/* Superíndice inline — clicável, discreto, alinhado à baseline do texto. */
sup.ref {
  font-size: .68em;
  line-height: 0;
  vertical-align: super;
  margin-left: .08em;
  font-variant-numeric: tabular-nums;
}
sup.ref a {
  color: hsl(var(--primary));
  text-decoration: none;
  padding: 0 .15em;
  border-radius: 3px;
  font-weight: 700;
  transition: background .15s;
}
sup.ref a:hover { background: hsl(var(--primary) / .12); text-decoration: none; }
sup.ref a::before { content: "["; opacity: .55; }
sup.ref a::after { content: "]"; opacity: .55; }

/* ---------- Disclaimer ---------- */
.disclaimer {
  margin: 2rem 0 0; padding: 1rem 1.15rem;
  background: hsl(var(--warning) / .08);
  border: 1px solid hsl(var(--warning) / .3);
  border-left: 3px solid hsl(var(--warning));
  border-radius: var(--radius);
  font-size: .875rem; line-height: 1.65;
  color: hsl(var(--foreground) / .85);
}
.disclaimer strong { color: hsl(var(--foreground)); }

/* ---------- Relacionados ---------- */
.related { margin: 3.5rem 0 0; }
.related h2 { font-size: 1.125rem; margin-bottom: 1rem; }
.related-grid { display: grid; gap: .9rem; grid-template-columns: 1fr; }
.related-card {
  display: block; border: 1px solid hsl(var(--border)); border-radius: var(--radius);
  padding: 1.1rem 1.2rem; background: hsl(var(--surface-1));
  transition: box-shadow .22s, transform .22s, border-color .22s;
}
.related-card:hover {
  text-decoration: none; box-shadow: var(--shadow-2);
  transform: translateY(-3px); border-color: hsl(var(--primary) / .35);
}
.related-card .rc-cat {
  font-size: .6875rem; text-transform: uppercase; letter-spacing: .09em;
  color: hsl(var(--primary)); font-weight: 700;
}
.related-card .rc-title { font-weight: 700; color: hsl(var(--foreground)); margin: .3rem 0 0; line-height: 1.35; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid hsl(var(--border));
  margin-top: 4rem; padding: 2rem 1.25rem;
  color: hsl(var(--muted-foreground)); font-size: .875rem;
  background: hsl(var(--surface-2) / .5);
}
.site-footer .wrap {
  max-width: var(--wide); margin: 0 auto;
  display: flex; flex-wrap: wrap; gap: 1rem 1.5rem;
  align-items: center; justify-content: space-between;
}
.site-footer .fbrand { display: inline-flex; align-items: center; gap: .55rem; }
.site-footer .fbrand .mini {
  width: 1.75rem; height: 1.75rem; border-radius: .5rem;
  overflow: hidden; background: #fff; flex: 0 0 auto; display: inline-block;
}
.site-footer .fbrand .mini img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transform: scale(1.42); transform-origin: 50% 33%;
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: .5rem 1.1rem; }
.site-footer a { color: hsl(var(--muted-foreground)); }
.site-footer a:hover { color: hsl(var(--primary)); }

/* ---------- Índice do blog ---------- */
.index-hero { padding: 3rem 0 .5rem; max-width: 46rem; }
.index-hero .eyebrow {
  display: inline-flex; align-items: center; gap: .65rem;
  font-size: .875rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase;
  color: hsl(var(--primary)); margin-bottom: 1rem;
}
.index-hero .eyebrow .mini {
  width: 2.5rem; height: 2.5rem; border-radius: .7rem;
  overflow: hidden; flex: 0 0 auto;
  display: inline-block;
  padding: 2px; background: var(--gradient-primary);
  box-shadow: var(--shadow-1);
}
.index-hero .eyebrow .mini img { border-radius: .55rem; background: #fff; }
.index-hero .eyebrow .mini img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transform: scale(1.42); transform-origin: 50% 33%;
}
.index-hero h1 { margin-bottom: .6rem; }
.index-hero p { color: hsl(var(--muted-foreground)); font-size: 1.1875rem; line-height: 1.6; }
.cat-section { margin: 3rem 0; }
.cat-section h2 {
  font-size: 1.3125rem; margin-bottom: 1.1rem; font-weight: 800; letter-spacing: -.02em;
  display: flex; align-items: center; gap: .75rem;
}
.cat-section h2::after {
  content: ""; flex: 1; height: 1px; background: hsl(var(--border));
}
.post-grid { display: grid; gap: 1.15rem; grid-template-columns: 1fr; }
.post-card {
  display: flex; flex-direction: column;
  border: 1px solid hsl(var(--border)); border-radius: calc(var(--radius) + .25rem);
  padding: 1.5rem; background: hsl(var(--surface-1));
  box-shadow: var(--shadow-1);
  transition: box-shadow .22s, transform .22s, border-color .22s;
}
.post-card:hover {
  text-decoration: none; box-shadow: var(--shadow-3);
  transform: translateY(-4px); border-color: hsl(var(--primary) / .35);
}
.post-card h3 {
  margin: .8rem 0 .45rem; font-size: 1.25rem; font-weight: 800;
  letter-spacing: -.022em; color: hsl(var(--foreground)); line-height: 1.28;
  text-wrap: balance;
}
.post-card p { margin: 0 0 1rem; color: hsl(var(--muted-foreground)); font-size: .9375rem; line-height: 1.6; }
.post-card .pc-meta {
  margin-top: auto; font-size: .75rem; color: hsl(var(--muted-foreground));
  font-variant-numeric: tabular-nums;
  padding-top: .85rem; border-top: 1px solid hsl(var(--border));
}

/* Mobile: o header não pode quebrar nem estourar a largura.
   Abaixo de 30rem escondemos o wordmark (a marca segue no ícone) e
   compactamos o CTA para que caiba na mesma linha. */
@media (max-width: 30rem) {
  .site-header .wrap { padding: .6rem 1rem; gap: .6rem; }
  .brandmark .word { display: none; }
  .header-cta { font-size: .8125rem; padding: .55rem .9rem; }
  main { padding-left: 1rem; padding-right: 1rem; }
  .wide { padding: 0 1rem; }
  .author-box { gap: .85rem; }
}

@media (min-width: 46rem) {
  .post-grid { grid-template-columns: repeat(2, 1fr); }
  .related-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 68rem) {
  .post-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- Impressão ---------- */
@media print {
  .site-header, .header-cta, .cta-inline, .cta-final, .related, .progress, .toc { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  main { max-width: none; }
  .prose a::after { content: " (" attr(href) ")"; font-size: 9pt; color: #555; }
}
