/* ============================================================
   O editor do artigo
   ------------------------------------------------------------
   Folha de papel, não formulário de blocos. As variáveis e as
   peças comuns vêm de ../help.css.
   ============================================================ */

.hpe { min-height: 100vh; background: var(--papel-2); }

/* -------------------------------------------- barra de trabalho */

.hpe-trabalho {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px;
  height: 60px; padding: 0 20px;
  background: var(--breu); color: #fff;
}
.hpe-volta {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 11px; border-radius: 9px;
  font-size: 13.5px; font-weight: 600;
  color: rgba(255, 255, 255, 0.6); text-decoration: none;
}
.hpe-volta:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.hpe-onde { display: flex; align-items: center; gap: 9px; margin-left: 6px; min-width: 0; }
.hpe-onde .hp-chapa { font-size: 9px; color: rgba(255, 255, 255, 0.4); white-space: nowrap; }
.hpe-onde b {
  font-size: 14.5px; font-weight: 700;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hpe-fim { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.hpe-salvo {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--fonte-mono); font-size: 11.5px; color: rgba(255, 255, 255, 0.5);
  white-space: nowrap;
}
.hpe-salvo i { width: 7px; height: 7px; border-radius: 50%; background: var(--ambar); }
.hpe-salvo i[data-ligado="1"] { background: var(--esmeralda); }

/* ------------------------------------------------------- colunas */

.hpe-tela { display: grid; grid-template-columns: 234px minmax(0, 1fr) 300px; align-items: start; }

.hpe-estrutura {
  position: sticky; top: 60px;
  height: calc(100vh - 60px); overflow-y: auto;
  padding: 22px 16px 40px 22px;
  border-right: 1px solid var(--filete);
}
.hpe-estrutura > .hp-chapa { display: block; color: var(--tinta-3); margin-bottom: 10px; }

.hpe-sumario { border-left: 1.5px solid var(--filete); margin-bottom: 24px; }
.hpe-sumario span {
  display: block; padding: 6px 0 6px 13px; margin-left: -1.5px;
  border-left: 1.5px solid transparent;
  font-size: 13.5px; color: var(--tinta-2);
}
.hpe-sumario .hpe-sub { padding-left: 26px; font-size: 12.5px; color: var(--tinta-3); }
.hpe-vazio { margin: 0; padding: 8px 0 8px 13px; font-size: 12.5px; color: var(--tinta-3); line-height: 1.5; }

.hpe-blocos { display: grid; gap: 3px; }
.hpe-bloco {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px; border: 0; border-radius: 9px;
  background: transparent; cursor: pointer; text-align: left;
  font-family: inherit; font-size: 13.5px; font-weight: 600; color: var(--tinta-2);
}
.hpe-bloco:hover { background: var(--papel); box-shadow: inset 0 0 0 1px var(--filete); color: var(--tinta); }
.hpe-marca {
  width: 26px; height: 26px; border-radius: 8px; flex: none;
  display: grid; place-items: center; color: #fff;
}

/* ------------------------------------------------------ a régua */

/* Fora da folha de propósito: dentro, o `overflow` dela vira contêiner de
   rolagem e a régua desce, comendo o título. */
.hpe-regua-fora {
  position: sticky; top: 60px; z-index: 20;
  background: rgba(245, 244, 251, 0.93);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--filete);
}
.hpe-regua {
  max-width: 780px; margin: 0 auto;
  display: flex; align-items: center; gap: 3px; flex-wrap: wrap;
  padding: 9px 4px;
}
.hpe-fer {
  display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 10px; border: 0; border-radius: 9px;
  background: transparent; cursor: pointer;
  font-family: inherit; font-size: 13px; font-weight: 600; color: var(--tinta-2);
}
.hpe-fer:hover { background: var(--papel); color: var(--tinta); }
.hpe-sep { width: 1px; height: 20px; background: var(--filete); margin: 0 5px; }
.hpe-select {
  height: 34px; border: 0; border-radius: 9px; padding: 0 8px;
  background: var(--papel); box-shadow: inset 0 0 0 1px var(--filete);
  font-family: inherit; font-size: 13px; font-weight: 700; color: var(--tinta);
  outline: none; cursor: pointer;
}

.hpe-pergunta {
  max-width: 780px; margin: 14px auto 0; padding: 14px 16px;
  border-radius: 14px; background: var(--papel);
  box-shadow: inset 0 0 0 1px var(--filete);
}
.hpe-pergunta .hp-rot { margin-top: 0; }

/* ------------------------------------------------------- a folha */

.hpe-papel {
  max-width: 780px; margin: 20px auto 90px;
  background: var(--papel); border-radius: 20px;
  box-shadow: 0 1px 0 var(--filete), 0 26px 60px -34px rgba(30, 16, 80, 0.35);
}
.hpe-escrita { padding: 34px 46px 70px; }

.hpe-titulo {
  width: 100%; border: 0; outline: none; padding: 0; background: transparent;
  font-family: var(--fonte-titulo); font-size: 38px; font-weight: 700;
  letter-spacing: -0.035em; line-height: 1.06; color: var(--tinta);
}
.hpe-titulo::placeholder { color: var(--tinta-3); }

.hpe-sub {
  width: 100%; margin-top: 12px; border: 0; outline: none; padding: 0; resize: none;
  background: transparent; font-family: inherit; font-size: 17px; line-height: 1.55; color: var(--tinta-2);
}
.hpe-sub::placeholder { color: var(--tinta-3); }

.hpe-corpo { margin-top: 22px; outline: none; font-size: 16px; line-height: 1.72; color: var(--tinta-2); }
.hpe-corpo:empty::before { content: "Escreva aqui."; color: var(--tinta-3); }
.hpe-corpo p { margin: 0 0 16px; }
.hpe-corpo h2 {
  font-family: var(--fonte-titulo); font-size: 25px; font-weight: 700;
  letter-spacing: -0.03em; margin: 32px 0 0; color: var(--tinta);
}
.hpe-corpo h3 { font-size: 18px; font-weight: 700; margin: 24px 0 0; color: var(--tinta); }
.hpe-corpo ul { margin: 0 0 16px; padding-left: 1.4rem; list-style: disc; }
.hpe-corpo ol { margin: 0 0 16px; padding-left: 1.5rem; list-style: decimal; }
.hpe-corpo a { color: var(--roxo); text-decoration: underline; text-underline-offset: 3px; }
.hpe-corpo img { max-width: 100%; border-radius: 14px; display: block; }
.hpe-corpo figcaption { margin-top: 8px; font-size: 13px; color: var(--tinta-3); text-align: center; }

/* Os blocos, dentro do editor, saem iguais ao que vai ao ar. */
.hpe-corpo .help-passos { margin: 22px 0; counter-reset: hp; }
.hpe-corpo .help-passo {
  position: relative; display: grid; grid-template-columns: 32px minmax(0, 1fr);
  gap: 16px; padding-bottom: 22px;
}
.hpe-corpo .help-passo::before {
  counter-increment: hp; content: counter(hp, decimal-leading-zero);
  width: 32px; height: 32px; border-radius: 10px;
  display: grid; place-items: center;
  font-family: var(--fonte-mono); font-size: 12px; font-weight: 700;
  color: #fff; background: var(--tinta);
}
.hpe-corpo .help-passo h3 { margin: 5px 0 0; font-size: 16px; }
.hpe-corpo .help-passo p { margin: 6px 0 0; font-size: 15px; }

.hpe-corpo .help-aviso {
  margin: 22px 0; padding: 15px 18px; border-radius: 13px;
  font-size: 15px; line-height: 1.6;
}
.hpe-corpo .help-aviso-titulo {
  display: block; font-family: var(--fonte-mono); font-size: 11.5px;
  letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 4px;
}
.hpe-corpo .help-aviso-dica { background: rgba(95, 49, 214, 0.07); box-shadow: inset 0 0 0 1px rgba(95, 49, 214, 0.2); color: #3a2478; }
.hpe-corpo .help-aviso-dica .help-aviso-titulo { color: var(--roxo); }
.hpe-corpo .help-aviso-atencao { background: rgba(247, 156, 45, 0.1); box-shadow: inset 0 0 0 1px rgba(247, 156, 45, 0.32); color: #7a4a04; }
.hpe-corpo .help-aviso-atencao .help-aviso-titulo { color: #b96f0c; }
.hpe-corpo .help-aviso-cuidado { background: rgba(240, 82, 110, 0.09); box-shadow: inset 0 0 0 1px rgba(240, 82, 110, 0.3); color: #8a1b33; }
.hpe-corpo .help-aviso-cuidado .help-aviso-titulo { color: var(--rosa); }

.hpe-corpo .help-caminho {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 12px; border-radius: 10px;
  background: var(--papel-2); box-shadow: inset 0 0 0 1px var(--filete);
  font-family: var(--fonte-mono); font-size: 12.5px; font-weight: 600; color: var(--tinta);
}

.hpe-corpo .help-tabela { width: 100%; border-collapse: collapse; margin: 22px 0; font-size: 15px; }
.hpe-corpo .help-tabela th {
  text-align: left; padding: 10px 12px;
  font-family: var(--fonte-mono); font-size: 10px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--tinta-3);
  border-bottom: 1.5px solid var(--tinta);
}
.hpe-corpo .help-tabela td { padding: 12px; border-bottom: 1px solid var(--filete); }

.hpe-corpo .help-faq { border-bottom: 1px solid var(--filete); margin: 4px 0; }
.hpe-corpo .help-faq-pergunta { padding: 14px 0; font-size: 16px; font-weight: 700; color: var(--tinta); cursor: pointer; }
.hpe-corpo .help-faq-resposta { margin: 0 0 16px; font-size: 15px; }

.hpe-corpo .help-video {
  margin: 22px 0; padding: 0; border-radius: 14px; overflow: hidden;
  background: linear-gradient(148deg, var(--casca), var(--breu));
  aspect-ratio: 16 / 9; display: grid; place-items: end center;
}
.hpe-corpo .help-video::before {
  content: "vídeo do YouTube";
  grid-area: 1 / 1; align-self: center;
  font-family: var(--fonte-mono); font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase; color: rgba(255, 255, 255, 0.5);
}
.hpe-corpo .help-video figcaption {
  grid-area: 1 / 1; align-self: end;
  width: 100%; padding: 10px 14px; margin: 0;
  background: rgba(0, 0, 0, 0.4); color: #fff; font-size: 12.5px; text-align: left;
}

/* ----------------------------------------------------- ajustes */

.hpe-ajustes {
  position: sticky; top: 60px;
  height: calc(100vh - 60px); overflow-y: auto;
  padding: 22px 24px 60px 18px;
  border-left: 1px solid var(--filete);
}
.hpe-grupo + .hpe-grupo { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--filete); }
.hpe-grupo > .hp-chapa { display: block; color: var(--tinta-3); margin-bottom: 10px; }
.hpe-nota { margin: 7px 0 0; font-size: 11.5px; color: var(--tinta-3); line-height: 1.5; word-break: break-all; }

.hpe-niveis { display: grid; grid-template-columns: repeat(auto-fit, minmax(78px, 1fr)); gap: 6px; margin-top: 6px; }
.hpe-nivel {
  height: 40px; border: 0; border-radius: 11px; cursor: pointer;
  background: var(--papel); box-shadow: inset 0 0 0 1px var(--filete);
  font-family: inherit; font-size: 13px; font-weight: 700; color: var(--tinta-2);
}
.hpe-nivel[data-ativo="1"] { background: var(--tinta); color: #fff; box-shadow: none; }

.hpe-palavras { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.hpe-palavra {
  border: 0; cursor: pointer; padding: 6px 10px; border-radius: 8px;
  background: var(--papel-3); color: var(--tinta-2);
  font-family: inherit; font-size: 12px; font-weight: 700;
}
.hpe-palavra:hover { background: rgba(240, 82, 110, 0.14); color: #8a1b33; }

.hpe-chave { display: flex; align-items: flex-start; gap: 10px; margin-top: 16px; cursor: pointer; }
.hpe-chave b { display: block; font-size: 13.5px; font-weight: 700; color: var(--tinta); }
.hpe-chave small { display: block; margin-top: 2px; font-size: 11.5px; color: var(--tinta-3); line-height: 1.4; }

@media (max-width: 1200px) {
  .hpe-tela { grid-template-columns: minmax(0, 1fr); }
  .hpe-estrutura, .hpe-ajustes { position: static; height: auto; border: 0; }
  .hpe-estrutura { border-bottom: 1px solid var(--filete); }
  .hpe-ajustes { border-top: 1px solid var(--filete); }
}
