/* single.css — Página de POST INDIVIDUAL (single.php).
   Etapa atual: CABEÇALHO do post (breadcrumb, tag de categoria, título,
   descrição/excerpt e meta com 4 ícones SVG inline) + estrutura de 2 colunas.

   NÃO estilizado nesta etapa: imagem destacada, player de áudio,
   conteúdo do texto e sidebar (Atalhos/banner). Esses entram em prompts
   seguintes. A estrutura de 2 colunas já fica pronta para receber.

   Cores do M&G (alinhadas com blog.css):
   - laranja .........: #E57C26
   - texto escuro ....: #0D0D0D
   - cinza meta ......: #666666
   - branco bg .......: #FFFFFF
*/

/* ============================================================
   FUNDO CLARO ESCOPADO AO POST
   ------------------------------------------------------------
   body do tema é #0E0E0E (style.css). blog.css já força branco
   nas páginas de listagem; aqui forçamos no post individual.
   padding-top compensa a navbar fixa (68px desktop / 60px <=1049px / 68px <=430px).
   ============================================================ */

html,
body.single {
  overflow-x: clip;
}

body.single {
  background-color: #FFFFFF;
  padding-top: 68px;
}

@media (max-width: 1049px) {
  body.single {
    /* Navbar mobile = 60px (navbar.css @media max-width:1049px) */
    padding-top: 60px;
  }
}

@media (max-width: 430px) {
  body.single {
    /* Navbar volta a 68px nessa faixa (navbar.css @media max-width:430px) */
    padding-top: 68px;
  }
}

/* ============================================================
   WRAPPER PRINCIPAL — container 1220px centralizado
   ============================================================ */

.post-template {
  width: 100%;
  max-width: 1220px;
  margin: 0 auto;
  padding: 32px 20px 64px;
  color: #0D0D0D;
  font-family: 'Montserrat', sans-serif;
}

/* ============================================================
   BREADCRUMB — "Blog > Categoria > Título do artigo"
   ------------------------------------------------------------
   Links (Blog, Categoria) sublinhados e escuros (#0D0D0D).
   Separadores ">" e o título atual em cinza (#666666).
   ============================================================ */

.post-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 11px;
  margin: 0 0 32px;
  font-size: 15.5px;
  font-weight: 300;
  line-height: 1.4;
}

.post-breadcrumb a {
  color: #0D0D0D;
  text-decoration: underline;
}

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

.post-breadcrumb span {
  color: #666666;
}

/* ============================================================
   2 COLUNAS — artigo (790px) + sidebar (flex, ~400px)
   ------------------------------------------------------------
   Estrutura pronta; sidebar será estilizada em prompt futuro.
   ============================================================ */

.post-content-wrapper {
  display: flex;
  gap: 30px;
  align-items: stretch;
}

.post-main-content {
  flex: 0 0 790px;
  max-width: 790px;
  min-width: 0;
}

.post-sidebar {
  flex: 1 1 auto;
  min-width: 0;
}

/* ============================================================
   TAG DE CATEGORIA — pill laranja
   ============================================================ */

.post-category {
  margin: 0 0 32px;
}

.post-category span {
  display: inline-block;
  width: fit-content;
  padding: 8px 10px;
  background-color: var(--color-primary-dark);
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  border-radius: 21px;
}

/* ============================================================
   TÍTULO + DESCRIÇÃO
   ============================================================ */

.post-title {
  margin: 0 0 10px;
  font-size: 32px;
  font-weight: 700;
  line-height: 1.1;
  color: #0D0D0D;
}

.post-description {
  margin: 0 0 30px;
  font-size: 16px;
  font-weight: 300;
  line-height: 1.4;
  color: #0D0D0D;
}

.post-description p {
  margin: 0;
}

/* ============================================================
   META — 4 itens com ÍCONE + texto
   ------------------------------------------------------------
   Cada .meta-item é inline-flex com ícone (::before) à esquerda.
   Ícones SVG inline via background-image (data URI) — sem requests
   extras e sem mexer no markup. Stroke #666666 combinando com o
   texto. Ordem fixa no single.php: (1) data publicação, (2) data
   modificação, (3) tempo de leitura, (4) autor.
   ============================================================ */

.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  margin: 0 0 32px;
}

.post-meta .meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  color: #666666;
}

.post-meta .meta-item::before {
  content: '';
  display: inline-block;
  width: 20px;
  height: 20px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  flex-shrink: 0;
}

/* (1) Calendário — data de publicação */
.post-meta .meta-item:nth-child(1)::before {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666666' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3Cline x1='8' y1='3' x2='8' y2='7'/%3E%3Cline x1='16' y1='3' x2='16' y2='7'/%3E%3C/svg%3E");
}

/* (2) Lápis sobre quadrado — data de modificação */
.post-meta .meta-item:nth-child(2)::before {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666666' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7'/%3E%3Cpath d='M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z'/%3E%3C/svg%3E");
}

/* (3) Relógio — tempo de leitura */
.post-meta .meta-item:nth-child(3)::before {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666666' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpolyline points='12 7 12 12 16 14'/%3E%3C/svg%3E");
}

/* (4) User em círculo — autor */
.post-meta .meta-item:nth-child(4)::before {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666666' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3Cpath d='M6.5 19c1.5-2.5 3.5-4 5.5-4s4 1.5 5.5 4'/%3E%3C/svg%3E");
}

/* ============================================================
   IMAGEM DESTACADA — proporção 790x492, cantos RETOS
   ------------------------------------------------------------
   Sem border-radius (Figma do artigo usa cantos retos — diferente
   do card da listagem, onde o radius 20px é mantido em blog.css).
   aspect-ratio mantém 790x492 independente da altura real da img;
   object-fit: cover recorta o necessário se a imagem fugir da
   proporção (esperado — qualquer imagem se encaixa na moldura).
   ============================================================ */

.post-featured-image {
  margin: 0 0 32px;
  width: 100%;
  aspect-ratio: 790 / 492;
  overflow: hidden;
}

.post-featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ============================================================
   CAIXA DO PLAYER DE ÁUDIO — só o container (placeholder visual)
   ------------------------------------------------------------
   Estilos preparados para receber o markup do player em prompt
   futuro. Hoje o single.php tem apenas um comentário no lugar do
   player; quando o markup entrar (h3 "Áudiodescrição" + caixa
   .custom-audio-player), estas regras já se aplicam. Os controles
   internos (play / barra / tempo) NÃO são desenhados aqui.
   ============================================================ */

.audio-description {
  margin: 0 0 32px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.audio-description h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.2;
  color: #4A4A4A;
}

.custom-audio-player {
  width: 100%;
  height: 52px;
  background: #FFFFFF;
  border: 1px solid #E6E6E6;
  border-radius: 10px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
}

/* Botão play/pause — sem ação por enquanto (disabled).
   Recebe o JS de áudio em etapa futura, junto com o ResponsiveVoice. */
.custom-audio-player .play-pause-btn {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: #4A4A4A;
}

.custom-audio-player .play-pause-btn[disabled] {
  cursor: not-allowed;
  opacity: 0.6;
}

.custom-audio-player .play-pause-btn svg {
  width: 20px;
  height: 20px;
  display: block;
}

/* Barra de progresso (input range) — reset cross-browser básico. */
.custom-audio-player .progress-bar {
  flex: 1;
  min-width: 0;
  height: 4px;
  margin: 0;
  padding: 0;
  background: #E6E6E6;
  border-radius: 2px;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.custom-audio-player .progress-bar[disabled] {
  cursor: not-allowed;
}

.custom-audio-player .progress-bar::-webkit-slider-runnable-track {
  height: 4px;
  background: #E6E6E6;
  border-radius: 2px;
}

.custom-audio-player .progress-bar::-moz-range-track {
  height: 4px;
  background: #E6E6E6;
  border-radius: 2px;
}

.custom-audio-player .progress-bar::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  background: #4A4A4A;
  border-radius: 50%;
  margin-top: -4px;
  border: none;
}

.custom-audio-player .progress-bar::-moz-range-thumb {
  width: 12px;
  height: 12px;
  background: #4A4A4A;
  border-radius: 50%;
  border: none;
}

.custom-audio-player .time-remaining {
  flex-shrink: 0;
  font-size: 14px;
  color: #4A4A4A;
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   CONTEÚDO DO ARTIGO (.post-content) — HTML do the_content()
   ------------------------------------------------------------
   Parágrafos light 20px com line-height confortável (1.6),
   subtítulos bold, links laranja, listas legíveis. As imagens
   internas herdam border-radius para combinar com a destaque.
   ============================================================ */

.post-content {
  font-size: 16px;
  font-weight: 300;
  line-height: 1.6;
  color: #0D0D0D;
}

.post-content>*:first-child {
  margin-top: 0;
}

.post-content>*:last-child {
  margin-bottom: 0;
}

.post-content p {
  margin: 0 0 20px;
}

.post-content h2 {
  margin: 40px 0 16px;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.25;
  color: #0D0D0D;
}

.post-content h3 {
  margin: 32px 0 14px;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.3;
  color: #0D0D0D;
}

.post-content h4 {
  margin: 24px 0 12px;
  font-size: 19px;
  font-weight: 600;
  line-height: 1.3;
  color: #0D0D0D;
}

.post-content a {
  color: var(--color-primary-dark);
  text-decoration: underline;
}

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

.post-content strong,
.post-content b {
  font-weight: 600;
}

.post-content em,
.post-content i {
  font-style: italic;
}

.post-content ul,
.post-content ol {
  margin: 0 0 20px;
  padding-left: 24px;
}

.post-content ul li,
.post-content ol li {
  margin-bottom: 8px;
}

.post-content ul li::marker {
  color: var(--color-primary-dark);
}

.post-content ol li::marker {
  color: var(--color-primary-dark);
  font-weight: 600;
}

.post-content blockquote {
  margin: 24px 0;
  padding: 12px 0 12px 20px;
  border-left: 4px solid var(--color-primary-dark);
  color: #4A4A4A;
  font-style: italic;
}

.post-content img {
  max-width: 100%;
  height: auto;
  margin: 24px 0;
  border-radius: 12px;
  display: block;
}

.post-content figure {
  margin: 24px 0;
}

.post-content figure img {
  margin: 0;
}

.post-content figcaption {
  margin-top: 8px;
  font-size: 14px;
  color: #666666;
  text-align: center;
}

.post-content hr {
  margin: 32px 0;
  border: 0;
  border-top: 1px solid #E0E0E0;
}

/* ============================================================
   SIDEBAR — caixa "Atalhos" (.post-index)
   ------------------------------------------------------------
   Caixa branca com borda laranja, sombra suave. Os <li> recebem
   classes .index-level-2 / .index-level-3 vindas do helper PHP;
   indento os de nível 3 para sugerir hierarquia.
   ============================================================ */

.post-sidebar {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.post-index {
  background-color: #FFFFFF;
  border: 1px solid var(--color-primary-dark);
  border-radius: 20px;
  padding: 26px 25px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  box-sizing: border-box;
}

.post-index h3 {
  margin: 0 0 20px;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--color-primary-dark);
}

/* Numeração via CSS counter — mantém <ul> com list-style: none e
   permite controlar a cor exata do número (#4A4A4A) de forma robusta
   cross-browser (estilizar ::marker em <ol> não cobre todos os navegadores). */
.post-index ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  counter-reset: post-index-counter;
}

.post-index ul li {
  margin: 0;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.3;
  color: #4A4A4A;
  counter-increment: post-index-counter;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.post-index ul li::before {
  content: counter(post-index-counter) ".";
  color: #4A4A4A;
  font-weight: 500;
  flex-shrink: 0;
}

.post-index ul li a {
  color: #4A4A4A;
  text-decoration: none;
  transition: color 0.2s ease;
}

.post-index ul li a:hover {
  color: var(--color-primary-dark);
}

.sidebar-banner {
  position: sticky;
  top: 115px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  width: 100%;
  height: 515px;
  padding: 0 36px 15px;
  background-color: #171717;
  background-image: url("../../images/blog/img-fundo-andre-artigo.webp");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border: 1px solid var(--color-primary);
  border-radius: 20px;
  box-shadow: 0 4px 12.2px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  box-sizing: border-box;
}

.sidebar-banner__mentor {
  position: absolute;
  bottom: 0;
  left: -3%;
  width: 110%;
  height: auto;
  z-index: 1;
  pointer-events: none;
  user-select: none;
}

.sidebar-banner::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 42%;
  background: linear-gradient(180deg, rgba(23, 23, 23, 0) 0%, var(--color-primary) 100%);
  pointer-events: none;
  z-index: 2;
}

.sidebar-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 40%, rgba(255, 255, 255, 0.20) 0%, rgba(255, 255, 255, 0) 60%);
  pointer-events: none;
  z-index: 0;
}

.sidebar-banner__content {
  position: relative;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-banner__text {
  background-color: #171717;
  border: 1px solid var(--color-primary);
  border-radius: 17px;
  padding: 8px 22px;
  box-shadow: 0 5px 4.6px -1px rgba(0, 0, 0, 0.35);
}

.sidebar-banner__text p {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.25;
  color: #FFFFFF;
  text-align: center;
}

.sidebar-banner__cta {
  display: block;
  padding: 17px;
  background: linear-gradient(166deg, var(--color-primary) 15.56%, var(--color-primary-dark) 99.82%);
  border: 1px solid #000000;
  border-radius: 12px;
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  box-sizing: border-box;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.sidebar-banner__cta:hover {
  transform: translateY(-1px);
  filter: brightness(0.95);
}

/* ============================================================
   RESPONSIVO — colapsa 2 colunas em <=991px (sidebar abaixo)
   ============================================================ */

@media (max-width: 991px) {
  .post-content-wrapper {
    flex-direction: column;
  }

  .post-main-content,
  .post-sidebar {
    flex: 1 1 auto;
    max-width: 100%;
    width: 100%;
  }
}

@media (max-width: 768px) {
  .post-sidebar {
    display: none;
  }

  .audio-description {
    display: none;
  }

  .post-breadcrumb {
    font-size: 9.5px;
    gap: 7px;
  }

  .post-category span {
    padding: 9.5px 12px;
    background-color: var(--color-primary);
    border-radius: 25px;
    font-size: 14.25px;
  }

  /* === REORDENAR BLOCOS DO ARTIGO NO MOBILE ===
     Ordem desktop (HTML): breadcrumb → tag → título → subtítulo → meta →
     IMAGEM → áudio → conteúdo.
     Ordem mobile (Figma) : breadcrumb → tag → IMAGEM → título → subtítulo →
     meta → áudio (hidden) → conteúdo.
     Todos são irmãos diretos de .post-main-content → CSS `order` resolve
     sem tocar no HTML. .post-main-content vira flex column só no mobile;
     no desktop continua como bloco normal. */
  .post-main-content {
    display: flex;
    flex-direction: column;
  }

  .post-breadcrumb {
    order: 1;
  }

  .post-category {
    order: 2;
  }

  .post-featured-image {
    order: 3;
  }

  .post-title {
    order: 4;
  }

  .post-description {
    order: 5;
  }

  .post-meta {
    order: 6;
  }

  .audio-description {
    order: 7;
  }

  .post-content {
    order: 8;
  }

  .post-template {
    padding: 24px 16px 48px;
  }

  /* Título mobile: 35px / 700 / uppercase / line-height 1.1 (Figma). */
  .post-title {
    font-size: 26px;
  }

  .post-description {
    font-size: 16px;
  }

  /* Meta em 2 LINHAS (Figma mobile): 2 itens por linha em space-between.*/
  .post-meta {
    justify-content: space-between;
    gap: 12px 0;
  }

  .post-meta .meta-item {
    flex: 0 1 48%;
    max-width: 48%;
    font-size: 17px;
  }

  .post-content {
    font-size: 16px;
  }

  .post-content h2 {
    font-size: 22px;
    margin: 32px 0 14px;
  }

  .post-content h3 {
    font-size: 19px;
    margin: 24px 0 12px;
  }

  .post-content h4 {
    font-size: 17px;
  }

  .audio-description h3 {
    font-size: 15px;
  }

  .post-index {
    padding: 22px 20px;
  }

  .post-index h3 {
    font-size: 15px;
  }

  .post-index ul li {
    font-size: 15px;
  }

  .sidebar-banner {
    padding: 0 24px 24px;
  }
}