/* public/css/fm/route-post.css
 *
 * Layout e tipografia de corpo (.fm-prose) da rota /post reconstruída (fatia 3).
 * React-pura sobre o PageShell, composta dos oficiais (fm-chip, fm-card, fm-button).
 * Só layout/estilo de rota aqui; primitivos nos fm/<componente>.css. Classes fm-.
 */

:root {
  --fm-prose-width: 46rem;
  --fm-prose-wide: 56rem; /* capa: respira além da coluna de texto, ainda centralizada */
}

/* —— coluna de leitura centralizada —— */
.fm-post {
  box-sizing: border-box;
  max-width: var(--fm-max-width);
  margin: 0 auto;
  /* folga no topo p/ a Nav (absolute, ~160px incl. a logo da 2ª linha) não cobrir
     o conteúdo — sem hero colorido, o conteúdo é o 1º elemento, então limpa a Nav. */
  padding: clamp(10.5rem, 16vw, 12rem) var(--fm-space-6) var(--fm-space-16);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.fm-post > * {
  width: 100%;
  max-width: var(--fm-prose-width);
}

.fm-breadcrumb {
  display: inline-flex;
  gap: 0.4rem;
  align-items: center;
  color: var(--fm-teal);
  text-decoration: none;
  margin-bottom: var(--fm-space-6);
}
.fm-breadcrumb:hover {
  text-decoration: underline;
}

/* —— cabeçalho: na MESMA coluna centralizada do corpo (texto alinhado à esquerda
   dentro da coluna) — evita o desalinhamento título-à-esquerda × corpo-centralizado —— */
.fm-post-header {
  display: flex;
  flex-direction: column;
  gap: var(--fm-space-4);
  align-items: flex-start;
}
/* título do artigo: menor que o hero de landing (fm-display) — escala de artigo */
.fm-post-header .fm-display {
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  line-height: 1.08;
}
.fm-post-summary {
  margin: 0;
  color: var(--fm-gray-500);
}
.fm-post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--fm-space-4);
  color: var(--fm-gray-300);
}
/* capa: mais larga que a coluna de texto, porém centralizada (mesmo eixo) */
.fm-post-cover {
  width: 100%;
  max-width: var(--fm-prose-wide);
  margin-top: var(--fm-space-6);
  border-radius: var(--fm-radius-lg);
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

/* —— TOC recolhível (topo, todas as larguras) —— */
.fm-toc {
  margin: var(--fm-space-8) 0;
  padding: var(--fm-space-4) var(--fm-space-6);
  border: 1px solid var(--fm-gray-100);
  border-radius: var(--fm-radius-md);
  background: var(--fm-surface);
}
.fm-toc-title {
  cursor: pointer;
  font-weight: 700;
  color: var(--fm-navy);
}
.fm-toc-nav {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: var(--fm-space-4);
}
.fm-toc-link {
  color: var(--fm-navy);
  text-decoration: none;
  border-left: 2px solid transparent;
  padding-left: 0.6rem;
}
.fm-toc-link--h3 {
  padding-left: 1.6rem;
  font-size: 0.95em;
  color: var(--fm-gray-500);
}
.fm-toc-link:hover {
  color: var(--fm-teal);
}
.fm-toc-link.is-current {
  color: var(--fm-teal);
  border-left-color: var(--fm-teal);
  font-weight: 700;
}

/* —— barra de progresso de leitura —— */
.fm-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: var(--fm-teal);
  z-index: 60;
  transition: width 0.05s linear;
}

/* —— .fm-prose: corpo do artigo (elevado) —— */
.fm-prose {
  color: var(--fm-gray-700);
  font-family: var(--fm-font-body);
  font-size: 1.1875rem;
  line-height: 1.7;
}
.fm-prose > * + * {
  margin-top: 1.25em;
}
.fm-prose h2 {
  font-family: var(--fm-font-display);
  color: var(--fm-navy);
  font-size: clamp(1.6rem, 3vw, 2rem);
  line-height: 1.2;
  margin-top: 2.2em;
  scroll-margin-top: 96px;
}
.fm-prose h3 {
  font-family: var(--fm-font-display);
  color: var(--fm-navy);
  font-size: clamp(1.25rem, 2.4vw, 1.5rem);
  line-height: 1.25;
  margin-top: 1.8em;
  scroll-margin-top: 96px;
}
.fm-prose a {
  color: var(--fm-teal);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.fm-prose strong {
  font-weight: 700;
  color: var(--fm-navy);
}
.fm-prose ul,
.fm-prose ol {
  padding-left: 1.4rem;
}
.fm-prose ul {
  list-style: none;
}
.fm-prose ul > li {
  position: relative;
  padding-left: 0.4rem;
}
.fm-prose ul > li::before {
  content: '';
  position: absolute;
  left: -0.9rem;
  top: 0.7em;
  width: 0.5rem;
  height: 0.14rem;
  background: var(--fm-teal);
}
.fm-prose ol {
  list-style: none;
  counter-reset: item;
}
.fm-prose ol > li {
  counter-increment: item;
  position: relative;
  padding-left: 0.4rem;
}
.fm-prose ol > li::before {
  content: counter(item);
  position: absolute;
  left: -1.4rem;
  color: var(--fm-teal);
  font-weight: 700;
}
.fm-prose li + li {
  margin-top: 0.4em;
}
.fm-prose blockquote {
  margin: 1.6em 0;
  padding-left: 1.2rem;
  border-left: 3px solid var(--fm-teal);
  font-style: italic;
  color: var(--fm-gray-500);
}
.fm-prose img {
  width: 100%;
  height: auto;
  border-radius: var(--fm-radius-md);
}
.fm-prose figure {
  margin: 1.8em 0;
}
.fm-prose figcaption {
  margin-top: 0.6rem;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--fm-gray-300);
}
.fm-prose hr {
  border: 0;
  border-top: 1px solid var(--fm-gray-100);
  margin: 2em 0;
}
.fm-prose pre {
  background: var(--fm-surface);
  border-radius: var(--fm-radius-md);
  padding: 1rem;
  overflow: auto;
}
.fm-prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
}

/* —— share —— */
.fm-sharebar {
  display: flex;
  align-items: center;
  gap: var(--fm-space-4);
  margin-top: var(--fm-space-12);
}
.fm-sharebar-links {
  display: flex;
  gap: var(--fm-space-3);
}
.fm-sharebar-link {
  display: inline-grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: 1px solid var(--fm-gray-100);
  color: var(--fm-navy);
}
.fm-sharebar-link svg {
  width: 18px;
  height: 18px;
}
.fm-sharebar-link:hover {
  background: var(--fm-teal);
  border-color: var(--fm-teal);
  color: var(--fm-white);
}

/* —— CTA full-bleed (teal) — section de ponta a ponta da casca —— */
.fm-post-cta {
  position: relative;
  overflow: hidden;
  margin-top: var(--fm-space-16);
  padding: clamp(4rem, 10vw, 7rem) var(--fm-space-6);
  background: var(--fm-teal);
  color: var(--fm-white);
  text-align: center;
}
.fm-post-cta-inner {
  position: relative;
  z-index: 2;
  max-width: 46rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--fm-space-4);
}
.fm-post-cta-text {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

/* —— relacionados (reusa fm-card) —— */
.fm-related {
  box-sizing: border-box;
  max-width: var(--fm-max-width);
  margin: 0 auto;
  padding: var(--fm-space-16) var(--fm-space-6) var(--fm-space-24);
}
.fm-related-title {
  margin: 0 0 var(--fm-space-8);
}
.fm-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  gap: var(--fm-space-6);
}
