/* Artigos do blog no padrão General (skill blog-padrao-general, 17/11/2026). Topo montado em inc/nm-artigo.php,
   comportamento em js/nm-artigo.js. Cores do site: roxo #4e2ec2 (links e destaques), azul #103464 (títulos),
   texto #2a2a2a, Montserrat. */

body.single-post {
  --nm-accent: #4e2ec2;
  --nm-accent-escuro: #3a2196;
  --nm-titulo: #103464;
  --nm-texto: #2a2a2a;
  --nm-listen-h: 92px;
}

/* Coluna do artigo: até 1240px; texto em 21,6px no computador. */
body.single-post #page-container .et_pb_row_0_tb_body { width: 90%; max-width: 1240px; }
body.single-post #page-container .et_pb_post_content_0_tb_body,
body.single-post #page-container .et_pb_code_2_tb_body { padding-left: 0 !important; padding-right: 0 !important; }
@media (min-width: 981px) {
  body.single-post #page-container .et_pb_post_content_0_tb_body { font-size: 21.6px; line-height: 1.7; }
  body.single-post #page-container .et_pb_post_content_0_tb_body p { line-height: 1.7; }
  body.single-post #page-container .et_pb_post_content_0_tb_body h2 { font-size: 30px; }
  body.single-post #page-container .et_pb_post_content_0_tb_body h3 { font-size: 25px; }
  body.single-post #page-container .et_pb_post_content_0_tb_body h4 { font-size: 22px; }
}

/* Topo ---------------------------------------------------------------------------------------------------- */
.nm-hero-wrap { margin-bottom: 0 !important; }
.nm-hero {
  display: grid;
  grid-template-columns: minmax(0, min(368px, 38%)) minmax(0, 1fr);
  grid-template-rows: auto auto auto 1fr;
  grid-template-areas: "img titulo" "img meta" "img tools" "img .";
  column-gap: 40px;
  margin: 0 0 36px;
}
.nm-hero--sem-foto { grid-template-columns: minmax(0, 1fr); grid-template-areas: "titulo" "meta" "tools"; grid-template-rows: auto; }
.nm-hero__titulo {
  grid-area: titulo;
  margin: 0;
  padding: 0;
  font-weight: 700;
  font-size: 38px;
  line-height: 1.15;
  color: var(--nm-titulo);
}
.nm-meta {
  grid-area: meta;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin: 14px 0 0;
}
.nm-meta__data { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 500; color: #555; }
.nm-meta__data svg { color: var(--nm-accent); flex-shrink: 0; }
.nm-tag {
  display: inline-flex;
  align-items: center;
  min-height: 0;
  padding: 4px 12px;
  border: 1px solid rgba(78, 46, 194, .25);
  border-radius: 999px;
  background: rgba(78, 46, 194, .07);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--nm-accent-escuro) !important;
  text-decoration: none !important;
  white-space: nowrap;
  transition: background-color .15s ease, border-color .15s ease;
}
a.nm-tag:hover { background: rgba(78, 46, 194, .14); border-color: rgba(78, 46, 194, .45); }
a.nm-tag:focus-visible { outline: 2px solid var(--nm-accent); outline-offset: 2px; }

.nm-hero__img { grid-area: img; align-self: start; margin: 0; padding: 0; line-height: 0; cursor: zoom-in; }
/* figure do tema vinha com display:flex e encolhia a foto (221px numa coluna de 368px) */
body.single-post .nm-hero .nm-hero__img { display: block; width: 100%; max-width: 100%; margin: 0; justify-self: stretch; }
/* width 100% (não auto): com os atributos width/height o navegador reserva a proporção antes de a foto chegar (CLS). */
.nm-hero__foto {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  background: #e8e4f7;
}
.nm-hero__img:focus-visible { outline: 3px solid var(--nm-accent); outline-offset: 3px; border-radius: 12px; }

.nm-tools {
  grid-area: tools;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 12px 20px;
  margin-top: 24px;
}
/* CLS: o espaço do player vem no HTML com altura mínima; o script só preenche. A linha do player
   ocupa o que sobra e os ícones de compartilhar ficam à direita, sem se sobrepor. */
.nm-listen-slot { flex: 1 1 340px; min-width: 0; min-height: var(--nm-listen-h); box-sizing: border-box; }
.nm-listen__placeholder {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--nm-accent);
  border-radius: 999px;
  padding: 9px 18px;
  background: var(--nm-accent);
  color: #fff;
  font: 500 14px/1 inherit;
  font-family: inherit;
  opacity: .85;
}

/* Compartilhar */
.nm-share { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; flex: 0 0 auto; }
.nm-share__titulo { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: #666; }
.nm-share__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  min-height: 36px;
  border-radius: 50%;
  background: var(--nm-accent);
  color: #fff !important;
  text-decoration: none !important;
  transition: transform .15s ease, background-color .15s ease;
}
button.nm-share__btn { padding: 0; border: 0; cursor: pointer; font: inherit; }
.nm-share__btn svg[hidden] { display: none; }
.nm-share__copiar.is-copiado { background: var(--nm-accent-escuro); }
.nm-share__btn:focus-visible { outline: 2px solid var(--nm-accent); outline-offset: 2px; }
.nm-share__aviso { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Player "Ouvir artigo" */
.nm-listen { padding: 0; font-family: inherit; }
.nm-listen__row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.nm-listen__row--seek { margin-top: 14px; flex-wrap: nowrap; }
.nm-listen__toggle,
.nm-listen__stop {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  font-family: inherit;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.nm-listen__toggle { border: 1px solid var(--nm-accent); background: var(--nm-accent); color: #fff; }
.nm-listen__stop { border: 1px solid rgba(0, 0, 0, .15); background: #fff; color: #333; }
.nm-listen__stop[hidden],
.nm-listen svg[hidden] { display: none; }
.nm-listen__rate {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #666;
}
.nm-listen__rate select {
  border: 1px solid rgba(0, 0, 0, .15);
  border-radius: 999px;
  padding: 6px 12px;
  background: #fff;
  color: #333;
  font-size: 13px;
  font-family: inherit;
}
.nm-listen__seek {
  flex: 1;
  min-width: 0;
  height: 24px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}
.nm-listen__seek::-webkit-slider-runnable-track { height: 4px; border-radius: 999px; background: rgba(0, 0, 0, .12); }
.nm-listen__seek::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; margin-top: -5px; width: 14px; height: 14px; border: 0; border-radius: 999px; background: var(--nm-accent); }
.nm-listen__seek::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 999px; background: var(--nm-accent); }
.nm-listen__seek::-moz-range-track { height: 4px; border-radius: 999px; background: rgba(0, 0, 0, .12); }
.nm-listen__status { flex-shrink: 0; min-width: 3.5em; text-align: right; font-size: 12px; color: #666; }
.nm-listen__hint {
  margin: 8px 0 0;
  padding: 0;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #8a8a8a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.et_pb_post_content .tts-chunk.is-speaking,
.nm-hero__titulo.is-speaking { background: #ffd84d; box-shadow: 0 0 0 3px #ffd84d; border-radius: 2px; }

/* Fotos do texto: sempre centralizadas (também alignleft/alignright). */
body.single-post #page-container .et_pb_post_content figure,
body.single-post #page-container .et_pb_post_content .wp-block-image { float: none !important; display: block; max-width: 100%; margin-left: auto !important; margin-right: auto !important; text-align: center; box-sizing: border-box; }
body.single-post #page-container .et_pb_post_content img.alignleft,
body.single-post #page-container .et_pb_post_content img.alignright,
body.single-post #page-container .et_pb_post_content img.aligncenter { float: none !important; display: block; margin-left: auto !important; margin-right: auto !important; }
body.single-post #page-container .et_pb_post_content figure img,
body.single-post #page-container .et_pb_post_content p > img { display: block; width: auto; max-width: 100%; height: auto; margin: 0 auto; }

/* Hover só com mouse e sem "reduzir movimento": destacada cresce 20%, fotos do texto 15%, com sombra. */
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .nm-hero__img { position: relative; z-index: 5; }
  .nm-hero__foto { transform-origin: left top; transition: transform .4s cubic-bezier(.22, .61, .36, 1), box-shadow .4s ease; }
  .nm-hero__img:hover { z-index: 50; }
  .nm-hero__img:hover .nm-hero__foto { transform: scale(1.2); box-shadow: 0 18px 40px rgba(0, 0, 0, .25); }
  body.single-post .et_pb_post_content figure img,
  body.single-post .et_pb_post_content p img { position: relative; transition: transform .5s cubic-bezier(.22, .61, .36, 1), box-shadow .5s ease; }
  body.single-post .et_pb_post_content figure img:hover,
  body.single-post .et_pb_post_content p img:hover { z-index: 5; transform: scale(1.15); box-shadow: 0 18px 40px rgba(0, 0, 0, .25); }
  .nm-share__btn:hover { transform: translateY(-2px); background: var(--nm-accent-escuro); }
  .nm-listen__toggle:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(78, 46, 194, .3); }
  .nm-listen__stop:hover { background: rgba(0, 0, 0, .04); }
}

/* Índice flutuante: canto inferior esquerdo (o direito fica para o chat). */
.nm-toc__toggle {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 99;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 999px;
  padding: 12px 16px;
  background: #fff;
  color: #333;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  font-family: inherit;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .12);
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease;
}
.nm-toc__toggle:hover,
.nm-toc__toggle[aria-expanded="true"] { border-color: var(--nm-accent); color: var(--nm-accent); }
.nm-toc__panel {
  position: fixed;
  left: 24px;
  bottom: 84px;
  z-index: 99;
  width: min(340px, calc(100vw - 48px));
  max-height: 60vh;
  overflow-y: auto;
  padding: 16px;
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .15);
  font-family: inherit;
}
.nm-toc__panel[hidden] { display: none; }
.nm-toc__eyebrow { margin: 0 0 10px; padding: 0; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--nm-accent); font-weight: 600; }
.nm-toc__list { list-style: none; margin: 0; padding: 0; }
.nm-toc__list li { margin: 0; padding: 0; list-style: none; }
.nm-toc__link { display: flex; gap: 8px; padding: 6px 0 6px 12px; border-left: 2px solid transparent; font-size: 14px; font-weight: 500; line-height: 1.35; color: #555 !important; text-decoration: none !important; transition: color .15s ease, border-color .15s ease; }
.nm-toc__num { flex-shrink: 0; min-width: 1.6em; color: var(--nm-accent); font-variant-numeric: tabular-nums; }
.nm-toc__link--sub { padding-left: 24px; font-size: 13px; font-weight: 400; }
.nm-toc__link--sub .nm-toc__num { min-width: 2.2em; }
.nm-toc__link:hover,
.nm-toc__link.is-active { color: #222 !important; border-left-color: var(--nm-accent); }
.et_pb_post_content h2[id],
.et_pb_post_content h3[id] { scroll-margin-top: 110px; }

/* Imagem ampliada (dialog nativo) */
.nm-zoom { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; padding: 0; border: 0; background: transparent; }
.nm-zoom[open] { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 72px 16px 32px; box-sizing: border-box; overflow: hidden; }
.nm-zoom::backdrop { background: rgba(12, 12, 14, .97); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.nm-zoom img { display: block; width: auto; height: auto; max-width: 100%; max-height: calc(100dvh - 190px); object-fit: contain; border-radius: 12px; box-shadow: 0 20px 60px rgba(0, 0, 0, .55); cursor: zoom-out; animation: nm-zoom-in .22s ease-out; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-user-drag: none; }
.nm-zoom__legenda { max-width: 32em; margin: 0; padding: 0; color: rgba(255, 255, 255, .9); font-size: 15px; font-weight: 500; line-height: 1.4; text-align: center; }
.nm-zoom__dica { margin: 0; padding: 0; color: rgba(255, 255, 255, .6); font-size: 12px; letter-spacing: .04em; }
.nm-zoom__fechar { position: fixed; top: max(12px, env(safe-area-inset-top)); right: 12px; display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid rgba(255, 255, 255, .3); border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff; font: 400 30px/1 Arial, sans-serif; cursor: pointer; }
.nm-zoom__fechar:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
@keyframes nm-zoom-in { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .nm-zoom img { animation: none; } }

/* Tablet */
@media (min-width: 768px) and (max-width: 980px) {
  .nm-hero { column-gap: 28px; }
  .nm-hero__titulo { font-size: 30px; }
}

/* Celular (até 767px): padrão medido a 412px nos blogs da agência. Ordem: título, data + tags, destacada
   (com a coluna de compartilhar à esquerda), player, texto. Tudo no HTML do servidor, sem JS movendo blocos. */
@media (max-width: 767px) {
  body.single-post { --nm-listen-h: 38px; }
  body.single-post #page-container .et_pb_row_0_tb_body { width: calc(100% - 36px) !important; max-width: none !important; margin-left: 18px !important; margin-right: 18px !important; }

  .nm-hero {
    grid-template-columns: minmax(0, 1fr) 68% minmax(0, 1fr);
    grid-template-rows: auto;
    grid-template-areas: "titulo titulo titulo" "meta meta meta" "share img ." "tools tools tools";
    column-gap: 0;
    margin: 0 0 16px;
    padding-top: 0;
  }
  /* título a ~25px do cabeçalho: seção 20px + linha 5px (a linha do Divi tinha 30px) */
  body.single-post #page-container .et_pb_row_0_tb_body { padding-top: 5px !important; }
  .nm-hero--sem-foto { grid-template-columns: minmax(0, 1fr); grid-template-areas: "titulo" "meta" "tools" "share"; }
  .nm-hero__titulo { font-size: 25px; line-height: 1.2; }
  /* 16px até a imagem pela margem de baixo da meta: a linha da imagem fica do tamanho exato da foto e a coluna de
     ícones (align-self: center) cai no centro dela. */
  body.single-post .nm-hero .nm-meta { margin: 6px 0 16px; gap: 6px 8px; }
  .nm-meta__data { font-size: 14px; }
  .nm-tag { font-size: 12px; padding: 4px 10px; }
  body.single-post .nm-hero .nm-hero__img { margin: 0; translate: 12px 0; justify-self: stretch; }
  .nm-tools { display: contents; }
  .nm-listen-slot { grid-area: tools; margin-top: 12px; }
  .nm-share { grid-area: share; flex-direction: column; flex-wrap: nowrap; gap: 8px; align-self: center; justify-self: center; translate: -6px 0; margin: 0; }
  .nm-hero--sem-foto .nm-share { flex-direction: row; justify-self: start; translate: none; }
  .nm-share__titulo { display: none; }
  .nm-share__btn { width: 36px; height: 36px; min-height: 36px; }
  .nm-listen__mais { display: none; }

  /* Player numa linha: velocidade, "Ouvir", barra e %. Tocando, a barra desce para a linha de baixo. */
  .nm-listen { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
  .nm-listen > .nm-listen__row:first-child { flex: 0 0 auto; flex-wrap: wrap; gap: 8px; }
  .nm-listen__rate { order: 0; }
  .nm-listen__toggle { order: 1; }
  .nm-listen__stop { order: 2; }
  .nm-listen__rate > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .nm-listen__row--seek { flex: 1 1 120px; min-width: 120px; gap: 8px; margin: 0; }
  .nm-listen__status { min-width: 0; }
  .nm-listen__hint { display: none; }

  /* Ritmo do texto */
  body.single-post #page-container .et_pb_post_content_0_tb_body { font-size: 16px; }
  body.single-post #page-container .et_pb_post_content_0_tb_body > p,
  body.single-post #page-container .et_pb_post_content_0_tb_body > ul,
  body.single-post #page-container .et_pb_post_content_0_tb_body > ol { margin: 0 0 16px !important; padding-top: 0 !important; padding-bottom: 0 !important; }
  body.single-post #page-container .et_pb_post_content_0_tb_body > h2 { margin: 32px 0 12px !important; padding: 0 !important; font-size: 19px !important; line-height: 1.3 !important; }
  body.single-post #page-container .et_pb_post_content_0_tb_body > h3 { margin: 24px 0 10px !important; padding: 0 !important; font-size: 17px !important; line-height: 1.3 !important; }
  body.single-post #page-container .et_pb_post_content_0_tb_body > h4 { margin: 24px 0 10px !important; padding: 0 !important; font-size: 16px !important; line-height: 1.3 !important; }
  body.single-post #page-container .et_pb_post_content_0_tb_body > figure,
  body.single-post #page-container .et_pb_post_content_0_tb_body .wp-block-image { width: 100% !important; margin: 8px 0 20px !important; padding: 0 !important; }
  body.single-post #page-container .et_pb_post_content_0_tb_body figcaption { margin-top: 8px; }

  .nm-toc__toggle { left: 16px; bottom: 16px; padding: 12px; }
  .nm-toc__toggle span { display: none; }
  .nm-toc__panel { left: 16px; bottom: 72px; width: calc(100vw - 32px); }
}

@media print {
  .nm-tools,
  .nm-share,
  .nm-toc { display: none !important; }
}
