/* HelpTech: páginas de artigo.
   Carregar depois de css/home.css, que traz cores, fonte, header e rodapé. */

/* Topo */
.artigo-topo { position: relative; overflow: hidden; background: var(--navy); color: #fff; }
.artigo-topo .wrap { position: relative; z-index: 1; padding-top: calc(var(--header) + clamp(32px, 5vw, 72px)); padding-bottom: clamp(48px, 6vw, 88px); }
.artigo-topo h1 { max-width: 17ch; margin: clamp(28px, 4vw, 56px) 0 24px; font-size: clamp(2rem, 3.9vw, 3.625rem); }
.artigo-meta { color: var(--on-navy); }
.voltar { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: var(--sky); font-weight: 560; text-decoration: none; }
.voltar .icon { transform: rotate(180deg); transition: transform 200ms var(--ease-out); }
.artigo-cabos { position: absolute; top: var(--header); right: 0; width: auto; height: calc(100% - var(--header)); }
.artigo-cabos path { fill: none; stroke: #4583c2; stroke-width: 8; }
.artigo-cabos path:nth-child(odd) { stroke: var(--sky); }
.artigo-cabos .vivo { stroke: var(--orange); }

/* Corpo: índice + leitura */
.artigo-grid {
  display: grid; grid-template-columns: minmax(220px, 300px) minmax(0, 42.5rem); gap: 48px clamp(56px, 9vw, 152px);
  align-items: start;
  padding-top: clamp(56px, 7vw, 104px); padding-bottom: var(--space);
}
.indice { position: sticky; top: calc(var(--header) + 40px); max-height: calc(100vh - var(--header) - 64px); overflow-y: auto; padding-left: 4px; }
.indice h2 { margin-bottom: 16px; font-size: 1rem; font-stretch: 100%; letter-spacing: 0; }
.indice li { position: relative; padding-left: 28px; }
/* trecho de cabo deste ponto até o próximo, qualquer que seja a altura do item */
.indice li::before, .indice li::after { content: ''; position: absolute; left: 4px; top: 18px; width: 4px; height: 100%; background: var(--line); }
.indice li::after { background: var(--orange); transform: scaleY(0); transform-origin: top; transition: transform 250ms var(--ease-out); }
.indice li:has(+ .lido)::after { transform: none; }
.indice li:last-child::before, .indice li:last-child::after { display: none; }
.indice a {
  display: block; min-height: 48px; padding: 8px 4px 14px 0;
  color: var(--muted); font-size: 0.9375rem; line-height: 1.35; text-decoration: none;
  transition: color 150ms ease;
}
.indice a::before {
  content: ''; position: absolute; z-index: 1; left: 0; top: 12px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--paper); box-shadow: inset 0 0 0 2px #8091ae;
  transition: background-color 150ms ease, box-shadow 150ms ease;
}
.indice .lido a::before { background: var(--orange); box-shadow: inset 0 0 0 2px var(--orange); }
.indice a[aria-current] { color: var(--ink); font-weight: 640; }

.leitura { overflow-wrap: break-word; }
.leitura section + section { margin-top: clamp(56px, 6vw, 88px); }
.leitura section { scroll-margin-top: 40px; }
.leitura h2 { margin-bottom: 24px; font-size: clamp(1.625rem, 2.5vw, 2.25rem); line-height: 1.12; }
.leitura h3 { margin: 36px 0 10px; font-size: 1.3125rem; color: var(--blue); text-wrap: balance; }
.leitura section p { font-size: 1.125rem; line-height: 1.72; color: #33415f; }
.leitura section p + p { margin-top: 1.2em; }
.leitura section strong { color: var(--ink); font-weight: 640; }

.leitura section ul { margin: 1em 0 1.2em; padding-left: 1.2em; list-style: disc; }
.leitura section li { padding: 3px 0 3px 4px; font-size: 1.125rem; line-height: 1.6; color: #33415f; }
.leitura section li::marker { color: var(--blue); }
.leitura section a { color: var(--blue); text-underline-offset: 4px; text-decoration-thickness: 1px; }
.leitura .fontes { padding-top: 32px; border-top: 1px solid var(--line); }
.leitura .fontes h2 { margin-bottom: 8px; font-size: 1.3125rem; font-stretch: 100%; letter-spacing: -0.012em; }
.leitura .fontes li, .leitura .fontes p { font-size: 1rem; }

.artigo-cta { margin-top: clamp(64px, 7vw, 104px); padding: clamp(28px, 4vw, 52px); border-radius: 8px; background: var(--navy); color: #fff; }
.artigo-cta h3 { margin: 0 0 16px; font-size: clamp(1.5rem, 2.2vw, 2rem); line-height: 1.15; letter-spacing: -0.022em; color: #fff; }
.artigo-cta p { margin-bottom: 28px; color: var(--on-navy); }
.artigo-cta strong { color: #fff; font-weight: 640; }

@media (hover: hover) and (pointer: fine) {
  .voltar:hover .icon { transform: translateX(-6px) rotate(180deg); }
  .indice a:hover { color: var(--blue); }
}

@media (max-width: 1020px) {
  .artigo-cabos { display: none; }
  .artigo-grid { grid-template-columns: minmax(0, 42.5rem); }
  .indice { position: static; max-height: none; padding-bottom: 40px; border-bottom: 1px solid var(--line); }
  /* fora da tela durante a leitura: aqui é só um sumário */
  .indice li { padding-left: 0; }
  .indice li::before, .indice li::after, .indice a::before { display: none; }
  .indice a[aria-current] { color: var(--muted); font-weight: inherit; }
}

@media (prefers-reduced-motion: reduce) {
  .indice li::after, .voltar .icon { transition: none; }
  .voltar:hover .icon { transform: rotate(180deg); }
}

@media print {
  .header, .indice, .artigo-cta, .footer, .voltar, .artigo-cabos { display: none; }
  .artigo-topo { background: none; color: #000; }
  .artigo-grid { display: block; }
}
