/* Garante que [hidden] funciona mesmo com display: flex ou grid */
[hidden] { display: none !important; }

/* ── Loading ── */
.post-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 60vh;
  font-size: 0.9rem;
  opacity: 0.55;
  color: var(--text-color);
}

.post-loading__spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

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

/* ── Erro ── */
.post-erro {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.post-erro__inner {
  text-align: center;
  max-width: 480px;
}

.post-erro__inner h1 {
  font-size: 1.8rem;
  margin-bottom: 12px;
}

.post-erro__inner p {
  opacity: 0.65;
  margin-bottom: 28px;
}

/* ── Main ── */
.post-main {
  padding-top: 80px; /* compensa header fixo */
}

/* ── Artigo ── */
.post-artigo {
  max-width: 760px;
  margin: 0 auto;
  padding: 60px 24px 100px;
}

/* Breadcrumb */
.post-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  opacity: 0.55;
  margin-bottom: 36px;
  flex-wrap: wrap;
}

.post-breadcrumb a {
  color: var(--text-color);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

.post-breadcrumb span {
  color: var(--text-color);
}

/* Cabeçalho */
.post-header {
  margin-bottom: 40px;
}

.post-categoria {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 14px;
  border-radius: 999px;
  background: rgba(92, 223, 242, 0.1);
  color: var(--primary-color);
  border: 1px solid rgba(92, 223, 242, 0.2);
  margin-bottom: 20px;
}

html.light .post-categoria {
  background: rgba(0, 119, 255, 0.08);
  border-color: rgba(0, 119, 255, 0.2);
}

.post-titulo {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-color);
  margin-bottom: 20px;
}

.post-resumo {
  font-size: 1.1rem;
  line-height: 1.75;
  opacity: 0.72;
  margin-bottom: 24px;
  color: var(--text-color);
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border-color);
}

.post-meta__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  opacity: 0.5;
  color: var(--text-color);
}

.post-meta__item svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* Imagem de capa */
.post-capa {
  margin: 36px 0 48px;
  border-radius: 16px;
  overflow: hidden;
}

.post-capa img {
  width: 100%;
  height: auto;
  display: block;
  max-height: 480px;
  object-fit: cover;
}

/* ── Conteúdo do artigo (Portable Text) ── */
.post-conteudo {
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--text-color);
}

.post-conteudo p {
  margin-bottom: 1.5rem;
  opacity: 0.88;
}

.post-conteudo h2 {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 2.5rem 0 1rem;
  color: var(--text-color);
}

.post-conteudo h3 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.35;
  margin: 2rem 0 0.75rem;
  color: var(--text-color);
}

.post-conteudo strong {
  font-weight: 700;
  color: var(--text-color);
  opacity: 1;
}

.post-conteudo em {
  font-style: italic;
}

.post-conteudo a {
  color: var(--primary-color);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.post-conteudo a:hover {
  opacity: 0.8;
}

.post-conteudo blockquote {
  border-left: 3px solid var(--primary-color);
  padding: 1rem 1.5rem;
  margin: 2rem 0;
  background: rgba(92, 223, 242, 0.05);
  border-radius: 0 12px 12px 0;
  font-style: italic;
  opacity: 0.85;
}

html.light .post-conteudo blockquote {
  background: rgba(0, 119, 255, 0.04);
}

.post-conteudo ul,
.post-conteudo ol {
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
}

.post-conteudo ul { list-style: disc; }
.post-conteudo ol { list-style: decimal; }

.post-conteudo li {
  margin-bottom: 0.5rem;
  opacity: 0.88;
}

/* Imagem dentro do artigo */
.post-conteudo figure {
  margin: 2rem 0;
}

.post-conteudo figure img {
  width: 100%;
  border-radius: 12px;
  display: block;
}

.post-conteudo figcaption {
  font-size: 0.82rem;
  opacity: 0.5;
  text-align: center;
  margin-top: 8px;
}

/* ── CTA final ── */
.post-cta-final {
  margin: 64px 0 48px;
  padding: 48px 40px;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  text-align: center;
}

.post-cta-final p {
  font-size: 0.85rem;
  opacity: 0.55;
  margin-bottom: 8px;
  color: var(--text-color);
}

.post-cta-final h2 {
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  font-weight: 700;
  margin-bottom: 28px;
  color: var(--text-color);
  line-height: 1.3;
}

.post-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 32px;
  border-radius: 999px;
  background: var(--primary-color);
  color: var(--btn-text);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.post-cta-btn svg {
  width: 16px;
  height: 16px;
}

.post-cta-btn:hover {
  transform: translateY(-3px);
  opacity: 0.9;
}

/* ── Botão voltar ── */
.post-voltar {
  padding-top: 32px;
  border-top: 1px solid var(--border-color);
}

.post-btn-voltar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-color);
  text-decoration: none;
  opacity: 0.65;
  transition: opacity 0.3s ease, color 0.3s ease;
}

.post-btn-voltar svg {
  width: 16px;
  height: 16px;
}

.post-btn-voltar:hover {
  opacity: 1;
  color: var(--primary-color);
}

/* ── Responsivo ── */
@media (max-width: 768px) {
  .post-artigo {
    padding: 40px 20px 80px;
  }

  .post-cta-final {
    padding: 36px 24px;
  }

  .post-conteudo h2 {
    font-size: 1.4rem;
  }

  .post-conteudo h3 {
    font-size: 1.15rem;
  }
}