/* Os GIFs e as figurinhas da HubSpace (05/11/2026, pedido do Lucca: "Adicionar a funcionalidade de mandar figurinhas e GIFs nos
   fóruns, chats, grupos e mensagens privadas na HubSpace"; hub-gifs.js). O botão "GIF" ao lado do de emojis, a janela da busca
   (GIFs | Figurinhas, duas colunas, o crédito do GIPHY) e o GIF dentro da mensagem: nas bolhas do chat, nas respostas do fórum
   e nos comentários das publicações. Só os azuis e os cinzas da HubClub. A altura do GIF na mensagem é fixa: a conversa não
   pula quando a imagem chega (o chat abre rolado até o fim). */

/* o botão (o texto "GIF" num quadradinho, como no WhatsApp e no Slack) */
.hs-bt-gif-txt { display: inline-grid; place-items: center; min-width: 26px; height: 18px; padding: 0 3px; border: 1.6px solid currentColor; border-radius: 5px;
  font: 800 .62rem/1 var(--tit); letter-spacing: .04em; }
.hs-bt-gif[aria-expanded="true"] { background: var(--hs-ativo); color: #fff; }
.hs-bt-gif[disabled] { opacity: .4; cursor: default; }
.hs-pub-com-gif { flex: none; width: 38px; height: 38px; border-radius: 50%; color: #8fd0f2; }

/* a janela */
.hs-gifs { position: fixed; z-index: 60; width: 344px; height: min(430px, calc(100vh - 32px)); display: flex; flex-direction: column; border-radius: 12px;
  background: #020a10; border: 1px solid rgba(118, 183, 213, .18); box-shadow: 0 18px 44px rgba(0, 0, 0, .65); overflow: hidden; }
.hs-gifs.hs-gifs-baixo { left: 8px; right: 8px; width: auto; height: min(62vh, 440px); }
.hs-gifs-abas { flex: none; display: flex; align-items: center; gap: 4px; padding: 8px 8px 0; }
.hs-gifs-aba { height: 32px; padding: 0 14px; border: 0; border-radius: 16px; background: none; color: var(--texto-2); font: 600 .82rem var(--tit); cursor: pointer; }
.hs-gifs-aba:hover { background: var(--hs-hover); color: #fff; }
.hs-gifs-aba.ativo { background: var(--hs-ativo); color: #fff; box-shadow: inset 0 0 0 1px rgba(118, 183, 213, .35); }
.hs-gifs-fechar { margin-left: auto; }
.hs-gifs-busca { flex: none; margin: 8px; height: 36px; padding: 0 12px; border: 1px solid rgba(118, 183, 213, .18); border-radius: 8px; background: #0f2130;
  color: var(--texto); font: 400 .9rem var(--txt); }
.hs-gifs-busca::placeholder { color: var(--hs-mudo); }
.hs-gifs-busca:focus { outline: none; border-color: rgba(118, 183, 213, .55); }
.hs-gifs-rolar { flex: 1; min-height: 0; overflow-y: auto; padding: 0 8px 8px; overscroll-behavior: contain; }
.hs-gifs-aviso { margin: 10px 4px; font-size: .82rem; color: var(--texto-2); text-align: center; }
.hs-gifs-aviso[hidden] { display: none; }
.hs-gifs-grade { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; align-items: start; }
.hs-gifs-col { display: grid; gap: 6px; min-width: 0; }
.hs-gifs-item { position: relative; display: block; width: 100%; padding: 0; border: 0; border-radius: 6px; overflow: hidden; background: #0b1c28; cursor: pointer; }
.hs-gifs-item.fig { background: #0a1823; }
.hs-gifs-item img { display: block; width: 100%; height: 100%; object-fit: cover; }
.hs-gifs-item.fig img { object-fit: contain; }
.hs-gifs-item:hover, .hs-gifs-item:focus-visible { outline: 2px solid var(--hs-acento); outline-offset: -2px; }
.hs-gifs-item.sem::after { content: "indisponível"; position: absolute; inset: 0; display: grid; place-items: center; font-size: .72rem; color: var(--hs-mudo); }
.hs-gifs.mandando .hs-gifs-item { opacity: .45; cursor: progress; }
.hs-gifs.mandando .hs-gifs-item.escolhido { opacity: 1; outline: 2px solid var(--hs-acento); outline-offset: -2px; }
.hs-gifs-mais { display: block; margin: 10px auto 2px; }
.hs-gifs-mais[hidden] { display: none; }
.hs-gifs-pe { flex: none; display: flex; justify-content: flex-end; padding: 6px 12px 8px; border-top: 1px solid var(--hs-linha); }
.hs-gifs-giphy { font: 600 .66rem var(--txt); letter-spacing: .02em; color: var(--texto-3); }
.hs-gifs-giphy b { font: 800 .72rem var(--tit); letter-spacing: .06em; color: var(--texto-2); }

/* o GIF dentro da mensagem: altura fixa (a conversa não pula), a largura que a imagem pedir até o limite */
.hs-gif { display: block; width: max-content; max-width: 100%; height: 160px; border-radius: 6px; background: rgba(118, 183, 213, .07); overflow: hidden; line-height: 0; }
.hs-gif img { display: block; height: 100%; width: auto; min-width: 90px; max-width: min(100%, 300px); object-fit: contain; }
.hs-gif.pronta { background: none; }
.hs-gif.hs-gif-fig { height: 120px; background: none; }
.hs-gif.hs-gif-fig img { min-width: 60px; }
.hs-gif.hs-gif-sem { display: inline-grid; place-items: center; width: auto; height: 44px; padding: 0 14px; line-height: 1.2; font-size: .8rem; color: var(--hs-mudo);
  background: rgba(118, 183, 213, .07); }
/* nas bolhas do chat: o GIF ocupa a bolha (a hora fica em cima dele, embaixo à direita); a figurinha fica sem bolha, como no WhatsApp */
.hs-bolha.tem-gif, .hs-bolha.tem-figurinha { white-space: normal; padding: 4px; }
.hs-bolha.tem-gif .hs-bolha-nome, .hs-bolha.tem-figurinha .hs-bolha-nome { margin: 2px 4px 4px; }
.hs-bolha.tem-gif .hs-bolha-meta, .hs-bolha.tem-figurinha .hs-bolha-meta { position: absolute; float: none; top: auto; right: 8px; bottom: 7px; margin: 0; padding: 2px 7px;
  border-radius: 9px; color: rgba(233, 241, 246, .85); background: rgba(2, 10, 16, .62); }
.hs-bolha.tem-figurinha { background: none; box-shadow: none; padding: 0; }
.hs-bolha.tem-figurinha::before { display: none; }
.hs-bolha.tem-figurinha .hs-bolha-meta { bottom: -2px; right: 0; }
.hs-bolha.tem-figurinha .hs-gif { margin-bottom: 14px; }
/* nas respostas do fórum e nos comentários */
.hs-msg-texto.tem-gif, .hs-msg-texto.tem-figurinha, .hs-pub-com-txt.tem-gif, .hs-pub-com-txt.tem-figurinha { white-space: normal; padding-top: 2px; }
.hs-pub-com-txt .hs-gif { height: 130px; }
.hs-pub-com-txt .hs-gif.hs-gif-fig { height: 100px; }

@media not all and (min-width: 641px) {
  .hs-gif { height: 136px; }
  .hs-gif img { max-width: min(100%, 240px); }
  .hs-gif.hs-gif-fig { height: 104px; }
  .hs-gifs-aba { padding: 0 12px; }
}
