/* Centraliza o header no topo */
.blog-post-header {
  width: 100%;
  text-align: center;
  margin: 0px 0 40px 0;
}

.blog-post-header h3 {
  font-size: 2rem;
  margin-bottom: 12px;
}

.blog-post-header a {
  color: #FFFFFF;
  text-decoration: none;
}

.blog-post-header a:hover {
  color: #0766E4;
}

.blog-post-header div {
  display: flex;
  justify-content: center;
  gap: 18px;
  font-size: 1rem;
  opacity: 0.85;
}

/* Layout principal: textos à esquerda, sumário/imagens à direita */
.main-content {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  max-width: 1200px;
  margin: 0 auto;
  gap: 40px;
  padding: 0 20px;
}

.main-content h1 {
  color: #0766E4;
  line-height: 2.5;
}

.main-content h2 {
  color: #0766E4;
  line-height: 2.5;
}

.main-content p {
  line-height: 2.5;
  font-size: 18px;
}

.main-content li {
  line-height: 2.5;
  font-size: 18px;
}

.main-content a {
  color: #FFFFFF;
  text-decoration: none;
}

.main-content a:hover {
  color: #0766E4;
}

/* Área de textos (section) */
.main-content section {
  flex: 1.1;
  /* diminua esse valor para deixar a área de texto mais estreita */
  max-width: 900px;
  /* limite a largura máxima do texto */
  min-width: 0;
  text-align: left;
  order: 2;
}

/* Área lateral (sumário e imagens) */
/* No seu CSS, adicione ou altere o estilo do aside */
.main-content aside {
  flex: 1;
  min-width: 250px;
  max-width: 350px;
  border-radius: 12px;
  padding: 24px 16px;
  margin-top: 0;
  position: sticky;
  top: 32px;
  /* Distância do topo ao rolar */
  align-self: flex-start;
  /* Garante o sticky */
  height: fit-content;
  /* Altura só do conteúdo */
  z-index: 10;
  order: 1;
}

.section-escritor {
  display: flex;
  align-items: center;
  margin: 50px 200px 50px 100px;
}

.section-escritor a {
  text-decoration: none;
  color: #FFFFFF;
}

.section-escritor a:hover {
  color: #0766E4;
}

.escritor-img {
  width: 100px;
  height: 100px;
  border-radius: 5px;
  margin-right: 32px;
  /* Espaço entre imagem e texto */
  margin-left: 60px;
  /* Anula margem à esquerda */
  display: block;
}

.director-text {
  text-align: left;
  font-size: 18px;
  /* Se quiser limitar a largura do texto ou controlar o espaço, ajuste aqui */
}

.toc {
  background: #181818;
  padding: 12px 18px;
  border-radius: 8px;
  color: #FFFFFF;
  max-height: 500px;
  /* Defina a altura máxima que deseja! */
  overflow-y: auto;
  /* Oculta a scrollbar no Chrome, Edge, Safari */
  scrollbar-width: none;
  /* Para Firefox */
  -ms-overflow-style: none;
  /* Para IE e Edge antigos */
}

.toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.toc li {
  margin-bottom: 4px;
  font-size: 0.9rem;
  line-height: 1.5;
}

.toc a {
  color: #FFFFFF;
  text-decoration: none;
  transition: color 0.2s;
}

.toc a:hover {
  color: #0766E4;
}

/* Destaque o link ativo do sumário */
.toc a.toc-ativo {
  color: #0766E4 !important;
  font-weight: bold;
}

.toc::-webkit-scrollbar {
  width: 6px;
  display: none;
}

.toc::-webkit-scrollbar-thumb {
  background: #222e41;
  border-radius: 3px;
}

.toc::-webkit-scrollbar-track {
  background: transparent;
}

#progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 4px;
  background: #0766E4;
  z-index: 9999;
  transition: width 0.2s;
}

/* Media Query para telas mobile (até 768px) */
@media (max-width: 768px) {

  /* Ajustes gerais para mobile */
  body {
    font-size: 16px;
    /* Reduz ligeiramente o tamanho da fonte para melhor legibilidade */
  }

  /* Header do post: centralizado, mas com margens menores */
  .blog-post-header {
    margin: 20px 0 30px 0;
    padding: 0 15px;
  }

  .blog-post-header h3 {
    font-size: 1.8rem;
    /* Reduz o tamanho do título */
  }

  .blog-post-header div {
    flex-direction: column;
    /* Empilha os itens de autor/data/leitura */
    gap: 8px;
    font-size: 0.9rem;
  }

  /* Layout principal: muda para coluna em mobile */
  .main-content {
    flex-direction: column;
    /* Empilha section e aside verticalmente */
    gap: 20px;
    padding: 0 15px;
    /* Margens laterais menores */
    max-width: 100%;
  }

  /* Área de textos (section) */
  .main-content section {
    flex: none;
    /* Remove o flex-grow */
    max-width: 100%;
    /* Ocupa toda a largura */
    order: 2;
    /* Mantém abaixo do aside se quiser, ou mude para 1 para inverter */
  }

  /* Área lateral (sumário): agora full-width e não sticky */
  .main-content aside {
    flex: none;
    min-width: 100%;
    max-width: 100%;
    position: static;
    /* Remove o sticky para mobile */
    order: 1;
    /* Coloca o sumário acima do conteúdo principal */
    margin-top: 0;
    padding: 16px;
  }

  .toc {
    max-height: none;
    /* Remove limitação de altura em mobile */
    overflow-y: visible;
  }

  .toc li {
    font-size: 1rem;
    /* Aumenta ligeiramente para toque */
  }

  /* Ajustes para textos e listas */
  .main-content h1,
  .main-content h2 {
    font-size: 1.5rem;
    /* Reduz tamanhos de headings */
    line-height: 1.8;
  }

  .main-content p,
  .main-content li {
    font-size: 16px;
    line-height: 1.8;
  }

  /* Imagens: responsivas, full-width */
  .main-content img {
    width: 100% !important;
    height: auto;
    max-width: 100%;
  }

  /* Seção do escritor: empilha verticalmente */
  .section-escritor {
    flex-direction: column;
    align-items: center;
    margin: 40px 15px;
    text-align: center;
  }

  .escritor-img {
    width: 80px;
    height: 80px;
    margin: 0 0 20px 0;
    /* Centraliza e adiciona espaço abaixo */
  }

  .director-text {
    font-size: 16px;
  }

  /* Barra de progresso: mantém, mas ajusta se necessário */
  #progress-bar {
    height: 3px;
    /* Levemente mais fina para mobile */
  }

  /* Outros ajustes: breadcrumb, etc. */
  .breadcrumb {
    padding: 0 15px;
  }

  .breadcrumb ol {
    flex-wrap: wrap;
    /* Permite quebra se necessário */
  }
}

/* Media Query para telas muito pequenas (até 480px) - ajustes extras se precisar */
@media (max-width: 480px) {
  .blog-post-header h3 {
    font-size: 1.5rem;
  }

  .main-content h1,
  .main-content h2 {
    font-size: 1.3rem;
  }

  .main-content p,
  .main-content li {
    font-size: 14px;
  }

  .escritor-img {
    width: 60px;
    height: 60px;
  }
}