/* ==========================================================================
   ComparaBike — conteúdo de post do blog

   Este arquivo é a ÚNICA fonte de estilo do corpo de um post. Ele é carregado
   tanto na página pública quanto no iframe de Preview do CMS, então o que o
   editor vê é literalmente o que o leitor recebe.

   Classes semânticas de propósito: utilities do Tailwind escritas dentro do
   conteúdo do post seriam removidas no purge (o build escaneia templates/,
   não o banco de dados).
   ========================================================================== */

.post-content {
  --pc-text:      #434a4c;
  --pc-ink:       #2a2d30;
  --pc-slate:     #434b5a;
  --pc-muted:     #666666;
  --pc-subtle:    #757575;
  --pc-border:    #e0e0e0;
  --pc-surface:   #f8f9fa;
  --pc-sage:      #89bd89;
  --pc-green:     #45702f;
  --pc-green-ink: #2f5e34;
  --pc-tint:      #e8f5e9;
  --pc-warn-bg:   #faf3d9;
  --pc-warn-ink:  #5a4a1f;
  --pc-danger-ink:#8c2020;
  --pc-danger-bg: #fdeaea;

  color: var(--pc-text);
  font-size: 1rem;
  line-height: 1.75;
  overflow-wrap: break-word;
}

/* --- ritmo vertical: o espaçamento vem do fluxo, não de margens soltas --- */
.post-content > * + * { margin-top: 1.25rem; }
.post-content > * { margin-bottom: 0; }

/* --- títulos --- */
.post-content h2,
.post-content h3,
.post-content h4 {
  color: var(--pc-slate);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.3;
  text-wrap: balance;
}
.post-content h2 { font-size: 1.5rem; }
.post-content h3 { font-size: 1.2rem; }
.post-content h4 { font-size: 1.05rem; }
.post-content > h2 + *,
.post-content > h3 + *,
.post-content > h4 + * { margin-top: 0.75rem; }
.post-content > * + h2 { margin-top: 2.25rem; }
.post-content > * + h3 { margin-top: 1.75rem; }

@media (min-width: 640px) {
  .post-content { font-size: 1.05rem; }
  .post-content h2 { font-size: 1.75rem; }
  .post-content h3 { font-size: 1.35rem; }
}

/* --- texto --- */
.post-content p { margin: 0; }
.post-content strong { color: var(--pc-ink); font-weight: 600; }
.post-content em { font-style: italic; }
.post-content small { font-size: 0.85em; color: var(--pc-muted); }

.post-content a {
  color: var(--pc-green);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  font-weight: 500;
}
.post-content a:hover { text-decoration-thickness: 2px; }
.post-content a:focus-visible { outline: 2px solid var(--pc-green); outline-offset: 2px; border-radius: 2px; }

/* --- listas --- */
.post-content ul,
.post-content ol { padding-left: 1.4rem; }
.post-content ul { list-style: disc; }
.post-content ol { list-style: decimal; }
.post-content li + li { margin-top: 0.4rem; }
.post-content li::marker { color: var(--pc-sage); }
.post-content ol li::marker { color: var(--pc-muted); font-weight: 600; }

/* --- mídia --- */
.post-content img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  border: 1px solid var(--pc-border);
}
.post-content figure { margin: 0; }
.post-content figcaption {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--pc-subtle);
  text-align: center;
}

/* --- citação --- */
.post-content blockquote {
  margin: 0;
  padding: 0.25rem 0 0.25rem 1.1rem;
  border-left: 3px solid var(--pc-sage);
  color: var(--pc-slate);
  font-size: 1.05em;
  font-style: italic;
}
.post-content blockquote p + p { margin-top: 0.75rem; }

/* --- código --- */
.post-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: var(--pc-surface);
  border: 1px solid var(--pc-border);
  border-radius: 4px;
  padding: 0.1em 0.35em;
}
.post-content pre {
  background: var(--pc-surface);
  border: 1px solid var(--pc-border);
  border-radius: 10px;
  padding: 1rem;
  overflow-x: auto;
}
.post-content pre code { background: none; border: 0; padding: 0; font-size: 0.85rem; }

/* --- regra --- */
.post-content hr { border: 0; border-top: 1px solid var(--pc-border); margin-block: 2rem; }

/* --- tabelas --- */
.post-content .post-table-scroll { overflow-x: auto; }
.post-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  min-width: 480px;
}
.post-content th,
.post-content td {
  text-align: left;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--pc-border);
  vertical-align: top;
}
.post-content thead th {
  background: var(--pc-surface);
  color: var(--pc-slate);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.post-content tbody tr:last-child td { border-bottom: 0; }

/* ==========================================================================
   Blocos de template — as peças que os templates de post montam
   ========================================================================== */

/* lead: parágrafo de abertura */
.post-content .post-lead {
  font-size: 1.15em;
  line-height: 1.65;
  color: var(--pc-slate);
  font-weight: 400;
}

/* caixa de destaque */
.post-content .post-callout {
  background: var(--pc-tint);
  border: 1px solid var(--pc-sage);
  border-radius: 12px;
  padding: 1rem 1.25rem;
}
.post-content .post-callout > * + * { margin-top: 0.6rem; }
.post-content .post-callout-title {
  font-weight: 700;
  color: var(--pc-green-ink);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.post-content .post-callout--warn { background: var(--pc-warn-bg); border-color: #e0cf94; }
.post-content .post-callout--warn .post-callout-title { color: var(--pc-warn-ink); }

/* veredito / resumo em caixa */
.post-content .post-verdict {
  border: 1px solid var(--pc-border);
  border-radius: 14px;
  background: #ffffff;
  padding: 1.25rem;
  display: grid;
  gap: 1rem;
}
@media (min-width: 640px) {
  .post-content .post-verdict { grid-template-columns: auto 1fr; align-items: center; }
}
.post-content .post-score {
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: var(--pc-tint);
  border: 2px solid var(--pc-sage);
  color: var(--pc-green-ink);
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.post-content .post-score small { display: block; font-size: 0.6rem; font-weight: 600; letter-spacing: 0.08em; color: var(--pc-green-ink); margin-top: 2px; }

/* prós e contras */
.post-content .post-balance { display: grid; gap: 1rem; }
@media (min-width: 640px) { .post-content .post-balance { grid-template-columns: 1fr 1fr; } }
.post-content .post-pros,
.post-content .post-cons {
  border: 1px solid var(--pc-border);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  background: #ffffff;
}
.post-content .post-pros { border-color: var(--pc-sage); background: var(--pc-tint); }
.post-content .post-cons { border-color: #e6c3c3; background: var(--pc-danger-bg); }
.post-content .post-pros h4 { color: var(--pc-green-ink); font-size: 0.82rem; letter-spacing: 0.06em; text-transform: uppercase; }
.post-content .post-cons h4 { color: var(--pc-danger-ink); font-size: 0.82rem; letter-spacing: 0.06em; text-transform: uppercase; }
.post-content .post-pros ul,
.post-content .post-cons ul { margin-top: 0.6rem; padding-left: 1.1rem; }
.post-content .post-pros li::marker { color: var(--pc-green-ink); }
.post-content .post-cons li::marker { color: var(--pc-danger-ink); }

/* ficha de especificações */
.post-content .post-specs {
  border: 1px solid var(--pc-border);
  border-radius: 12px;
  overflow: hidden;
  background: #ffffff;
}
.post-content .post-specs dl { margin: 0; display: grid; grid-template-columns: 1fr; }
@media (min-width: 560px) { .post-content .post-specs dl { grid-template-columns: repeat(2, 1fr); } }
.post-content .post-specs div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--pc-border);
}
.post-content .post-specs dt { color: var(--pc-muted); font-size: 0.85rem; }
.post-content .post-specs dd { margin: 0; color: var(--pc-ink); font-weight: 600; font-size: 0.9rem; text-align: right; }

/* grid de cards */
.post-content .post-grid { display: grid; gap: 1rem; }
@media (min-width: 640px) { .post-content .post-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .post-content .post-grid--3 { grid-template-columns: repeat(3, 1fr); } }
.post-content .post-pick {
  border: 1px solid var(--pc-border);
  border-radius: 12px;
  background: #ffffff;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.post-content .post-pick img { border-radius: 8px; aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
.post-content .post-pick-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pc-green-ink);
  background: var(--pc-tint);
  border-radius: 4px;
  padding: 0.15rem 0.4rem;
  align-self: flex-start;
}
.post-content .post-pick h3 { font-size: 1.05rem; margin: 0; }
.post-content .post-pick p { font-size: 0.9rem; color: var(--pc-muted); flex: 1 1 auto; }

/* FAQ */
.post-content .post-faq { display: flex; flex-direction: column; gap: 0.5rem; }
.post-content .post-faq details {
  border: 1px solid var(--pc-border);
  border-radius: 10px;
  background: #ffffff;
  padding: 0.75rem 1rem;
}
.post-content .post-faq summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--pc-slate);
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}
.post-content .post-faq summary::-webkit-details-marker { display: none; }
.post-content .post-faq summary::after {
  content: "+";
  color: var(--pc-sage);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1;
  flex: 0 0 auto;
}
.post-content .post-faq details[open] summary::after { content: "–"; }
.post-content .post-faq details[open] summary { margin-bottom: 0.6rem; }
.post-content .post-faq summary:focus-visible { outline: 2px solid var(--pc-green); outline-offset: 2px; border-radius: 4px; }

/* CTA */
.post-content .post-cta {
  border: 1px solid var(--pc-sage);
  background: var(--pc-tint);
  border-radius: 14px;
  padding: 1.25rem 1.4rem;
  text-align: center;
}
.post-content .post-cta > * + * { margin-top: 0.65rem; }
.post-content .post-cta h3 { color: var(--pc-green-ink); margin: 0; }
.post-content .post-cta p { color: var(--pc-slate); font-size: 0.95rem; }
.post-content .post-cta-btn {
  display: inline-block;
  background: var(--pc-green);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.6rem 1.4rem;
  border-radius: 8px;
  text-decoration: none;
  transition: background-color 150ms cubic-bezier(0.2, 0, 0, 1);
}
.post-content .post-cta-btn:hover { background: #3a5f27; text-decoration: none; }
.post-content .post-cta-btn:focus-visible { outline: 2px solid var(--pc-green); outline-offset: 3px; }

/* nota do autor */
.post-content .post-note {
  font-size: 0.85rem;
  color: var(--pc-subtle);
  border-top: 1px solid var(--pc-border);
  padding-top: 0.9rem;
}

@media (prefers-reduced-motion: reduce) {
  .post-content * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
