/* =====================================================================
   ui2, familia d-item: CHANGELOG COMPLETO do item (item/<slug>/changelog/)
   ---------------------------------------------------------------------
   Estrutura da pagina de changelog do gpltimes, pele do ui2: faixa com
   migalha e pilulas, abas de filtro com contagem, linha do tempo por ano
   (um cartao por versao, as 3 mais novas abertas) e coluna lateral fixa
   com o item e o resumo do que mudou. No celular a lateral se desmonta
   (display:contents): o cartao do item sobe para antes da linha do tempo e
   o "O que mudou" desce para o fim, sem duplicar markup.
   So tokens: nenhuma cor, fonte, raio ou sombra literal.
   ===================================================================== */
.ui2-item-changelog .band h1 { overflow-wrap: anywhere; }
.ui2-item-changelog .chip b { color: var(--ink); }

/* ------------------------------------------------------------ grade */
.clh-body {
  display: grid; grid-template-columns: minmax(0, 1fr) 340px; grid-template-areas: "main aside";
  gap: 32px; align-items: start; padding-top: 32px; padding-bottom: 72px;
}
.clh-main { grid-area: main; min-width: 0; }
.clh-aside { grid-area: aside; align-self: stretch; }
.clh-aside-in { position: sticky; top: 20px; display: grid; gap: 16px; }
/* a coluna acompanha a rolagem e nunca passa da janela: no maximo a altura dela menos
   os dois respiros, rolando por dentro (pedido do Marcus, 11/10/2026: em janela baixa o
   fim do cartao sumia e parecia que a lateral nao descia) */
.clh-aside-in { max-height: calc(100vh - 40px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; margin-inline: -8px; padding: 0 8px 12px; }

/* ------------------------------------------------------------ abas */
.clh-tabs { margin-bottom: 26px; }
.clh-tabs > button[aria-pressed="false"]:hover { border-color: var(--ink); }
.clh-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dot, var(--muted)); flex: none; }
.clh-dot--novo, .clh-grp--novo, .clh-mudou-i--novo { --dot: var(--green); }
.clh-dot--melhoria, .clh-grp--melhoria, .clh-mudou-i--melhoria { --dot: var(--accent); }
.clh-dot--correcao, .clh-grp--correcao, .clh-mudou-i--correcao { --dot: var(--amber); }
.clh-dot--seguranca, .clh-grp--seguranca, .clh-mudou-i--seguranca { --dot: var(--danger); }
.clh-dot--removido, .clh-grp--removido, .clh-mudou-i--removido,
.clh-grp--outro, .clh-mudou-i--outro { --dot: var(--muted); }
.clh-tabs > .is-on .clh-dot { box-shadow: 0 0 0 2px var(--surface); }

/* ------------------------------------------------------------ linha do tempo */
.clh-ano + .clh-ano { margin-top: 34px; }
.clh-ano-h {
  display: flex; align-items: baseline; gap: 4px; margin-bottom: 14px;
  font: var(--h-w) 1.25rem/1.2 var(--font-display); letter-spacing: var(--h-ls); color: var(--ink);
}
.clh-ano-h small { font: 600 var(--fs-sm)/1 var(--font-body); letter-spacing: 0; color: var(--muted); }
.clh-lista { position: relative; list-style: none; margin: 0; padding: 0 0 0 28px; }
.clh-lista::before {
  content: ""; position: absolute; top: 8px; bottom: 8px; left: 7px; width: 2px;
  border-radius: 2px; background: var(--line);
}
.clh-v { position: relative; }
.clh-v + .clh-v { margin-top: 14px; }
.clh-v::before {
  content: ""; position: absolute; top: 24px; left: -27px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--surface); border: 3px solid var(--line); box-sizing: border-box;
}
.clh-v--ultima::before { border-color: var(--green); background: var(--green-soft); }

.clh-card { overflow: hidden; }
.clh-v-hd { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 16px 20px; }
.clh-v-id { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-width: 0; }
.clh-v-num { font: 700 1.08rem/1.2 var(--font-mono); color: var(--ink); overflow-wrap: anywhere; }
.clh-v-resumo { display: flex; flex-wrap: wrap; gap: 6px; }
.clh-v-acts { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.clh-dl.is-loading, .clh-dl:disabled { opacity: .6; cursor: progress; transform: none; }
.clh-tg {
  display: inline-flex; align-items: center; gap: 4px; height: 36px; padding: 0 8px 0 12px; cursor: pointer;
  border: 0; border-radius: var(--r-pill); background: transparent;
  font: 600 var(--fs-xs)/1 var(--font-body); color: var(--muted);
}
.clh-tg:hover { color: var(--ink); background: var(--surface-2); }
.clh-tg .i { width: 16px; height: 16px; transform: rotate(180deg); }
.clh-tg[aria-expanded="false"] .i { transform: none; }

.clh-v-corpo { display: grid; gap: 16px; padding: 16px 20px 20px; border-top: 1px solid var(--line-soft); }
.clh-v.is-fechada .clh-v-corpo { display: none; }
.clh-tag { margin-bottom: 9px; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; }
.clh-ul { list-style: none; margin: 0; padding: 0; }
.clh-ul li { position: relative; padding-left: 18px; font-size: var(--fs-sm); color: var(--text); overflow-wrap: anywhere; }
.clh-ul li + li { margin-top: 7px; }
.clh-ul li::before {
  content: ""; position: absolute; left: 3px; top: .62em; width: 6px; height: 6px; border-radius: 50%;
  background: var(--dot, var(--muted));
}
.clh-nota { display: flex; align-items: center; gap: 6px; margin-top: 22px; }
.clh-nota .i { width: 14px; height: 14px; flex: none; }

/* ancora do up-legacy-versions.js: nunca aparece (o JS dele faz fadeIn na caixa) */
#up-version-box.clh-lv { display: none !important; }

/* ------------------------------------------------------------ vazio */
.clh-vazio { padding: 44px 28px; text-align: center; }
.clh-vazio-ico {
  display: inline-grid; place-items: center; width: 52px; height: 52px; margin-bottom: 14px;
  border-radius: 50%; background: var(--accent-soft); color: var(--accent);
}
.clh-vazio-ico .i { width: 24px; height: 24px; }
.clh-vazio h2 { font-size: var(--fs-h3); }
.clh-vazio p { max-width: 46ch; margin: 8px auto 20px; color: var(--text); }

/* ------------------------------------------------------------ lateral */
.clh-side { display: grid; gap: 14px; padding: 18px; }
.clh-side-capa { display: block; }
.clh-side-capa .thumb { box-shadow: var(--sh-card); }
.clh-side-nome { font-size: 1.06rem; line-height: 1.3; overflow-wrap: anywhere; }
.clh-side-nome a:hover { color: var(--accent); }
.clh-side-ver { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 6px; font-size: var(--fs-sm); }
.clh-side-ok { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); font-weight: 600; color: var(--green); }
.clh-side-ok .i { width: 16px; height: 16px; flex: none; }
.clh-side-cota { margin-top: -6px; }

.clh-mudou { padding: 18px; }
.clh-mudou-h { display: flex; align-items: center; gap: 8px; font-size: var(--fs-body); }
.clh-mudou-h .i { width: 18px; height: 18px; color: var(--accent); }
.clh-mudou-p { margin-top: 6px; font-size: var(--fs-sm); color: var(--text); }
.clh-mudou-p b { color: var(--ink); }
.clh-mudou-l { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.clh-mudou-i { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 10px; font-size: var(--fs-xs); color: var(--text); }
.clh-mudou-i b { color: var(--ink); }
.clh-mudou-i i { grid-column: 1 / -1; position: relative; height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.clh-mudou-i i::after { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: var(--v); border-radius: inherit; background: var(--dot, var(--muted)); }

/* ------------------------------------------------------------ movimento */
@media (prefers-reduced-motion: no-preference) {
  .clh-tg .i { transition: transform .2s ease; }
  .clh-tg { transition: color .2s ease, background .2s ease; }
}

/* ------------------------------------------------------------ tablet e celular */
@media (max-width: 980px) {
  .clh-body { display: flex; flex-direction: column; align-items: stretch; gap: 20px; padding-top: 24px; padding-bottom: 56px; }
  .clh-aside, .clh-aside-in { display: contents; }
  .clh-side { order: 1; grid-template-columns: 120px minmax(0, 1fr); align-items: center; }
  .clh-side > .btn, .clh-side-ok, .clh-side-cota { grid-column: 1 / -1; }
  .clh-main { order: 2; }
  .clh-mudou { order: 3; }
}
@media (max-width: 640px) {
  .clh-tabs { gap: 6px; margin-bottom: 20px; }
  .clh-tabs > button { padding: 7px 12px; font-size: var(--fs-xs); }
  .clh-lista { padding-left: 20px; }
  .clh-lista::before { left: 4px; }
  .clh-v::before { left: -21px; top: 22px; width: 12px; height: 12px; }
  /* versao + Mostrar na mesma linha; resumo e Download embaixo */
  .clh-v-hd {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "id tg" "res res" "dl dl";
    padding: 12px 12px 12px 16px; gap: 8px 10px;
  }
  .clh-v-acts { display: contents; }
  .clh-v-id { grid-area: id; }
  .clh-v-resumo { grid-area: res; }
  .clh-v-resumo:empty { display: none; }
  .clh-tg { grid-area: tg; align-self: start; }
  .clh-dl { grid-area: dl; justify-self: start; }
  .clh-v-corpo { padding: 14px 16px 18px; }
  .clh-side { grid-template-columns: 96px minmax(0, 1fr); padding: 14px; gap: 12px; }
}
