/* Leitura em voz alta (js/narracao.js): realce palavra por palavra, botão de ouvir e barra da leitura. */

/* ---------- realce ---------- */
n-b { display: block; min-width: 0; }
n-p, [data-np] { transition: opacity .28s linear; }
.np-f { opacity: .32; }
/* a palavra que está sendo dita: um degradê que atravessa a palavra, do texto cheio para o apagado */
n-p.np-a {
  opacity: 1;
  -webkit-mask-image: linear-gradient(90deg, #000 calc(var(--k, 0) * 150% - 50%), rgb(0 0 0 / .32) calc(var(--k, 0) * 150%));
          mask-image: linear-gradient(90deg, #000 calc(var(--k, 0) * 150% - 50%), rgb(0 0 0 / .32) calc(var(--k, 0) * 150%));
}
[data-np].np-a { opacity: 1; }
.np-ligada .np-lendo [data-entra], .np-ligada .np-lendo { transition-delay: 0s; }

/* ---------- botão da capa ---------- */
.capa-acoes { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; margin-top: 30px !important; }
.capa-acoes .descer { margin-top: 0 !important; }
.ouvir { display: inline-flex; align-items: center; gap: 14px; min-height: 60px; padding: 4px 26px 4px 5px; border: 0; border-radius: 999px; background: #3CCB5A; color: #06270F; font: 700 17px/1.15 "Inter", system-ui, sans-serif; text-align: left; cursor: pointer; box-shadow: 0 10px 30px rgb(6 39 15 / .34); transition: transform .2s cubic-bezier(.2, .7, .2, 1), background .2s; }
.ouvir[hidden] { display: none; }
.ouvir i { position: relative; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: #06270F; color: #8CE5A0; flex: none; }
.ouvir i::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid #06270F; opacity: 0; }
.ouvir svg { width: 24px; height: 24px; margin-left: 3px; fill: currentColor; stroke: none; }
.ouvir span { display: grid; gap: 3px; }
.ouvir small { font-size: 13px; font-weight: 600; opacity: .78; }
.ouvir:hover { background: #4ED46B; transform: translateY(-1px); }
.ouvir:active { transform: scale(.98); }
.ouvir:focus-visible, .np-b:focus-visible, .np-daqui:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
@media (prefers-reduced-motion: no-preference) {
  .ouvir:not(.np-usado) i::after { animation: np-onda 2.4s ease-out 1.2s infinite; }
  @keyframes np-onda { 0% { opacity: .55; transform: scale(1); border-color: #8CE5A0; } 70%, 100% { opacity: 0; transform: scale(1.75); border-color: #8CE5A0; } }
}

/* ---------- botão redondo (depois da capa, com a leitura desligada) ---------- */
.np-daqui { position: fixed; z-index: 40; right: max(14px, env(safe-area-inset-right)); bottom: calc(16px + env(safe-area-inset-bottom)); display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 18px 0 14px; border: 0; border-radius: 999px; background: #0A2540; color: #F4F6F9; font: 650 15px "Inter", system-ui, sans-serif; cursor: pointer; box-shadow: 0 8px 26px rgb(10 37 64 / .36), 0 0 0 1px rgb(255 255 255 / .14); }
.np-daqui[hidden] { display: none; }
.np-daqui svg { width: 22px; height: 22px; fill: none; stroke: #8CE5A0; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.np-daqui:hover { background: #143A5E; }

/* ---------- barra da leitura ---------- */
.np-barra { position: fixed; z-index: 45; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; align-items: center; gap: 4px; width: min(430px, calc(100vw - 20px)); padding: 6px 8px; border-radius: 999px; background: #0A2540; color: #F4F6F9; box-shadow: 0 12px 34px rgb(10 37 64 / .42), 0 0 0 1px rgb(255 255 255 / .14); font: 600 13px "Inter", system-ui, sans-serif; }
.np-barra[hidden] { display: none; }
.np-b { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; }
.np-b:hover { background: rgb(255 255 255 / .1); }
.np-b svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.np-b svg .cheio { fill: currentColor; stroke: none; }
.np-toca { background: #3CCB5A; color: #06270F; }
.np-toca:hover { background: #4ED46B; }
.np-meio { position: relative; flex: 1; min-width: 0; display: grid; gap: 5px; padding: 0 8px 0 6px; }
.np-trilho { display: block; height: 14px; padding: 5px 0; cursor: pointer; background: linear-gradient(rgb(255 255 255 / .2), rgb(255 255 255 / .2)) center / 100% 4px no-repeat; border-radius: 2px; }
.np-trilho i { display: block; height: 4px; border-radius: 2px; background: #8CE5A0; transform-origin: 0 50%; transform: scaleX(0); }
.np-tempo { font-variant-numeric: tabular-nums; color: #BFCADA; line-height: 1; }
.np-aviso { position: absolute; right: 8px; bottom: 0; line-height: 1; color: #FFD9A0; max-width: 70%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np-aviso:empty { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .np-barra:not([hidden]) { animation: np-sobe .35s cubic-bezier(.2, .7, .2, 1) both; }
  @keyframes np-sobe { from { opacity: 0; transform: translate(-50%, 16px); } }
}
/* espaço no fim da página para a barra não cobrir o rodapé */
.np-ligada body { padding-bottom: 76px; }

/* ---------- apresentação de investimento (investidor.html) ---------- */
.capa-acoes .comecar { margin-top: 0 !important; }
/* em tela larga a capa não tem altura para mais um botão: ele vai para o lado direito, sobre a foto */
@media (min-width: 1100px) {
  .quadro.capa .ouvir { position: absolute; z-index: 3; right: clamp(84px, 9vw, 150px); top: 46%; }
}
.np-daqui.np-esq { right: auto; left: max(14px, env(safe-area-inset-left)); }
/* com a leitura ligada, a barra ocupa o lugar do passador de cenas */
.np-ligada .passos { display: none; }
@media print { .ouvir, .np-barra, .np-daqui { display: none !important; } }
