/* =============================================================
   Blog Post – estilos da página de post individual
   ============================================================= */

/* PAGE HERO: estilos base definidos em main.css */

/* ── POST HERO ───────────────────────────────────────────── */
.post-hero {
  background-color: var(--primary-container);
  padding: 120px 0 50px;
  position: relative;
  overflow: hidden;
}
.post-hero .page-hero-img     { position: absolute; inset: 0; z-index: 0; }
.post-hero .page-hero-img img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }
.post-hero .page-hero-overlay { position: absolute; inset: 0; z-index: 1; background: linear-gradient(to right, rgba(10,16,46,.92) 0%, rgba(14,21,58,.82) 45%, rgba(14,21,58,.60) 100%); }
.post-hero .container         { position: relative; z-index: 2; }
.post-hero .page-hero-title {
  max-width: 720px;
}

.post-hero-meta {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-top: 1.5rem;
  font-size: 14px;
  color: rgba(255,255,255,.6);
}
.post-hero-meta time,
.post-hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}
.post-hero-meta svg {
  opacity: .6;
}
.post-hero-sep {
  width: 1px;
  height: 16px;
  background: rgba(255,255,255,.2);
}

/* ── BARRA DE PROGRESSO DE LEITURA ───────────────────────── */
.reading-progress-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: transparent;
  z-index: 9999;
  pointer-events: none;
}
.reading-progress-bar {
  height: 100%;
  background: var(--secondary-cta); /* Verde floresta */
  width: 0%;
  transition: width 0.1s ease;
}

/* ── LAYOUT POST (conteúdo + sidebar) ────────────────────── */
.post-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 3.5rem;
  align-items: start;
}

/* ── CORPO DO POST ───────────────────────────────────────── */
.post-body {
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: break-word;
}

/* Tipografia do conteúdo gerado */
.post-body h2 {
  font-family: 'Manrope', sans-serif;
  font-size: clamp(22px, 2.5vw, 28px);
  font-weight: 800;
  color: var(--primary);
  line-height: 1.25;
  margin: 2.5rem 0 1rem;
  letter-spacing: -.01em;
}
.post-body h2:first-child { margin-top: 0; }

.post-body h3 {
  font-family: 'Manrope', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.3;
  margin: 2rem 0 .75rem;
}

.post-body p {
  font-size: 16px;
  line-height: 1.8;
  color: var(--on-surface);
  margin-bottom: 1.25rem;
}

.post-body strong {
  color: var(--primary);
  font-weight: 700;
}

.post-body a {
  color: #229CFF;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(34,156,255,.25);
  transition: border-color .2s;
}
.post-body a:hover {
  border-color: #229CFF;
}

.post-body ul,
.post-body ol {
  margin: 1rem 0 1.5rem 1.5rem;
  font-size: 16px;
  line-height: 1.8;
  color: var(--on-surface);
}
.post-body li {
  margin-bottom: .5rem;
}
.post-body li::marker {
  color: var(--secondary-cta);
}

/* Imagens dentro do corpo */
.post-body img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,.1);
}
.post-body figure {
  margin: 2rem 0;
  text-align: center;
}
.post-body figcaption {
  font-size: .85rem;
  color: var(--on-surface-v);
  margin-top: .6rem;
  font-style: italic;
}

/* Blockquote */
.post-body blockquote {
  border-left: 4px solid var(--secondary-cta);
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
  background: rgba(253,107,52,.04);
  border-radius: 0 12px 12px 0;
  font-size: 17px;
  line-height: 1.7;
  color: var(--on-surface);
  font-style: italic;
}

/* ── SIDEBAR ─────────────────────────────────────────────── */
.post-sidebar {
  position: sticky;
  top: 100px;
}

/* Widgets da Sidebar */
.sidebar-widget {
  background: #fff;
  border: 1px solid var(--outline-v);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.sidebar-widget-title {
  font-family: 'Manrope', sans-serif;
  font-size: 14px;
  font-weight: 800;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}

/* Categorias */
.sidebar-cat-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.sidebar-cat-list li {
  margin-bottom: .5rem;
}
.sidebar-cat-list li:last-child {
  margin-bottom: 0;
}
.sidebar-cat-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--on-surface-v);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: .5rem 0;
  border-bottom: 1px dashed var(--outline-v);
  transition: all .2s;
}
.sidebar-cat-list li:last-child .sidebar-cat-link {
  border-bottom: none;
}
.sidebar-cat-link:hover {
  color: #229CFF;
}
.sidebar-cat-count {
  background: var(--surface-low);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 12px;
  color: var(--on-surface-v);
}
.sidebar-cat-link:hover .sidebar-cat-count {
  background: rgba(34,156,255,.1);
  color: #229CFF;
}

/* Posts Recentes */
.sidebar-recent-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.sidebar-recent-item {
  display: flex;
  flex-direction: column;
  gap: .25rem;
}
.sidebar-recent-item:not(:last-child) {
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--outline-v);
}
.sidebar-recent-date {
  font-size: 12px;
  color: var(--on-surface-v);
}
.sidebar-recent-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  line-height: 1.4;
  transition: color .2s;
}
.sidebar-recent-title:hover {
  color: #229CFF;
}

/* Card compartilhar */
.post-share-card {
  background: #fff;
  border: 1px solid var(--outline-v);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.post-share-title {
  font-family: 'Manrope', sans-serif;
  font-size: 14px;
  font-weight: 800;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 1rem;
}

.post-share-links {
  display: flex;
  gap: .6rem;
}

.post-share-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--outline-v);
  background: var(--surface-low);
  cursor: pointer;
  transition: all .2s;
  color: var(--on-surface-v);
  text-decoration: none;
}
.post-share-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
}

.post-share-btn--whatsapp:hover { background: #25d366; color: #fff; border-color: #25d366; }
.post-share-btn--linkedin:hover { background: #0077b5; color: #fff; border-color: #0077b5; }
.post-share-btn--email:hover    { background: #EA4335; color: #fff; border-color: #EA4335; }
.post-share-btn--copy:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.post-share-btn--copy.copied { background: #459A4E; color: #fff; border-color: #459A4E; }

/* Botão voltar */
.post-back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  width: 100%;
  padding: .85rem 1rem;
  background: var(--surface-low);
  color: var(--on-surface-v);
  border: 1px solid var(--outline-v);
  border-radius: 12px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all .2s;
}
.post-back-btn:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: rgba(29,44,111,.03);
}

/* ── POSTS RELACIONADOS ──────────────────────────────────── */
.post-related {
  background: var(--surface-low);
  border-top: 1px solid var(--outline-v);
}
.post-related .blog-listing-header {
  text-align: center;
}

.blog-grid--related {
  grid-template-columns: repeat(3, 1fr);
}

/* ── CTA ─────────────────────────────────────────────────── */
.post-cta {
  background: var(--secondary-cta);
  padding: 4rem 0;
}
.post-cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}
.post-cta-title {
  font-family: 'Manrope', sans-serif;
  font-size: clamp(22px, 2.5vw, 30px);
  font-weight: 700;
  color: #fff;
  line-height: 1.25;
  margin-bottom: .4rem;
}
.post-cta-sub {
  font-size: 16px;
  color: rgba(255,255,255,.82);
}
.post-cta .btn-cta {
  background: #fff;
  color: var(--primary);
}
.post-cta .btn-cta:hover {
  background: rgba(255,255,255,.9);
  box-shadow: 0 4px 20px rgba(0,0,0,.18);
  transform: translateY(-1px);
}

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 1024px) {
  .post-layout {
    grid-template-columns: 1fr 240px;
    gap: 2.5rem;
  }
  .blog-grid--related { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .post-hero { padding: 100px 0 40px; }

  .post-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .post-sidebar {
    position: static;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
  }
  .sidebar-widget { margin-bottom: 0; }
  .post-share-card { margin-bottom: 0; }
  .post-back-btn { width: 100%; }

  .post-body h2 { font-size: 22px; margin: 2rem 0 .75rem; }
  .post-body h3 { font-size: 18px; }
  .post-body p  { font-size: 15px; line-height: 1.75; }

  .blog-grid--related { grid-template-columns: 1fr; max-width: 520px; margin: 0 auto; }

  .post-cta-inner { flex-direction: column; text-align: center; }
  .post-cta .btn { width: 100%; justify-content: center; }

  .post-hero-meta { flex-wrap: wrap; gap: .75rem; }
}
