/* INTERFACE EM PORTUGUÊS */
html:lang(pt):has(meta[name="citation_language"][content|="en" i]) {
  --rbpg-idioma-texto: "Texto em inglês";
}

html:lang(pt):has(meta[name="citation_language"][content|="pt" i]) {
  --rbpg-idioma-texto: "Texto em português";
}

html:lang(pt):has(meta[name="citation_language"][content|="es" i]) {
  --rbpg-idioma-texto: "Texto em espanhol";
}

/* INTERFACE EM ESPANHOL */
html:lang(es):has(meta[name="citation_language"][content|="en" i]) {
  --rbpg-idioma-texto: "Texto en inglés";
}

html:lang(es):has(meta[name="citation_language"][content|="pt" i]) {
  --rbpg-idioma-texto: "Texto en portugués";
}

html:lang(es):has(meta[name="citation_language"][content|="es" i]) {
  --rbpg-idioma-texto: "Texto en español";
}

/* INTERFACE EM INGLÊS */
html:lang(en):has(meta[name="citation_language"][content|="en" i]) {
  --rbpg-idioma-texto: "Full text in English";
}

html:lang(en):has(meta[name="citation_language"][content|="pt" i]) {
  --rbpg-idioma-texto: "Full text in Portuguese";
}

html:lang(en):has(meta[name="citation_language"][content|="es" i]) {
  --rbpg-idioma-texto: "Full text in Spanish";
}

/* ALINHAMENTO DO BOTÃO E DA INDICAÇÃO */
html:has(meta[name="citation_language"]:is(
  [content|="en" i],
  [content|="pt" i],
  [content|="es" i]
))
.galleys_links li:has(a.obj_galley_link.pdf) {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .4rem .65rem;
}

/* INDICAÇÃO DISCRETA AO LADO DO PDF */
html:has(meta[name="citation_language"]:is(
  [content|="en" i],
  [content|="pt" i],
  [content|="es" i]
))
.galleys_links li:has(a.obj_galley_link.pdf)::after {
  content: var(--rbpg-idioma-texto, none);
  display: inline-block;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #4b5563;
  font-size: .85rem;
  font-weight: 400;
  line-height: 1.5;
}